Announcement Announcement Module
Collapse
No announcement yet.
Weblogic classpath problems preventing schema-based configuration to work Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Weblogic classpath problems preventing schema-based configuration to work

    I'm starting this thread to see if I can catch any attention from you guys towards my problem.

    There seems to be a jar in my WEB-INF/lib that is preventing the correct parsing of the app context files when starting a web application context, but only when I try to deploy my webapp in expanded mode. I need to deploy it in an expanded war because we're using Adobe Flex 1.5. This app worked perfectly in the same environment when we used Spring 1.2.x., and started to have problems when migrating to Spring 2.0.1.

    Please note that this problem isn't due to Spring 1.2.x and Spring 2.0.1 jars living in the same classpath. The nature of my issue is different from those already posted, although the same exception is thrown. Also note that I'm using schema-based Spring configuration.

    These are the contents of my WEB-INF/lib dir so you guys can help me detecting if some jar is causing the deployment to fail. Note that the snapshots versions are not frameworks, but application code.

    Code:
    12/01/2007  12:45 p.m.           444,689 antlr-2.7.6rc1.jar
    12/01/2007  12:45 p.m.             4,467 aopalliance-1.0.jar
    12/01/2007  12:45 p.m.            26,361 asm-1.5.3.jar
    12/01/2007  12:45 p.m.            16,757 asm-attrs-1.5.3.jar
    12/01/2007  12:45 p.m.           115,002 aspectjrt-1.5.2a.jar
    12/01/2007  12:45 p.m.         1,896,338 aspectjweaver-1.5.2a.jar
    12/01/2007  12:45 p.m.           434,186 authagent-5.0.3.jar
    12/01/2007  12:45 p.m.            63,966 avalon-framework-4.1.3.jar
    12/01/2007  12:45 p.m.            13,374 base-core-2.0.1.jar
    12/01/2007  12:45 p.m.           912,523 bcprov-jdk14-124.jar
    12/01/2007  12:45 p.m.            82,003 beanlib-3.2.1.jar
    12/01/2007  12:45 p.m.           282,338 cglib-2.1_3.jar
    12/01/2007  12:45 p.m.            46,725 commons-codec-1.3.jar
    12/01/2007  12:45 p.m.           175,426 commons-collections-2.1.1.jar
    12/01/2007  12:45 p.m.           207,723 commons-lang-2.1.jar
    12/01/2007  12:45 p.m.            52,915 commons-logging-1.1.jar
    12/01/2007  12:45 p.m.            26,202 commons-logging-api-1.0.4.jar
    12/01/2007  12:45 p.m.           313,898 dom4j-1.6.1.jar
    12/01/2007  12:45 p.m.            47,531 ehcache-1.1.jar
    12/01/2007  12:45 p.m.         1,971,632 hibernate-3.1.3.jar
    12/01/2007  12:45 p.m.           308,641 jcaptcha-all-1.0-RC-2.0.1.jar
    12/01/2007  12:45 p.m.            20,682 jstl-1.1.2.jar
    12/01/2007  12:45 p.m.             8,812 jta-1.0.1B.jar
    12/01/2007  12:45 p.m.           121,070 junit-3.8.1.jar
    12/01/2007  12:45 p.m.           352,291 log4j-1.2.9.jar
    12/01/2007  12:45 p.m.            72,150 logkit-1.0.1.jar
    12/01/2007  12:45 p.m.            11,178 seguridad-api-1.3-SNAPSHOT.jar
    12/01/2007  12:45 p.m.           138,402 seguridad-core-1.3-SNAPSHOT.jar
    12/01/2007  12:45 p.m.            11,537 seguridad-ejb-1.3-SNAPSHOT.jar
    12/01/2007  12:45 p.m.            92,161 seguridad-modelo-1.3-SNAPSHOT.jar
    12/01/2007  12:45 p.m.            77,977 servlet-api-2.3.jar
    12/01/2007  12:45 p.m.         2,568,189 spring-2.0.1.jar
    12/01/2007  12:45 p.m.            75,421 spring-ldap-1.1.jar
    12/01/2007  12:45 p.m.           393,259 standard-1.1.2.jar
    12/01/2007  12:45 p.m.             7,243 utils-3.5.0.jar
    12/01/2007  12:45 p.m.           261,710 xstream-1.1.3.jar
    And this is the exception thrown:

    Code:
    org.xml.sax.SAXParseException: Document root element "beans", must match DOCTYPE
     root "null".
            at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAX
    ParseException(ErrorHandlerWrapper.java:236)
            at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.error(Err
    orHandlerWrapper.java:172)
            at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(
    XMLErrorReporter.java:382)
            at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(
    XMLErrorReporter.java:316)
            at com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDValidator.rootEleme
    ntSpecified(XMLDTDValidator.java:1652)
            at com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDValidator.handleSta
    rtElement(XMLDTDValidator.java:1931)
            at com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDValidator.startElem
    ent(XMLDTDValidator.java:795)
            at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImp
    l.scanStartElement(XMLDocumentFragmentScannerImpl.java:878)
            at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$Conten
    tDispatcher.scanRootElementHook(XMLDocumentScannerImpl.java:1157)
            at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImp
    l$FragmentContentDispatcher.dispatch(XMLDocumentFragmentScannerImpl.java:1794)
            at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImp
    l.scanDocument(XMLDocumentFragmentScannerImpl.java:368)
            at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(X
    ML11Configuration.java:834)
            at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(X
    ML11Configuration.java:764)
            at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.
    java:148)
            at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.
    java:250)
            at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(Doc
    umentBuilderImpl.java:292)
            at weblogic.xml.jaxp.RegistryDocumentBuilder.parse(RegistryDocumentBuild
    er.java:150)
            at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadB
    eanDefinitions(XmlBeanDefinitionReader.java:222)
            at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBea
    nDefinitions(XmlBeanDefinitionReader.java:173)
            at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBea
    nDefinitions(XmlBeanDefinitionReader.java:148)
            at org.springframework.beans.factory.support.AbstractBeanDefinitionReade
    r.loadBeanDefinitions(AbstractBeanDefinitionReader.java:128)
            at org.springframework.beans.factory.support.AbstractBeanDefinitionReade
    r.loadBeanDefinitions(AbstractBeanDefinitionReader.java:144)
            at org.springframework.web.context.support.XmlWebApplicationContext.load
    BeanDefinitions(XmlWebApplicationContext.java:126)
            at org.springframework.web.context.support.XmlWebApplicationContext.load
    BeanDefinitions(XmlWebApplicationContext.java:94)
            at org.springframework.context.support.AbstractRefreshableApplicationCon
    text.refreshBeanFactory(AbstractRefreshableApplicationContext.java:89)
            at org.springframework.context.support.AbstractApplicationContext.refres
    h(AbstractApplicationContext.java:262)
    Please help, this is a production issue, and we definitely will not go back to Spring 1.2.x!!!

    J.

  • #2
    You might try placing an updated version of Xerces in your lib folder; presently, the built-in sun version (as identified by com.sun.org.apache.xerces.) is being used - we have had schema parsing issues with this in the past.

    However, this doesn't explain why you get different behaviour between exploded & packaged deployments...

    Comment


    • #3
      Please note that this problem isn't due to Spring 1.2.x and Spring 2.0.1 jars living in the same classpath. The nature of my issue is different from those already posted, although the same exception is thrown. Also note that I'm using schema-based Spring configuration.
      Could you provide some information to back-up this assertion? This precise problem has been reportedly caused by mixing Spring 1.x and 2.x jars (here).

      Comment


      • #4
        What version?

        Thanks for the reply,

        What version of Xerces are you suggesting? I've tried to place xerces-2.4.0.jar, but I do not know if any other jar is required (such as xercesImpl, xmlParserAPIs, etc.).

        J.

        Comment


        • #5
          I have one app in front of me with xerces 2.7.1 (xerces.jar, xml-apis.jar).

          Comment


          • #6
            Evidence of Spring 1.2.x and Spring 2.0.x jars not being mixed

            Thanks for you reply.

            Originally posted by Chris Lee View Post
            Could you provide some information to back-up this assertion? This precise problem has been reportedly caused by mixing Spring 1.x and 2.x jars (here).
            Evidence for my assertion is shown in the list I posted with the contents of my WEB-INF/lib dir. As you will see, no Spring 1.2.x jar is displayed there.

            If you need any stronger evidence, please let me know so I can post it.

            J.

            Comment


            • #7
              Well, that'll about do it I had mis-read your original post as stating that you did have both.

              Comment


              • #8
                Updating Xerces to no avail

                Originally posted by Chris Lee View Post
                I have one app in front of me with xerces 2.7.1 (xerces.jar, xml-apis.jar).
                I updated the xerces jars on my app. classpath with the version you specified, and with newer ones, and it keeps giving me the same error. Any other ideas?

                If you're willing to embark on further testing, I'd be happy to send a package with all the jars specified in my previous post (save perhaps for the ones containing our application classes).

                Comment


                • #9
                  Glad to help, though won't likely have time to reproduce your environment.

                  A few additional comments:

                  1) If the exception you are getting with Xerces on the classpath is the same, then it is possible that your XML parser is resolved elsewhere (essentially ignoring the updated version).
                  2) Is it possible that there is an XML error in one of the Spring context files - that it is actually missing the DOCTYPE? You had mentioned using the schema, so this is unlikely.
                  3) From the stack trace, it looks like the weblogic-provided XML parser is being used (weblogic.xml.jaxp.RegistryDocumentBuilder); there are some references (here) around changing this; not sure with Weblogic how you can have your app use one library without affecting the app server itself.

                  It looks like you're one the right track with upgrading the XML parser - just need to figure out how to get the new version loaded for your app.

                  Comment


                  • #10
                    This WebLogic FAQ may be worth a read.

                    Comment

                    Working...
                    X