This discussion is archived
1 Reply Latest reply: Jan 11, 2010 7:25 AM by 652974 RSS

How to change the defaut xmlparser on OC4J Standalone 10.1.3.4 for Spring 3

652974 Newbie
Currently Being Moderated
Hi All

I am trying to use OC4J 10.1.3.4 standalone with Spring 3.0 but I keep getting the error
nested exception is oracle.xml.parser.schema.XSDException: Duplicated definition for: 'identifiedType'
It worked fine when I was using Spring 2.5.6

I have tried to change the parser as described here (http://www.oracle.com/technology/tech/java/oc4j/1013/how_to/how-to-swapxmlparser/doc/readme.html). This is not quite ideal as I want to change the parser for the whole server and not just one application and besides, If I cant start the server, I will not be able to change the parser for an application anyway. I say this because the default xml parser (xmlparserV2.jar) throws an exeception if you try to use it with Spring 3.0 i.e.
nested exception is oracle.xml.parser.schema.XSDException: Duplicated definition for: 'identifiedType'
I have had a look on them Oracle Forums(How can I use a 3rd party XML parser such as xerces with OC4J ? and Spring forums and appararently you have to change the XML parser (because the oracle xml parser is buggy!!) by puting the Xerces parser(or any other parser for that matter) on the classpath and then using the following switch
java -Djavax.xml.parsers.SAXParserFactory=org.apache.xerces.jaxp.SAXParserFactoryImpl -Xbootclasspath/a:C:\Miscellaneous\xercesImpl.jar -jar oc4j.jar
However, when I try and start OC4J, I get the following error and I have no idea how to solve this. I have been at this for a couple of weeks but I still not getting any joy.
[Fatal Error] :-1:-1: Premature end of file.
2010-01-07 10:29:06.881 ERROR J2EE JCA-01006 Error initializing an ApplicationConnectionManager - ConnectorArchive and Application cannot be null
2010-01-07 10:29:06.881 ERROR J2EE JCA-01004 {0}
2010-01-07 10:29:06.881 WARNING J2EE JCA-01013 Error (Error setting JavaBean property 'managedDataSourceConfigXML' for ManagedConnectionFactory class 'oracle.oc4j.sql.spi.ManagedConnectionFactoryImpl for standalone resource adapter 'Oracle JDBC Resource Adapter'. Exception is: java.lang.reflect.InvocationTargetException) while setting up RA for MCF (oracle.oc4j.sql.spi.ManagedConnectionFactoryImpl) for standalone resource adapter 'Oracle JDBC Resource Adapter'
2010-01-07 10:29:06.881 ERROR J2EE OJR-00105 Exception creating Managed DataSource ConnectorPropertySet.  Exception: Error setting up resource adapter for standalone resource adapter 'Oracle JDBC Resource Adapter'. ManagedConnectionFactory implementation class 'oracle.oc4j.sql.spi.ManagedConnectionFactoryImpl' cannot be set up: Error setting JavaBean property 'managedDataSourceConfigXML' for ManagedConnectionFactory class 'oracle.oc4j.sql.spi.ManagedConnectionFactoryImpl for standalone resource adapter 'Oracle JDBC Resource Adapter'. Exception is: java.lang.reflect.InvocationTargetException 
10/01/07 10:29:06 SEVERE: ApplicationStateRunning.initConnector Error occurred initializing connectors.  Exception is: Exception creating Managed DataSource ConnectorPropertySet.  Exception: Error setting up resource adapter for standalone resource adapter 'Oracle JDBC Resource Adapter'. ManagedConnectionFactory implementation class 'oracle.oc4j.sql.spi.ManagedConnectionFactoryImpl' cannot be set up: Error setting JavaBean property 'managedDataSourceConfigXML' for ManagedConnectionFactory class 'oracle.oc4j.sql.spi.ManagedConnectionFactoryImpl for standalone resource adapter 'Oracle JDBC Resource Adapter'. Exception is: java.lang.reflect.InvocationTargetException 
10/01/07 10:29:06 SEVERE: ApplicationStateRunning.initConnector Stack trace: oracle.oc4j.sql.DataSourceException: Exception creating Managed DataSource ConnectorPropertySet.  Exception: Error setting up resource adapter for standalone resource adapter 'Oracle JDBC Resource Adapter'. ManagedConnectionFactory implementation class 'oracle.oc4j.sql.spi.ManagedConnectionFactoryImpl' cannot be set up: Error setting JavaBean property 'managedDataSourceConfigXML' for ManagedConnectionFactory class 'oracle.oc4j.sql.spi.ManagedConnectionFactoryImpl for standalone resource adapter 'Oracle JDBC Resource Adapter'. Exception is: java.lang.reflect.InvocationTargetException 
     at com.evermind.server.ApplicationStateRunning.addConnectionFactory(ApplicationStateRunning.java:1623)
     at com.evermind.server.ApplicationStateRunning.initManagedDataSource(ApplicationStateRunning.java:1573)
     at com.evermind.server.ApplicationStateRunning.initDataSourceConnector(ApplicationStateRunning.java:2042)
     at com.evermind.server.ApplicationStateRunning.initConnector(ApplicationStateRunning.java:1287)
     at com.evermind.server.ApplicationStateRunning.initConnectors(ApplicationStateRunning.java:362)
     at com.evermind.server.ApplicationStateRunning.initializeApplication(ApplicationStateRunning.java:220)
     at com.evermind.server.Application.setConfig(Application.java:454)
     at com.evermind.server.Application.setConfig(Application.java:355)
     at com.evermind.server.ApplicationServer.initializeDefaultApplication(ApplicationServer.java:1603)
     at com.evermind.server.ApplicationServer.initializeAutoDeployedApplications(ApplicationServer.java:1586)
     at com.evermind.server.ApplicationServer.setConfig(ApplicationServer.java:1018)
     at com.evermind.server.ApplicationServerLauncher.run(ApplicationServerLauncher.java:131)
     at java.lang.Thread.run(Thread.java:595)
Caused by: java.lang.InstantiationException: Error setting up resource adapter for standalone resource adapter 'Oracle JDBC Resource Adapter'. ManagedConnectionFactory implementation class 'oracle.oc4j.sql.spi.ManagedConnectionFactoryImpl' cannot be set up: Error setting JavaBean property 'managedDataSourceConfigXML' for ManagedConnectionFactory class 'oracle.oc4j.sql.spi.ManagedConnectionFactoryImpl for standalone resource adapter 'Oracle JDBC Resource Adapter'. Exception is: java.lang.reflect.InvocationTargetException
     at com.evermind.server.connector.ApplicationConnectionManager.initOutbound(ApplicationConnectionManager.java:909)
     at com.evermind.server.connector.ApplicationConnectionManager.init(ApplicationConnectionManager.java:314)
     at com.evermind.server.connector.deployment.ConnectorArchive.createConnectionManager(ConnectorArchive.java:1178)
     at com.evermind.server.connector.deployment.ConnectorArchive.addConnectionFactory(ConnectorArchive.java:662)
     at com.evermind.server.ApplicationStateRunning.addConnectionFactory(ApplicationStateRunning.java:1616)
     ... 12 more

10/01/07 10:29:06 WARNING: Application.setConfig Application: default is in failed state as initialization failed. 
java.lang.InstantiationException: Error occurred initializing connectors.  Exception is: Exception creating Managed DataSource ConnectorPropertySet.  Exception: Error setting up resource adapter for standalone resource adapter 'Oracle JDBC Resource Adapter'. ManagedConnectionFactory implementation class 'oracle.oc4j.sql.spi.ManagedConnectionFactoryImpl' cannot be set up: Error setting JavaBean property 'managedDataSourceConfigXML' for ManagedConnectionFactory class 'oracle.oc4j.sql.spi.ManagedConnectionFactoryImpl for standalone resource adapter 'Oracle JDBC Resource Adapter'. Exception is: java.lang.reflect.InvocationTargetException 
10/01/07 10:29:06 Error initializing server: Application: default is in failed state as initialization failed
10/01/07 10:29:07 Fatal error: server exiting
Can anyone help or show me how to change the xml parser please ?

Thanks in advance!!
  • 1. Re: How to change the defaut xmlparser on OC4J Standalone 10.1.3.4 for Spring 3
    652974 Newbie
    Currently Being Moderated
    Hi All,

    I have found a way to change the xml parser for my application and NOT the xml parser for the server. I followed the instructions here http://www.oracle.com/technology/tech/java/oc4j/1013/how_to/how-to-swapxmlparser/doc/readme.html. In the end, I had to settle for changing the xml parser of my application(i.e. It uses its a custom parser e.g. xerces not the default OC4J parser i.e. xmlparserV2) and not the xml parser for OC4J because it was near impossible to change the xml parser for OC4J and besides, as the OC4J default parser(xmlparserV2) works well with the server and not my application, it made more sense to change the parser for my application (changed to Xerces) and not OC4J. Hope this helps someone else who may come across a similar problem.

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points