Announcement Announcement Module
Collapse
No announcement yet.
java.lang.ClassCastException: weblogic.xml.jaxp.RegistryDocumentBuilderFactory Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • java.lang.ClassCastException: weblogic.xml.jaxp.RegistryDocumentBuilderFactory

    Get the following classcastexception on deploy of web application that uses spring bean configuration. Problem occurs in WL 9, did not occur in WL 8. WL 9 runs on Java 5, so I had to remove Xerces from my webapp's lib. Also deploys fine on Tomcat.

    Anybody out there been where I am, and solved the problem?

    [HTTP:101216]Servlet: "init" failed to preload on startup in Web application: "TBMCSAdapter.war". java.lang.ClassCastException: weblogic.xml.jaxp.RegistryDocumentBuilderFactory at javax.xml.parsers.DocumentBuilderFactory.newInstan ce()Ljavax.xml.parsers.DocumentBuilderFactory;(Unk nown Source) at org.springframework.beans.factory.xml.XmlBeanDefin itionReader.createDocumentBuilderFactory(XmlBeanDe finitionReader.java:250) at org.springframework.beans.factory.xml.XmlBeanDefin itionReader.doLoadBeanDefinitions(XmlBeanDefinitio nReader.java:217) at org.springframework.beans.factory.xml.XmlBeanDefin itionReader.loadBeanDefinitions(XmlBeanDefinitionR eader.java:173) at org.springframework.beans.factory.xml.XmlBeanDefin itionReader.loadBeanDefinitions(XmlBeanDefinitionR eader.java:148) at org.springframework.beans.factory.support.Abstract BeanDefinitionReader.loadBeanDefinitions(AbstractB eanDefinitionReader.java:126) at org.springframework.beans.factory.support.Abstract BeanDefinitionReader.loadBeanDefinitions(AbstractB eanDefinitionReader.java:142) at org.springframework.context.support.AbstractXmlApp licationContext.loadBeanDefinitions(AbstractXmlApp licationContext.java:113) at org.springframework.context.support.AbstractXmlApp licationContext.loadBeanDefinitions(AbstractXmlApp licationContext.java:81) at org.springframework.context.support.AbstractRefres hableApplicationContext.refreshBeanFactory(Abstrac tRefreshableApplicationContext.java:89) at org.springframework.context.support.AbstractApplic ationContext.refresh(AbstractApplicationContext.ja va:269) at org.springframework.context.support.ClassPathXmlAp plicationContext.<init>(ClassPathXmlApplicationCon text.java:87) at org.springframework.context.support.ClassPathXmlAp plicationContext.<init>(ClassPathXmlApplicationCon text.java:72) at org.springframework.context.support.ClassPathXmlAp plicationContext.<init>(ClassPathXmlApplicationCon text.java:63) at gov.jcre.adapter.util.ServicesManager.init(Service sManager.java:46) at gov.jcre.adapter.util.InitServlet.init(InitServlet .java:59) at javax.servlet.GenericServlet.init(GenericServlet.j ava:256) at weblogic.servlet.internal.StubSecurityHelper$Servl etInitAction.run(StubSecurityHelper.java:276) at weblogic.security.acl.internal.AuthenticatedSubjec t.doAs(AuthenticatedSubject.java:321) at weblogic.security.service.SecurityManager.runAs(Se curityManager.java:121) at weblogic.servlet.internal.StubSecurityHelper.creat eServlet(StubSecurityHelper.java:68) at weblogic.servlet.internal.StubLifecycleHelper.crea teOneInstance(StubLifecycleHelper.java:58) at weblogic.servlet.internal.StubLifecycleHelper.<ini t>(StubLifecycleHelper.java:48) at weblogic.servlet.internal.ServletStubImpl.prepareS ervlet(ServletStubImpl.java:493) at weblogic.servlet.internal.WebAppServletContext.pre loadServlet(WebAppServletContext.java:1688) at weblogic.servlet.internal.WebAppServletContext.loa dServletsOnStartup(WebAppServletContext.java:1665) at weblogic.servlet.internal.WebAppServletContext.pre loadResources(WebAppServletContext.java:1585) at weblogic.servlet.internal.WebAppServletContext.sta rt(WebAppServletContext.java:2678) at weblogic.servlet.internal.WebAppModule.startContex ts(WebAppModule.java:874) at weblogic.servlet.internal.WebAppModule.start(WebAp pModule.java:326) at weblogic.application.internal.flow.ModuleListenerI nvoker.start(ModuleListenerInvoker.java:114)

  • #2
    Possible Solution

    Hi,

    I was facing the exact same problem, but on different versions of WebLogic 8.1 (sp3 and sp4).

    We were building our .war artifact with maven2 and it was adding a xml-beans-1.xb2 to the lib directory. We modified the pom so it does not include that jar file with the following:

    <dependency>
    <groupId>xml-apis</groupId>
    <artifactId>xml-apis</artifactId>
    <version>1.0.b2</version>
    <scope>provided</scope>
    </dependency>

    Now it is working fine.
    Our project was also using weblogic.xml to specify that the web-inf classes should be first in the classpath than weblogic's ones

    Hope this helps to anobody else out there.

    Best Regards,
    Andrés Bernasconi.

    Comment


    • #3
      Hi,
      I was having the same problem with Weblogic 10.3 and this solution worked perfectly.

      Thanks a lot for your help.

      Comment


      • #4
        I'm Glad!

        It's incredible the reach of even old forums. 3 years later and this info was useful to somebody...who would have known.

        Regards and good luck
        AB

        Comment


        • #5
          Thank you very much. Helped me out 4 years later

          Comment


          • #6
            Originally posted by Priit View Post
            Thank you very much. Helped me out 4 years later
            Yes, me too, 7 years later :-) Thanks!

            Comment


            • #7
              Thanks a ton
              Sotretus
              .. it helped me too 7 years later

              Comment


              • #8
                Thanks a ton Sotretus.. it helped me too 7 years later

                Comment


                • #9
                  Thanks a ton, it helped me too 7 years later

                  Comment

                  Working...
                  X