Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

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: TestsuiteAssignee: Heiko Braun <ike.braun>
Status: CLOSED NEXTRELEASE QA Contact:
Severity: high Docs Contact:
Priority: high    
Version: 6.0.0CC: 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
project_key: JBPAPP6

This will be rerun for ER4 but craeting a jira as discussed with Ondra

I built the eap testsuite on Oracle JDK6 and tried to run it on IBM JDKK 1.6
However i see following build failure:

Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.3.2-redhat-1:compile (default-compile) on project jboss-as-testsuite-shared: Compilation failure
[ERROR] /mnt/hudson_workspace/workspace/eap-60-as-testsuite-RHEL6-buildoracleJDK6_testrunIBMJDK16/jboss-eap/testsuite/shared/src/main/java/org/jboss/as/test/integration/management/base/AbstractMgmtTestBase.java:[207,95] cannot find symbol
[ERROR] symbol  : method newFactory()
[ERROR] location: class javax.xml.stream.XMLOutputFactory
[ERROR] -> [Help 1]


Hudson job link:

http://hudson.qa.jboss.com/hudson/view/EAP6/view/EAP6-AS-Testsuite/job/eap-60-as-testsuite-RHEL6-buildoracleJDK6_testrunIBMJDK16/6/consoleText

I get positive results(successful build failing only at integration-benchmark for ER3) when I run the same configuration on Oracle JDK 1.6 (i.e mvn install on Oracle JDK 16 followed by mvn test on Oracle JDK16)

Comment 1 Madhumita Sadhukhan 2012-03-28 13:58:06 UTC
Link: Added: This issue is related to JBPAPP-7937


Comment 2 Ondřej Žižka 2012-03-28 15:48:37 UTC
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}

Comment 3 Ondřej Žižka 2012-03-28 15:51:18 UTC
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?

Comment 4 Ondřej Žižka 2012-03-28 16:13:31 UTC
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.

Comment 5 Paul Gier 2012-03-28 16:19:44 UTC
{quote}
-Dmaven.local.repo
{quote}
I think it should be -Dmaven.repo.local

Comment 6 Ondřej Žižka 2012-03-28 16:30:25 UTC
Only a comment typo. Fixed.

Comment 7 Ondřej Žižka 2012-03-29 12:56:02 UTC
Link: Added: This issue relates to CTS-53


Comment 8 Madhumita Sadhukhan 2012-03-29 13:59:18 UTC
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/)
	

Comment 9 Madhumita Sadhukhan 2012-04-05 15:41:53 UTC
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

Comment 10 Madhumita Sadhukhan 2012-04-13 12:52:32 UTC
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)


Comment 11 Rajesh Rajasekaran 2012-04-17 15:46:59 UTC
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? 

Comment 12 Rajesh Rajasekaran 2012-04-17 15:46:59 UTC
Labels: Added: eap6_need_triage


Comment 13 Madhumita Sadhukhan 2012-04-18 08:57:43 UTC
Link: Added: This issue is a dependency of JBQA-4954


Comment 14 Rajesh Rajasekaran 2012-04-25 22:31:20 UTC
Link: Added: This issue is a dependency of JBPAPP-8827


Comment 15 Rajesh Rajasekaran 2012-04-25 23:13:49 UTC
Link: Added: This issue is related to JBPAPP-7965


Comment 16 Rajesh Rajasekaran 2012-04-25 23:13:57 UTC
Link: Removed: This issue is a dependency of JBPAPP-8827 


Comment 17 Madhumita Sadhukhan 2012-04-26 14:48:37 UTC
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?
 




Comment 18 Jason Greene 2012-04-30 18:17:51 UTC
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.

Comment 19 Jason Greene 2012-04-30 18:33:16 UTC
Here is the fix, just for notes:

https://github.com/jbossas/jboss-as/commit/87babbc2957df9c7fffebf229e90f741af4de139

Comment 20 Madhumita Sadhukhan 2012-05-01 15:22:24 UTC
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

Comment 21 Madhumita Sadhukhan 2012-05-01 15:25:25 UTC
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.

Comment 22 Paul Gier 2012-05-01 15:35:48 UTC
Looks like the relevant commit was on Apr 17, one day after the rebase on Apr 16.  It will be merged for ER7.

Comment 23 Madhumita Sadhukhan 2012-05-10 14:50:58 UTC
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/

Comment 24 Tom WELLS 2012-06-05 04:14:11 UTC
Release Notes Docs Status: Added: Not Required


Comment 25 Anne-Louise Tangring 2012-11-05 17:45:16 UTC
Release Notes Docs Status: Removed: Not Required 
Docs QE Status: Removed: NEW