Created attachment 888274 [details] The full application launch error shown in the web console Description of problem: When creating a wildfly application that references an existing git repository that requires java7, the application fails to launch as it appears that a java6 compiler is being used. Version-Release number of selected component (if applicable): How reproducible: Every time Steps to Reproduce: 1. Create a wildfly application 2. Use https://github.com/starksm64/DevNation2014 in the Source Code field 3. Click the Create Application button Actual results: Unable to complete the requested operation. ... [INFO] Compiling 13 source files to /var/lib/openshift/535592835973ca088100033b/app-root/runtime/repo/iotbof-sdk/target/classes [INFO] ------------------------------------------------------------- [ERROR] COMPILATION ERROR : [INFO] ------------------------------------------------------------- [ERROR] Failure executing javac, but could not parse the error: javac: invalid target release: 1.7 Usage: javac <options> <source files> use -help for a list of possible options [INFO] 1 error [INFO] ------------------------------------------------------------- [INFO] ------------------------------------------------------------------------ [INFO] Reactor Summary: [INFO] [INFO] iotbof ............................................ SUCCESS [1.043s] [INFO] IoT BOF SDK ....................................... FAILURE [54.707s] [INFO] IoT BOF EJBs ...................................... SKIPPED [INFO] IoT BOF WARs ...................................... SKIPPED [INFO] IoT BOF EAR ....................................... SKIPPED [INFO] IoT BOF Tests ..................................... SKIPPED [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 57.273s [INFO] Finished at: Mon Apr 21 17:52:29 EDT 2014 [INFO] Final Memory: 16M/166M [INFO] ------------------------------------------------------------------------ [WARNING] The requested profile "openshift" could not be activated because it does not exist. [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.3.2:compile (default-compile) on project iotbof-sdk: Compilation failure [ERROR] Failure executing javac, but could not parse the error: Expected results: The application creation should succeed. Additional info:
Farah, we do this w/ the Jboss cartridges today via marker files: function update-configuration() { if marker_present java7 || [ ${1:-undefined} == java7 ] then export JAVA_HOME=$OPENSHIFT_JBOSSEAP_JDK7 else export JAVA_HOME=$OPENSHIFT_JBOSSEAP_JDK6 fi echo $JAVA_HOME > $OPENSHIFT_JBOSSEAP_DIR/env/JAVA_HOME echo "$JAVA_HOME/bin:$M2_HOME/bin:$OPENSHIFT_JBOSSEAP_DIR/bin/tools" > $OPENSHIFT_JBOSSEAP_DIR/env/OPENSHIFT_JBOSSEAP_PATH_ELEMENT } Where the JDK vars are defined as: /etc/alternatives/java_sdk_1.6.0 /etc/alternatives/java_sdk_1.7.0 Let me know if you have any questions or want me to review the changes if/when you make them.
The WildFly cartridge also supports using marker files to specify the java version. Adding a java7 marker file to the existing git repository will solve the problem, e.g., see https://github.com/fjuma/DevNation2014/commit/9d6fa73e6f5d75451b1947a9242a3dd9300e366b.
The problem is that I don't have access to the application git repository at the point of creation. This happens on the initial creation of the application from the OpenShift Online web console. What is needed is a checkbox that indicates the level of Java required for the Source Code project being imported so that the online framework can create the appropriate javaX marker.
You would need to add that file to the repository, or fork the repo and add it to your version and use that to launch the openshift app, if you can't get it added to the primary repo. (Or create the app and then add the source later)
In my opinion this is something that should be handled by the application launch page. In general, a language based cartridge should allow the user to specify what level they need. The next issue will be when I need to deploy a java8 based cartridge and the trigger does not work because that is not currently supported. I should know that at the point of application creation, not by having to dig through some error logs.