Bug 1029149 - RTGov quickstarts cannot be built/run OOTB after importing into JBDS
RTGov quickstarts cannot be built/run OOTB after importing into JBDS
Status: CLOSED CURRENTRELEASE
Product: JBoss Fuse Service Works 6
Classification: JBoss
Component: Examples (Show other bugs)
6.0.0 GA
Unspecified Unspecified
unspecified Severity urgent
: ER7
: 6.0.0
Assigned To: Gary Brown
Andrej Podhradsky
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-11-11 14:07 EST by Len DiMaggio
Modified: 2014-07-02 05:18 EDT (History)
5 users (show)

See Also:
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: ---


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
JBoss Issue Tracker RTGOV-314 Major Closed Fix errors when importing quickstarts into JBDS-IS 2014-07-02 05:42:36 EDT

  None (edit)
Description Len DiMaggio 2013-11-11 14:07:34 EST
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 16:03:09 EST
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-11 21:46:58 EST
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 15:34:35 EST
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 16:19:53 EST
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 16:23:00 EST
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 09:53:42 EST
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 10:37:19 EST
Gary Brown <gary@brownuk.com> updated the status of jira RTGOV-314 to Resolved
Comment 9 Gary Brown 2013-11-13 18:49:56 EST
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 06:37:08 EST
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 05:50:20 EST
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 05:18:54 EDT
Gary Brown <gary@brownuk.com> updated the status of jira RTGOV-314 to Closed

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