Bug 1089759 - [RFE]Cannot launch wildfly app with existing source that requires Java7
Summary: [RFE]Cannot launch wildfly app with existing source that requires Java7
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: OpenShift Online
Classification: Red Hat
Component: Image
Version: 2.x
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
: ---
Assignee: Farah Juma
QA Contact: libra bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-04-21 22:05 UTC by Scott M Stark
Modified: 2015-05-15 00:41 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-04-22 22:50:50 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
The full application launch error shown in the web console (10.40 KB, text/plain)
2014-04-21 22:05 UTC, Scott M Stark
no flags Details

Description Scott M Stark 2014-04-21 22:05:47 UTC
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:

Comment 1 Ben Parees 2014-04-22 15:19:00 UTC
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.

Comment 2 Farah Juma 2014-04-22 22:50:50 UTC
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.

Comment 3 Scott M Stark 2014-04-24 16:06:58 UTC
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.

Comment 4 Ben Parees 2014-04-24 16:42:06 UTC
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)

Comment 5 Scott M Stark 2014-04-24 17:00:43 UTC
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.


Note You need to log in before you can comment on or make changes to this bug.