Bug 270863 - JPA Test build.xml: jaxp.properties for SE testing should not be overwritten by server version
Summary: JPA Test build.xml: jaxp.properties for SE testing should not be overwritten ...
Status: RESOLVED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Eclipselink (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P3 major (vote)
Target Milestone: ---   Edit
Assignee: Nobody - feel free to take it CLA
QA Contact:
URL: http://fisheye2.atlassian.com/changel...
Whiteboard:
Keywords: test
Depends on:
Blocks:
 
Reported: 2009-04-01 14:53 EDT by Michael OBrien CLA
Modified: 2022-06-09 10:26 EDT (History)
3 users (show)

See Also:


Attachments
patch for the bug (2.43 KB, patch)
2009-04-09 15:35 EDT, Kevin Yuan CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Michael OBrien CLA 2009-04-01 14:53:06 EDT
Recently over the past couple weeks I have noticed that I am getting JAXP transformer exceptions, I discussed this with our SDO/XML group and targeted the jaxp property.
    This happens on a new machine running XP and SUN 1.6.0_xx, I have been using the IBM J9 JVM as my JAVA_HOME with no problems for the past 2 months but would like to use the SUN JDK again.
    My question is - has anyone else had issues with a javax.xml.transform.TransformerFactoryConfigurationError on the provider org.apache.xalan.processor.TransformerFactoryImpl, if they are also running server tests on the side?

    2 Issues:
------------
    This turns out to be a conflict with configuring the tests to run on a specific application server and running in SE mode - the script may need to be partitioned into Server/SE sections.
    A secondary issue of SVN rev 3681 is that any settings in jaxp.properties is overwritten by the eclipselink.jpa.test/build.xml script

>Temporary fix:
-----------------
    The temp fix is to comment out the javax.xml.transform.TransformerFactory property in jre/lib/jaxp.properties.
        javax.xml.transform.TransformerFactory=org.apache.xalan.processor.TransformerFactoryImpl

    However, I noticed that this file was being rewritten by the build since the following change on 16 March 2009 - there is no bug # attached to the diff in fisheye - so I don't know all the reasons why we need to rewrite this file, but from the comments in build.xml it looks like the change is for WebLogic and WebSphere.  But WebSphere runs fine using the jaxp processor [com.ibm.xtq.xslt.jaxp.compiler.TransformerFactoryImpl].

    See:
            http://fisheye2.atlassian.com/browse/eclipselink/trunk/jpa/eclipselink.jpa.test/build.xml?r=3681#l815
            http://fisheye2.atlassian.com/changelog/eclipselink/?cs=3681


    <target name="generate-report">
        <!-- WebLogic and WebSphere servers require specific jaxp.properties for generating report -->
-->        <delete file="${env.JAVA_HOME}/jre/lib/jaxp.properties" failonerror="false"/>
-->        <copy todir="${env.JAVA_HOME}/jre/lib" file="${eclipselink.jpa.test}/resource/${server.name}/jaxp.properties" failonerror="false"/>
        <junitreport todir="${eclipselink.jpa.test}/${report.dir}">


>Full fix:
----------
   It seems that the variable ${server.name} that is set in your test.properties is being used to target the appropriate jaxp.properties to copy from resource to jre/lib.
   In my case it is set to the following (which is why i can only run tests in WebSphere since I started defining this variable)
        server.name=websphere
   I don't think that generating test reports for non-server testing should be affected by this server flag - the script needs to be modified into server/non-server mode here.

>Working
@rem javax.xml.transform.TransformerFactory=org.apache.xalan.processor.TransformerFactoryImpl


>Failing
javax.xml.transform.TransformerFactory=org.apache.xalan.processor.TransformerFactoryImpl

C:\view_w34r1a>ant test-jpa
Buildfile: build.xml
     [echo] trunk.build.location = 'C:\view_w34r1a'
     [echo] env.CLASSPATH        = '${env.CLASSPATH}'
     [echo] java.class.path      = 'c:\opt\ant171\lib\ant-launcher.jar;C:\opt\ant171\lib\ant-antlr.jar;C:\opt\ant171\lib\ant-apache-bcel.jar
;C:\opt\ant171\lib\ant-apache-bsf.jar;C:\opt\ant171\lib\ant-apache-log4j.jar;C:\opt\ant171\lib\ant-apache-oro.jar;C:\opt\ant171\lib\ant-apac
he-regexp.jar;C:\opt\ant171\lib\ant-apache-resolver.jar;C:\opt\ant171\lib\ant-commons-logging.jar;C:\opt\ant171\lib\ant-commons-net.jar;C:\o
pt\ant171\lib\ant-jai.jar;C:\opt\ant171\lib\ant-javamail.jar;C:\opt\ant171\lib\ant-jdepend.jar;C:\opt\ant171\lib\ant-jmf.jar;C:\opt\ant171\l
ib\ant-jsch.jar;C:\opt\ant171\lib\ant-junit.jar;C:\opt\ant171\lib\ant-launcher.jar;C:\opt\ant171\lib\ant-netrexx.jar;C:\opt\ant171\lib\ant-n
odeps.jar;C:\opt\ant171\lib\ant-starteam.jar;C:\opt\ant171\lib\ant-stylebook.jar;C:\opt\ant171\lib\ant-swing.jar;C:\opt\ant171\lib\ant-testu
til.jar;C:\opt\ant171\lib\ant-trax.jar;C:\opt\ant171\lib\ant-weblogic.jar;C:\opt\ant171\lib\ant.jar;C:\opt\ant171\lib\junit-4.1.jar;C:\opt\a
nt171\lib\junit-4.2.jar;C:\opt\ant171\lib\junit-4.3.1.jar;C:\opt\ant171\lib\junit-ext-param.jar;C:\opt\ant171\lib\junit.jar;C:\opt\ant171\li
b\junit4-ext-param.jar;C:\opt\ant171\lib\junit4-ext-pb4.jar;C:\opt\ant171\lib\xercesImpl.jar;C:\opt\ant171\lib\xml-apis.jar;c:\jdk1.6.0\lib\
tools.jar'
     [echo] user.home            = 'C:\Documents and Settings\mfobrien'
     [echo] Loading user properties from: 'C:\Documents and Settings\mfobrien/build.properties'
     [echo] oracle.extensions.depend.dir = 'extension.oracle.lib.external'
     [echo] extensions.depend.dir        = 'C:\view_w34r1a/../extension.lib.external'
     [echo] junit.lib = 'extension.oracle.lib.external/junit.jar'
     [echo] Loading default properties from: 'C:\view_w34r1a/build.properties'
     [echo] java.version='1.6.0_07'
     [echo] jdbc.driver.jar='${jdbc.driver.jar}'

test-jpa:

clean-test:
   [delete] Deleting directory C:\view_w34r1a\jpa\eclipselink.jpa.test\reports
   [delete] Deleting directory C:\view_w34r1a\jpa\eclipselink.jpa.test\run
    [mkdir] Created dir: C:\view_w34r1a\jpa\eclipselink.jpa.test\reports
    [mkdir] Created dir: C:\view_w34r1a\jpa\eclipselink.jpa.test\run


run-test:
     [echo] Running test on jdbc:oracle:thin:@10.156.52.98:1521:orcl
Warning: Reference run.classpath has not been set at runtime, but was found during
build file parsing, attempting to resolve. Future versions of Ant may support
 referencing ids defined in non-executed targets.
Warning: Reference compile.path has not been set at runtime, but was found during
build file parsing, attempting to resolve. Future versions of Ant may support
 referencing ids defined in non-executed targets.
    [junit] [EL Warning]: ServerSession(21868771)--Ignoring default serialization on element [private org.eclipse.persistence.testing.models
.jpa.fieldaccess.advanced.Employee$Gender org.eclipse.persistence.testing.models.jpa.fieldaccess.advanced.Employee.gender] within entity class [class org.eclipse.persistence.testing.models.jpa.fieldaccess.advanced.Employee] since a @Convert is specified.
    [junit] [EL Warning]: ServerSession(21868771)--Ignoring default serialization on element [private java.lang.String org.eclipse.persistence.testing.models.jpa.fieldaccess.advanced.Buyer.gender] within entity class [class org.eclipse.persistence.testing.models.jpa.fieldaccess.advanced.Buyer] since a @Convert is specified.
    [junit] [EL Warning]: ServerSession(21868771)--Optimistic locking metadata is already defined on the descriptor for the entity [class or
g.eclipse.persistence.testing.models.jpa.fieldaccess.advanced.Buyer]. Ignoring version specification on element [private int org.eclipse.persistence.testing.models.jpa.fieldaccess.advanced.Buyer.version].
    [junit] [EL Warning]: ServerSession(21868771)--Ignoring default serialization on element [private java.util.Map org.eclipse.persistence.testing.models.jpa.fieldaccess.advanced.Buyer.creditCards] within entity class [class org.eclipse.persistence.testing.models.jpa.fieldaccess.advanced.Buyer] since a @Convert is specified.
    [junit] [EL Warning]: ServerSession(21868771)--Ignoring default serialization on element [private java.util.Map org.eclipse.persistence.testing.models.jpa.fieldaccess.advanced.Buyer.creditCards] within entity class [class org.eclipse.persistence.testing.models.jpa.fieldaccess.advanced.Buyer] since a @Convert is specified.
    [junit] [EL Warning]: 2009-04-01 14:06:56.437--ServerSession(24257622)--Ignoring default serialization on element [private org.eclipse.p
ersistence.testing.models.jpa.fieldaccess.advanced.Employee$Gender org.eclipse.persistence.testing.models.jpa.fieldaccess.advanced.Employee.
gender] within entity class [class org.eclipse.persistence.testing.models.jpa.fieldaccess.advanced.Employee] since a @Convert is specified.
    [junit] [EL Warning]: 2009-04-01 14:06:56.437--ServerSession(24257622)--Ignoring default serialization on element [private java.lang.Str
ing org.eclipse.persistence.testing.models.jpa.fieldaccess.advanced.Buyer.gender] within entity class [class org.eclipse.persistence.testing.models.jpa.fieldaccess.advanced.Buyer] since a @Convert is specified.
    [junit] [EL Warning]: 2009-04-01 14:06:56.437--ServerSession(24257622)--Optimistic locking metadata is already defined on the descriptor
 for the entity [class org.eclipse.persistence.testing.models.jpa.fieldaccess.advanced.Buyer]. Ignoring version specification on element [private int org.eclipse.persistence.testing.models.jpa.fieldaccess.advanced.Buyer.version].
    [junit] [EL Warning]: 2009-04-01 14:06:56.437--ServerSession(24257622)--Ignoring default serialization on element [private java.util.Map
 org.eclipse.persistence.testing.models.jpa.fieldaccess.advanced.Buyer.creditCards] within entity class [class org.eclipse.persistence.testing.models.jpa.fieldaccess.advanced.Buyer] since a @Convert is specified.
    [junit] [EL Warning]: 2009-04-01 14:06:56.437--ServerSession(24257622)--Ignoring default serialization on element [private java.util.Map
 org.eclipse.persistence.testing.models.jpa.fieldaccess.advanced.Buyer.creditCards] within entity class [class org.eclipse.persistence.testing.models.jpa.fieldaccess.advanced.Buyer] since a @Convert is specified.
    [junit] java.lang.reflect.InvocationTargetException
    [junit]     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    [junit]     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    [junit]     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    [junit]     at java.lang.reflect.Method.invoke(Method.java:597)
    [junit]     at sun.instrument.InstrumentationImpl.loadClassAndStartAgent(InstrumentationImpl.java:323)
    [junit]     at sun.instrument.InstrumentationImpl.loadClassAndCallPremain(InstrumentationImpl.java:338)
    [junit] Caused by: java.lang.reflect.InvocationTargetException
    [junit]     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    [junit]     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    [junit]     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    [junit]     at java.lang.reflect.Method.invoke(Method.java:597)
    [junit]     at org.eclipse.persistence.internal.jpa.deployment.JavaSECMPInitializerAgent.initializeFromAgent(JavaSECMPInitializerAgent.java:45)
    [junit]     at org.eclipse.persistence.internal.jpa.deployment.JavaSECMPInitializerAgent.premain(JavaSECMPInitializerAgent.java:38)
    [junit]     ... 6 more
    [junit] Caused by: javax.xml.transform.TransformerFactoryConfigurationError: Provider org.apache.xalan.processor.TransformerFactoryImpl not found
    [junit]     at javax.xml.transform.TransformerFactory.newInstance(TransformerFactory.java:108)
    [junit]     at org.eclipse.persistence.platform.xml.jaxp.JAXPTransformer.<init>(JAXPTransformer.java:51)
    [junit]     at org.eclipse.persistence.platform.xml.jaxp.JAXPPlatform.newXMLTransformer(JAXPPlatform.java:135)
    [junit]     at org.eclipse.persistence.oxm.XMLMarshaller.initialize(XMLMarshaller.java:104)
    [junit]     at org.eclipse.persistence.oxm.XMLMarshaller.<init>(XMLMarshaller.java:99)
    [junit]     at org.eclipse.persistence.oxm.XMLContext.createMarshaller(XMLContext.java:297)
    [junit]     at org.eclipse.persistence.internal.jpa.metadata.xml.XMLEntityMappingsWriter.write(XMLEntityMappingsWriter.java:53)
    [junit]     at org.eclipse.persistence.internal.jpa.metadata.xml.XMLEntityMappingsWriter.write(XMLEntityMappingsWriter.java:41)
    [junit]     at org.eclipse.persistence.internal.jpa.metadata.xml.XMLEntityMappings.reloadXMLEntityMappingsObject(XMLEntityMappings.java:671)
    [junit]     at org.eclipse.persistence.internal.jpa.metadata.xml.XMLEntityMappings.reloadMappedSuperclass(XMLEntityMappings.java:653)
    [junit]     at org.eclipse.persistence.internal.jpa.metadata.ORMetadata.reloadMappedSuperclass(ORMetadata.java:365)
    [junit]     at org.eclipse.persistence.internal.jpa.metadata.accessors.classes.EntityAccessor.addPotentialMappedSuperclass(EntityAccessor.java:183)
    [junit]     at org.eclipse.persistence.internal.jpa.metadata.accessors.classes.EntityAccessor.discoverMappedSuperclassesAndInheritanceParents(EntityAccessor.java:273)
    [junit]     at org.eclipse.persistence.internal.jpa.metadata.accessors.classes.EntityAccessor.preProcess(EntityAccessor.java:549)
    [junit]     at org.eclipse.persistence.internal.jpa.metadata.MetadataProject.processStage1(MetadataProject.java:959)
    [junit]     at org.eclipse.persistence.internal.jpa.metadata.MetadataProcessor.processORMMetadata(MetadataProcessor.java:443)
    [junit]     at org.eclipse.persistence.internal.jpa.deployment.PersistenceUnitProcessor.processORMetadata(PersistenceUnitProcessor.java:297)
    [junit]     at org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl.predeploy(EntityManagerSetupImpl.java:834)
    [junit]     at org.eclipse.persistence.internal.jpa.deployment.JPAInitializer.callPredeploy(JPAInitializer.java:110)
    [junit]     at org.eclipse.persistence.internal.jpa.deployment.JPAInitializer.initPersistenceUnits(JPAInitializer.java:159)
    [junit]     at org.eclipse.persistence.internal.jpa.deployment.JPAInitializer.initialize(JPAInitializer.java:144)
    [junit] FATAL ERROR in native method: processing of -javaagent failed
    [junit]     at org.eclipse.persistence.internal.jpa.deployment.JavaSECMPInitializer.initializeFromAgent(JavaSECMPInitializer.java:145)
    [junit]     ... 12 more
    [junit] Exception in thread "main"
    [junit] Running org.eclipse.persistence.testing.tests.jpa.FullRegressionTestSuite
    [junit] Tests run: 1, Failures: 0, Errors: 1, Time elapsed: 0 sec
    [junit] Test org.eclipse.persistence.testing.tests.jpa.FullRegressionTestSuite FAILED (crashed)

generate-report:
-->   [delete] Deleting: c:\jdk1.6.0\jre\lib\jaxp.properties
-->     [copy] Copying 1 file to c:\jdk1.6.0\jre\lib
[junitreport] Processing C:\view_w34r1a\jpa\eclipselink.jpa.test\reports\TESTS-TestSuites.xml to C:\view_w34r1a\jpa\eclipselink.jpa.test\reports\junit-noframes.html
[junitreport] Loading stylesheet jar:file:/C:/opt/ant171/lib/ant-junit.jar!/org/apache/tools/ant/taskdefs/optional/junit/xsl/junit-noframes.xsl

BUILD FAILED
C:\view_w34r1a\build.xml:583: The following error occurred while executing this line:
C:\view_w34r1a\jpa\eclipselink.jpa.test\build.xml:513: The following error occurred while executing this line:
C:\view_w34r1a\jpa\eclipselink.jpa.test\build.xml:818: javax.xml.transform.TransformerFactoryConfigurationError: Provider org.apache.xalan.processor.TransformerFactoryImpl not found

Total time: 9 seconds
C:\view_w34r1a>



thank you
/michael
Comment 1 Michael OBrien CLA 2009-04-01 16:11:34 EDT
>This issue will not show up if your JAVA_HOME env variable is empty - you will end up with the following ineffective directory.
C:\view_w34r1f\${env.JAVA_HOME}\jre\lib
>and the log
   [delete] Deleting: C:\view_w34r1f\${env.JAVA_HOME}\jre\lib\jaxp.properties
>The script change needs to verify the JAVA_HOME variable before the delete/copy.
Comment 2 Kevin Yuan CLA 2009-04-09 15:35:44 EDT
Created attachment 131447 [details]
patch for the bug

Only JPA testing running on WAS and WLS need it's own jaxp.properties in order to generate test report. So add an additional generate-servertest-report target to treat the JPA server test, all other non-server test will not copy jaxp.properties any more.

Test: Run JPA testing both inside and outside container.

See rev 3912 for 2.0
      http://fisheye2.atlassian.com/changelog/eclipselink/?cs=3912
      and rev 3913 for 1.1.1      
http://fisheye2.atlassian.com/changelog/eclipselink/?cs=3913
Comment 3 Kevin Yuan CLA 2009-04-09 15:36:41 EDT
Fix on 2.0 and 1.1.1
Comment 4 Eclipse Webmaster CLA 2022-06-09 10:26:09 EDT
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink