3 Replies Latest reply on Apr 1, 2009 10:33 PM by 694126

    oc4j + xerces

    633629
      I'm trying to deploy a struts 2 application in oc4j 10.1.3.4 Standard and I´m receiving the following error:

      JspServlet: unable to dispatch to requested page: Exception:java.lang.ClassCastException: org.apache.xerces.jaxp.SAXParserFactoryImpl

      Some people told me to put some jar files in <ORACLE_HOME>/jdk/jre/lib

      Those jars are :
      xalan-2.6.0.jar
      xerces-2.4.0.jar
      xercesImpl-2.8.1.jar
      xmlParserAPIs-2.6.2.jar

      But after I´ve copied thos dependencies my app deployment process gets the following error :

      Caught exception while loading file struts-default.xml - [unknown location]
      at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loadConfigurationFiles(XmlConfigurationProvider.java:839)
      at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loadDocuments(XmlConfigurationProvider.java:131)
      at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.init(XmlConfigurationProvider.java:100)
      at com.opensymphony.xwork2.config.impl.DefaultConfiguration.reload(DefaultConfiguration.java:130)
      at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:52)
      at org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(Dispatcher.java:395)
      at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:452)
      at org.apache.struts2.dispatcher.FilterDispatcher.init(FilterDispatcher.java:201)
      at com.evermind[Oracle Containers for J2EE 10g (10.1.3.4.0) ].server.http.HttpApplication.getFilterConfig(HttpApplication.java:7592)
      at com.evermind[Oracle Containers for J2EE 10g (10.1.3.4.0) ].server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:515)
      at com.evermind[Oracle Containers for J2EE 10g (10.1.3.4.0) ].server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:370)
      at com.evermind[Oracle Containers for J2EE 10g (10.1.3.4.0) ].server.http.HttpRequestHandler.doProcessRequest(HttpRequestHandler.java:871)
      at com.evermind[Oracle Containers for J2EE 10g (10.1.3.4.0) ].server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:453)
      at com.evermind[Oracle Containers for J2EE 10g (10.1.3.4.0) ].server.http.AJPRequestHandler.run(AJPRequestHandler.java:313)
      at com.evermind[Oracle Containers for J2EE 10g (10.1.3.4.0) ].server.http.AJPRequestHandler.run(AJPRequestHandler.java:199)
      at oracle.oc4j.network.ServerSocketReadHandler$SafeRunnable.run(ServerSocketReadHandler.java:260)
      at oracle.oc4j.network.ServerSocketAcceptHandler.procClientSocket(ServerSocketAcceptHandler.java:234)
      at oracle.oc4j.network.ServerSocketAcceptHandler.access$700(ServerSocketAcceptHandler.java:29)
      at oracle.oc4j.network.ServerSocketAcceptHandler$AcceptHandlerHorse.run(ServerSocketAcceptHandler.java:879)
      at com.evermind[Oracle Containers for J2EE 10g (10.1.3.4.0)

      ].util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:303)
      at java.lang.Thread.run(Thread.java:595)
      Caused by: java.lang.ClassCastException: org.apache.xerces.jaxp.SAXParserFactoryImpl
      at javax.xml.parsers.SAXParserFactory.newInstance(Unknown Source)
      at com.opensymphony.xwork2.util.DomHelper.parse(DomHelper.java:101)
      at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loadConfigurationFiles(XmlConfigurationProvider.java:830)
        • 1. Re: oc4j + xerces
          codealchemist
          Greetings,
          Since the error is a Class Cast Exception, look for a place in your code where you may have run afoul of the rules for casting data types say, an Integer as a String.
          -Michael
          • 2. Re: oc4j + xerces
            Steve Button-Oracle
            If you must use Xerces, then you need to configure it as a shared-library so that is it visible to the application. This is covered in the documentation and as a how-to on OTN.

            Dropping these libs into that directory won't really help you much and is what is causing the problem. Make sure you remove them.

            -steve-
            • 3. Re: oc4j + xerces
              694126
              Hi Steve,

              I have a problem with some shared-libraries, the problem is that my application logging doesn't work, the page redirect to itself, please see this forum

              Re: OC4J and RichFaces 10.1.3.1

              I change the orion-application.xml adding this lines:

              <imported-shared-libraries>
              <remove-inherited name="oracle.toplink"/>
              <remove-inherited name="oracle.xml"/>
              <remove-inherited name="oracle.xml.security"/>
              </imported-shared-libraries>

              but it doesn't work, is still redirect to itself, staying in a loop.

              This problem occurs with all OC4J versions after 10.1.3.0, please, can you tell me how to solve this?

              Regards, Erick