Bug 1029149

Summary: RTGov quickstarts cannot be built/run OOTB after importing into JBDS
Product: [JBoss] JBoss Fuse Service Works 6 Reporter: Len DiMaggio <ldimaggi>
Component: ExamplesAssignee: Gary Brown <gbrown>
Status: CLOSED CURRENTRELEASE QA Contact: Andrej Podhradsky <apodhrad>
Severity: urgent Docs Contact:
Priority: unspecified    
Version: 6.0.0 GACC: asantos, atangrin, dlesage, kconner, soa-p-jira
Target Milestone: ER7   
Target Release: 6.0.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
If you try to import RTGov quick starts into JBDS 7, you will see the following error message: Dynamic Web Module 3.0 requires Java 1.6 or newer. This is caused by the fact that the org.eclipse.jdt.core.prefs class includes hard-coded references to Java 1.5: The "samples-jbossas-sla-report" complains about a missing persistence.xml file. This file exists within the project, but is not directly within the classpath, so to fix this issue you will need to add "src/test/resources/META-INF" as the source directory and then select the "Maven->Update Project..." menu item in the "samples-jbossas-sla-report" project. If JavaServer Faces errors appear associated with the "samples-jbossas-sla-monitor" project, then select the "Maven->Update Project..." menu item on the project. You may need to do this twice, if the errors do not disappear after performing the action the first time.
Story Points: ---
Clone Of: Environment:
Last Closed: Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Len DiMaggio 2013-11-11 19:07:34 UTC
Description of problem:

The RTGov quickstarts org.eclipse.jdt.core.prefs include hardcoded references to Java 1.5:

./activityclient/.settings/org.eclipse.jdt.core.prefs
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
org.eclipse.jdt.core.compiler.compliance=1.5
org.eclipse.jdt.core.compiler.source=1.5

./sla/report/.settings/org.eclipse.jdt.core.prefs
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
org.eclipse.jdt.core.compiler.compliance=1.5
org.eclipse.jdt.core.compiler.source=1.5

./sla/monitor/.settings/org.eclipse.jdt.core.prefs
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
org.eclipse.jdt.core.compiler.compliance=1.5
org.eclipse.jdt.core.compiler.source=1.5

./sla/epn/.settings/org.eclipse.jdt.core.prefs
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
org.eclipse.jdt.core.compiler.compliance=1.5
org.eclipse.jdt.core.compiler.source=1.5

./ordermgmt/ip/.settings/org.eclipse.jdt.core.prefs
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
org.eclipse.jdt.core.compiler.compliance=1.5
org.eclipse.jdt.core.compiler.source=1.5

./policy/async/.settings/org.eclipse.jdt.core.prefs
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
org.eclipse.jdt.core.compiler.compliance=1.5
org.eclipse.jdt.core.compiler.source=1.5

./policy/sync/.settings/org.eclipse.jdt.core.prefs
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
org.eclipse.jdt.core.compiler.compliance=1.5
org.eclipse.jdt.core.compiler.source=1.5

As a result, build errors are seen when the projects are imported as-is into JBDS7:

Dynamic Web Module 3.0 requires Java 1.6 or newer.


Version-Release number of selected component (if applicable):
ER6

How reproducible:
100%

Steps to Reproduce:
1. Import RTGov quickstarts into JBDS
2.
3.

Actual results:
Dynamic Web Module 3.0 requires Java 1.6 or newer.

Expected results:
No errors - all quickstarts should import and run cleanly in JBDS.

Additional info:

Comment 1 Alan Santos 2013-11-11 21:03:09 UTC
Not sure JBDS is to blame for that 

https://github.com/Governance/rtgov/blob/master/samples/jbossas/pom.xml#L186

Comment 2 Len DiMaggio 2013-11-12 02:46:58 UTC
The reference to 1.5 Java is in the pom:

                        <!-- Specify the compiler options and settings -->
                        <plugin>
                                <groupId>org.apache.maven.plugins</groupId>
                                <artifactId>maven-compiler-plugin</artifactId>
                                <configuration>
                                        <source>1.5</source>
                                        <target>1.5</target>
                                        <showDeprecation>false</showDeprecation>
                                        <showWarnings>false</showWarnings>
                                </configuration>
                        </plugin>

Comment 4 Len DiMaggio 2013-11-12 20:34:35 UTC
Changing the reference in the pom.xml file from Java 1.5 to Java 1.7 resolves the initial error - but then presents an error of:

JavaServer Faces 2.0 requires Dynamic Web Module 2.5 or newer.

See attached screenshot - setting the facet version to 2.5 results in an error of:

Cannot change version of project facet Dynamic Web Module to 2.5

Comment 5 Alan Santos 2013-11-12 21:19:53 UTC
Somehow or other I got past the dynamic web module error (I think by building it outside of JBDS). I then ran into an error stating that it was missing the @ApplicationPath annotation - disabling the JAX-RS validator or setting that particular activator to a Warning resolved this.  

Suggest either documenting the change to JAX-RS or updating the RTGov sample.

Comment 6 Alan Santos 2013-11-12 21:23:00 UTC
perhaps this should be in another BZ.

samples-jbossas-sla-report also includes an error that it is missing persistence.xml

That can be changed to a warning in Preferences/Java Persistence/JPA/Errors / Warnings

This should be doc'd or fixed in the quickstart

Comment 7 Gary Brown 2013-11-13 14:53:42 UTC
Reference to JDK 1.5 has been removed.

The persistence.xml file does exist in src/test/resources/META-INF. To overcome this error, it is necessary to add this location as a 'source folder' and then select the 'Maven->Update Project...' on the 'samples-jbossas-sla-report' project.

Unclear why the JavaServer Faces errors occur on the 'samples-jbossas-sla-monitor' project - but if you do 'Maven->Update Project...' on that project (sometimes it has to be done twice) then the errors go - so think this is an Eclipse/maven issue.


Also note: if using the maven Eclipse plugin (e.g. mvn eclipse:eclipse) the Eclipse projects can be imported (as a general project) without any issues.

So apart from the JDK 1.5 fix, the other errors will require docs. How do I mark this BZ to ensure this happens?

Comment 8 JBoss JIRA Server 2013-11-13 15:37:19 UTC
Gary Brown <gary> updated the status of jira RTGOV-314 to Resolved

Comment 9 Gary Brown 2013-11-13 23:49:56 UTC
Doc changes required when describing importing rtgov quickstarts into JBDS-IS:

The "samples-jbossas-sla-report" complains about a missing persistence.xml file. This file exists within the project, but is not directly within the classpath, so to fix this issue you will need to add the folder "src/test/resources/META-INF" as a source folder, and then select the "Maven->Update Project..." menu item on the "samples-jbossas-sla-report" project.

If JavaServer Faces errors appear associated with the "samples-jbossas-sla-monitor" project, then select the "Maven->Update Project..." menu item on the project. This may need to be performed twice, if the errors do not disappear after performing the action once.

Comment 10 Gary Brown 2013-11-14 11:37:08 UTC
Made additional change, based on a workaround link found by Alan, so the JavaServer Faces errors no longer appear - so only docs required for the first (para) issue related to missing persistence.xml.

Comment 11 Andrej Podhradsky 2013-12-16 10:50:20 UTC
Verified with FSW 6.0.0.ER7 + JBDS-IS 7.0.0.CR1. 

Note that there is another error after importing RTGov quickstarts into JBDS, reported as new bug at https://bugzilla.redhat.com/show_bug.cgi?id=1043447

Comment 12 JBoss JIRA Server 2014-07-02 09:18:54 UTC
Gary Brown <gary> updated the status of jira RTGOV-314 to Closed