Announcement Announcement Module
Collapse
No announcement yet.
1.5 M1: Tutorial App: java.lang.LinkageError: loader constraints violated when linkin Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • 1.5 M1: Tutorial App: java.lang.LinkageError: loader constraints violated when linkin

    All,

    I am receiving the following error when trying to run the tutorial application on WLS 9.2.

    java.lang.LinkageError: loader constraints violated when linking javax/xml/namespace/NamespaceContext class
    at org.springframework.xml.xpath.Jaxp13XPathExpressio nFactory.createXPathExpression(Jaxp13XPathExpressi onFactory.java:80)
    at org.springframework.xml.xpath.XPathExpressionFacto ry.createXPathExpression(XPathExpressionFactory.ja va:86)
    at org.springframework.ws.transport.http.WsdlDefiniti onHandlerAdapter.afterPropertiesSet(WsdlDefinition HandlerAdapter.java:142)
    at org.springframework.ws.transport.http.MessageDispa tcherServlet.initWsdlDefinitionHandlerAdapter(Mess ageDispatcherServlet.java:288)
    at org.springframework.ws.transport.http.MessageDispa tcherServlet.initFrameworkServlet(MessageDispatche rServlet.java:203)
    at org.springframework.web.servlet.FrameworkServlet.i nitServletBean(FrameworkServlet.java:237)
    at org.springframework.web.servlet.HttpServletBean.in it(HttpServletBean.java:126)
    at javax.servlet.GenericServlet.init(GenericServlet.j ava:256)
    at weblogic.servlet.internal.StubSecurityHelper$Servl etInitAction.run(StubSecurityHelper.java:278)
    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:64)
    at weblogic.servlet.internal.StubLifecycleHelper.crea teOneInstance(StubLifecycleHelper.java:58)
    at weblogic.servlet.internal.StubLifecycleHelper.(Stu bLifecycleHelper.java:48)
    at weblogic.servlet.internal.ServletStubImpl.prepareS ervlet(ServletStubImpl.java:507)
    at weblogic.servlet.internal.ServletStubImpl.execute( ServletStubImpl.java:235)
    at weblogic.servlet.internal.ServletStubImpl.execute( ServletStubImpl.java:175)
    at weblogic.servlet.internal.WebAppServletContext$Ser vletInvocationAction.run(WebAppServletContext.java :3231)
    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.WebAppServletContext.sec uredExecute(WebAppServletContext.java:2002)
    at weblogic.servlet.internal.WebAppServletContext.exe cute(WebAppServletContext.java:1908)
    at weblogic.servlet.internal.ServletRequestImpl.run(S ervletRequestImpl.java:1362)
    at weblogic.work.ExecuteThread.execute(ExecuteThread. java:209)
    at weblogic.work.ExecuteThread.run(ExecuteThread.java :181)


    I have configured the application as an Ear and followed the recommendations made in earlier threads (class loader filtering, prefer web-inf classes, drop the saaj 1.3 jars etc).

    Any ideas what this might be?

  • #2
    More information:

    I am sure this a version conflict of some sort. Here is more detailed information:

    The Exception:
    Code:
    java.lang.LinkageError: loader constraints violated when linking javax/xml/namespace/NamespaceContext class
    	at org.springframework.xml.xpath.Jaxp13XPathExpressionFactory.createXPathExpression(Jaxp13XPathExpressionFactory.java:80)
    	at org.springframework.xml.xpath.XPathExpressionFactory.createXPathExpression(XPathExpressionFactory.java:86)
    	at org.springframework.ws.transport.http.WsdlDefinitionHandlerAdapter.afterPropertiesSet(WsdlDefinitionHandlerAdapter.java:142)
    	at org.springframework.ws.transport.http.MessageDispatcherServlet.initWsdlDefinitionHandlerAdapter(MessageDispatcherServlet.java:288)
    	at org.springframework.ws.transport.http.MessageDispatcherServlet.initFrameworkServlet(MessageDispatcherServlet.java:203)
    	at org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:237)
    	at org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:126)
    	at javax.servlet.GenericServlet.init(GenericServlet.java:256)
    	at weblogic.servlet.internal.StubSecurityHelper$ServletInitAction.run(StubSecurityHelper.java:278)
    	at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
    	at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
    	at weblogic.servlet.internal.StubSecurityHelper.createServlet(StubSecurityHelper.java:64)
    	at weblogic.servlet.internal.StubLifecycleHelper.createOneInstance(StubLifecycleHelper.java:58)
    	at weblogic.servlet.internal.StubLifecycleHelper.(StubLifecycleHelper.java:48)
    	at weblogic.servlet.internal.ServletStubImpl.prepareServlet(ServletStubImpl.java:507)
    	at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:235)
    	at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:175)
    	at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3231)
    	at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
    	at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
    	at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2002)
    	at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:1908)
    	at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1362)
    	at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
    	at weblogic.work.ExecuteThread.run(ExecuteThread.java:181)
    Here is the weblogic-application.xml file:
    Code:
    <?xml version='1.0' encoding='UTF-8'?>
    <weblogic-application xmlns="http://www.bea.com/ns/weblogic/90" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
        <application-param>
            <param-name>webapp.encoding.default</param-name>
            <param-value>UTF-8</param-value>
        </application-param>
        
        <!--
         Don't load the JSR-181 packages from the system classloader.  Instead,
         The application classloader will provide the javax.jws.* packages     
        -->    
        <prefer-application-packages>
            <package-name>javax.jws.*</package-name>
        </prefer-application-packages>
    </weblogic-application>
    Here is the weblogic.xml file:
    Code:
    <?xml version='1.0' encoding='UTF-8'?>
    <weblogic-web-app xmlns="http://www.bea.com/ns/weblogic/90" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
        <container-descriptor>
            <prefer-web-inf-classes>true</prefer-web-inf-classes>
        </container-descriptor>
    </weblogic-web-app>

    Comment


    • #3
      Tried Axiom, still does not work

      All,

      I tried Axiom thinking that this was some sort of SAAJ problem. Here is what I did (in addition to the above):

      Jar files in classpath

      Code:
      activation-1.1.1.jar
      aopalliance-1.0.jar
      axiom-api-1.2.5.jar
      axiom-impl-1.2.5.jar
      commons-logging-1.1.1.jar
      jaxen-1.1.1.jar
      jdom-1.0.jar
      log4j-1.2.15.jar
      mail-1.4.1.jar
      spring-aop-2.0.7.jar
      spring-beans-2.0.7.jar
      spring-context-2.0.7.jar
      spring-core-2.0.7.jar
      spring-oxm-1.5.0-m1.jar
      spring-web-2.0.7.jar
      spring-webmvc-2.0.7.jar
      spring-ws-core-1.5.0-m1.jar
      spring-xml-1.5.0-m1.jar
      stax-api-1.0.1.jar
      wsdl4j-1.6.1.jar
      wstx-asl-3.2.3.jar
      Here is the message factory I am using:

      Code:
          <bean id="messageFactory" class="mycustom.WoodstoxEnabledAxiomSoapMessageFactory">
              <property name="payloadCaching" value="true"/>
          </bean>
      Here is the source for the above message factory (Found on another post on this forum):

      Code:
      package mycustom;
      
      import org.springframework.ws.soap.axiom.AxiomSoapMessageFactory;
      
      public class WoodstoxEnabledAxiomSoapMessageFactory extends AxiomSoapMessageFactory {
      
      	static {
      		System.setProperty("javax.xml.stream.XMLInputFactory", "com.ctc.wstx.stax.WstxInputFactory");
      		System.setProperty("javax.xml.stream.XMLOutputFactory", "com.ctc.wstx.stax.WstxOutputFactory");
      		System.setProperty("javax.xml.stream.XMLEventFactory", "com.ctc.wstx.stax.WstxEventFactory");
      	}
      
      	public WoodstoxEnabledAxiomSoapMessageFactory() {
      		super();
      	}
      	
      }
      Here is the stack trace I am still receiving:
      Code:
      java.lang.LinkageError: loader constraints violated when linking javax/xml/namespace/NamespaceContext class
      	at org.springframework.xml.xpath.Jaxp13XPathExpressionFactory.createXPathExpression(Jaxp13XPathExpressionFactory.java:80)
      	at org.springframework.xml.xpath.XPathExpressionFactory.createXPathExpression(XPathExpressionFactory.java:86)
      	at org.springframework.ws.transport.http.WsdlDefinitionHandlerAdapter.afterPropertiesSet(WsdlDefinitionHandlerAdapter.java:142)
      	at org.springframework.ws.transport.http.MessageDispatcherServlet.initWsdlDefinitionHandlerAdapter(MessageDispatcherServlet.java:288)
      	at org.springframework.ws.transport.http.MessageDispatcherServlet.initFrameworkServlet(MessageDispatcherServlet.java:203)
      	at org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:237)
      	at org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:126)
      	at javax.servlet.GenericServlet.init(GenericServlet.java:256)
      	at weblogic.servlet.internal.StubSecurityHelper$ServletInitAction.run(StubSecurityHelper.java:278)
      	at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
      	at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
      	at weblogic.servlet.internal.StubSecurityHelper.createServlet(StubSecurityHelper.java:64)
      	at weblogic.servlet.internal.StubLifecycleHelper.createOneInstance(StubLifecycleHelper.java:58)
      	at weblogic.servlet.internal.StubLifecycleHelper.(StubLifecycleHelper.java:48)
      	at weblogic.servlet.internal.ServletStubImpl.prepareServlet(ServletStubImpl.java:507)
      	at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:235)
      	at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:175)
      	at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3231)
      	at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
      	at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
      	at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2002)
      	at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:1908)
      	at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1362)
      	at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
      	at weblogic.work.ExecuteThread.run(ExecuteThread.java:181)
      Here is the output from the log:

      Code:
      2007-12-18 08:09:40,681 DEBUG [org.springframework.ws.transport.http.MessageDispatcherServlet] - Initializing servlet 'spring-ws'
      2007-12-18 08:09:40,744 INFO [org.springframework.ws.transport.http.MessageDispatcherServlet] - FrameworkServlet 'spring-ws': initialization started
      2007-12-18 08:09:40,744 DEBUG [org.springframework.ws.transport.http.MessageDispatcherServlet] - Servlet with name 'spring-ws' will try to create custom WebApplicationContext context of class 'org.springframework.web.context.support.XmlWebApplicationContext', using parent context [null]
      2007-12-18 08:09:41,306 DEBUG [org.springframework.ws.server.endpoint.mapping.PayloadRootQNameEndpointMapping] - Mapped key [{http://mycompany.com/hr/schemas}HolidayRequest] onto endpoint [com.mycompany.hr.ws.HolidayEndpoint@162f58e]
      2007-12-18 08:09:41,619 INFO [org.springframework.ws.soap.axiom.AxiomSoapMessageFactory] - Enabled payload caching
      2007-12-18 08:09:41,619 DEBUG [org.springframework.ws.transport.http.MessageDispatcherServlet] - Published WebApplicationContext of servlet 'spring-ws' as ServletContext attribute with name [org.springframework.web.servlet.FrameworkServlet.CONTEXT.spring-ws]
      <Dec 18, 2007 8:09:41 AM EST> <Error> <HTTP> <BEA-101017> <[weblogic.servlet.internal.WebAppServletContext@6196fc - appName: 'tutorialEar', name: 'tutorial', context-path: '/tutorial'] Root cause of ServletException.
      java.lang.LinkageError: loader constraints violated when linking javax/xml/namespace/NamespaceContext class
              at org.springframework.xml.xpath.Jaxp13XPathExpressionFactory.createXPathExpression(Jaxp13XPathExpressionFactory.java:80)
              at org.springframework.xml.xpath.XPathExpressionFactory.createXPathExpression(XPathExpressionFactory.java:86)
              at org.springframework.ws.transport.http.WsdlDefinitionHandlerAdapter.afterPropertiesSet(WsdlDefinitionHandlerAdapter.java:142)
              at org.springframework.ws.transport.http.MessageDispatcherServlet.initWsdlDefinitionHandlerAdapter(MessageDispatcherServlet.java:288)
              at org.springframework.ws.transport.http.MessageDispatcherServlet.initFrameworkServlet(MessageDispatcherServlet.java:203)
              Truncated. see log file for complete stacktrace
      >

      Comment


      • #4
        Solved

        My problem was solved by adding the following jars to the WEB-INF/lib directory:

        xalan-2.7.0.jar
        xercesImpl-2.8.1.jar
        xml-apis-1.3.04.jar

        In addition, the application does work without needing to package it as an ear. Adding custom filters to the weblogic-application.xml does not appear to be needed. I will attempt to override the SAAJ version and let you know my findings...

        Comment

        Working...
        X