1 2 Previous Next

Scott Stark's Blog

18 posts
Scott Stark

A generic producer method

Posted by Scott Stark Aug 21, 2012

Someone asked about "Can I write a method producer method without knowing the type until runtime?" and I was looking at something similar, trying to figure out what needs and Extension, so I mocked a little solution that uses a general producer method based on a specific qualifier annotation and a wrapping parameterized interface. See the forum thread for the original question, and this possible approach. While this may not be as transparent and generic as the user was asking for, it is a pretty simple way to achieve some form of dynamic production of injection values.

 

1. Create an qualifier annotation ConfigType:

package test.com.si.weld.dynproducer;


import javax.inject.Qualifier;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;
import static java.lang.annotation.ElementType.*;
import static java.lang.annotation.RetentionPolicy.*;


/**
 * @author Scott Stark
 * @version $Revision:$
 */
@Qualifier
@Retention(RUNTIME)
@Target({TYPE, METHOD, FIELD, PARAMETER})
public @interface ConfigType {
}

 

2. Create a simple parameterized interface and wrapper implementation to hold the user defined configuration class types:

package test.com.si.weld.dynproducer;

public interface IStoreSettings<T> {
    T getSettings();
}
package test.com.si.weld.dynproducer;


public class StoreSettingsWrapper<T> implements IStoreSettings<T> {
    private T settings;


    StoreSettingsWrapper(T settings) {
        this.settings = settings;
    }
    @Override
    public T getSettings() {
        return settings;
    }
    @Override
    public String toString() {
        return settings.toString();
    }
}

 

3. Create a general producer method that takes an InjectionPoint:

package test.com.si.weld.dynproducer;


import javax.enterprise.inject.Produces;
import javax.enterprise.inject.spi.BeanManager;
import javax.enterprise.inject.spi.InjectionPoint;
import java.lang.reflect.Constructor;
import java.lang.reflect.ParameterizedType;
import java.lang.reflect.Type;
import java.util.Arrays;


/**
 * @author Scott Stark
 * @version $Revision:$
 */
public class GenericConfigFactory {
    @Produces @ConfigType
    public IStoreSettings configProducer(InjectionPoint ip, BeanManager beanManager) throws Exception {
        dumpInjectionPoint(ip);
        ParameterizedType type = (ParameterizedType) ip.getType();
        Type[] typeArgs = type.getActualTypeArguments();
        Class<?> settingsClass = (Class<?>) typeArgs[0];
        Constructor ctor = settingsClass.getConstructor();
        Object settings = ctor.newInstance();
        StoreSettingsWrapper wrapper = new StoreSettingsWrapper(settings);
        return wrapper;
    }


    private void dumpInjectionPoint(InjectionPoint ip) {
        StringBuilder tmp = new StringBuilder("InjectionPoint");
        tmp.append("\n\tgetAnnotated:"+ip.getAnnotated());
        tmp.append(";\n\t getType:"+ip.getType());
        ParameterizedType type = (ParameterizedType) ip.getType();
        Type[] typeArgs = type.getActualTypeArguments();
        Type rawType = type.getRawType();
        tmp.append("\n\t\ttypeArgs: "+ Arrays.asList(typeArgs));
        tmp.append("\n\t\trawType: "+ rawType);
        tmp.append(";\n\t getQualifiers:"+ip.getQualifiers());
        tmp.append(";\n\t getBean:"+ip.getBean());
        tmp.append(";\n\t getMember:"+ip.getMember());
        tmp.append(";\n\t isDelegate:"+ip.isDelegate());
        tmp.append(";\n\t isTransient:"+ip.isTransient());
        System.out.println(tmp.toString());
    }
}

 

 

Now one can create different type of configuration objects and have them injected into a consumer:

 

package test.com.si.weld.dynproducer;


public @interface Config {
    public String value();
}

package test.com.si.weld.dynproducer;


import javax.inject.Inject;


public class ConfigUser {
    @Inject @ConfigType
    private IStoreSettings<MyDataStoreSettings> settings;
    @Inject @ConfigType
    private IStoreSettings<AnotherDataStoreSettings> settings2;


    @Override
    public String toString() {
        return "ConfigUser{" +
                "settings2=" + settings2 +
                ", settings=" + settings +
                '}';
    }
}

package test.com.si.weld.dynproducer;


import java.io.File;


public class MyDataStoreSettings {
    @Config("number.of.threads.key")
    int numberOfThreads = 1;
    @Config("root.folder.key")
    File rootFolder = new File("/tmp");


    @Override
    public String toString() {
        return "MyDataStoreSettings{" +
                "numberOfThreads=" + numberOfThreads +
                ", rootFolder=" + rootFolder +
                '}';
    }
}

package test.com.si.weld.dynproducer;


public class AnotherDataStoreSettings {
    @Config("thread.count.key")
    int threadCount = 2;
    @Config("tmp.path.key")
    String tmpPath = "/tmp";


    @Override
    public String toString() {
        return "AnotherDataStoreSettings{" +
                "threadCount=" + threadCount +
                ", tmpPath=" + tmpPath +
                '}';
    }
}

 

A little Arquillian testcase illustrates the behavior:

 

package test.com.si.weld.dynproducer;


import org.jboss.arquillian.container.test.api.Deployment;
import org.jboss.arquillian.junit.Arquillian;
import org.jboss.shrinkwrap.api.ShrinkWrap;
import org.jboss.shrinkwrap.api.asset.EmptyAsset;
import org.jboss.shrinkwrap.api.spec.JavaArchive;
import org.junit.Test;
import org.junit.runner.RunWith;


import javax.inject.Inject;


@RunWith(Arquillian.class)
public class DynProducerTest {
    @Deployment
    public static JavaArchive createDeployment()
    {
        JavaArchive archive = ShrinkWrap.create(JavaArchive.class)
          .addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml");
        archive.addPackages(true, "test/com/si/weld/dynproducer");
        return archive;
    }


    @Inject
    ConfigUser configUser;


    @Test
    public void testDynProducer() {
        System.out.printf("configUser=%s\n", configUser);
    }
}

 

Outputs:

 

34 [main] INFO org.jboss.weld.Version - WELD-000900 1.1.9 (Final)
InjectionPoint
          getAnnotated:[field] @ConfigType @Inject private test.com.si.weld.dynproducer.ConfigUser.settings;
           getType:interface test.com.si.weld.dynproducer.IStoreSettings<class test.com.si.weld.dynproducer.MyDataStoreSettings>
                    typeArgs: [class test.com.si.weld.dynproducer.MyDataStoreSettings]
                    rawType: interface test.com.si.weld.dynproducer.IStoreSettings;
           getQualifiers:[@test.com.si.weld.dynproducer.ConfigType()];
           getBean:Managed Bean [class test.com.si.weld.dynproducer.ConfigUser] with qualifiers [@Any @Default];
           getMember:private test.com.si.weld.dynproducer.IStoreSettings test.com.si.weld.dynproducer.ConfigUser.settings;
           isDelegate:false;
           isTransient:false
InjectionPoint
          getAnnotated:[field] @ConfigType @Inject private test.com.si.weld.dynproducer.ConfigUser.settings2;
           getType:interface test.com.si.weld.dynproducer.IStoreSettings<class test.com.si.weld.dynproducer.AnotherDataStoreSettings>
                    typeArgs: [class test.com.si.weld.dynproducer.AnotherDataStoreSettings]
                    rawType: interface test.com.si.weld.dynproducer.IStoreSettings;
           getQualifiers:[@test.com.si.weld.dynproducer.ConfigType()];
           getBean:Managed Bean [class test.com.si.weld.dynproducer.ConfigUser] with qualifiers [@Any @Default];
           getMember:private test.com.si.weld.dynproducer.IStoreSettings test.com.si.weld.dynproducer.ConfigUser.settings2;
           isDelegate:false;
           isTransient:false
configUser=ConfigUser{settings2=AnotherDataStoreSettings{threadCount=2, tmpPath=/tmp}, settings=MyDataStoreSettings{numberOfThreads=1, rootFolder=/tmp}}

 

See the attached dynproducer.zip for the full source.

 

ironmaiden:SITesting starksm$ jar -tf dynproducer.zip

src/test/java/test/com/si/weld/dynproducer/

src/test/java/test/com/si/weld/dynproducer/AnotherDataStoreSettings.java

src/test/java/test/com/si/weld/dynproducer/Config.java

src/test/java/test/com/si/weld/dynproducer/ConfigType.java

src/test/java/test/com/si/weld/dynproducer/ConfigUser.java

src/test/java/test/com/si/weld/dynproducer/DynProducerTest.java

src/test/java/test/com/si/weld/dynproducer/GenericConfigFactory.java

src/test/java/test/com/si/weld/dynproducer/IStoreSettings.java

src/test/java/test/com/si/weld/dynproducer/MyDataStoreSettings.java

src/test/java/test/com/si/weld/dynproducer/StoreSettingsWrapper.java

So the next thing I wanted to do was to tie into the shutdown of the Weld framework, and the way to do that is via an javax.enterprise.inject.spi.Extension implementation. The default way to add an Extension is to use the META-INF/services mechanism, but since the custom startup class had access to the Weld instance, and this has an addExtension method, I leveraged that along with a couple of new annotations to have the custom startup handle all of the details. The new classes are:

 

package com.si.weld;


import org.jboss.weld.environment.se.Weld;
import org.jboss.weld.environment.se.WeldContainer;


import javax.enterprise.inject.spi.Extension;
import javax.enterprise.util.AnnotationLiteral;
import java.lang.annotation.Annotation;


/**
 * A weld startup class for use in Java SE environment
 *
 * @author Scott Stark
 * @version $Revision:$
 */
public class CustomWeldStartMain {


    /**
     * The entry point to the weld initialization
     * @param args - the
     *             [0] = the class name of WeldMain class to bootstrap
     *             [1..n] = the args to pass to the WeldMain.main(String...) method
     * @throws Exception
     */
    public static void main(String[] args) throws Exception {
        // Need at least one arg giving the WeldMain implementation class name
        if(args.length == 0) {
            throw new IllegalStateException("Non-zero arguments required, first argument must be main class name");
        }
        // Load the class to use as the main class
        String mainClassName = args[0];
        Class<?> mainClass = CustomWeldStartMain.class.getClassLoader().loadClass(mainClassName);
        if(WeldMain.class.isAssignableFrom(mainClass) == false) {
            throw new IllegalStateException(mainClassName+"does not implement WeldMain");
        }
        Class<WeldMain> weldMainClass = (Class<WeldMain>) mainClass;
        Weld weld = new Weld();
        // See if there is a main class extension
        Extension mainExtension = loadExtension(weldMainClass, weld);
        if(mainExtension instanceof DefaultWeldMainExtension) {
            // This is a hack to tie into extension to know which WeldMain impl was used
            DefaultWeldMainExtension tme = (DefaultWeldMainExtension) mainExtension;
            tme.setWeldMainClass(weldMainClass);
        }
        // Standard Weld bootstrap from org.jboss.weld.environment.se.StartMain
        WeldContainer weldContainer = weld.initialize();
        Annotation qualifier = new AnnotationLiteral<WeldMainType>() {};
        WeldMain main = weldContainer.instance().select(weldMainClass, qualifier).get();


        // Add the SE shutdown hook
        Runtime.getRuntime().addShutdownHook(new ShutdownHook(weld));
        // Call the WeldMain.main() entry point
        String[] subargs = new String[args.length-1];
        System.arraycopy(args, 1, subargs, 0, args.length-1);
        main.main(subargs);
    }


    /**
     * Look for an Extension implementation via a WeldMainExtension on the weldMainClass
     * @param weldMainClass
     * @param weld
     */
    private static Extension loadExtension(Class<WeldMain> weldMainClass, Weld weld) {
        Extension extension = null;
        WeldMainExtension extensionType = weldMainClass.getAnnotation(WeldMainExtension.class);
        if(extensionType != null) {
            try {
                Class<? extends Extension> c = extensionType.value();
                extension = c.newInstance();
                weld.addExtension(extension);
            } catch (Exception e) {
                e.printStackTrace();
            }
        }
        return extension;
    }


    static class ShutdownHook extends Thread {
        private final Weld weld;


        ShutdownHook(final Weld weld) {
            this.weld = weld;
        }


        public void run() {
            weld.shutdown();
        }
    }
}

package com.si.weld;


/**
 * A simple interface defining the Weld post bootstrap main entry point.
 *
 * @author Scott Stark
 * @version $Revision:$
 */
public interface WeldMain {
    public void main(String[] args) throws Exception;
    public void shutdown();
}

package com.si.weld;


import javax.enterprise.inject.spi.Extension;
import javax.inject.Qualifier;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;
import static java.lang.annotation.ElementType.*;
import static java.lang.annotation.RetentionPolicy.*;


/**
 * A WeldMainExtension qualifier
 * @author Scott Stark
 * @version $Revision:$
 */
@Qualifier
@Target({TYPE})
@Retention(RUNTIME)
public @interface WeldMainExtension {
    Class<? extends Extension> value();
}

package com.si.weld;


import javax.inject.Qualifier;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;
import static java.lang.annotation.ElementType.*;
import static java.lang.annotation.RetentionPolicy.*;


/**
 * A WeldMain qualifier used to identify which WeldMain bean was used
 * @author Scott Stark
 * @version $Revision:$
 */
@Qualifier
@Target({TYPE})
@Retention(RUNTIME)
public @interface WeldMainType {
}

package com.si.weld;


import javax.enterprise.context.spi.CreationalContext;
import javax.enterprise.event.Observes;
import javax.enterprise.inject.UnsatisfiedResolutionException;
import javax.enterprise.inject.spi.AnnotatedConstructor;
import javax.enterprise.inject.spi.AnnotatedField;
import javax.enterprise.inject.spi.AnnotatedMethod;
import javax.enterprise.inject.spi.AnnotatedType;
import javax.enterprise.inject.spi.Bean;
import javax.enterprise.inject.spi.BeanManager;
import javax.enterprise.inject.spi.BeforeShutdown;
import javax.enterprise.inject.spi.Extension;
import javax.enterprise.inject.spi.ProcessAnnotatedType;
import javax.enterprise.util.AnnotationLiteral;
import java.lang.annotation.Annotation;
import java.lang.reflect.Type;
import java.util.Arrays;
import java.util.HashSet;
import java.util.Set;


/**
 * A Weld Extension that marks the ManagedBean used as the WeldMain instance with a
 * WeldMainType qualifier to allow it to be selected during shutdown, and its WeldMain.shutdown
 * method called.
 * @author Scott Stark
 * @version $Revision:$
 */
public class DefaultWeldMainExtension implements Extension {
    private Class<WeldMain> weldMainClass;
    private HashSet<WeldMainAnnotatedType> weldMainTypes = new HashSet<WeldMainAnnotatedType>();


    <T> void processAnnotatedType(@Observes ProcessAnnotatedType<T> pat) {
        AnnotatedType<T> atype = pat.getAnnotatedType();
        if(WeldMain.class.isAssignableFrom(atype.getJavaClass())) {
            //System.out.printf("TestMainExtension: scanning type: %s\n", atype.getJavaClass().getName());
            // If this is a WeldMain, add a wrapper to later hold a WeldMainType qualifier
            if(atype.getJavaClass().equals(weldMainClass)) {
                WeldMainAnnotatedType wrapped = new WeldMainAnnotatedType(atype);
                weldMainTypes.add(wrapped);
                pat.setAnnotatedType(wrapped);
            }
        }
    }
    void beforeShutdown(@Observes BeforeShutdown shutdown, final BeanManager beanManager){
        // Find the WeldMain to invoke shutdown on
        Annotation qualifier = new AnnotationLiteral<WeldMainType>() {};
        WeldMain main = getInstanceByType(beanManager, WeldMain.class, qualifier);
        main.shutdown();
    }


    protected <T> T getInstanceByType(BeanManager manager, Class<T> type, Annotation... bindings) {
        Set<Bean<?>> beans = manager.getBeans(type, bindings);
        final Bean<?> bean = manager.resolve(beans);
        if (bean == null) {
            throw new UnsatisfiedResolutionException("Unable to resolve a bean for " + type + " with bindings " + Arrays.asList(bindings));
        }
        CreationalContext<?> cc = manager.createCreationalContext(bean);
        return type.cast(manager.getReference(bean, type, cc));
    }


    public void setWeldMainClass(Class<WeldMain> weldMainClass) {
        this.weldMainClass = weldMainClass;
    }


    private static class WeldMainAnnotatedType<T> implements AnnotatedType<T> {
        private final AnnotatedType<T> type;
        private boolean markAsWeldMainType = true;
        WeldMainAnnotatedType(AnnotatedType<T> type){
            this.type = type;
        }


        @Override
        public boolean isAnnotationPresent(Class<? extends Annotation> annotationType) {
           return annotationType.equals(WeldMainType.class) ?
                   markAsWeldMainType : type.isAnnotationPresent(annotationType);
        }


        @Override
        public Set<AnnotatedConstructor<T>> getConstructors() {
            return type.getConstructors();
        }


        @Override
        public Set<AnnotatedField<? super T>> getFields() {
            return type.getFields();
        }


        @Override
        public Class<T> getJavaClass() {
            return type.getJavaClass();
        }


        @Override
        public Set<AnnotatedMethod<? super T>> getMethods() {
            return type.getMethods();
        }


        @Override
        public <T extends Annotation> T getAnnotation(Class<T> annotationType) {
            return type.getAnnotation(annotationType);
        }


        @Override
        public Set<Annotation> getAnnotations() {
            HashSet<Annotation> annotations = new HashSet<Annotation>(type.getAnnotations());
            if(markAsWeldMainType) {
                annotations.add(new AnnotationLiteral<WeldMainType>() {});
            }
            return annotations;
        }


        @Override
        public Type getBaseType() {
            return type.getBaseType();
        }


        @Override
        public Set<Type> getTypeClosure() {
            return type.getTypeClosure();
        }
    }


}

 

The new sample TestMain becomes:

 

package test.com.si.weld;

import com.si.weld.DefaultWeldMainExtension;
import com.si.weld.WeldMain;
import com.si.weld.WeldMainExtension;

import javax.enterprise.inject.Default;
import javax.inject.Singleton;
import java.util.Arrays;


/**
 * A minimalist WeldMain implementation
 *
 * @author Scott Stark
 * @version $Revision:$
 */
@Singleton
@Default
@WeldMainExtension(DefaultWeldMainExtension.class)
public class TestMain2 implements WeldMain {
    public TestMain2() {
    }


    public void main(String[] args) {
        System.out.printf("TestMain2.main(%s)\n", Arrays.asList(args));
    }


    @Override
    public void shutdown() {
        System.out.printf("TestMain2.shutdown()\n");
    }
}

 

 

Which when run using the CustomWeldStartMain main entry point produces:

 

/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/bin/java -Didea.launcher.port=7537 "..." com.intellij.rt.execution.application.AppMain com.si.weld.CustomWeldStartMain test.com.si.weld.TestMain2 arg2 arg3
34 [main] INFO org.jboss.weld.Version - WELD-000900 1.1.9 (Final)
296 [main] INFO org.jboss.weld.Bootstrap - WELD-000101 Transactional services not available. Injection of @Inject UserTransaction not available. Transactional observers will be invoked synchronously.
TestMain2.main([arg2, arg3])
TestMain2.shutdown()


Process finished with exit code 0

 

 

 

It was a whole lot more code just to add support for the invocation of the WeldMain.shutdown method, and most of that had to do with getting a qualifier on the ManagedBean that was used as the WeldMain implementation. Perhaps there is an easier way.

I was working with Weld framework in a Java SE environment largely through the IDE, and had found posts about using the org.jboss.weld.environment.se.StartMain class to bootstrap Weld from within Java SE, but I wanted more control over which class was targeted as the prescribed approach of having a ContainerInitialized event listener ala:

 

public class TestMain {
    public void main(@Observes ContainerInitialized event, @Parameters List parameters) {
        System.out.printf("TestMain.main called, parameters=%s\n", parameters);
    }
}

 

would result in every such listener in the ide classpath being called. I took the simple StartMain bootstrap code and created the following CustomWeldStartMain that accepts the name of the class to use as the post bootstrap entry point:

 

package com.si.weld;


import org.jboss.weld.environment.se.Weld;
import org.jboss.weld.environment.se.WeldContainer;


/**
 * A weld startup class for use in Java SE environment
 *
 * @author Scott Stark
 * @version $Revision:$
 */
public class CustomWeldStartMain {


    /**
     * The entry point to the weld initialization
     * @param args - the
     *             [0] = the class name of WeldMain class to bootstrap
     *             [1..n] = the args to pass to the WeldMain.main(String...) method
     * @throws Exception
     */
    public static void main(String[] args) throws Exception {
        // Need at least one arg giving the WeldMain implementation class name
        if(args.length == 0) {
            throw new IllegalStateException("Non-zero arguments required, first argument must be main class name");
        }
        // Load the class to use as the main class
        String mainClassName = args[0];
        Class<?> mainClass = CustomWeldStartMain.class.getClassLoader().loadClass(mainClassName);
        if(WeldMain.class.isAssignableFrom(mainClass) == false) {
            throw new IllegalStateException(mainClassName+"does not implement WeldMain");
        }
        Class<WeldMain> weldMainClass = (Class<WeldMain>) mainClass;
        // Standard Weld bootstrap from org.jboss.weld.environment.se.StartMain
        Weld weld = new Weld();
        WeldContainer weldContainer = weld.initialize();
        WeldMain main = weldContainer.instance().select(weldMainClass).get();
        // Add the SE shutdown hook
        Runtime.getRuntime().addShutdownHook(new ShutdownHook(weld));
        // Call the WeldMain.main() entry point
        String[] subargs = new String[args.length-1];
        System.arraycopy(args, 1, subargs, 0, args.length-1);
        main.main(subargs);
    }


    static class ShutdownHook extends Thread {
        private final Weld weld;


        ShutdownHook(final Weld weld) {
            this.weld = weld;
        }


        public void run() {
            weld.shutdown();
        }
    }
}

package com.si.weld;


/**
 * A simple interface defining the Weld post bootstrap main entry point.
 * 
 * @author Scott Stark
 * @version $Revision:$
 */
public interface WeldMain {
    public void main(String[] args) throws Exception;
}

 

Here is a sample test WeldMain entry point that is invoked when running from within the ide using a

 

package test.com.si.weld;


import com.si.weld.WeldMain;


import javax.inject.Singleton;
import java.util.Arrays;


/**
 * A minimalist WeldMain implementation
 *
 * @author Scott Stark
 * @version $Revision:$
 */
@Singleton
public class TestMain2 implements WeldMain {
    public void main(String[] args) {
        System.out.printf("TestMain2.main(%s)\n", Arrays.asList(args));
    }
}

 

 

To run this class, I setup a run configuration that specified com.si.weld.CustomWeldStartMain as the main class, and included test.com.si.weld.TestMain2 as the first program argument, with arg2, arg3 as the second argument. Running this within the ide produced:

 

/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/bin/java -Didea.launcher.port=7537 "..." com.intellij.rt.execution.application.AppMain com.si.weld.CustomWeldStartMain test.com.si.weld.TestMain2 arg2 arg3

45 [main] INFO org.jboss.weld.Version - WELD-000900 1.1.9 (Final)

263 [main] INFO org.jboss.weld.Bootstrap - WELD-000101 Transactional services not available. Injection of @Inject UserTransaction not available. Transactional observers will be invoked synchronously.

TestMain2.main([arg2, arg3])

Process finished with exit code 0

 

Maybe this is of general interest as an alternative StartMain?

With the announcment of EAP6, EAP is now available in the cloud environment provided by OpenShift. This post updates how to test the OpenShift jboss-eap-6.0 based cartridge standalone configuration in your own environment.

 

The configuration of the JBossAS7 server used by the OpenShift Express JBossAS cartridge is a simple modification of the jboss-eap-6.0 release which my be obtained from https://access.redhat.com/home

 

The contents of the jboss-eap-6.0 release need to be updated with the attached standalone.xml, standalone.conf, and the database driver modules. The exact steps would be:

  1. Create a demo directory to contain the files. I use /tmp/eap6conf, so if you use the same, no changes need to be made to the following directions or configuration files.
  2. download jboss-eap-6.0.zip from https://access.redhat.com/home using your subscription.
  3. unzip jboss-eap-6.0.zip
  4. Create a link from jbosseap-6.0 to jboss-eap-6.0, or copy the jboss-eap-6.0 directory to jbosseap-6.0
    1. ln -s jboss-eap-6.0 jbosseap-6.0
  5. Download the attachments on this blog
  6. unzip bin.zip to get the bin/{standalone.conf,standalone.sh} files
  7. cp bin/* to jbosseap-6.0/bin
  8. Edit the jbosseap-6.0/bin/standalone.conf file to change any of the environment variables in the first section to match your environment.
  9. unzip the modules.zip from within the jbosseap-6.0 directory to add the modules for mysql, mongodb, and switchyard to the server modules. (Note, the attached modules.zip does not contain the switchyard modules as this made the attachment too large. To build the full modules.zip, clone the https://github.com/openshift/jboss-as7-modules repo and do a 'gradle createModuleZip' to build it.)

 

OpenShift Environment Variables

There are several environment variables referenced in the standalone.xml from the OpenShift JBossAS7 cartridge standalone.xml and standalone.conf files. They are:

 

# OPENSHIFT_GEAR_NAME is the NAME of the application as passed to the rhc create app -a NAME … command
OPENSHIFT_GEAR_NAME

# OPENSHIFT_REPO_DIR is the git repository of the application deployment. For reproducing the standalone configuration
# it has no meaningful value as it is only used to pickup application specific overrides of the server
# configuration files.
OPENSHIFT_REPO_DIR = 

# OPENSHIFT_GEAR_DIR is the root directory of the application. 
OPENSHIFT_GEAR_DIR = 


# OPENSHIFT_GEAR_TYPE is jbosseap-6.0 for a jbossas cartridge. This is also used as the root of
# the jbosseap-6.0 application server associated with the application. In the OpenShift environment, each
# application is associated with a user that has a copy of the jboss-eap-6.0 server contents installed to ${OPENSHIFT_GEAR_DIR}${OPENSHIFT_GEAR_TYPE}, e.g., /tmp/demo/jbosseap-6.0.
OPENSHIFT_GEAR_TYPE = jbosseap-6.0

# OPENSHIFT_DB_TYPE is the type of the embedded database configured using the rhc-ctl-app command:
# rhc-ctl-app -a demo -e add-mysql-5.1
# This will be empty if no database cartridge has been embedded.
OPENSHIFT_DB_TYPE = 
# OPENSHIFT_DB_HOST gives the IP address the embedded database is listening on
OPENSHIFT_DB_HOST
# OPENSHIFT_DB_PORT gives the port the embedded database is listening on
OPENSHIFT_DB_PORT
# OPENSHIFT_DB_USERNAME gives the configured username to access the embedded database
OPENSHIFT_DB_USERNAME
# OPENSHIFT_DB_PASSWORD gives the configured username to access the embedded database
OPENSHIFT_DB_PASSWORD

# OPENSHIFT_INTERNAL_IP is the local ip address to bind the server's services to. Typically you would use
# localhost/127.0.0.1 for your local environment.
OPENSHIFT_INTERNAL_IP = 

# OPENSHIFT_JBOSS_CLUSTER is the ip address[port] for the TCPPING initial_hosts property used by the jgroups
# subsystem configuration. This is used when scaling of the application is enabled in OpenShift. For local, single server
# testing this will not be used.
OPENSHIFT_JBOSS_CLUSTER = 

# OPENSHIFT_JBOSS_CLUSTER_PROXY_PORT is the port used by the TCP groups protocol bind_port property.
OPENSHIFT_JBOSS_CLUSTER_PROXY_PORT = 7600

# OPENSHIFT_GEAR_DNS is the public dns name of the server hosting the application created by rhc app create -a … .
# For an application named demo, in a domain named jbossdev, the DNS name would be: demo-jbossdev.rhcloud.com.
# This is used by the jgroups subsystem configuration as the ip address/hostname for the external_addr property used to
# communicate with other jboss instances. For a local, single server testing this should be the same as the
# OPENSHIFT_INTERNAL_IP value.
OPENSHIFT_GEAR_DNS = 

# The node_profile value is derived from the type of node the application is running on. The default is small as that is the free
# offering which provide 500Mb of memory to the application. 
node_profile = small

 

The relevant values for these in the attached standalone.conf file that I tested with are:

 

#### Edit this variables for your test environment
export OPENSHIFT_GEAR_NAME= eap6conf
export OPENSHIFT_GEAR_DIR=/tmp/eap6conf/
export OPENSHIFT_GEAR_TYPE=jbosseap-6.0
export OPENSHIFT_INTERNAL_IP=127.0.0.1
export OPENSHIFT_GEAR_DNS=127.0.0.1
export node_profile=small
####

 

Running the OpenShift configuration is realized by executing the standalone.sh from your jbosseap-6.0/bin directory:

 

[800](ironmaiden eap6]) > cd /tmp/eap6conf/jbosseap-6.0/bin
[801](ironmaiden bin]) >./standalone.sh
=========================================================================


  JBoss Bootstrap Environment


  JBOSS_HOME: /tmp/eap6conf/jbosseap-6.0


  JAVA: /System/Library/Frameworks/JavaVM.framework/Versions/1.6/Home/bin/java


  JAVA_OPTS: -d32 -client -Xmx256m -XX:MaxPermSize=128m -XX:+AggressiveOpts -Dorg.apache.tomcat.util.LOW_MEMORY=true -Dorg.jboss.resolver.warning=true -Djava.net.preferIPv4Stack=true -Djboss.node.name=127.0.0.1 -Djgroups.bind_addr=127.0.0.1


=========================================================================


14:23:01,595 INFO  [org.jboss.modules] JBoss Modules version 1.1.2.GA-redhat-1
14:23:01,784 INFO  [org.jboss.msc] JBoss MSC version 1.0.2.GA-redhat-1
14:23:01,828 INFO  [org.jboss.as] JBAS015899: JBoss EAP 6.0.0.GA (AS 7.1.2.Final-redhat-1) starting
14:23:02,676 INFO  [org.xnio] XNIO Version 3.0.4.GA-redhat-1
14:23:02,676 INFO  [org.jboss.as.server] JBAS015888: Creating http management service using socket-binding (management-http)
14:23:02,684 INFO  [org.xnio.nio] XNIO NIO Implementation Version 3.0.4.GA-redhat-1
14:23:02,693 INFO  [org.jboss.remoting] JBoss Remoting version 3.2.8.GA-redhat-1
14:23:02,708 INFO  [org.jboss.as.logging] JBAS011502: Removing bootstrap log handlers
14:23:02,711 INFO  [org.jboss.as.configadmin] (ServerService Thread Pool -- 26) JBAS016200: Activating ConfigAdmin Subsystem
14:23:02,728 INFO  [org.jboss.as.clustering.infinispan] (ServerService Thread Pool -- 31) JBAS010280: Activating Infinispan subsystem.
14:23:02,752 INFO  [org.jboss.as.naming] (ServerService Thread Pool -- 38) JBAS011800: Activating Naming Subsystem
14:23:02,788 INFO  [org.jboss.as.security] (ServerService Thread Pool -- 44) JBAS013101: Activating Security Subsystem
14:23:02,797 INFO  [org.jboss.as.osgi] (ServerService Thread Pool -- 39) JBAS011906: Activating OSGi Subsystem
14:23:02,815 INFO  [org.jboss.as.security] (MSC service thread 1-4) JBAS013100: Current PicketBox version=4.0.9.Final-redhat-1
14:23:02,816 INFO  [org.jboss.as.webservices] (ServerService Thread Pool -- 48) JBAS015537: Activating WebServices Extension
14:23:02,822 INFO  [org.jboss.as.connector.logging] (MSC service thread 1-1) JBAS010408: Starting JCA Subsystem (JBoss IronJacamar 1.0.11.Final-redhat-1)
14:23:02,855 INFO  [org.jboss.as.connector.subsystems.datasources] (ServerService Thread Pool -- 27) JBAS010403: Deploying JDBC-compliant driver class org.h2.Driver (version 1.3)
14:23:02,878 INFO  [org.jboss.as.naming] (MSC service thread 1-5) JBAS011802: Starting Naming Service
14:23:02,891 INFO  [org.jboss.as.mail.extension] (MSC service thread 1-1) JBAS015400: Bound mail session [java:jboss/mail/Default]
14:23:03,072 INFO  [org.jboss.ws.common.management.AbstractServerConfig] (MSC service thread 1-3) JBoss Web Services - Stack CXF Server 4.0.4.GA-redhat-1
14:23:03,217 INFO  [org.apache.coyote.http11.Http11Protocol] (MSC service thread 1-1) Starting Coyote HTTP/1.1 on http-/127.0.0.1:8080
14:23:03,307 INFO  [org.jboss.as.connector.subsystems.datasources] (MSC service thread 1-6) JBAS010400: Bound data source [java:jboss/datasources/ExampleDS]
14:23:03,333 INFO  [org.jboss.as.server.deployment.scanner] (MSC service thread 1-6) JBAS015012: Started FileSystemDeploymentService for directory /tmp/eap6conf/jbosseap-6.0/standalone/deployments
14:23:03,350 INFO  [org.jboss.as.remoting] (MSC service thread 1-4) JBAS017100: Listening on 127.0.0.1:9999
14:23:03,350 INFO  [org.jboss.as.remoting] (MSC service thread 1-7) JBAS017100: Listening on 127.0.0.1:4447
14:23:03,409 INFO  [org.jboss.as] (Controller Boot Thread) JBAS015951: Admin console listening on http://127.0.0.1:9990
14:23:03,409 INFO  [org.jboss.as] (Controller Boot Thread) JBAS015874: JBoss EAP 6.0.0.GA (AS 7.1.2.Final-redhat-1) started in 2129ms - Started 134 of 214 services (79 services are passive or on-demand)

 

Diff of Configuration Files

The full difference from the base standalone.xml configuration you would see in a current jbosseap-6.0 cartridge application on OpenShift vs the standalone.xml seen in the jboss-eap-6.0/standalone/configuration/standalone.xml is shown below.

 

[855](ironmaiden eap6]) > diff -w .openshift/config/standalone.xml /home/git/JBossAS/Downloads/jboss-eap-6.0/standalone/configuration/standalone.xml 
4d3
< 
7,8d5
<                     <extension module="org.jboss.as.clustering.jgroups" />
<                     <extension module="org.jboss.as.cmp" />
14,15d10
<                     <extension module="org.jboss.as.jacorb" />
<                     <extension module="org.jboss.as.jaxr" />
20d14
<                     <extension module="org.jboss.as.jsr77" />
23d16
<                     <extension module="org.jboss.as.messaging" />
36d28
< 
37a30,46
>         <security-realms>
>             <security-realm name="ManagementRealm">
>                 <authentication>
>                     <local default-user="$local"/>
>                     <properties path="mgmt-users.properties" relative-to="jboss.server.config.dir"/>
>                 </authentication>
>             </security-realm>
>             <security-realm name="ApplicationRealm">
>                 <authentication>
>                     <local default-user="$local" allowed-users="*"/>
>                     <properties path="application-users.properties" relative-to="jboss.server.config.dir"/>
>                 </authentication>
>                 <authorization>
>                     <properties path="application-roles.properties" relative-to="jboss.server.config.dir"/>
>                 </authorization>
>             </security-realm>
>         </security-realms>
39c48
<             <native-interface>
---
>             <native-interface security-realm="ManagementRealm">
42c51
<             <http-interface>
---
>             <http-interface security-realm="ManagementRealm">
47d55
< 
50,51c58,63
<                               <!--console-handler name="CONSOLE"> <level name="INFO"/> <formatter> <pattern-formatter 
<                                         pattern="%d{HH:mm:ss,SSS} %-5p [%c] (%t) %s%E%n"/> </formatter> </console-handler -->
---
>             <console-handler name="CONSOLE">
>                 <level name="INFO"/>
>                 <formatter>
>                     <pattern-formatter pattern="%d{HH:mm:ss,SSS} %-5p [%c] (%t) %s%E%n"/>
>                 </formatter>
>             </console-handler>
54,55c66
<                                                   <pattern-formatter
<                                                             pattern="%d{yyyy/MM/dd HH:mm:ss,SSS} %-5p [%c] (%t) %s%E%n" />
---
>                     <pattern-formatter pattern="%d{HH:mm:ss,SSS} %-5p [%c] (%t) %s%E%n"/>
79c90
<                                                   <!--handler name="CONSOLE"/ -->
---
>                     <handler name="CONSOLE"/>
84d94
<                     <subsystem xmlns="urn:jboss:domain:cmp:1.0" />
88,91c98,99
<                                         <datasource jndi-name="java:jboss/datasources/ExampleDS"
<                                                   enabled="true" use-java-context="true" pool-name="H2DS">
<                                                   <connection-url>jdbc:h2:${jboss.server.data.dir}/test;DB_CLOSE_DELAY=-1
<                                                   </connection-url>
---
>                 <datasource jndi-name="java:jboss/datasources/ExampleDS" pool-name="ExampleDS" enabled="true" use-java-context="true">
>                     <connection-url>jdbc:h2:mem:test;DB_CLOSE_DELAY=-1</connection-url>
98,118d105
<                                         <datasource jndi-name="java:jboss/datasources/MysqlDS"
<                                                   enabled="${mysql.enabled}" use-java-context="true" pool-name="MysqlDS">
<                                                   <connection-url>jdbc:mysql://${env.OPENSHIFT_DB_HOST}:${env.OPENSHIFT_DB_PORT}/${env.OPENSHIFT_APP_NAME}
<                                                   </connection-url>
<                                                   <driver>mysql</driver>
<                                                   <security>
<                                                             <user-name>${env.OPENSHIFT_DB_USERNAME}</user-name>
<                                                             <password>${env.OPENSHIFT_DB_PASSWORD}</password>
<                                                   </security>
<                                         </datasource>
<                                         <datasource jndi-name="java:jboss/datasources/PostgreSQLDS"
<                                                   enabled="${postgresql.enabled}" use-java-context="true" pool-name="PostgreSQLDS"
<                                                   use-ccm="true">
<                                                   <connection-url>jdbc:postgresql://${env.OPENSHIFT_DB_HOST}:${env.OPENSHIFT_DB_PORT}/${env.OPENSHIFT_APP_NAME}
<                                                   </connection-url>
<                                                   <driver>postgresql</driver>
<                                                   <security>
<                                                             <user-name>${env.OPENSHIFT_DB_USERNAME}</user-name>
<                                                             <password>${env.OPENSHIFT_DB_PASSWORD}</password>
<                                                   </security>
<                                         </datasource>
121,130c108
<                                                             <xa-datasource-class>org.h2.jdbcx.JdbcDataSource
<                                                             </xa-datasource-class>
<                                                   </driver>
<                                                   <driver name="mysql" module="com.mysql.jdbc">
<                                                             <xa-datasource-class>com.mysql.jdbc.jdbc2.optional.MysqlXADataSource
<                                                             </xa-datasource-class>
<                                                   </driver>
<                                                   <driver name="postgresql" module="org.postgresql.jdbc">
<                                                             <xa-datasource-class>org.postgresql.xa.PGXADataSource
<                                                             </xa-datasource-class>
---
>                         <xa-datasource-class>org.h2.jdbcx.JdbcDataSource</xa-datasource-class>
136,138c114
<                               <deployment-scanner path="deployments"
<                                         relative-to="jboss.server.base.dir" scan-interval="5000"
<                                         deployment-timeout="300" />
---
>             <deployment-scanner path="deployments" relative-to="jboss.server.base.dir" scan-interval="5000"/>
141,144c117,118
<                               <spec-descriptor-property-replacement>false
<                               </spec-descriptor-property-replacement>
<                               <jboss-descriptor-property-replacement>true
<                               </jboss-descriptor-property-replacement>
---
>             <spec-descriptor-property-replacement>false</spec-descriptor-property-replacement>
>             <jboss-descriptor-property-replacement>true</jboss-descriptor-property-replacement>
151,152c125
<                                         <stateful default-access-timeout="5000" cache-ref="simple"
<                                                   clustered-cache-ref="clustered" />
---
>                 <stateful default-access-timeout="5000" cache-ref="simple"/>
155,158d127
<                               <mdb>
<                                         <resource-adapter-ref resource-adapter-name="hornetq-ra" />
<                                         <bean-instance-pool-ref pool-name="mdb-strict-max-pool" />
<                               </mdb>
161,166c130,131
<                                                   <strict-max-pool name="slsb-strict-max-pool"
<                                                             max-pool-size="20" instance-acquisition-timeout="5"
<                                                             instance-acquisition-timeout-unit="MINUTES" />
<                                                   <strict-max-pool name="mdb-strict-max-pool"
<                                                             max-pool-size="20" instance-acquisition-timeout="5"
<                                                             instance-acquisition-timeout-unit="MINUTES" />
---
>                     <strict-max-pool name="slsb-strict-max-pool" max-pool-size="20" instance-acquisition-timeout="5" instance-acquisition-timeout-unit="MINUTES"/>
>                     <strict-max-pool name="mdb-strict-max-pool" max-pool-size="20" instance-acquisition-timeout="5" instance-acquisition-timeout-unit="MINUTES"/>
171,174c136
<                                         <cache name="passivating" passivation-store-ref="file"
<                                                   aliases="SimpleStatefulCache" />
<                                         <cache name="clustered" passivation-store-ref="infinispan"
<                                                   aliases="StatefulTreeCache" />
---
>                 <cache name="passivating" passivation-store-ref="file" aliases="SimpleStatefulCache"/>
178,179d139
<                                         <cluster-passivation-store name="infinispan"
<                                                   cache-container="ejb" />
192d151
<                               <iiop enable-by-default="false" use-qualified-name="false" />
195,229c154,156
<                               <cache-container name="cluster" aliases="ha-partition"
<                                         default-cache="default">
<                                         <transport lock-timeout="60000" />
<                                         <replicated-cache name="default" mode="SYNC"
<                                                   batching="true">
<                                                   <locking isolation="REPEATABLE_READ" />
<                                         </replicated-cache>
<                               </cache-container>
<                               <cache-container name="web" aliases="standard-session-cache"
<                                         default-cache="repl">
<                                         <transport lock-timeout="60000" />
<                                         <replicated-cache name="repl" mode="ASYNC"
<                                                   batching="true">
<                                                   <file-store />
<                                         </replicated-cache>
<                                         <replicated-cache name="sso" mode="SYNC" batching="true" />
<                                         <distributed-cache name="dist" mode="ASYNC"
<                                                   batching="true" l1-lifespan="0">
<                                                   <file-store />
<                                         </distributed-cache>
<                               </cache-container>
<                               <cache-container name="ejb" aliases="sfsb sfsb-cache"
<                                         default-cache="repl">
<                                         <transport lock-timeout="60000" />
<                                         <replicated-cache name="repl" mode="ASYNC"
<                                                   batching="true">
<                                                   <eviction strategy="LRU" max-entries="10000" />
<                                                   <file-store />
<                                         </replicated-cache>
<                                         <!-- ~ Clustered cache used internally by EJB subsytem for managing the 
<                                                   client-mapping(s) of ~ the socketbinding referenced by the EJB remoting connector -->
<                                         <replicated-cache name="remote-connector-client-mappings"
<                                                   mode="SYNC" batching="true" />
<                                         <distributed-cache name="dist" mode="ASYNC"
<                                                   batching="true" l1-lifespan="0">
---
>             <cache-container name="hibernate" default-cache="local-query" module="org.jboss.as.jpa.hibernate:4">
>                 <local-cache name="entity">
>                     <transaction mode="NON_XA"/>
231,236c158,159
<                                                   <file-store />
<                                         </distributed-cache>
<                               </cache-container>
<                               <cache-container name="hibernate" default-cache="local-query"
<                                         module="org.jboss.as.jpa.hibernate:4">
<                                         <transport lock-timeout="60000" />
---
>                     <expiration max-idle="100000"/>
>                 </local-cache>
242,247c165
<                                         <invalidation-cache name="entity" mode="SYNC">
<                                                   <transaction mode="NON_XA" />
<                                                   <eviction strategy="LRU" max-entries="10000" />
<                                                   <expiration max-idle="100000" />
<                                         </invalidation-cache>
<                                         <replicated-cache name="timestamps" mode="ASYNC">
---
>                 <local-cache name="timestamps">
250c168
<                                         </replicated-cache>
---
>                 </local-cache>
253,260d170
<                     <subsystem xmlns="urn:jboss:domain:jacorb:1.2">
<                               <orb>
<                                         <initializers transactions="spec" security="on" />
<                               </orb>
<                     </subsystem>
<                     <subsystem xmlns="urn:jboss:domain:jaxr:1.1">
<                               <connection-factory jndi-name="java:jboss/jaxr/ConnectionFactory" />
<                     </subsystem>
282,316d191
<                     <subsystem xmlns="urn:jboss:domain:jgroups:1.1"
<                               default-stack="tcp">
<                               <stack name="tcp">
<                                         <transport type="TCP" socket-binding="jgroups-tcp">
<                                                   <property name="external_addr">${env.OPENSHIFT_GEAR_DNS}</property>
<                                                   <property name="external_port">${env.OPENSHIFT_JBOSS_CLUSTER_PROXY_PORT}
<                                                   </property>
<                                                   <property name="bind_port">7600</property>
<                                                   <property name="bind_addr">${env.OPENSHIFT_INTERNAL_IP}</property>
<                                         </transport>
<                                         <protocol type="TCPPING">
<                                                   <property name="timeout">3000</property>
<                                                   <property name="initial_hosts">${env.OPENSHIFT_JBOSS_CLUSTER}</property>
<                                                   <property name="port_range">0</property>
<                                                   <property name="num_initial_members">1</property>
<                                         </protocol>
<                                         <protocol type="MERGE2" />
<                                         <protocol type="FD" />
<                                         <protocol type="VERIFY_SUSPECT" />
<                                         <protocol type="BARRIER" />
<                                         <protocol type="pbcast.NAKACK" />
<                                         <protocol type="UNICAST2" />
<                                         <protocol type="pbcast.STABLE" />
<                                         <protocol type="pbcast.GMS" />
<                                         <protocol type="UFC" />
<                                         <protocol type="MFC" />
<                                         <protocol type="FRAG2" />
<                                         <protocol type="AUTH">
<                                                   <property name="auth_class">org.jgroups.auth.MD5Token</property>
<                                                   <property name="token_hash">SHA</property>
<                                                   <property name="auth_value">${env.OPENSHIFT_JBOSS_CLUSTER}</property>
<                                         </protocol>
<                                         <!--protocol type="pbcast.STATE_TRANSFER"/> <protocol type="pbcast.FLUSH"/ -->
<                               </stack>
<                     </subsystem>
324d198
<                     <subsystem xmlns="urn:jboss:domain:jsr77:1.0" />
330,403d203
<                     <subsystem xmlns="urn:jboss:domain:messaging:1.2">
<                               <hornetq-server>
<                                         <clustered>true</clustered>
<                                         <persistence-enabled>true</persistence-enabled>
<                                         <security-enabled>false</security-enabled>
<                                         <journal-file-size>102400</journal-file-size>
<                                         <journal-min-files>2</journal-min-files>
<                                         <connectors>
<                                                   <netty-connector name="netty" socket-binding="messaging" />
<                                                   <netty-connector name="netty-throughput"
<                                                             socket-binding="messaging-throughput">
<                                                             <param key="batch-delay" value="50" />
<                                                   </netty-connector>
<                                                   <in-vm-connector name="in-vm" server-id="0" />
<                                         </connectors>
<                                         <acceptors>
<                                                   <netty-acceptor name="netty" socket-binding="messaging" />
<                                                   <netty-acceptor name="netty-throughput"
<                                                             socket-binding="messaging-throughput">
<                                                             <param key="batch-delay" value="50" />
<                                                             <param key="direct-deliver" value="false" />
<                                                   </netty-acceptor>
<                                                   <in-vm-acceptor name="in-vm" server-id="0" />
<                                         </acceptors>
<                                         <!--broadcast-groups> <broadcast-group name="bg-group1"> <socket-binding>messaging-group</socket-binding> 
<                                                   <broadcast-period>5000</broadcast-period> <connector-ref>netty</connector-ref> 
<                                                   </broadcast-group> </broadcast-groups> <discovery-groups> <discovery-group 
<                                                   name="dg-group1"> <socket-binding>messaging-group</socket-binding> <refresh-timeout>10000</refresh-timeout> 
<                                                   </discovery-group> </discovery-groups> <cluster-connections> <cluster-connection 
<                                                   name="my-cluster"> <address>jms</address> <connector-ref>netty</connector-ref> 
<                                                   <discovery-group-ref discovery-group-name="dg-group1"/> </cluster-connection> 
<                                                   </cluster-connections -->
<                                         <address-settings>
<                                                   <!--default for catch all -->
<                                                   <address-setting match="#">
<                                                             <dead-letter-address>jms.queue.DLQ</dead-letter-address>
<                                                             <expiry-address>jms.queue.ExpiryQueue</expiry-address>
<                                                             <redelivery-delay>0</redelivery-delay>
<                                                             <redistribution-delay>1000</redistribution-delay>
<                                                             <max-size-bytes>10485760</max-size-bytes>
<                                                             <address-full-policy>BLOCK</address-full-policy>
<                                                             <message-counter-history-day-limit>10
<                                                             </message-counter-history-day-limit>
<                                                   </address-setting>
<                                         </address-settings>
<                                         <jms-connection-factories>
<                                                   <connection-factory name="InVmConnectionFactory">
<                                                             <connectors>
<                                                                       <connector-ref connector-name="in-vm" />
<                                                             </connectors>
<                                                             <entries>
<                                                                       <entry name="java:/ConnectionFactory" />
<                                                             </entries>
<                                                   </connection-factory>
<                                                   <connection-factory name="RemoteConnectionFactory">
<                                                             <connectors>
<                                                                       <connector-ref connector-name="netty" />
<                                                             </connectors>
<                                                             <entries>
<                                                                       <entry name="java:jboss/exported/jms/RemoteConnectionFactory" />
<                                                             </entries>
<                                                   </connection-factory>
<                                                   <pooled-connection-factory name="hornetq-ra">
<                                                             <transaction mode="xa" />
<                                                             <connectors>
<                                                                       <connector-ref connector-name="in-vm" />
<                                                             </connectors>
<                                                             <entries>
<                                                                       <entry name="java:/JmsXA" />
<                                                             </entries>
<                                                   </pooled-connection-factory>
<                                         </jms-connection-factories>
<                               </hornetq-server>
<                     </subsystem>
419,422c219,220
<                                         <capability name="org.apache.felix.configadmin"
<                                                   startlevel="1" />
<                                         <capability name="org.jboss.as.osgi.configadmin"
<                                                   startlevel="1" />
---
>                 <capability name="org.apache.felix.configadmin" startlevel="1"/>
>                 <capability name="org.jboss.as.osgi.configadmin" startlevel="1"/>
427c225
<                               <connector name="remoting-connector" socket-binding="remoting" />
---
>             <connector name="remoting-connector" socket-binding="remoting" security-realm="ApplicationRealm"/>
462,463c260
<                               <recovery-environment socket-binding="txn-recovery-environment"
<                                         status-socket-binding="txn-status-manager" />
---
>             <recovery-environment socket-binding="txn-recovery-environment" status-socket-binding="txn-status-manager"/>
466,471c263,265
<                     <subsystem xmlns="urn:jboss:domain:web:1.1"
<                               default-virtual-server="default-host" native="false">
<                               <connector name="http" protocol="HTTP/1.1" scheme="http"
<                                         socket-binding="http" />
<                               <virtual-server name="default-host"
<                                         enable-welcome-root="false">
---
>         <subsystem xmlns="urn:jboss:domain:web:1.1" default-virtual-server="default-host" native="false">
>             <connector name="http" protocol="HTTP/1.1" scheme="http" socket-binding="http"/>
>             <virtual-server name="default-host" enable-welcome-root="true">
472a267
>                 <alias name="example.com"/>
477c272
<                               <wsdl-host>${env.OPENSHIFT_INTERNAL_IP}</wsdl-host>
---
>             <wsdl-host>${jboss.bind.address:127.0.0.1}</wsdl-host>
480,483c275,276
<                                         <pre-handler-chain name="recording-handlers"
<                                                   protocol-bindings="##SOAP11_HTTP ##SOAP11_HTTP_MTOM ##SOAP12_HTTP ##SOAP12_HTTP_MTOM">
<                                                   <handler name="RecordingHandler"
<                                                             class="org.jboss.ws.common.invocation.RecordingServerHandler" />
---
>                 <pre-handler-chain name="recording-handlers" protocol-bindings="##SOAP11_HTTP ##SOAP11_HTTP_MTOM ##SOAP12_HTTP ##SOAP12_HTTP_MTOM">
>                     <handler name="RecordingHandler" class="org.jboss.ws.common.invocation.RecordingServerHandler"/>
489d281
< 
492c284
<                               <loopback-address value="${env.OPENSHIFT_INTERNAL_IP}" />
---
>             <inet-address value="${jboss.bind.address.management:127.0.0.1}"/>
495c287
<                               <loopback-address value="${env.OPENSHIFT_INTERNAL_IP}" />
---
>             <inet-address value="${jboss.bind.address:127.0.0.1}"/>
496a289
>         <!-- TODO - only show this if the jacorb subsystem is added  -->
498,500c291,295
<                               <!-- Used for IIOP sockets in the standarad configuration. To secure JacORB 
<                                         you need to setup SSL -->
<                               <loopback-address value="${env.OPENSHIFT_INTERNAL_IP}" />
---
>             <!--
>               ~  Used for IIOP sockets in the standard configuration.
>               ~                  To secure JacORB you need to setup SSL 
>               -->
>             <inet-address value="${jboss.bind.address.unsecure:127.0.0.1}"/>
503,510c298,302
< 
<           <socket-binding-group name="standard-sockets"
<                     default-interface="public" port-offset="0">
<                     <socket-binding name="management-native" interface="management"
<                               port="9999" />
<                     <socket-binding name="management-http" interface="management"
<                               port="9990" />
< 
---
>     <socket-binding-group name="standard-sockets" default-interface="public" port-offset="${jboss.socket.binding.port-offset:0}">
>         <socket-binding name="management-native" interface="management" port="${jboss.management.native.port:9999}"/>
>         <socket-binding name="management-http" interface="management" port="${jboss.management.http.port:9990}"/>
>         <socket-binding name="management-https" interface="management" port="${jboss.management.https.port:9443}"/>
>         <socket-binding name="ajp" port="8009"/>
513,523c305
<                     <socket-binding name="jacorb" interface="unsecure"
<                               port="3528" />
<                     <socket-binding name="jacorb-ssl" interface="unsecure"
<                               port="3529" />
<                     <socket-binding name="jgroups-tcp" port="7600" />
<                     <socket-binding name="messaging" port="5445" />
<                     <!--socket-binding name="messaging-group" multicast-address="${jboss.messaging.group.address:231.7.7.7}" 
<                               multicast-port="${jboss.messaging.group.port:9876}"/ -->
<                     <socket-binding name="messaging-throughput" port="5455" />
<                     <socket-binding name="osgi-http" interface="management"
<                               port="8090" />
---
>         <socket-binding name="osgi-http" interface="management" port="8090"/>

The OpenShift PaaS environment has updated the JBossAS cartridge to use jboss-as-7.1.0.Final as the server version.  This post updates how to test the OpenShift JBossAS7 7.1.0.Final based cartridge standalone configuration in your own environment.

 

The configuration of the JBossAS7 server used by the OpenShift Express JBossAS cartridge is a simple modification of the jboss-as-7.1.0.Final release which my be obtained from http://www.jboss.org/as7.html

 

The contents of the jboss-as-7.1.0.Final release need to be updated with the attached standalone.xml, standalone.conf, and the database driver modules. The exact steps would be:

  1. Create a demo directory to contain the files. I use /tmp/as710conf, so if you use the same, no changes need to be made to the following directions or configuration files.
  2. download http://download.jboss.org/jbossas/7.1/jboss-as-7.1.0.Final/jboss-as-7.1.0.Final.zip
  3. unzip jboss-as-7.1.0.Final.zip
  4. Create a link from jbossas-7 to jboss-as-7.1.0.Final, or copy the jboss-as-7.1.0.Final directory to jbossas-7
    1. ln -s jboss-as-7.1.0.Final jbossas-7
  5. Download the attachments on this blog
  6. unzip bin.zip to get the bin/{standalone.conf,standalone.sh} files
  7. cp bin/* to jbossas-7/bin
  8. Edit the jbossas-7/bin/standalone.conf file to change any of the
  9. unzip the modules.zip from within the jbossas-7 directory to add the modules for mysql, mongodb, and switchyard to the server modules. (Note, the attached modules.zip does not contain the switchyard modules as this made the attachment too large. To build the full modules.zip, clone the https://github.com/openshift/jboss-as7-modules repo and do a 'gradle createModuleZip' to build it.)

 

 

There are several environment variables referenced in the standalone.xml from the OpenShift JBossAS7 cartridge standalone.xml and standalone.conf files. They are:

 

# OPENSHIFT_GEAR_NAME is the NAME of the application as passed to the rhc create app -a NAME … command
OPENSHIFT_GEAR_NAME

# OPENSHIFT_REPO_DIR is the git repository of the application deployment. For reproducing the standalone configuration
# it has no meaningful value as it is only used to pickup application specific overrides of the server
# configuration files.
OPENSHIFT_REPO_DIR = 

# OPENSHIFT_GEAR_DIR is the root directory of the application. 
OPENSHIFT_GEAR_DIR = 

# OPENSHIFT_GEAR_TYPE is jbossas-7 for a jbossas cartridge. This is also used as the root of
# the jbossas7 application server associated with the application. In the OpenShift environment, each
# application is associated with a user that has a copy of the jboss-as-7.1.0.Final server contents installed to ${OPENSHIFT_GEAR_DIR}${OPENSHIFT_GEAR_TYPE}, e.g., /tmp/demo/jbossas-7.
OPENSHIFT_GEAR_TYPE = jbossas-7. 

# OPENSHIFT_DB_TYPE is the type of the embedded database configured using the rhc-ctl-app command:
# rhc-ctl-app -a demo -e add-mysql-5.1
# This will be empty if no database cartridge has been embedded.
OPENSHIFT_DB_TYPE = 
# OPENSHIFT_DB_HOST gives the IP address the embedded database is listening on
OPENSHIFT_DB_HOST
# OPENSHIFT_DB_PORT gives the port the embedded database is listening on
OPENSHIFT_DB_PORT
# OPENSHIFT_DB_USERNAME gives the configured username to access the embedded database
OPENSHIFT_DB_USERNAME
# OPENSHIFT_DB_PASSWORD gives the configured username to access the embedded database
OPENSHIFT_DB_PASSWORD

# OPENSHIFT_INTERNAL_IP is the local ip address to bind the server's services to. Typically you would use
# localhost/127.0.0.1 for your local environment.
OPENSHIFT_INTERNAL_IP = 

# OPENSHIFT_JBOSS_CLUSTER is the ip address[port] for the TCPPING initial_hosts property used by the jgroups
# subsystem configuration. This is used when scaling of the application is enabled in OpenShift. For local, single server
# testing this will not be used.
OPENSHIFT_JBOSS_CLUSTER = 

# OPENSHIFT_JBOSS_CLUSTER_PROXY_PORT is the port used by the TCP groups protocol bind_port property.
OPENSHIFT_JBOSS_CLUSTER_PROXY_PORT = 7600

# OPENSHIFT_GEAR_DNS is the public dns name of the server hosting the application created by rhc app create -a … .
# For an application named demo, in a domain named jbossdev, the DNS name would be: demo-jbossdev.rhcloud.com.
# This is used by the jgroups subsystem configuration as the ip address/hostname for the external_addr property used to
# communicate with other jboss instances. For a local, single server testing this should be the same as the
# OPENSHIFT_INTERNAL_IP value.
OPENSHIFT_GEAR_DNS = 

# The node_profile value is derived from the type of node the application is running on. The default is small as that is the free
# offering which provide 500Mb of memory to the application. 
node_profile = small

 

The relevant values for these in the attached standalone.conf file that I tested with are:

 

#### Edit this variables for your test environment
export OPENSHIFT_GEAR_NAME=as710conf
export OPENSHIFT_GEAR_DIR=/tmp/as710conf/
export OPENSHIFT_GEAR_TYPE=jbossas-7
export OPENSHIFT_INTERNAL_IP=127.0.0.1
export OPENSHIFT_GEAR_DNS=127.0.0.1
export node_profile=small
####

 

Running the OpenShift configuration is realized by executing the standalone.sh from your jbossas-7/bin directory:

 

[152](ironmaiden:as710conf) > cd /tmp/as710conf/jbossas-7/bin/
[153](ironmaiden:bin) > ./standalone.sh 
=========================================================================


  JBoss Bootstrap Environment


  JBOSS_HOME: /tmp/as710conf/jbossas-7


  JAVA: /System/Library/Frameworks/JavaVM.framework/Versions/1.6/Home/bin/java


  JAVA_OPTS: -d32 -client -Xmx256m -XX:MaxPermSize=128m -XX:+AggressiveOpts -Dorg.apache.tomcat.util.LOW_MEMORY=true -Dorg.jboss.resolver.warning=true -Djava.net.preferIPv4Stack=true -Djboss.node.name=127.0.0.1 -Djgroups.bind_addr=127.0.0.1


=========================================================================


05:47:38,320 INFO  [org.jboss.modules] JBoss Modules version 1.1.1.GA
05:47:38,490 INFO  [org.jboss.msc] JBoss MSC version 1.0.2.GA
05:47:38,554 INFO  [org.jboss.as] JBAS015899: JBoss AS 7.1.0.Final "Thunder" starting
05:47:39,265 INFO  [org.xnio] XNIO Version 3.0.3.GA
05:47:39,265 INFO  [org.jboss.as.server] JBAS015888: Creating http management service using socket-binding (management-http)
05:47:39,274 INFO  [org.xnio.nio] XNIO NIO Implementation Version 3.0.3.GA
05:47:39,283 INFO  [org.jboss.remoting] JBoss Remoting version 3.2.2.GA
05:47:39,294 INFO  [org.jboss.as.logging] JBAS011502: Removing bootstrap log handlers
05:47:39,297 INFO  [org.jboss.as.configadmin] (ServerService Thread Pool -- 26) JBAS016200: Activating ConfigAdmin Subsystem
05:47:39,307 INFO  [org.jboss.as.clustering.infinispan] (ServerService Thread Pool -- 31) JBAS010280: Activating Infinispan subsystem.
05:47:39,328 INFO  [org.jboss.as.security] (ServerService Thread Pool -- 44) JBAS013101: Activating Security Subsystem
05:47:39,333 INFO  [org.jboss.as.osgi] (ServerService Thread Pool -- 39) JBAS011940: Activating OSGi Subsystem
05:47:39,336 INFO  [org.jboss.as.naming] (ServerService Thread Pool -- 38) JBAS011800: Activating Naming Subsystem
05:47:39,342 INFO  [org.jboss.as.security] (MSC service thread 1-3) JBAS013100: Current PicketBox version=4.0.6.final
05:47:39,359 INFO  [org.jboss.as.connector] (MSC service thread 1-7) JBAS010408: Starting JCA Subsystem (JBoss IronJacamar 1.0.7.Final)
05:47:39,372 INFO  [org.jboss.as.webservices] (ServerService Thread Pool -- 48) JBAS015537: Activating WebServices Extension
05:47:39,480 INFO  [org.jboss.as.naming] (MSC service thread 1-8) JBAS011802: Starting Naming Service
05:47:39,503 INFO  [org.jboss.as.mail.extension] (MSC service thread 1-4) JBAS015400: Bound mail session [java:jboss/mail/Default]
05:47:39,518 INFO  [org.jboss.as.connector.subsystems.datasources] (ServerService Thread Pool -- 27) JBAS010403: Deploying JDBC-compliant driver class org.h2.Driver (version 1.3)
05:47:39,567 INFO  [org.jboss.ws.common.management.AbstractServerConfig] (MSC service thread 1-7) JBoss Web Services - Stack CXF Server 4.0.1.GA
05:47:39,687 INFO  [org.apache.coyote.http11.Http11Protocol] (MSC service thread 1-7) Starting Coyote HTTP/1.1 on http--127.0.0.1-8080
05:47:39,837 INFO  [org.jboss.as.server.deployment.scanner] (MSC service thread 1-5) JBAS015012: Started FileSystemDeploymentService for directory /tmp/as710conf/jbossas-7/standalone/deployments
05:47:39,853 INFO  [org.jboss.as.remoting] (MSC service thread 1-3) JBAS017100: Listening on /127.0.0.1:4447
05:47:39,853 INFO  [org.jboss.as.remoting] (MSC service thread 1-6) JBAS017100: Listening on /127.0.0.1:9999
05:47:39,941 INFO  [org.jboss.as.connector.subsystems.datasources] (MSC service thread 1-5) JBAS010400: Bound data source [java:jboss/datasources/ExampleDS]
05:47:39,950 INFO  [org.jboss.as] (Controller Boot Thread) JBAS015874: JBoss AS 7.1.0.Final "Thunder" started in 1922ms - Started 134 of 205 services (70 services are passive or on-demand)

 

 

Diff of Configuration Files

The full difference from the base standalone.xml configuration you would see in a current jbossas-7 cartridge application on OpenShift vs the standalone.xml seen in the jboss-as-7.1.0.Final/standalone/configuration/standalone.xml is show below.

 

[260](ironmaiden:tmp) > diff -w /tmp/demo/.openshift/config/standalone.xml /home/git/JBossAS/Downloads/jboss-as-7.1.0.Final/standalone/configuration/standalone.xml
7c7
<         <extension module="org.jboss.as.clustering.jgroups"/>
---
>         <extension module="org.jboss.as.configadmin"/>
18a19
>         <extension module="org.jboss.as.osgi"/>
25a27
>         <extension module="org.jboss.as.webservices"/>
29c31
<     <!--management>
---
>     <management>
50c52
<     </management-->
---
>     </management>
54c56
<             <!--console-handler name="CONSOLE">
---
>             <console-handler name="CONSOLE">
59c61
<             </console-handler-->
---
>             </console-handler>
62c64
<                     <pattern-formatter pattern="%d{yyyy/MM/dd HH:mm:ss,SSS} %-5p [%c] (%t) %s%E%n"/>
---
>                     <pattern-formatter pattern="%d{HH:mm:ss,SSS} %-5p [%c] (%t) %s%E%n"/>
86c88
<                     <!--handler name="CONSOLE"/-->
---
>                     <handler name="CONSOLE"/>
90a93
>         <subsystem xmlns="urn:jboss:domain:configadmin:1.0"/>
93,94c96,97
<                 <datasource jndi-name="java:jboss/datasources/ExampleDS" enabled="true" use-java-context="true" pool-name="H2DS">
<                     <connection-url>jdbc:h2:${jboss.server.data.dir}/test;DB_CLOSE_DELAY=-1</connection-url>
---
>                 <datasource jndi-name="java:jboss/datasources/ExampleDS" pool-name="ExampleDS" enabled="true" use-java-context="true">
>                     <connection-url>jdbc:h2:mem:test;DB_CLOSE_DELAY=-1</connection-url>
101,116d103
<                 <datasource jndi-name="java:jboss/datasources/MysqlDS" enabled="${mysql.enabled}" use-java-context="true" pool-name="MysqlDS">
<                     <connection-url>jdbc:mysql://${env.OPENSHIFT_DB_HOST}:${env.OPENSHIFT_DB_PORT}/${env.OPENSHIFT_GEAR_NAME}</connection-url>
<                     <driver>mysql</driver>
<                     <security>
<                       <user-name>${env.OPENSHIFT_DB_USERNAME}</user-name>
<                       <password>${env.OPENSHIFT_DB_PASSWORD}</password>
<                     </security>
<                 </datasource>
<                 <datasource jndi-name="java:jboss/datasources/PostgreSQLDS" enabled="${postgresql.enabled}" use-java-context="true" pool-name="PostgreSQLDS" use-ccm="true">
<                     <connection-url>jdbc:postgresql://${env.OPENSHIFT_DB_HOST}:${env.OPENSHIFT_DB_PORT}/${env.OPENSHIFT_GEAR_NAME}</connection-url>
<                     <driver>postgresql</driver>
<                     <security>
<                       <user-name>${env.OPENSHIFT_DB_USERNAME}</user-name>
<                       <password>${env.OPENSHIFT_DB_PASSWORD}</password>
<                     </security>
<                 </datasource>
121,126d107
<                     <driver name="mysql" module="com.mysql.jdbc">
<                         <xa-datasource-class>com.mysql.jdbc.jdbc2.optional.MysqlXADataSource</xa-datasource-class>
<                     </driver>
<                     <driver name="postgresql" module="org.postgresql.jdbc">
<                         <xa-datasource-class>org.postgresql.xa.PGXADataSource</xa-datasource-class>
<                     </driver>
139c120
<                 <stateful default-access-timeout="5000" cache-ref="simple" clustered-cache-ref="clustered"/>
---
>                 <stateful default-access-timeout="5000" cache-ref="simple"/>
142c123
<             <!--mdb>
---
>             <mdb>
145c126
<             </mdb-->
---
>             </mdb>
155d135
<                 <cache name="clustered" passivation-store-ref="infinispan" aliases="StatefulTreeCache"/>
159d138
<                 <cluster-passivation-store name="infinispan" cache-container="ejb"/>
172d150
<             <!--iiop enable-by-default="false" use-qualified-name="false"/-->
174,204c152
<         <subsystem xmlns="urn:jboss:domain:infinispan:1.1" default-cache-container="cluster">
<             <cache-container name="cluster" aliases="ha-partition" default-cache="default">
<                 <transport lock-timeout="60000"/>
<                 <replicated-cache name="default" mode="SYNC" batching="true">
<                     <locking isolation="REPEATABLE_READ"/>
<                 </replicated-cache>
<             </cache-container>
<             <cache-container name="web" aliases="standard-session-cache" default-cache="repl">
<                 <transport lock-timeout="60000"/>
<                 <replicated-cache name="repl" mode="ASYNC" batching="true">
<                     <file-store/>
<                 </replicated-cache>
<                 <replicated-cache name="sso" mode="SYNC" batching="true"/>
<                 <distributed-cache name="dist" mode="ASYNC" batching="true">
<                     <file-store/>
<                 </distributed-cache>
<             </cache-container>
<             <cache-container name="ejb" aliases="sfsb sfsb-cache" default-cache="repl">
<                 <transport lock-timeout="60000"/>
<                 <replicated-cache name="repl" mode="ASYNC" batching="true">
<                     <eviction strategy="LRU"/>
<                     <file-store/>
<                 </replicated-cache>
<                 <!-- Clustered cache used internally by EJB subsytem for managing the client-mapping(s) of
<                 the socketbinding referenced by the EJB remoting connector -->
<                 <replicated-cache name="remote-connector-client-mappings" mode="SYNC" batching="true"/>
<                 <distributed-cache name="dist" mode="ASYNC" batching="true">
<                     <eviction strategy="LRU"/>
<                     <file-store/>
<                 </distributed-cache>
<             </cache-container>
---
>         <subsystem xmlns="urn:jboss:domain:infinispan:1.1" default-cache-container="hibernate">
206,208c154,155
<                 <transport lock-timeout="60000"/>
<                 <local-cache name="local-query">
<                     <transaction mode="NONE"/>
---
>                 <local-cache name="entity">
>                     <transaction mode="NON_XA"/>
212,213c159,160
<                 <invalidation-cache name="entity" mode="SYNC">
<                     <transaction mode="NON_XA"/>
---
>                 <local-cache name="local-query">
>                     <transaction mode="NONE"/>
216,217c163,164
<                 </invalidation-cache>
<                 <replicated-cache name="timestamps" mode="ASYNC">
---
>                 </local-cache>
>                 <local-cache name="timestamps">
220c167
<                 </replicated-cache>
---
>                 </local-cache>
229,231c176,178
<                         <core-threads count="10"/>
<                         <queue-length count="10" />
<                         <max-threads count="10" />
---
>                     <core-threads count="50"/>
>                     <queue-length count="50"/>
>                     <max-threads count="50"/>
235,237c182,184
<                         <core-threads count="10"/>
<                         <queue-length count="10" />
<                         <max-threads count="10" />
---
>                     <core-threads count="50"/>
>                     <queue-length count="50"/>
>                     <max-threads count="50"/>
243,275c190,192
<         <subsystem xmlns="urn:jboss:domain:jgroups:1.0" default-stack="tcp">
<             <stack name="tcp">
<                 <transport type="TCP" socket-binding="jgroups-tcp"> 
<                           <property name="external_addr">${env.OPENSHIFT_GEAR_DNS}</property>
<                     <property name="external_port">${env.OPENSHIFT_JBOSS_CLUSTER_PROXY_PORT}</property>
<                     <property name="bind_port">7600</property>
<                     <property name="bind_addr">${env.OPENSHIFT_INTERNAL_IP}</property>
<                 </transport>
<                 <protocol type="TCPPING">
<                           <property name="timeout">3000</property>
<                           <property name="initial_hosts">${env.OPENSHIFT_JBOSS_CLUSTER}</property>
<                           <property name="port_range">0</property>
<                           <property name="num_initial_members">1</property>
<                 </protocol>
<                 <protocol type="MERGE2"/>
<                 <protocol type="FD"/>
<                 <protocol type="VERIFY_SUSPECT"/>
<                 <protocol type="BARRIER"/>
<                 <protocol type="pbcast.NAKACK"/>
<                 <protocol type="UNICAST2"/>
<                 <protocol type="pbcast.STABLE"/>
<                 <protocol type="pbcast.GMS"/>
<                 <protocol type="UFC"/>
<                 <protocol type="MFC"/>
<                 <protocol type="FRAG2"/>
<                 <protocol type="AUTH">
<                         <property name="auth_class">org.jgroups.auth.MD5Token</property>
<                         <property name="token_hash">SHA</property>
<                         <property name="auth_value">${env.OPENSHIFT_JBOSS_CLUSTER}</property>
<                 </protocol>
<                 <!--protocol type="pbcast.STATE_TRANSFER"/>
<                 <protocol type="pbcast.FLUSH"/-->
<             </stack>
---
>         <subsystem xmlns="urn:jboss:domain:jmx:1.1">
>             <show-model value="true"/>
>             <remoting-connector/>
285a203,218
>         <subsystem xmlns="urn:jboss:domain:osgi:1.2" activation="lazy">
>             <properties>
>                 <!-- Specifies the beginning start level of the framework -->
>                 <property name="org.osgi.framework.startlevel.beginning">1</property>
>             </properties>
>             <capabilities>
>                 <!-- modules registered with the OSGi layer on startup -->
>                 <capability name="javax.servlet.api:v25"/>
>                 <capability name="javax.transaction.api"/>
>                 <!-- bundles started in startlevel 1 -->
>                 <capability name="org.apache.felix.log" startlevel="1"/>
>                 <capability name="org.jboss.osgi.logging" startlevel="1"/>
>                 <capability name="org.apache.felix.configadmin" startlevel="1"/>
>                 <capability name="org.jboss.as.osgi.configadmin" startlevel="1"/>
>             </capabilities>
>         </subsystem>
288c221
<             <connector name="remoting-connector" socket-binding="remoting"/>
---
>             <connector name="remoting-connector" socket-binding="remoting" security-realm="ApplicationRealm"/>
296c229,237
<                         <login-module code="UsersRoles" flag="required"/>
---
>                         <login-module code="Remoting" flag="optional">
>                             <module-option name="password-stacking" value="useFirstPass"/>
>                         </login-module>
>                         <login-module code="RealmUsersRoles" flag="required">
>                             <module-option name="usersProperties" value="${jboss.server.config.dir}/application-users.properties"/>
>                             <module-option name="rolesProperties" value="${jboss.server.config.dir}/application-roles.properties"/>
>                             <module-option name="realm" value="ApplicationRealm"/>
>                             <module-option name="password-stacking" value="useFirstPass"/>
>                         </login-module>
323c264
<             <virtual-server name="default-host" enable-welcome-root="false">
---
>             <virtual-server name="default-host" enable-welcome-root="true">
324a266
>                 <alias name="example.com"/>
326a269,278
>         <subsystem xmlns="urn:jboss:domain:webservices:1.1">
>             <modify-wsdl-address>true</modify-wsdl-address>
>             <wsdl-host>${jboss.bind.address:127.0.0.1}</wsdl-host>
>             <endpoint-config name="Standard-Endpoint-Config"/>
>             <endpoint-config name="Recording-Endpoint-Config">
>                 <pre-handler-chain name="recording-handlers" protocol-bindings="##SOAP11_HTTP ##SOAP11_HTTP_MTOM ##SOAP12_HTTP ##SOAP12_HTTP_MTOM">
>                     <handler name="RecordingHandler" class="org.jboss.ws.common.invocation.RecordingServerHandler"/>
>                 </pre-handler-chain>
>             </endpoint-config>
>         </subsystem>
332c284
<             <loopback-address value="${env.OPENSHIFT_INTERNAL_IP}"/>
---
>             <inet-address value="${jboss.bind.address.management:127.0.0.1}"/>
335c287
<             <loopback-address value="${env.OPENSHIFT_INTERNAL_IP}"/>
---
>             <inet-address value="${jboss.bind.address:127.0.0.1}"/>
342,344c294,297
<         <socket-binding name="jgroups-tcp" port="7600"/>
<         <!--socket-binding name="management-native" interface="management" port="${jboss.management.native.port:9999}"/>
<         <socket-binding name="management-http" interface="management" port="${jboss.management.http.port:9990}"/-->
---
>         <socket-binding name="management-native" interface="management" port="${jboss.management.native.port:9999}"/>
>         <socket-binding name="management-http" interface="management" port="${jboss.management.http.port:9990}"/>
>         <socket-binding name="management-https" interface="management" port="${jboss.management.https.port:9443}"/>
>         <socket-binding name="osgi-http" interface="management" port="8090"/>

JSR 355, JCP.next.2

 

The second phase of revising the Java Community Process is underway as JSR 355, the stated goal being:

 

This JSR will make changes to the JCP's Process Document and the Executive Committee's Standing Rules with the goal of merging the two Executive Committees into one and reducing the number of Executive Committee members from the current total of 32.

 

 

While not large in scope, the JSR does bring up some interesting process changes that the community should provide feedback on. The current list of issues are:

 

 

See the JSR 355 Home Page to subscribe to or view the mailing lists, and browse the JSR 355 JIRA issues to provide feedback.

Scott Stark

Adopt A JSR

Posted by Scott Stark Jan 11, 2012

So I heard about a new interesting effort being headed by the London Java Users Group and the SOUJava user group is this Adopt a JSR effort, where they are promoting their own users as well other Java User Groups to get involved in JSRs. The idea is that since the recently updated JCP process emphasises transparency and community involvment, a very natural function for JUGs is to contribute to JSRs that interest them. That is a great idea and is a perfect match with the new JCP process. Take a look at their page, and if you are a member of a JUG, think about getting your JUG involved in contributing feedback to JSRs of interest.

A great illustration of the degree of customization one can achieve with the latest release of the JBossAS7 cartridge in OpenShift Express is seen in Ben's post on getting TorqueBox running:

 

http://torquebox.org/news/2011/09/07/torquebox-openshift-express/

The upcoming refresh of the OpenShift Express release, due out Tuesday September 6,  includes an updated JBoss AS 7 cartridge that features the following changes:

 

  • You can now extend the jbossas7 server modules used by your application by adding the modules to the .openshift/config/modules directory in your application git repository. When you push these modules, they are incorporated into the server MODULEPATH on restart.
  • Actually, any content you add to the .openshift/config/ directory of the application repository is linked into the jbossas7/standalone/configuration directory of your application server in the express environment. This allows you to add configuration files that may be referenced by the server standalone.xml file. One example would be security property files referenced by the security subsystem configuration.
  • The jbossas7 server version has been updated to be based on the jboss-as-web-7.0.1.Final.zip release

I thought I would put together a summary of the changes for our spec leads to comment on to help solicit feedback on the JSR-348 JCP v2.8 public draft. These changes are relative to the current JCP2 Document, v2.7 (May 15 2009). The headings below are from the v2.8 JCP public review document, and terms in bold are from the v2.8 Definitions section.

 

Note that the JSR-348 public review ends on Sep 6, 2011, so make sure you have your comments recorded either view the mailing list, or issue tracker by then.

I Executive Summary

The two ECs representing the embedded and server spaces will likely be collapsed into one.

 

 

The four steps of a JSR are slightly tweaked to have step 2 be "Draft Releases" vs the v2.7 "Early Draft" phase to emphasize that any number of drafts can be put out to encourage feedback from the community. Step 3, "Final Release" vs the v2.7 "Public Draft" phase clarifies how a draft becomes the final proposal and requirement for an TCK and RI that passes the TCK. This emphasizes that the RI and TCK must be completed before the final draft can be submitted to the EC for approval.

 

 

II Definitions

The section covering definitions of terms used in the process document have been greatly expanded by pulling in all of the definitions spread through the v2.7 process document into one section.

 

 

1.1 EXPERT GROUP TRANSPARENCY

Having a JSR EG work in a completely transparent manner is a major focus of this v2.8 rev of the JCP. While the v2.7 rev did encourage transparency, it was not required. In v2.8, EGs must operate in a transparent with public channels with public responses to all input. How this will be accomplished must be specified in the JSR submission.

 

 

1.1.1 MAILING LISTS

All substantive business must be carried out on a public mailing list in the v2.8 process. This was only encouraged in v2.7.

 

 

1.1.2 ISSUE TRACKING

Issues must be track through a publicly readable issue tracking mechanism in the v2.8 process, with all formal comments entered as issues, and all issues must be publicly responded to before a JSR can go on to the next phase. There was no requirement for issue tracking in v2.7.

 

 

1.1.3 CHANGES TO LICENSING TERMS

There are stronger requirements to maintain the initial RI and TCK licensing terms. If a change to the RI and TCK is approved, the original licensing terms published at the time of Final Release must continue to be offered.

 

 

1.2.2 DISRUPTIVE, UNCOOPERATIVE OR UNRESPONSIVE EXPERT GROUP MEMBERS

The process for dealing with EG members that are not contributing has been simplified and strengthened. Any three members of the EG can approach the Spec Lead and request that the EG member in question be excluded from further participation in the EG. If the Spec Lead agrees to the request he can then do so.

 

 

1.2.3 UNRESPONSIVE OR INACTIVE SPEC LEAD

New to the v2.8 process document is the notion of an unresponsive spec lead and the process by which they may be replaced.

 

 

1.3 JSR Deadlines

A number of deadlines from the initial JSR Approval Ballot (JSR Approval) have been introduced to ensure a JSR proceeds at reasonable pace through the various phase. A JSR must:

  • begin Early Draft Review within the first 12 months
  • begin Public Review within 2 years
  • achieve Final Release within 3 years

 

otherwise, the EC should initiate a JSR Renewal Ballot unless it is agreed that there are extraordinary circumstances that justify the delay.

 

1.4 COMPATIBILITY TESTING

The Spec Lead is responsible for defining the process whereby the TCK is used to certify implementations of the JSR as compatible. The Maintenance Lead must submit to the PMO at least quarterly, and at every Maintenance Release, a list of all implementations that have been certified as compatible and that have been released publicly or commercially.  If the Spec Lead submits the information in the form of a pointer to an already published list the PMO may choose simply to reference that list rather than duplicate it.

 

 

TCK license terms must permit implementors to freely and publicly discuss the testing process and detailed TCK test results with all interested parties.

 

 

1.7 ESCALATION AND APPEALS

v2.8 introduces an escalation/appeals process where any EG member can appeal to the EC regarding a decision, an action or inaction by the PMO, a Spec Lead, or a Maintenance Lead that affects EG participation or issue-resolution and which cannot be resolved by other reasonable means.

 

 

3.1 WRITE THE FIRST DRAFT OF THE SPECIFICATION

3.2 EARLY DRAFT REVIEW

This is largely the same between v2.8 and v2.7, but there is an emphasis on the fact that multiple iterations of the Early Draft/Early Draft Review phases can be utilized if an EG believes that would be helpful.

 

 

4.1.2 ESTABLISH A FIRST-LEVEL TCK APPEALS PROCESS

This is the same as in v2.7, but the reference to a full TCK appeals process has been dropped in favor of a simplified description of how to escalate the appeal to the PMO and EC, which may trigger a TCK Appeal Ballot.

 

 

4.1.3 UPDATE THE DELIVERABLES IN RESPONSE TO THE APPEAL BALLOT

v2.8 includes a section on the need to update one or more of the TCK, the Specification, or the RI. Within one month of the close of a successful TCK Appeal Ballot the Maintenance Lead must update these deliverables as necessary and record the changes in the relevant sections of the Change Log.

 

 

4.2 FINAL APPROVAL BALLOT

v2.8 unifies the complete TCK compatible implementations requirments by including the following conditions from the JSPA:

 

  a) fully implement the Spec(s) including all required interfaces and functionality, and

  b) do not modify, subset, superset, or otherwise extend the Licensor Name Space, or include any public or

          protected packages, classes, Java interfaces, fields or methods within the Licensor Name Space other

          than those required/authorized by the Spec or Specs being implemented.

 

and, requires that in addition to 100% signature test coverage, no non-specified APIs are included in the JSR's namespace.

 

 

4.3 FINAL RELEASE

v2.8 add the requirement that a means to obtain the TCK documentation at no charge must be published. Further, a requirement to maintain the links to the RI and TCK must remain valid through the life of the JSR, or the JSR is subject to reversion back to the Proposed Final Draft or Maintenance Review stage as appropriate, and would have complete the Final Release or Maintenance Release process again.

 

 

5.2 MAINTENANCE REVIEW

v2.8 has simplified the maintenance process, which now requires the use of an issue tracker to gather items for consideration for inclusion in the revision.

 

 

6.3 EC DUTIES AND RESPONSIBILITIES

v2.8 expands the v2.7 EC duties in 3 areas:

- Review and provide guidance on proposed licensing terms of proposed JSRs.

- Ensure that publicly expressed issues/concerns with a JSR are addressed by the Expert Group.

- Decide when JSRs that have not made sufficient progress through the Process should be withdrawn.

The first of two rounds (or maybe three) of revision of the Java Community Process specifications is reaching it's first public draft review stage this Friday at midnight. Head over to the JCP page for JSR348 to view the draft. There are only 30 days until voting to approve the draft concludes, so you should have your comments in within the first 2-3 weeks to have the most impact.

 

The JSR348 project page is located at java.net, and there you can find links to the JSR348 Issues tracker, and mailing lists and archives.

 

Note that the scope of this initial revision is limited to what are deemed non-controversial, so you should browse the list of issues deferred until phase 2, read the public draft, review the various discussion mailing lists, and then raise an issue to make your voice heard.

 

If you feel there is something you would like to raise or comment on, but aren't sure you want to do that yourself, drop me a message with your comments and I'll see if I can be your advocate.

 

Scott Stark

sstark@redhat.com

When you create an Express application, you have some buried treasure in the application git repsository that is created. If you look under the .openshift directory, you will see the following:

 

[18](ironmaiden:seamrocks) > ls -lR .openshift/
total 0
drwxr-xr-x  3 starksm  wheel  102 Aug 11 11:41 action_hooks
drwxr-xr-x  3 starksm  wheel  102 Aug 11 11:41 config
drwxr-xr-x  3 starksm  wheel  102 Aug 11 11:41 markers


.openshift//action_hooks:
total 8
-rwxr-xr-x  1 starksm  wheel  187 Aug 11 11:41 build


.openshift//config:
total 24
-rw-r--r--  1 starksm  wheel  9488 Aug 11 11:41 standalone.xml


.openshift//markers:
total 8
-rw-r--r--  1 starksm  wheel  422 Aug 11 11:41 README

 

  • .openshift/action_hooks/build
    • This is a script that is run after the deployment has been built, but before the server has been restarted.
  • .openshift/config/standalone.xml
    • This is the standalone.xml that will be run by the jbossas7 server instance associated with your application. You can change things like logging levels and other basic settings, but don't go wild because the server runs under restrictions.
  • .openshift/markers
    • Adding marker files to this directory will have the following effects:

      • skip_maven_build - Maven build step will be skipped

      • skip_maven_build_keep - Maven build step will be skipped and the previous output in deployments (excluding what is git pushed) will be left intact from the previous build.  Applies as long as skip_maven_build_keep is present plus one git push after it is removed.

 

In the future we will be looking to expose additional functionality like being able to extend the modules used by the server.

Since you don't have access to your server installation on the OpenShift Express box you happen to be running your app in the cloud on, it would be nice if there was a way to pull down the various log files from the JBossAS7 server. There is using the rhc-tail-files client tools command. For example, as part of going through Matt's blog on getting a Seam app running in the cloud, I wanted to see how the server logs evolved over the course of pushing out the seam application. I did this be running the following command after creating the seamsrocks application, but before doing the git push. The resulting command output shows the original logs as well as how the evolve as the server is restarted with the updated application.

 

[54](ironmaiden:tmp) > rhc-tail-files -o '-n 5000' -a seamrocks -p *
Contacting https://openshift.redhat.com
Attempting to tail files: seamrocks/logs/*
Use ctl + c to stop


==> seamrocks/logs/boot.log <==
14:41:17,500 INFO  [org.jboss.modules] JBoss Modules version 1.0.1.GA
14:41:17,785 INFO  [org.jboss.msc] JBoss MSC version 1.0.0.GA
14:41:17,834 INFO  [org.jboss.as] JBoss AS 7.0.0.Final "Lightning" starting
14:41:17,836 DEBUG [org.jboss.as.config] Configured system properties:
          file.encoding = UTF-8
          file.encoding.pkg = sun.io
          file.separator = /
          java.awt.graphicsenv = sun.awt.X11GraphicsEnvironment
          java.awt.printerjob = sun.print.PSPrinterJob
          java.class.path = /var/lib/libra/eb673a8e363d46bfb0a7135b8ac7e65f/seamrocks/jbossas-7.0/jboss-modules.jar
          java.class.version = 50.0
          java.endorsed.dirs = /usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0.x86_64/jre/lib/endorsed
          java.ext.dirs = /usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0.x86_64/jre/lib/ext:/usr/java/packages/lib/ext
          java.home = /usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0.x86_64/jre
          java.io.tmpdir = /tmp
          java.library.path = /usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0.x86_64/jre/lib/amd64/server:/usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0.x86_64/jre/lib/amd64:/usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0.x86_64/jre/../lib/amd64:/usr/java/packages/lib/amd64:/usr/lib64:/lib64:/lib:/usr/lib
          java.runtime.name = OpenJDK Runtime Environment
          java.runtime.version = 1.6.0_20-b20
          java.specification.name = Java Platform API Specification
          java.specification.vendor = Sun Microsystems Inc.
          java.specification.version = 1.6
          java.util.logging.manager = org.jboss.logmanager.LogManager
          java.vendor = Sun Microsystems Inc.
          java.vendor.url = http://java.sun.com/
          java.vendor.url.bug = http://java.sun.com/cgi-bin/bugreport.cgi
          java.version = 1.6.0_20
          java.vm.info = mixed mode
          java.vm.name = OpenJDK 64-Bit Server VM
          java.vm.specification.name = Java Virtual Machine Specification
          java.vm.specification.vendor = Sun Microsystems Inc.
          java.vm.specification.version = 1.0
          java.vm.vendor = Sun Microsystems Inc.
          java.vm.version = 19.0-b09
          javax.xml.datatype.DatatypeFactory = __redirected.__DatatypeFactory
          javax.xml.parsers.DocumentBuilderFactory = __redirected.__DocumentBuilderFactory
          javax.xml.parsers.SAXParserFactory = __redirected.__SAXParserFactory
          javax.xml.stream.XMLEventFactory = __redirected.__XMLEventFactory
          javax.xml.stream.XMLInputFactory = __redirected.__XMLInputFactory
          javax.xml.stream.XMLOutputFactory = __redirected.__XMLOutputFactory
          javax.xml.transform.TransformerFactory = __redirected.__TransformerFactory
          javax.xml.validation.SchemaFactory:http://www.w3.org/2001/XMLSchema = __redirected.__SchemaFactory
          javax.xml.xpath.XPathFactory:http://java.sun.com/jaxp/xpath/dom = __redirected.__XPathFactory
          jboss.home.dir = /var/lib/libra/eb673a8e363d46bfb0a7135b8ac7e65f/seamrocks/jbossas-7.0
          jboss.host.name = ex-node11
          jboss.modules.dir = /var/lib/libra/eb673a8e363d46bfb0a7135b8ac7e65f/seamrocks/jbossas-7.0/modules
          jboss.node.name = ex-node11
          jboss.qualified.host.name = ex-node11.prod.rhcloud.com
          jboss.server.base.dir = /var/lib/libra/eb673a8e363d46bfb0a7135b8ac7e65f/seamrocks/jbossas-7.0/standalone
          jboss.server.config.dir = /var/lib/libra/eb673a8e363d46bfb0a7135b8ac7e65f/seamrocks/jbossas-7.0/standalone/configuration
          jboss.server.data.dir = /var/lib/libra/eb673a8e363d46bfb0a7135b8ac7e65f/seamrocks/jbossas-7.0/standalone/data
          jboss.server.deploy.dir = /var/lib/libra/eb673a8e363d46bfb0a7135b8ac7e65f/seamrocks/jbossas-7.0/standalone/data/content
          jboss.server.log.dir = /var/lib/libra/eb673a8e363d46bfb0a7135b8ac7e65f/seamrocks/jbossas-7.0/standalone/log
          jboss.server.name = ex-node11
          jboss.server.temp.dir = /var/lib/libra/eb673a8e363d46bfb0a7135b8ac7e65f/seamrocks/jbossas-7.0/standalone/tmp
          line.separator = 


          logging.configuration = file:/var/lib/libra/eb673a8e363d46bfb0a7135b8ac7e65f/seamrocks/jbossas-7.0/standalone/configuration/logging.properties
          module.path = /var/lib/libra/eb673a8e363d46bfb0a7135b8ac7e65f/seamrocks/jbossas-7.0/modules
          org.jboss.boot.log.file = /var/lib/libra/eb673a8e363d46bfb0a7135b8ac7e65f/seamrocks/jbossas-7.0/standalone/log/boot.log
          org.jboss.resolver.warning = true
          org.xml.sax.driver = __redirected.__XMLReaderFactory
          os.arch = amd64
          os.name = Linux
          os.version = 2.6.32-131.4.1.el6.x86_64
          path.separator = :
          sun.arch.data.model = 64
          sun.boot.class.path = /usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0.x86_64/jre/lib/resources.jar:/usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0.x86_64/jre/lib/rt.jar:/usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0.x86_64/jre/lib/sunrsasign.jar:/usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0.x86_64/jre/lib/jsse.jar:/usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0.x86_64/jre/lib/jce.jar:/usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0.x86_64/jre/lib/charsets.jar:/usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0.x86_64/jre/lib/netx.jar:/usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0.x86_64/jre/lib/plugin.jar:/usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0.x86_64/jre/lib/rhino.jar:/usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0.x86_64/jre/lib/modules/jdk.boot.jar:/usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0.x86_64/jre/classes
          sun.boot.library.path = /usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0.x86_64/jre/lib/amd64
          sun.cpu.endian = little
          sun.cpu.isalist = 
          sun.io.unicode.encoding = UnicodeLittle
          sun.java.launcher = SUN_STANDARD
          sun.jnu.encoding = UTF-8
          sun.management.compiler = HotSpot 64-Bit Server Compiler
          sun.os.patch.level = unknown
          sun.rmi.dgc.client.gcInterval = 3600000
          sun.rmi.dgc.server.gcInterval = 3600000
          user.country = US
          user.dir = /var/lib/libra/eb673a8e363d46bfb0a7135b8ac7e65f/seamrocks
          user.home = /var/lib/libra/eb673a8e363d46bfb0a7135b8ac7e65f
          user.language = en
          user.name = eb673a8e363d46bfb0a7135b8ac7e65f
          user.timezone = America/New_York
14:41:18,690 INFO  [org.jboss.as.logging] Removing bootstrap log handlers


==> seamrocks/logs/server.log <==
14:41:18,706 INFO  [org.jboss.as.connector.subsystems.datasources] (Controller Boot Thread) Deploying JDBC-compliant driver class org.h2.Driver (version 1.2)
14:41:18,712 INFO  [org.jboss.as.connector.subsystems.datasources] (Controller Boot Thread) Deploying non-JDBC-compliant driver class com.mysql.jdbc.Driver (version 5.1)
14:41:18,732 INFO  [org.jboss.as.clustering.infinispan.subsystem] (Controller Boot Thread) Activating Infinispan subsystem.
14:41:18,860 INFO  [org.jboss.as.naming] (Controller Boot Thread) Activating Naming Subsystem
14:41:18,877 INFO  [org.jboss.as.naming] (MSC service thread 1-1) Starting Naming Service 
14:41:18,878 INFO  [org.jboss.as.security] (Controller Boot Thread) Activating Security Subsystem
14:41:19,145 INFO  [org.apache.catalina.core.AprLifecycleListener] (MSC service thread 1-2) The Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: /usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0.x86_64/jre/lib/amd64/server:/usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0.x86_64/jre/lib/amd64:/usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0.x86_64/jre/../lib/amd64:/usr/java/packages/lib/amd64:/usr/lib64:/lib64:/lib:/usr/lib
14:41:19,228 INFO  [org.jboss.as.ee] (Controller Boot Thread) Activating EE subsystem
14:41:19,246 INFO  [org.apache.coyote.http11.Http11Protocol] (MSC service thread 1-1) Starting Coyote HTTP/1.1 on http--127.1.49.1-8080
14:41:19,348 INFO  [org.jboss.as.connector] (MSC service thread 1-2) Starting JCA Subsystem (JBoss IronJacamar 1.0.0.CR2)
14:41:19,382 INFO  [org.jboss.as.connector.subsystems.datasources] (MSC service thread 1-1) Bound data source [java:jboss/datasources/ExampleDS]
14:41:19,878 INFO  [org.jboss.as.deployment] (MSC service thread 1-2) Started FileSystemDeploymentService for directory /var/lib/libra/eb673a8e363d46bfb0a7135b8ac7e65f/seamrocks/jbossas-7.0/standalone/deployments
14:41:19,900 INFO  [org.jboss.as] (Controller Boot Thread) JBoss AS 7.0.0.Final "Lightning" started in 2708ms - Started 84 of 109 services (22 services are passive or on-demand)
14:41:19,956 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-2) Starting deployment of "ROOT.war"
14:41:20,328 INFO  [org.jboss.web] (MSC service thread 1-2) registering web context: 
14:41:20,378 INFO  [org.jboss.as.server.controller] (DeploymentScanner-threads - 2) Deployed "ROOT.war"


==> seamrocks/logs/boot.log <==
14:47:38,067 INFO  [org.jboss.as.logging] Restored bootstrap log handlers
14:47:38,087 INFO  [com.arjuna.ats.jbossatx] ARJUNA32018: Destroying TransactionManagerService
14:47:38,088 INFO  [com.arjuna.ats.jbossatx] ARJUNA32014: Stopping transaction recovery manager
14:47:38,093 INFO  [org.jboss.as.server.deployment] Stopped deployment ROOT.war in 62ms
14:47:38,095 INFO  [org.jboss.as] JBoss AS 7.0.0.Final "Lightning" stopped in 60ms
/usr/bin/tail: seamrocks/logs/boot.log: file truncated
14:53:46,728 INFO  [org.jboss.modules] JBoss Modules version 1.0.1.GA
14:53:47,030 INFO  [org.jboss.msc] JBoss MSC version 1.0.0.GA
14:53:47,099 INFO  [org.jboss.as] JBoss AS 7.0.0.Final "Lightning" starting
14:53:47,101 DEBUG [org.jboss.as.config] Configured system properties:
          file.encoding = ANSI_X3.4-1968
          file.encoding.pkg = sun.io
          file.separator = /
          java.awt.graphicsenv = sun.awt.X11GraphicsEnvironment
          java.awt.printerjob = sun.print.PSPrinterJob
          java.class.path = /var/lib/libra/eb673a8e363d46bfb0a7135b8ac7e65f/seamrocks/jbossas-7.0/jboss-modules.jar
          java.class.version = 50.0
          java.endorsed.dirs = /usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0.x86_64/jre/lib/endorsed
          java.ext.dirs = /usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0.x86_64/jre/lib/ext:/usr/java/packages/lib/ext
          java.home = /usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0.x86_64/jre
          java.io.tmpdir = /tmp
          java.library.path = /usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0.x86_64/jre/lib/amd64/server:/usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0.x86_64/jre/lib/amd64:/usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0.x86_64/jre/../lib/amd64:/usr/java/packages/lib/amd64:/usr/lib64:/lib64:/lib:/usr/lib
          java.runtime.name = OpenJDK Runtime Environment
          java.runtime.version = 1.6.0_20-b20
          java.specification.name = Java Platform API Specification
          java.specification.vendor = Sun Microsystems Inc.
          java.specification.version = 1.6
          java.util.logging.manager = org.jboss.logmanager.LogManager
          java.vendor = Sun Microsystems Inc.
          java.vendor.url = http://java.sun.com/
          java.vendor.url.bug = http://java.sun.com/cgi-bin/bugreport.cgi
          java.version = 1.6.0_20
          java.vm.info = mixed mode
          java.vm.name = OpenJDK 64-Bit Server VM
          java.vm.specification.name = Java Virtual Machine Specification
          java.vm.specification.vendor = Sun Microsystems Inc.
          java.vm.specification.version = 1.0
          java.vm.vendor = Sun Microsystems Inc.
          java.vm.version = 19.0-b09
          javax.xml.datatype.DatatypeFactory = __redirected.__DatatypeFactory
          javax.xml.parsers.DocumentBuilderFactory = __redirected.__DocumentBuilderFactory
          javax.xml.parsers.SAXParserFactory = __redirected.__SAXParserFactory
          javax.xml.stream.XMLEventFactory = __redirected.__XMLEventFactory
          javax.xml.stream.XMLInputFactory = __redirected.__XMLInputFactory
          javax.xml.stream.XMLOutputFactory = __redirected.__XMLOutputFactory
          javax.xml.transform.TransformerFactory = __redirected.__TransformerFactory
          javax.xml.validation.SchemaFactory:http://www.w3.org/2001/XMLSchema = __redirected.__SchemaFactory
          javax.xml.xpath.XPathFactory:http://java.sun.com/jaxp/xpath/dom = __redirected.__XPathFactory
          jboss.home.dir = /var/lib/libra/eb673a8e363d46bfb0a7135b8ac7e65f/seamrocks/jbossas-7.0
          jboss.host.name = ex-node11
          jboss.modules.dir = /var/lib/libra/eb673a8e363d46bfb0a7135b8ac7e65f/seamrocks/jbossas-7.0/modules
          jboss.node.name = ex-node11
          jboss.qualified.host.name = ex-node11.prod.rhcloud.com
          jboss.server.base.dir = /var/lib/libra/eb673a8e363d46bfb0a7135b8ac7e65f/seamrocks/jbossas-7.0/standalone
          jboss.server.config.dir = /var/lib/libra/eb673a8e363d46bfb0a7135b8ac7e65f/seamrocks/jbossas-7.0/standalone/configuration
          jboss.server.data.dir = /var/lib/libra/eb673a8e363d46bfb0a7135b8ac7e65f/seamrocks/jbossas-7.0/standalone/data
          jboss.server.deploy.dir = /var/lib/libra/eb673a8e363d46bfb0a7135b8ac7e65f/seamrocks/jbossas-7.0/standalone/data/content
          jboss.server.log.dir = /var/lib/libra/eb673a8e363d46bfb0a7135b8ac7e65f/seamrocks/jbossas-7.0/standalone/log
          jboss.server.name = ex-node11
          jboss.server.temp.dir = /var/lib/libra/eb673a8e363d46bfb0a7135b8ac7e65f/seamrocks/jbossas-7.0/standalone/tmp
          line.separator = 


          logging.configuration = file:/var/lib/libra/eb673a8e363d46bfb0a7135b8ac7e65f/seamrocks/jbossas-7.0/standalone/configuration/logging.properties
          module.path = /var/lib/libra/eb673a8e363d46bfb0a7135b8ac7e65f/seamrocks/jbossas-7.0/modules
          org.jboss.boot.log.file = /var/lib/libra/eb673a8e363d46bfb0a7135b8ac7e65f/seamrocks/jbossas-7.0/standalone/log/boot.log
          org.jboss.resolver.warning = true
          org.xml.sax.driver = __redirected.__XMLReaderFactory
          os.arch = amd64
          os.name = Linux
          os.version = 2.6.32-131.4.1.el6.x86_64
          path.separator = :
          sun.arch.data.model = 64
          sun.boot.class.path = /usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0.x86_64/jre/lib/resources.jar:/usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0.x86_64/jre/lib/rt.jar:/usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0.x86_64/jre/lib/sunrsasign.jar:/usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0.x86_64/jre/lib/jsse.jar:/usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0.x86_64/jre/lib/jce.jar:/usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0.x86_64/jre/lib/charsets.jar:/usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0.x86_64/jre/lib/netx.jar:/usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0.x86_64/jre/lib/plugin.jar:/usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0.x86_64/jre/lib/rhino.jar:/usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0.x86_64/jre/lib/modules/jdk.boot.jar:/usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0.x86_64/jre/classes
          sun.boot.library.path = /usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0.x86_64/jre/lib/amd64
          sun.cpu.endian = little
          sun.cpu.isalist = 
          sun.io.unicode.encoding = UnicodeLittle
          sun.java.launcher = SUN_STANDARD
          sun.jnu.encoding = ANSI_X3.4-1968
          sun.management.compiler = HotSpot 64-Bit Server Compiler
          sun.os.patch.level = unknown
          sun.rmi.dgc.client.gcInterval = 3600000
          sun.rmi.dgc.server.gcInterval = 3600000
          user.country = US
          user.dir = /var/lib/libra/eb673a8e363d46bfb0a7135b8ac7e65f/git/seamrocks.git
          user.home = /var/lib/libra/eb673a8e363d46bfb0a7135b8ac7e65f
          user.language = en
          user.name = eb673a8e363d46bfb0a7135b8ac7e65f
          user.timezone = America/New_York
/usr/bin/tail: seamrocks/logs/server.log: file truncated


==> seamrocks/logs/boot.log <==
14:53:47,974 INFO  [org.jboss.as.logging] Removing bootstrap log handlers


==> seamrocks/logs/server.log <==
14:53:47,998 INFO  [org.jboss.as.connector.subsystems.datasources] (Controller Boot Thread) Deploying JDBC-compliant driver class org.h2.Driver (version 1.2)
14:53:48,004 INFO  [org.jboss.as.connector.subsystems.datasources] (Controller Boot Thread) Deploying non-JDBC-compliant driver class com.mysql.jdbc.Driver (version 5.1)
14:53:48,013 INFO  [org.jboss.as.clustering.infinispan.subsystem] (Controller Boot Thread) Activating Infinispan subsystem.
14:53:48,138 INFO  [org.jboss.as.naming] (Controller Boot Thread) Activating Naming Subsystem
14:53:48,147 INFO  [org.jboss.as.naming] (MSC service thread 1-1) Starting Naming Service 
14:53:48,160 INFO  [org.jboss.as.security] (Controller Boot Thread) Activating Security Subsystem
14:53:48,393 INFO  [org.apache.catalina.core.AprLifecycleListener] (MSC service thread 1-2) The Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: /usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0.x86_64/jre/lib/amd64/server:/usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0.x86_64/jre/lib/amd64:/usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0.x86_64/jre/../lib/amd64:/usr/java/packages/lib/amd64:/usr/lib64:/lib64:/lib:/usr/lib
14:53:48,408 INFO  [org.jboss.as.ee] (Controller Boot Thread) Activating EE subsystem
14:53:48,493 INFO  [org.apache.coyote.http11.Http11Protocol] (MSC service thread 1-2) Starting Coyote HTTP/1.1 on http--127.1.49.1-8080
14:53:48,631 INFO  [org.jboss.as.connector] (MSC service thread 1-1) Starting JCA Subsystem (JBoss IronJacamar 1.0.0.CR2)
14:53:48,709 INFO  [org.jboss.as.connector.subsystems.datasources] (MSC service thread 1-1) Bound data source [java:jboss/datasources/ExampleDS]
14:53:49,109 INFO  [org.jboss.as.deployment] (MSC service thread 1-2) Started FileSystemDeploymentService for directory /var/lib/libra/eb673a8e363d46bfb0a7135b8ac7e65f/seamrocks/jbossas-7.0/standalone/deployments
14:53:49,152 INFO  [org.jboss.as] (Controller Boot Thread) JBoss AS 7.0.0.Final "Lightning" started in 2752ms - Started 84 of 109 services (22 services are passive or on-demand)
14:53:49,170 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-2) Starting deployment of "ROOT.war"
14:53:50,623 INFO  [org.jboss.jpa] (MSC service thread 1-2) read persistence.xml for booking
14:53:50,818 INFO  [org.jboss.weld] (MSC service thread 1-1) Processing CDI deployment: ROOT.war
14:53:50,890 INFO  [org.jboss.as.ejb3.deployment.processors.EjbJndiBindingsDeploymentUnitProcessor] (MSC service thread 1-1) JNDI bindings for session bean named BookingAgent in deployment unit deployment "ROOT.war" are as follows:


          java:global/ROOT/BookingAgent!org.jboss.seam.examples.booking.booking.BookingAgent
          java:app/ROOT/BookingAgent!org.jboss.seam.examples.booking.booking.BookingAgent
          java:module/BookingAgent!org.jboss.seam.examples.booking.booking.BookingAgent
          java:global/ROOT/BookingAgent
          java:app/ROOT/BookingAgent
          java:module/BookingAgent


14:53:50,890 INFO  [org.jboss.as.ejb3.deployment.processors.EjbJndiBindingsDeploymentUnitProcessor] (MSC service thread 1-1) JNDI bindings for session bean named BookingAuthenticator in deployment unit deployment "ROOT.war" are as follows:


          java:global/ROOT/BookingAuthenticator!org.jboss.seam.security.Authenticator
          java:app/ROOT/BookingAuthenticator!org.jboss.seam.security.Authenticator
          java:module/BookingAuthenticator!org.jboss.seam.security.Authenticator
          java:global/ROOT/BookingAuthenticator
          java:app/ROOT/BookingAuthenticator
          java:module/BookingAuthenticator


14:53:50,890 INFO  [org.jboss.as.ejb3.deployment.processors.EjbJndiBindingsDeploymentUnitProcessor] (MSC service thread 1-1) JNDI bindings for session bean named CurrentUserManager in deployment unit deployment "ROOT.war" are as follows:


          java:global/ROOT/CurrentUserManager!org.jboss.seam.examples.booking.account.CurrentUserManager
          java:app/ROOT/CurrentUserManager!org.jboss.seam.examples.booking.account.CurrentUserManager
          java:module/CurrentUserManager!org.jboss.seam.examples.booking.account.CurrentUserManager
          java:global/ROOT/CurrentUserManager
          java:app/ROOT/CurrentUserManager
          java:module/CurrentUserManager


14:53:50,891 INFO  [org.jboss.as.ejb3.deployment.processors.EjbJndiBindingsDeploymentUnitProcessor] (MSC service thread 1-1) JNDI bindings for session bean named BookingHistory in deployment unit deployment "ROOT.war" are as follows:


          java:global/ROOT/BookingHistory!org.jboss.seam.examples.booking.booking.BookingHistory
          java:app/ROOT/BookingHistory!org.jboss.seam.examples.booking.booking.BookingHistory
          java:module/BookingHistory!org.jboss.seam.examples.booking.booking.BookingHistory
          java:global/ROOT/BookingHistory
          java:app/ROOT/BookingHistory
          java:module/BookingHistory


14:53:50,891 INFO  [org.jboss.as.ejb3.deployment.processors.EjbJndiBindingsDeploymentUnitProcessor] (MSC service thread 1-1) JNDI bindings for session bean named HotelSearch in deployment unit deployment "ROOT.war" are as follows:


          java:global/ROOT/HotelSearch!org.jboss.seam.examples.booking.inventory.HotelSearch
          java:app/ROOT/HotelSearch!org.jboss.seam.examples.booking.inventory.HotelSearch
          java:module/HotelSearch!org.jboss.seam.examples.booking.inventory.HotelSearch
          java:global/ROOT/HotelSearch
          java:app/ROOT/HotelSearch
          java:module/HotelSearch


14:53:50,891 INFO  [org.jboss.as.ejb3.deployment.processors.EjbJndiBindingsDeploymentUnitProcessor] (MSC service thread 1-1) JNDI bindings for session bean named PasswordManager in deployment unit deployment "ROOT.war" are as follows:


          java:global/ROOT/PasswordManager!org.jboss.seam.examples.booking.account.PasswordManager
          java:app/ROOT/PasswordManager!org.jboss.seam.examples.booking.account.PasswordManager
          java:module/PasswordManager!org.jboss.seam.examples.booking.account.PasswordManager
          java:global/ROOT/PasswordManager
          java:app/ROOT/PasswordManager
          java:module/PasswordManager


14:53:50,891 INFO  [org.jboss.as.ejb3.deployment.processors.EjbJndiBindingsDeploymentUnitProcessor] (MSC service thread 1-1) JNDI bindings for session bean named Registrar in deployment unit deployment "ROOT.war" are as follows:


          java:global/ROOT/Registrar!org.jboss.seam.examples.booking.account.Registrar
          java:app/ROOT/Registrar!org.jboss.seam.examples.booking.account.Registrar
          java:module/Registrar!org.jboss.seam.examples.booking.account.Registrar
          java:global/ROOT/Registrar
          java:app/ROOT/Registrar
          java:module/Registrar


14:53:51,409 INFO  [org.jboss.weld] (MSC service thread 1-1) Starting Services for CDI deployment: ROOT.war
14:53:51,457 INFO  [org.jboss.weld.Version] (MSC service thread 1-1) WELD-000900 1.1.2 (AS7)
14:53:51,521 INFO  [org.jboss.jpa] (MSC service thread 1-1) starting Persistence Unit Service 'ROOT.war#booking' 
14:53:51,578 INFO  [org.jboss.weld] (MSC service thread 1-2) Starting weld service
14:53:51,706 INFO  [org.hibernate.annotations.common.Version] (MSC service thread 1-1) Hibernate Commons Annotations 3.2.0.Final
14:53:51,710 INFO  [org.hibernate.cfg.Environment] (MSC service thread 1-1) HHH00412:Hibernate [WORKING]
14:53:51,711 INFO  [org.hibernate.cfg.Environment] (MSC service thread 1-1) HHH00206:hibernate.properties not found
14:53:51,713 INFO  [org.hibernate.cfg.Environment] (MSC service thread 1-1) HHH00021:Bytecode provider name : javassist
14:53:51,733 INFO  [org.hibernate.ejb.Ejb3Configuration] (MSC service thread 1-1) HHH00204:Processing PersistenceUnitInfo [
          name: booking
          ...]
14:53:51,799 WARN  [org.hibernate.cfg.AnnotationBinder] (MSC service thread 1-1) HHH00194:Package not found or wo package-info.java: org.jboss.seam.examples.booking.bootstrap
14:53:51,799 WARN  [org.hibernate.cfg.AnnotationBinder] (MSC service thread 1-1) HHH00194:Package not found or wo package-info.java: org.jboss.seam.examples.booking.account
14:53:51,799 WARN  [org.hibernate.cfg.AnnotationBinder] (MSC service thread 1-1) HHH00194:Package not found or wo package-info.java: org.jboss.seam.examples.booking.booking
14:53:51,800 WARN  [org.hibernate.cfg.AnnotationBinder] (MSC service thread 1-1) HHH00194:Package not found or wo package-info.java: org.jboss.seam.examples.booking.exceptioncontrol
14:53:51,800 WARN  [org.hibernate.cfg.AnnotationBinder] (MSC service thread 1-1) HHH00194:Package not found or wo package-info.java: org.jboss.seam.examples.booking.reference
14:53:51,800 WARN  [org.hibernate.cfg.AnnotationBinder] (MSC service thread 1-1) HHH00194:Package not found or wo package-info.java: org.jboss.seam.examples.booking.model
14:53:51,801 WARN  [org.hibernate.cfg.AnnotationBinder] (MSC service thread 1-1) HHH00194:Package not found or wo package-info.java: org.jboss.seam.examples.booking.log
14:53:51,801 WARN  [org.hibernate.cfg.AnnotationBinder] (MSC service thread 1-1) HHH00194:Package not found or wo package-info.java: org.jboss.seam.examples.booking.security
14:53:51,801 WARN  [org.hibernate.cfg.AnnotationBinder] (MSC service thread 1-1) HHH00194:Package not found or wo package-info.java: org.jboss.seam.examples.booking.i18n
14:53:51,802 WARN  [org.hibernate.cfg.AnnotationBinder] (MSC service thread 1-1) HHH00194:Package not found or wo package-info.java: org.jboss.seam.examples.booking.inventory
14:53:51,937 INFO  [org.jboss.seam.solder.Version] (MSC service thread 1-2) Seam Solder null (build id: null)
14:53:51,956 INFO  [org.jboss.seam.config.xml.bootstrap.XmlConfigExtension] (MSC service thread 1-2) Seam Config XML provider starting...
14:53:51,958 INFO  [org.jboss.seam.config.xml.bootstrap.XmlConfigExtension] (MSC service thread 1-2) Loading XmlDocumentProvider: org.jboss.seam.config.xml.bootstrap.ResourceLoaderXmlDocumentProvider
14:53:51,962 INFO  [org.jboss.seam.config.xml.bootstrap.XmlConfigExtension] (MSC service thread 1-2) Reading XML file: vfs:/content/ROOT.war/WEB-INF/classes/META-INF/seam-beans.xml
14:53:52,035 INFO  [org.jboss.seam.config.xml.bootstrap.XmlConfigExtension] (MSC service thread 1-2) Reading XML file: vfs:/content/ROOT.war/WEB-INF/lib/seam-international-3.0.0.Final.jar/META-INF/beans.xml
14:53:52,047 INFO  [org.jboss.seam.config.xml.bootstrap.XmlConfigExtension] (MSC service thread 1-2) Reading XML file: vfs:/content/ROOT.war/WEB-INF/lib/seam-security-3.0.0.Final.jar/META-INF/beans.xml
14:53:52,048 INFO  [org.jboss.seam.config.xml.bootstrap.XmlConfigExtension] (MSC service thread 1-2) Reading XML file: vfs:/content/ROOT.war/WEB-INF/lib/seam-servlet-3.0.0.Final.jar/META-INF/beans.xml
14:53:52,049 INFO  [org.jboss.seam.config.xml.bootstrap.XmlConfigExtension] (MSC service thread 1-2) Reading XML file: vfs:/content/ROOT.war/WEB-INF/lib/seam-solder-3.0.0.Final.jar/META-INF/beans.xml
14:53:52,050 INFO  [org.jboss.seam.config.xml.bootstrap.XmlConfigExtension] (MSC service thread 1-2) Reading XML file: vfs:/content/ROOT.war/WEB-INF/lib/seam-faces-3.0.0.Final.jar/META-INF/beans.xml
14:53:52,051 INFO  [org.hibernate.service.jdbc.connections.internal.ConnectionProviderInitiator] (MSC service thread 1-1) HHH00130:Instantiating explicit connection provider: org.hibernate.ejb.connection.InjectedDataSourceConnectionProvider
14:53:52,077 INFO  [org.jboss.seam.config.xml.bootstrap.XmlConfigExtension] (MSC service thread 1-2) Reading XML file: vfs:/content/ROOT.war/WEB-INF/lib/seam-catch-3.0.0.Final.jar/META-INF/beans.xml
14:53:52,090 INFO  [org.jboss.seam.config.xml.bootstrap.XmlConfigExtension] (MSC service thread 1-2) Adding XML Defined Bean: org.jboss.seam.security.IdentityImpl
14:53:52,417 INFO  [org.hibernate.dialect.Dialect] (MSC service thread 1-1) HHH00400:Using dialect: org.hibernate.dialect.HSQLDialect
14:53:52,433 INFO  [org.hibernate.engine.jdbc.internal.LobCreatorBuilder] (MSC service thread 1-1) HHH00423:Disabling contextual LOB creation as JDBC driver reported JDBC version [3] less than 4
14:53:52,439 INFO  [org.hibernate.engine.transaction.internal.TransactionFactoryInitiator] (MSC service thread 1-1) HHH00268:Transaction strategy: org.hibernate.engine.transaction.internal.jta.CMTTransactionFactory
14:53:52,442 INFO  [org.hibernate.hql.internal.ast.ASTQueryTranslatorFactory] (MSC service thread 1-1) HHH00397:Using ASTQueryTranslatorFactory
14:53:52,479 INFO  [org.hibernate.validator.util.Version] (MSC service thread 1-1) Hibernate Validator 4.1.0.Final
14:53:52,483 INFO  [org.hibernate.validator.engine.resolver.DefaultTraversableResolver] (MSC service thread 1-1) Instantiated an instance of org.hibernate.validator.engine.resolver.JPATraversableResolver.
14:53:52,750 INFO  [org.jboss.seam.solder.core.CoreExtension] (MSC service thread 1-2) Preventing class org.jboss.seam.faces.validation.InputElement from being installed as bean due to @Veto annotation
14:53:52,820 INFO  [org.hibernate.tool.hbm2ddl.SchemaExport] (MSC service thread 1-1) HHH00227:Running hbm2ddl schema export
14:53:52,845 INFO  [org.hibernate.tool.hbm2ddl.SchemaExport] (MSC service thread 1-1) HHH00230:Schema export complete
14:53:53,314 INFO  [org.jboss.seam.solder.core.CoreExtension] (MSC service thread 1-2) Preventing class org.jboss.seam.international.locale.LocaleConfiguration from being installed as bean due to @Veto annotation
14:53:53,780 INFO  [org.jboss.seam.config.xml.bootstrap.XmlConfigExtension] (MSC service thread 1-2) Preventing installation of default bean: org.jboss.seam.security.IdentityImpl
14:53:54,297 INFO  [org.jboss.seam.solder.core.CoreExtension] (MSC service thread 1-2) Preventing class org.jboss.seam.solder.core.VersionLoggerUtil from being installed as bean due to @Veto annotation
14:53:54,710 INFO  [org.jboss.seam.solder.core.CoreExtension] (MSC service thread 1-2) Preventing class org.jboss.seam.solder.resourceLoader.ResourceProvider from being installed as bean due to @Veto annotation
14:53:55,166 INFO  [org.jboss.seam.solder.core.CoreExtension] (MSC service thread 1-2) Preventing class org.jboss.seam.servlet.http.HttpServletRequestContext from being installed as bean due to @Veto annotation
14:53:55,366 INFO  [org.jboss.seam.solder.core.CoreExtension] (MSC service thread 1-2) Preventing class org.jboss.seam.servlet.ServletRequestContext from being installed as bean due to @Veto annotation
14:53:55,434 INFO  [org.jboss.seam.solder.core.CoreExtension] (MSC service thread 1-2) Preventing class org.jboss.seam.examples.booking.model.User from being installed as bean due to @Veto annotation
14:53:55,452 INFO  [org.jboss.seam.solder.core.CoreExtension] (MSC service thread 1-2) Preventing class org.jboss.seam.examples.booking.model.Booking from being installed as bean due to @Veto annotation
14:53:55,456 INFO  [org.jboss.seam.solder.core.CoreExtension] (MSC service thread 1-2) Preventing class org.jboss.seam.examples.booking.model.Hotel from being installed as bean due to @Veto annotation
14:53:55,588 INFO  [org.jboss.seam.solder.core.CoreExtension] (MSC service thread 1-2) Preventing class org.jboss.seam.transaction.UTTransaction from being installed as bean due to @Veto annotation
14:53:55,622 INFO  [org.jboss.seam.solder.core.CoreExtension] (MSC service thread 1-2) Preventing class org.jboss.seam.transaction.SeSynchronizations from being installed as bean due to @Veto annotation
14:53:55,643 INFO  [org.jboss.seam.solder.core.CoreExtension] (MSC service thread 1-2) Preventing class org.jboss.seam.transaction.CMTTransaction from being installed as bean due to @Veto annotation
14:53:55,647 INFO  [org.jboss.seam.solder.core.CoreExtension] (MSC service thread 1-2) Preventing class org.jboss.seam.transaction.EntityTransaction from being installed as bean due to @Veto annotation
14:53:55,733 INFO  [org.jboss.seam.solder.core.CoreExtension] (MSC service thread 1-2) Preventing class org.jboss.seam.persistence.hibernate.HibernateManagedSessionExtensionImpl from being installed as bean due to @Veto annotation
14:53:55,744 INFO  [org.jboss.seam.solder.core.CoreExtension] (MSC service thread 1-2) Preventing class org.jboss.seam.transaction.NoTransaction from being installed as bean due to @Veto annotation
14:53:55,821 INFO  [org.jboss.seam.solder.core.CoreExtension] (MSC service thread 1-2) Preventing class org.jboss.seam.transaction.HibernateTransaction from being installed as bean due to @Veto annotation
14:53:55,829 INFO  [org.jboss.seam.solder.core.CoreExtension] (MSC service thread 1-2) Preventing class org.jboss.seam.persistence.HibernatePersistenceProvider from being installed as bean due to @Veto annotation
14:53:56,156 INFO  [org.jboss.seam.config.xml.bootstrap.XmlConfigExtension] (MSC service thread 1-2) Wrapping InjectionTarget to set field values: org.jboss.seam.security.IdentityImpl
14:53:56,251 INFO  [org.jboss.seam.international.status.TypedStatusMessageBundleExtension] (MSC service thread 1-2) Add @MessageBundle to org.jboss.seam.solder.reflection.annotated.AnnotatedTypeBuilder.messages injection point for the type: org.jboss.seam.solder.support.SolderMessages
14:53:56,356 INFO  [org.jboss.seam.international.status.TypedStatusMessageBundleExtension] (MSC service thread 1-2) Add @MessageBundle to org.jboss.seam.solder.reflection.annotated.AnnotationBuilder.messages injection point for the type: org.jboss.seam.solder.support.SolderMessages
14:53:57,391 INFO  [org.jboss.seam.examples.booking.bootstrap.ApplicationInitializer] (MSC service thread 1-1) Importing seed data for application Seam Booking Example (Java EE Environment)
14:53:57,806 INFO  [org.jboss.seam.examples.booking.bootstrap.ApplicationInitializer] (MSC service thread 1-1) Seed data successfully imported
14:53:57,857 INFO  [javax.enterprise.resource.webcontainer.jsf.config] (MSC service thread 1-1) Initializing Mojarra 2.0.4 (FCS b09-jbossorg-4) for context ''
14:53:59,753 INFO  [javax.enterprise.resource.webcontainer.jsf.config] (MSC service thread 1-1) Monitoring jndi:/default-host/WEB-INF/faces-config.xml for modifications
14:53:59,794 INFO  [com.ocpsoft.pretty.PrettyFilter] (MSC service thread 1-1) PrettyFilter starting up...
14:54:00,201 INFO  [com.ocpsoft.pretty.PrettyFilter] (MSC service thread 1-1) PrettyFilter initialized.
14:54:00,210 INFO  [seam-servlet] (MSC service thread 1-1) Catch Integration for Servlets enabled
14:54:00,230 INFO  [org.jboss.web] (MSC service thread 1-1) registering web context: 
14:54:00,287 INFO  [org.jboss.as.server.controller] (DeploymentScanner-threads - 2) Deployed "ROOT.war"

Both the Express and Flex cartridges are based on the JBossAS7 web profile. Express reduces some of the services enabled by default in the web profile as I discussed in this post, while Flex actually adds addition services for clustering of web sessions using Infinispan and JGroups.

 

Web Session Clustering

The configuration of the web session cache replication employs a configuration that utilizes a TCP based JGroups configuration, and a FILE_PING discovery protocol that utilizes the Flex underlying clustered file system based on the glusterfs. The reason for use of TCP is that multicast is not usable in the Amazon cloud environment, and the reason the FILE_PING discovery protocol is used is that the Flex layer is in control of the cluster membership. By writing the cluster membership to the application shared directory, Flex is in control of what nodes an application sees. The Infinispan and JGroups subsystem configuration fragments are listed here:

 

        <subsystem xmlns="urn:jboss:domain:infinispan:1.0" default-cache-container="hibernate">
            <cache-container name="hibernate" default-cache="local-query">
                <local-cache name="entity">
                    <eviction strategy="LRU" max-entries="10000"/>
                    <expiration max-idle="100000"/>
                </local-cache>
                <local-cache name="local-query">
                    <eviction strategy="LRU" max-entries="10000"/>
                    <expiration max-idle="100000"/>
                </local-cache>
                <local-cache name="timestamps">
                    <eviction strategy="NONE"/>
                </local-cache>
            </cache-container>
            <!-- web session replication cache definitions -->
            <cache-container name="web" default-cache="repl">
                <alias>standard-session-cache</alias>
                <transport stack="tcp" />
                <replicated-cache name="repl" mode="ASYNC" batching="true">
                    <locking isolation="REPEATABLE_READ"/>
                    <file-store/>
                </replicated-cache>
                <distributed-cache name="dist" mode="ASYNC" batching="true">
                    <locking isolation="REPEATABLE_READ"/>
                    <file-store/>
                </distributed-cache>
            </cache-container>
        </subsystem>
        <subsystem xmlns="urn:jboss:domain:jgroups:1.0" default-stack="tcp">
            <stack name="tcp">
                <transport type="TCP" socket-binding="jgroups-tcp" diagnostics-socket-binding="jgroups-diagnostics"/>
                <protocol type="FILE_PING">
                  <property name="location">${vostok.app.shared}</property>
                  <property name="timeout">5000</property>
                  <property name="num_initial_members">1</property>
                </protocol>
                <protocol type="MERGE2"/>
                <protocol type="FD_SOCK" socket-binding="jgroups-tcp-fd"/>
                <protocol type="FD"/>
                <protocol type="VERIFY_SUSPECT"/>
                <protocol type="BARRIER"/>
                <protocol type="pbcast.NAKACK"/>
                <protocol type="UNICAST"/>
                <protocol type="pbcast.STABLE"/>
                <protocol type="VIEW_SYNC"/>
                <protocol type="pbcast.GMS"/>
                <protocol type="UFC"/>
                <protocol type="MFC"/>
                <protocol type="FRAG2"/>
                <protocol type="pbcast.STREAMING_STATE_TRANSFER"/>
                <protocol type="pbcast.FLUSH"/>
            </stack>
        </subsystem>

 

The ${vostok.app.shared} value is an application specific directory that is shared across the cluster members assocaited with the application. The Flex environment maintains the application distributed directory for each application.

 

Server Isolation

Both the Flex and Express environments launch a JBossAS7 instance for the logical PAAS application. In the current implementations, the mechanism by which the JBossAS7 server instances are isolated on a given PAAS envionrment EC2 server instance differ due to differences in the current Flex and Express implementations.

 

Isolation by Interface

The Express environment assigns each application a unique IP address on the loopback interface. It is a property of Fedora/RHEL that one can bind unique loopback addresses without having to configure a specific alias. When the AS7 cartridge is called to configure an application, it locates the next unique loopback interface IP address, and set the {ip} placeholder in the following standalone.xml fragement with the IP address:

 

<server xmlns="urn:jboss:domain:1.0">
   <management>
...


    <interfaces>
        <interface name="management">
            <loopback-address value="{ip}"/>
        </interface>
        <interface name="public">
            <loopback-address value="{ip}"/>
        </interface>
    </interfaces>

</server>

 

Isolation by Ports

In the Flex environment, there is no support currently available for assigning the cartridge a unique loopback address, so what the Flex cartridge does is to determine a unique port offset based on the available of a free http port. It starts at the default value of 8080, and advances by 100 until a free port is found. The offset is then used as the port-offset value socket-binding-group configuration. The offset also has to be applied separately to each of the managment-interfaces ports due to issue: (https://issues.jboss.org/browse/AS7-1476). Note that this configuration fragment also show the use of the eth0 interface by the JGroups port references shown in the above JGroups fragment. The eth0 interface is usable interface between the instances in the Flex cluster.

 

<server xmlns="urn:jboss:domain:1.0">

   <management>

...

        <management-interfaces>

           <native-interface interface="management" port="9999" />

           <http-interface interface="management" port="9990"/>

        </management-interfaces>

    </management>

 

    <interfaces>

        <interface name="management">

            <inet-address value="127.0.0.1"/>

        </interface>

        <interface name="public">

           <inet-address value="127.0.0.1"/>

        </interface>

        <interface name="eth0">

           <nic name="eth0"/>

        </interface>

    </interfaces>

 

    <socket-binding-group name="standard-sockets" default-interface="public" port-offset='0'>

...

        <socket-binding name="jgroups-tcp" port="7600" interface="eth0" />

        <socket-binding name="jgroups-tcp-fd" port="57600" interface="eth0" />

...

    </socket-binding-group>

</server>

In this post I'm drilling into some of the details of OpenShift from the perspective of the JBossAS7 cartridges that were created for Express and Flex. The basic notion in terms of providing a PaaS container is that of a cartridge. A cartridge plugs functionality into the PaaS environment, and is responsible for handling cartridge callouts known as hooks. The hooks are what handle container specific details of installing/starting/stopping/removing PaaS applications that rely on a given container type. A PaaS application may use more than one cartridge as part of the application. One example of this usage for the JavaEE applications the JBossAS7 cartridge supports would be a MySQL cartridge that provides a MySQL database for use by the application.

 

Let's look at what the JBossAS7 cartridge does in the two environments.

Express

The Express environment is oriented toward a developer getting their application running. It runs with a more limited JBossAS7 server as I described in JBossAS7 Configuration in OpenShift Express. The focus is on a single node, git repository development model where you update your application in either source or binary form and push it out to the OpenShift environment to have an application running quickly. There is little you can configure in the environment in terms of the server the app runs on, and the only access to the server you have is through the command line tools and the application git repository.

 

The Express cartridge framework supports the following cartridge hooks. The hooks highlighted in bold are the only ones the JBossAS7 cartridge provides an implementation for:

 

  • add-module
  • configure
    • This is where most of the work is done. It is a bash script which creates an application local JBossAS7 instance with it's standalone/deployments directory mapped to the user's git repository deployments content. It creates the git repository with git hooks to build and restart the server if a source development model is in effect, sets up a control shell script which handles the real work for the start/stop/restart/status hooks, links the log files to where the Express framework picks them up, updates the standalone.xml with the loopback address assigned to the application, and installs an httpd configuration to proxy the external application url to the JBossWeb container. This also starts the JBossAS7 server.
  • deconfigure
    • Removal of application and it's setup
  • info
  • post-install
  • post-remove
  • pre-install
    • simply checks that the java-1.6.0-openjdk httpd rpm packages are installed
  • reload
  • remove-module
  • restart
  • start
    • This is a simple bash script which calls out to the control shell script to start the server. This ends up calling the application's JBossAS7 bin/standalone.sh to launch the server.
  • status
    • Checks if the server is running and if so, returns the tail of the server.log. If the server is not running, reports that as the status.
  • stop
    • This is a simple bash script which calls out to the control shell script to stop the server.
  • update_namespace

 

The git repository for the application contains some configuration and scripts that can be updated to control your application deployment on the server. I'll talk about those in a seperate blog entry.

Flex

The Flex framework is not surprisingly, much more flexible with respect to what you can control in the PaaS environment. You have control over cluster definitions, and other IaaS aspects in addition to your PaaS containers.

 

  • configure
    • This is a Python class where the initial setup of the application specific JBossAS7 instance is done. It lays down the JBossAS7 structure. There is integration with the Flex console configuration wizard which displays the MySQL datasource fields as well.
  • deconfigure
    • Removal of application and it's setup
  • post-install
    • Integrates the JBossWeb instrumentation module that allows tracking of web requests by Flex
  • start
    • This is a bash script finishes some configuration details like determining which port offset to use . As I described in this post Differences Between the Express and Flex JBossAS7 Configurations, Flex and Express differ in how they isolate the JBossAS7 instances. In Flex, a port offset is determined at startup time based on the existence of other http listening ports. The start script also links the standalone/deployments directory to the application git repository, and well as the log file location the Flex console looks to, and installs an httpd configuration to proxy the external application url to the JBossWeb container.
  • stop
    • This calls out to the bin/jboss-admin.sh script to shutdown the server, using the port offset information to determine how to connect to the server.

 

Future (Codename TBD)

Right now the Express/Flex environments are based on very different internal infrastructures, and even though they build on the concept of a cartridge, the implementations are different. This is not a good thing for many reasons, not the least of which is that it complicates opening up development to a wider community. To address this, the OpenShift architecture is moving to a public, open source development mode that will be hosted on github under the following Organization:

https://github.com/openshift

 

The new project is called Codename TBD (not really, but it is still being discussed), and the goal is to develop a common cartridge SPI/API and infrastructure to address the current duplication of effort and limitations. To that end, I invite you to browse the existing code and docs in the github organization repositories, as well as the OpenShift Community pages.

 

We are looking for feedback from both the end user PaaS developer as well as PaaS container providers. My involvement will be from the perspective of what PaaS notions can be pushed as standards for consieration in JavaEE 7 and 8.

Filter Blog

By date:
By tag: