Bug 900105 (JBPAPP6-671)
| Summary: | EAP 6 runtime failure w/ IBM JDK 1.6 due to old STaX - missing javax.xml.stream.XMLOutputFactory | ||
|---|---|---|---|
| Product: | [JBoss] JBoss Enterprise Application Platform 6 | Reporter: | Madhumita Sadhukhan <msadhukh> |
| Component: | Testsuite | Assignee: | Heiko Braun <ike.braun> |
| Status: | CLOSED NEXTRELEASE | QA Contact: | |
| Severity: | high | Docs Contact: | |
| Priority: | high | ||
| Version: | 6.0.0 | CC: | jason.greene, msadhukh, ozizka, pgier, pslavice |
| Target Milestone: | --- | ||
| Target Release: | EAP 6.0.0 | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| URL: | http://jira.jboss.org/jira/browse/JBPAPP6-671 | ||
| Whiteboard: | eap6_need_triage | ||
| Fixed In Version: | Doc Type: | Bug Fix | |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2012-06-05 04:14:11 UTC | Type: | Bug |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
| Embargoed: | |||
|
Description
Madhumita Sadhukhan
2012-03-28 13:36:49 UTC
Link: Added: This issue is related to JBPAPP-7937 This might come handy: https://bugzilla.redhat.com/show_bug.cgi?id=779610 {quote} There are multiple workarounds to this problem 1) It is possible to start the server if run.conf contains peoperties necessary to be set to use IBM's implementation. -Djavax.xml.stream.XMLInputFactory=com.ibm.xml.xlxp.api.stax.XMLInputFactoryImpl -Djavax.xml.stream.XMLOutputFactory=com.ibm.xml.xlxp.api.stax.XMLOutputFactoryImpl -Djavax.xml.stream.XMLEventFactory=com.ibm.xml.xlxp.api.stax.XMLEventFactoryImpl 2) Enable properties mention in 1) in file \{java.home}/lib/stax.properties 3) Copy jboss-as/lib/endorsed/stax-api.jar to \{java.home}/lib/endorsed {quote} The problem is that the IBM JDK used has old STaX API. So the IBM JDK needs to be updated. Workarounds described above. Madhumita, can you try please? Ok, so {{-rf testsuite}} doesn't work, because -Dmaven.repo.local doesn't work - Maven doesn't reach into the local repo for the artifacts built in the first step. No idea why. Madhumita will try with -X to see where is Maven actually looking.
{quote}
-Dmaven.local.repo
{quote}
I think it should be -Dmaven.repo.local
Only a comment typo. Fixed. Link: Added: This issue relates to CTS-53 Stacktrace with -X enabled shows missing dependency: Caused by: org.sonatype.aether.resolution.ArtifactResolutionException: The following artifacts could not be resolved: org.jboss.as:jboss-as-testsuite-shared:jar:7.1.1.Final-redhat-1, org.jboss.as:jboss-as-arquillian-container-managed:jar:7.1.1.Final-redhat-1, org.jboss.as:jboss-as-arquillian-common:jar:7.1.1.Final-redhat-1, org.jboss.as:jboss-as-arquillian-testenricher-msc:jar:7.1.1.Final-redhat-1, org.jboss.as:jboss-as-arquillian-protocol-jmx:jar:7.1.1.Final-redhat-1: Could not find artifact org.jboss.as:jboss-as-testsuite-shared:jar:7.1.1.Final-redhat-1 in mead-eap6 (http://download.lab.bos.redhat.com/rel-eng/repos/jb-eap-6-rhel-6-build/JBEAP-6.0.0-ER4/427261/maven/) ...................................................................................................................................... Caused by: org.sonatype.aether.transfer.ArtifactNotFoundException: Could not find artifact org.jboss.as:jboss-as-testsuite-shared:jar:7.1.1.Final-redhat-1 in mead-eap6 (http://download.lab.bos.redhat.com/rel-eng/repos/jb-eap-6-rhel-6-build/JBEAP-6.0.0-ER4/427261/maven/) I could not replicate above XMLOutputFactory issue re-using jboss-eap zip compiled and run on SunJDK and then only used for runnoing tests on ibm jdk. However could not obtain decent results with complete testsuite run on ibmjdk due to volatile eap testsuite in ER4.1 which kept failing at basic target due to timeout.(https://issues.jboss.org/browse/JBPAPP-8628) http://hudson.qa.jboss.com/hudson/view/EAP6/view/EAP6-Hibernate/job/eap-60-as-testsuite-RHEL6-zipbuiltonoracleJDK6_testrunIBMJDK16/ Also i checked that -rf verifies and tries to use local-repo first tests are failing for similar issue even though we do not compile EAP 6 on IBM JDK failing tests: org.jboss.as.test.smoke.mgmt.datasource.AddMySqlDataSourceOperationsUnitTestCase.testAddDsAndTestConnection org.jboss.as.test.smoke.mgmt.datasource.DataSourceOperationsUnitTestCase Stacktrace: java.lang.NoSuchMethodError: javax/xml/stream/XMLOutputFactory.newFactory()Ljavax/xml/stream/XMLOutputFactory; at org.jboss.as.test.integration.management.base.AbstractMgmtTestBase.modelToXml(AbstractMgmtTestBase.java:180) at org.jboss.as.test.integration.management.jca.DsMgmtTestBase.marshalAndReparseDsResources(DsMgmtTestBase.java:86) at org.jboss.as.test.smoke.mgmt.datasource.DataSourceOperationsUnitTestCase.testAddDsAndTestConnection(DataSourceOperationsUnitTestCase.java:108) Jason, the last comment in this JIRA is the most relevant. Looks like IBM JDK has an older version of STAX, which is missing methods required by the AS. What should be our recommendation for our customer who use IBM JDK? How does the lib/endorsed mechanism work in AS7? Would that work? Labels: Added: eap6_need_triage Link: Added: This issue is a dependency of JBQA-4954 Link: Added: This issue is a dependency of JBPAPP-8827 Link: Added: This issue is related to JBPAPP-7965 Link: Removed: This issue is a dependency of JBPAPP-8827 I tried following steps without really tampering the jdk:
1) trying to set -Djava.endorsed.dirs=path to stax-api.jar taken from eap5 in $JAVA_OPTS in standalone.conf located at jboss-eap-6.0/bin
I still saw the same failures as I feel that the jar was not getting picked up correctly
I am not sure if the JAVA_OPTS was getting picked up from standalone.conf at all
2) I tried to set the following properties in script that starts the testsuite run:
mvn -fae -B -s settings.xml install -rf testsuite -Pnormal -DallTests -Dmaven.test.failure.ignore=true -Dmaven.repo.local=local-repo -Djboss.dist=${WORKSPACE}/jboss-eap-6.0 -Dnode0=$MYTESTIP_1 -Dnode1=$MYTESTIP_2 -Dmcast=$MCAST_ADDR -Dsurefire.forked.process.timeout=2200 -Djavax.xml.stream.XMLInputFactory=com.ibm.xml.xlxp.api.stax.XMLInputFactoryImpl -Djavax.xml.stream.XMLOutputFactory=com.ibm.xml.xlxp.api.stax.XMLOutputFactoryImpl
-Djavax.xml.stream.XMLEventFactory=com.ibm.xml.xlxp.api.stax.XMLEventFactoryImpl
3) I found that IBM jdk already ships with a sample stax.properties.sample present in jre/lib and I had it enabled in qa lab
which has the above specified properties.
-Dsurefire.forked.process.timeout=2200 -Djavax.xml.stream.XMLInputFactory=com.ibm.xml.xlxp.api.stax.XMLInputFactoryImpl -Djavax.xml.stream.XMLOutputFactory=com.ibm.xml.xlxp.api.stax.XMLOutputFactoryImpl
-Djavax.xml.stream.XMLEventFactory=com.ibm.xml.xlxp.api.stax.XMLEventFactoryImpl
The tests still fail with:
java.lang.NoSuchMethodError: javax/xml/stream/XMLOutputFactory.newFactory()Ljavax/xml/stream/XMLOutputFactory;
which says that it is actually trying to access javax/xml/stream/XMLOutputFactory instead of the IBM packages due to which it fails consistently on IBM JDK probably because the jar containing the above path is in the classpath.
Do you think this is the correct reason and is there any way that can be overridden?
I fix this one upstream awhile back. The problem is newFactory is not a standard method, and should never be used (newInstance should be used instead). Reopen if you see a problem with ER6. Here is the fix, just for notes: https://github.com/jbossas/jboss-as/commit/87babbc2957df9c7fffebf229e90f741af4de139 The problem still persists in ER6.I dont think the change has made way into ER6 as I still see following in AbstractMgmtTestBase.java
XMLExtendedStreamWriter writer = XMLExtendedStreamWriterFactory.create(XMLOutputFactory.newFactory()
.createXMLStreamWriter(strWriter));
Please pull this change for ER7
Paul, Assigned to you as this issue was fixed for ER6 but probably did not make way into EAP ER6.Please make sure this fix is in. Looks like the relevant commit was on Apr 17, one day after the rebase on Apr 16. It will be merged for ER7. The tests failing for missing method in XMLOutputFactory pass now with EAP6 ER7. We are also able to compile EAP6 ER7 successfully on IBM JDK http://hudson.qa.jboss.com/hudson/view/EAP6/view/EAP6-AS-Testsuite/job/eap-60-as-testsuite-RHEL6-buildIBMJDK6_testrunIBMJDK16/52/ Release Notes Docs Status: Added: Not Required Release Notes Docs Status: Removed: Not Required Docs QE Status: Removed: NEW |