Announcement Announcement Module
Collapse
No announcement yet.
Linkage problem when using jetty 6 plugin. Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Linkage problem when using jetty 6 plugin.

    I am attempting to use Spring WS with a predefined wsdl. When using jetty to test my application with SOAP UI. The following stacktrace occurs..

    Code:
    2007-06-23 16:13:49.803::WARN:  /LaunchService/
    java.lang.LinkageError: loader constraint violation: when resolving overridden method "org.springframework.oxm.jaxb.Jaxb2Marshaller$Jaxb2AttachmentUnmarshaller.getAttachmentAsDataHandler(Ljava/lang/String;)Ljavax/activation/DataHandler;" the class loader (instance of org/mortbay/jetty/webapp/WebAppClassLoader) of the current class, org/springframework/oxm/jaxb/Jaxb2Marshaller$Jaxb2AttachmentUnmarshaller, and its superclass loader (instance of <bootloader>), have different Class objects for the type javax/activation/DataHandler used in the signature
            at org.springframework.oxm.jaxb.Jaxb2Marshaller.unmarshal(Jaxb2Marshaller.java:305)
            at org.springframework.ws.server.endpoint.support.MarshallingUtils.unmarshal(MarshallingUtils.java:53)
            at org.springframework.ws.server.endpoint.AbstractMarshallingPayloadEndpoint.unmarshalRequest(AbstractMarshallingPayloadEndpoint.java:138)
            at org.springframework.ws.server.endpoint.AbstractMarshallingPayloadEndpoint.invoke(AbstractMarshallingPayloadEndpoint.java:129)
            at org.springframework.ws.server.endpoint.adapter.MessageEndpointAdapter.invoke(MessageEndpointAdapter.java:40)
            at org.springframework.ws.server.MessageDispatcher.dispatch(MessageDispatcher.java:210)
            at org.springframework.ws.server.MessageDispatcher.receive(MessageDispatcher.java:157)
            at org.springframework.ws.transport.support.WebServiceMessageReceiverObjectSupport.handleConnection(WebServiceMessageReceiverObjectSupport.java:86)
            at org.springframework.ws.transport.http.WebServiceMessageReceiverHandlerAdapter.handle(WebServiceMessageReceiverHandlerAdapter.java:56)
            at org.springframework.ws.transport.http.MessageDispatcherServlet.doService(MessageDispatcherServlet.java:157)
            at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:461)
            at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:426)
            at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
            at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
            at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:487)
            at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:367)
            at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
            at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181)
            at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:712)
            at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:405)
            at org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:211)
            at org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114)
            at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:139)
            at org.mortbay.jetty.Server.handle(Server.java:295)
            at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:503)
            at org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:841)
            at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:639)
            at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:210)
            at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:379)
            at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:361)
            at org.mortbay.thread.BoundedThreadPool$PoolThread.run(BoundedThreadPool.java:442)
    My POM.xml looks like this.

    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
             xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
        <modelVersion>4.0.0</modelVersion>
        <groupId>org.evatest</groupId>
        <artifactId>evatest-ws</artifactId>
        <packaging>war</packaging>
        <!--<version>1.0</version>-->
        <name>Evatest Webservice server</name>
        <parent>
            <groupId>org.evatest</groupId>
            <artifactId>evatest</artifactId>
            <version>0.1-SNAPSHOT</version>
        </parent>
        <dependencies>
            <dependency>
                <groupId>commons-logging</groupId>
                <artifactId>commons-logging</artifactId>
                <version>1.1</version>
            </dependency>
            <dependency>
                <groupId>org.springframework.ws</groupId>
                <artifactId>spring-ws-core</artifactId>
                <version>1.0-rc2</version>
            </dependency>
            <dependency>
                <groupId>org.springframework.ws</groupId>
                <artifactId>spring-ws-core-tiger</artifactId>
                <version>1.0-rc2</version>
            </dependency>
            <dependency>
                <groupId>org.springframework.ws</groupId>
                <artifactId>spring-oxm</artifactId>
                <version>1.0-rc2</version>
            </dependency>
            <dependency>
                <groupId>org.springframework.ws</groupId>
                <artifactId>spring-oxm-tiger</artifactId>
                <version>1.0-rc2</version>
            </dependency>
            <dependency>
                <groupId>javax.activation</groupId>
                <artifactId>activation</artifactId>
                <version>1.1</version>
                <scope>runtime</scope>
            </dependency>
        </dependencies>
        <build>
            <finalName>evatest-ws</finalName>
            <plugins>
                <plugin>
                    <groupId>com.sun.tools.xjc.maven2</groupId>
                    <artifactId>maven-jaxb-plugin</artifactId>
                    <version>1.1</version>
                    <executions>
                        <execution>
                            <goals>
                                <goal>generate</goal>
                            </goals>
                        </execution>
                    </executions>
                    <configuration>
                        <generatePackage>org.evatest.ws</generatePackage>
                        <includeSchemas>
                            <includeSchema>**/TIRLaunchService.xsd</includeSchema>
                        </includeSchemas>
                        <!--<catalog>${basedir}/src/main/resources/catalog.xml</catalog>-->
                        <verbose>true</verbose>
                        <args>-npa</args>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.mortbay.jetty</groupId>
                    <artifactId>maven-jetty-plugin</artifactId>
                    <version>6.1.4</version>
                    <configuration>
                        <!--<jettyConfig>jetty-run-config.xml</jettyConfig>-->
                        <contextPath>/</contextPath>
                        <connectors>
                            <connector implementation="org.mortbay.jetty.nio.SelectChannelConnector">
                                <port>8080</port>
                                <!--<maxIdleTime>60000</maxIdleTime>-->
                            </connector>
                        </connectors>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <inherited>true</inherited>
                    <configuration>
                        <source>1.5</source>
                        <target>1.5</target>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-idea-plugin</artifactId>
                    <version>2.0</version>
                    <configuration>
                        <jdkName>1.5</jdkName>
                        <jdkLevel>1.5</jdkLevel>
                        <downloadSources>false</downloadSources>
                        <downloadJavadocs>false</downloadJavadocs>
                    </configuration>
                </plugin>
            </plugins>
        </build>     
    </project>
    Is there anything wrong in my config?

    ws-servlet.xml
    Code:
    <beans xmlns="http://www.springframework.org/schema/beans"
           xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
           xsi:schemaLocation="
           http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd">
    
        <bean id="marshaller" class="org.springframework.oxm.jaxb.Jaxb2Marshaller">
            <property name="contextPath" value="org.evatest.ws"/>
            <property name="schema" value="classpath:META-INF/wsdl/TIRLaunchService.xsd"/>        
        </bean>    
        
        <bean id="endpoint" class="org.evatest.ws.impl.TIRLaunchServiceImpl">
            <property name="marshaller" ref="marshaller"/>
            <property name="unmarshaller" ref="marshaller"/>
        </bean>
    
        <bean id="launchService" class="org.springframework.ws.wsdl.wsdl11.SimpleWsdl11Definition">
            <property name="wsdl" value="classpath:META-INF/wsdl/TIRLaunchSyncSingle.wsdl"/>      
        </bean>
        <bean id="endpointMapping" class="org.springframework.ws.soap.server.endpoint.mapping.SoapActionEndpointMapping">
            <property name="interceptors">
                <list>
                    <ref bean="loggingInterceptor"/>
                </list>
            </property>
            <property name="mappings">
                <props>
                    <prop key="http://www.imsglobal.org/soap/ti/ProxyToolLaunch">endpoint</prop>
                </props>
            </property>
        </bean>
    
        <bean id="loggingInterceptor" class="org.springframework.ws.server.endpoint.interceptor.PayloadLoggingInterceptor"/>
    </beans>

  • #2
    I cannot reproduce this, even with the same version of Jetty used (6.1.4). It seems to be some problem related to the JAF, i.e. Jetty already has some implementation of it. You could try changing the scope of javax.activation from runtime to provided.

    Comment


    • #3
      The problem went away when I added this to the marshaller

      Code:
      <bean id="marshaller" class="org.springframework.oxm.jaxb.Jaxb2Marshaller">
              <property name="contextPath" value="org.evatest.ws"/>
              <property name="schema" value="classpath:META-INF/wsdl/TIRLaunchService.xsd"/>        
              <property name="mtomEnabled" value="false"/>
          </bean>
      Any thoughts why this happened?

      Comment


      • #4
        Yeah, that is also a good way to fix it. The propery mtomEnabled will be made false by default in 1.0 final, it causing more problems than this one.

        Comment

        Working...
        X