Uploaded image for project: 'Spring Web Services'
  1. Spring Web Services
  2. SWS-476

java.lang.NoClassDefFoundError: com/sun/org/apache/xml/internal/security/Init

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Cannot Reproduce
    • Affects Version/s: 1.5.5
    • Fix Version/s: 1.5.6
    • Component/s: Security
    • Labels:
      None
    • Environment:
      jdk 1.5, maven 2.0.9

      Description

      Using security interceptor for certficates has the attached result. Maybe the required dependency should be added in pom.xml.

      java.lang.NoClassDefFoundError: com/sun/org/apache/xml/internal/security/Init
      at com.sun.xml.wss.impl.SecurableSoapMessage.<clinit>(SecurableSoapMessage.java:94)
      at com.sun.xml.wss.ProcessingContext.setSOAPMessage(ProcessingContext.java:217)
      at com.sun.xml.wss.impl.misc.XWSSProcessor2_0Impl.createProcessingContext(XWSSProcessor2_0Impl.java:151)
      at org.springframework.ws.soap.security.xwss.XwsSecurityInterceptor.validateMessage(XwsSecurityInterceptor.java:159)
      at org.springframework.ws.soap.security.AbstractWsSecurityInterceptor.handleRequest(AbstractWsSecurityInterceptor.java:104)
      at org.springframework.ws.server.MessageDispatcher.dispatch(MessageDispatcher.java:213)
      at org.springframework.ws.server.MessageDispatcher.receive(MessageDispatcher.java:168)
      at org.springframework.ws.transport.support.WebServiceMessageReceiverObjectSupport.handleConnection(WebServiceMessageReceiverObjectSupport.java:88)
      at org.springframework.ws.transport.http.WebServiceMessageReceiverHandlerAdapter.handle(WebServiceMessageReceiverHandlerAdapter.java:57)
      at org.springframework.ws.transport.http.MessageDispatcherServlet.doService(MessageDispatcherServlet.java:230)
      at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:571)
      at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:511)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:713)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:806)
      at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:502)
      at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:365)
      at org.mortbay.jetty.security.ConstraintsSecurityHandler.handle(ConstraintsSecurityHandler.java:220)
      at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181)
      at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:822)
      at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:305)
      at org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:229)
      at org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:113)
      at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
      at org.mortbay.jetty.Server.handle(Server.java:324)
      at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:550)
      at org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:890)
      at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:743)
      at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:215)
      at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:407)
      at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:421)
      at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:520)

        Activity

        routis Routis Haralampos created issue -
        Hide
        arjen.poutsma Arjen Poutsma added a comment -

        This class is in xmlsec, in the com.sun.org.apache.xml.security group, see http://springframework.svn.sourceforge.net/viewvc/springframework/repos/repo-ext/com/sun/org/apache/xml/security/xmlsec/2.0.

        XWSS has a transative dependency to it, so things should work.

        Show
        arjen.poutsma Arjen Poutsma added a comment - This class is in xmlsec, in the com.sun.org.apache.xml.security group, see http://springframework.svn.sourceforge.net/viewvc/springframework/repos/repo-ext/com/sun/org/apache/xml/security/xmlsec/2.0 . XWSS has a transative dependency to it, so things should work.
        arjen.poutsma Arjen Poutsma made changes -
        Field Original Value New Value
        Resolution Cannot Reproduce [ 5 ]
        Status Open [ 1 ] Resolved [ 5 ]
        Hide
        routis Routis Haralampos added a comment -

        Maybe I missing something.
        XWSS pom (found at http://download.java.net/maven/1/com.sun.xml.wss/poms/xws-security-2.0-FCS.pom) does not hava a dependency on xmlsec.
        Thus, the issue is easily reproducable.

        Show
        routis Routis Haralampos added a comment - Maybe I missing something. XWSS pom (found at http://download.java.net/maven/1/com.sun.xml.wss/poms/xws-security-2.0-FCS.pom ) does not hava a dependency on xmlsec. Thus, the issue is easily reproducable.
        Hide
        arjen.poutsma Arjen Poutsma added a comment -

        Reopening to investigate further

        Show
        arjen.poutsma Arjen Poutsma added a comment - Reopening to investigate further
        arjen.poutsma Arjen Poutsma made changes -
        Resolution Cannot Reproduce [ 5 ]
        Status Resolved [ 5 ] Reopened [ 4 ]
        arjen.poutsma Arjen Poutsma made changes -
        Fix Version/s 1.5.6 [ 11141 ]
        Hide
        arjen.poutsma Arjen Poutsma added a comment -

        XWSS depends on xmldsig (javax.xml.crypto), which depends on xmlsec (com.sun.org.apache.xml.security). Here's the related snipped from "mvn dependency:tree":

        [INFO] +- com.sun.xml.wss:xws-security:jar:2.0-FCS:compile
        [INFO] |  \- javax.xml.crypto:xmldsig:jar:1.0:compile
        [INFO] |     \- com.sun.org.apache.xml.security:xmlsec:jar:2.0:runtime

        Show
        arjen.poutsma Arjen Poutsma added a comment - XWSS depends on xmldsig (javax.xml.crypto), which depends on xmlsec (com.sun.org.apache.xml.security). Here's the related snipped from "mvn dependency:tree": [INFO] +- com.sun.xml.wss:xws-security:jar:2.0-FCS:compile [INFO] | \- javax.xml.crypto:xmldsig:jar:1.0:compile [INFO] | \- com.sun.org.apache.xml.security:xmlsec:jar:2.0:runtime
        arjen.poutsma Arjen Poutsma made changes -
        Resolution Fixed [ 1 ]
        Status Reopened [ 4 ] Resolved [ 5 ]
        Hide
        routis Routis Haralampos added a comment -

        So, I believe a compile-time dependency to xmlsec has to be added. Propably this dependency should be marked as optinal since there are two ways of implementing ws-security in sprin-ws.

        Show
        routis Routis Haralampos added a comment - So, I believe a compile-time dependency to xmlsec has to be added. Propably this dependency should be marked as optinal since there are two ways of implementing ws-security in sprin-ws.
        Hide
        arjen.poutsma Arjen Poutsma added a comment -

        I don't think so. runtime deps are transitive, see http://maven.apache.org/guides/introduction/introduction-to-dependency-mechanism.html

        Also, the airline sample shows this: it depends on spring-ws-security, which depends on XWSS, which depends on xmlsec. When I run "mvn war", i clearly see xmlsec in WEB-INF/lib.

        Show
        arjen.poutsma Arjen Poutsma added a comment - I don't think so. runtime deps are transitive, see http://maven.apache.org/guides/introduction/introduction-to-dependency-mechanism.html Also, the airline sample shows this: it depends on spring-ws-security, which depends on XWSS, which depends on xmlsec. When I run "mvn war", i clearly see xmlsec in WEB-INF/lib.
        arjen.poutsma Arjen Poutsma made changes -
        Resolution Fixed [ 1 ]
        Status Resolved [ 5 ] Reopened [ 4 ]
        arjen.poutsma Arjen Poutsma made changes -
        Status Reopened [ 4 ] Resolved [ 5 ]
        Resolution Cannot Reproduce [ 5 ]
        Hide
        routis Routis Haralampos added a comment -

        Arjen, you are abolutly right about my previous comment the compile time dependency (I had the impression that spring was using the missing class). I will investigate further the problem because it is rather a xwss - maven issue.

        Show
        routis Routis Haralampos added a comment - Arjen, you are abolutly right about my previous comment the compile time dependency (I had the impression that spring was using the missing class). I will investigate further the problem because it is rather a xwss - maven issue.
        Hide
        arjen.poutsma Arjen Poutsma added a comment -

        Closing old issues

        Show
        arjen.poutsma Arjen Poutsma added a comment - Closing old issues
        arjen.poutsma Arjen Poutsma made changes -
        Status Resolved [ 5 ] Closed [ 6 ]
        Transition Time In Source Status Execution Times Last Executer Last Execution Date
        Open Open Resolved Resolved
        39m 50s 1 Arjen Poutsma 22/Jan/09 11:35 PM
        Resolved Resolved Reopened Reopened
        22h 55m 2 Arjen Poutsma 26/Jan/09 12:51 AM
        Reopened Reopened Resolved Resolved
        2d 2h 20m 2 Arjen Poutsma 26/Jan/09 12:51 AM
        Resolved Resolved Closed Closed
        1194d 6h 12m 1 Arjen Poutsma 04/May/12 7:03 AM

          People

          • Assignee:
            arjen.poutsma Arjen Poutsma
            Reporter:
            routis Routis Haralampos
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: