Uploaded image for project: 'Codehaus Cargo'
  1. CARGO-1309

Cannot deploy to jetty9x, RuntimeException: Error scanning file

    Details

    • Type: Bug
    • Status: Closed (View workflow)
    • Priority: Major
    • Resolution: Fixed
    • Affects versions: 1.4.12
    • Fix versions: 1.4.13
    • Components: Maven2/Maven3
    • Labels:
      None
    • Environment:

      Mac OS X 10.10

      Description

      I'm developing a web application using Spring 4.1.4 that cannot deploy into jetty9x embedded container using cargo-maven2-plugin:1.4.12.

      I have found that the issue might be related to including the wrong version of the org.ow2.asm:asm dependency.

      It seems that cargo is including version 4.1 of asm library (see JettyArtifactResolver.java:259) but by looking into Jetty 9.2.7 maven dependencies it seems to use version 5.0.1 instead. See difference here:

      JettyArtifactResolver.java

      List<Dependency> jetty9xDependencies = new ArrayList<Dependency>();
      jetty9xDependencies.add(new Dependency("org.eclipse.jetty", "jetty-annotations", "9.2.7.v20150116"));
      ...
      jetty9xDependencies.add(new Dependency("org.ow2.asm", "asm", "4.1"));
      jetty9xDependencies.add(new Dependency("org.ow2.asm", "asm-commons", "4.1"));
      

      Maven dependencies

      [INFO] +- org.eclipse.jetty:jetty-annotations:jar:9.2.7.v20150116:test
      [INFO] | +- org.eclipse.jetty:jetty-plus:jar:9.2.7.v20150116:test
      [INFO] | | \- org.eclipse.jetty:jetty-jndi:jar:9.2.7.v20150116:test
      [INFO] | +- org.eclipse.jetty:jetty-webapp:jar:9.2.7.v20150116:test
      [INFO] | | +- org.eclipse.jetty:jetty-xml:jar:9.2.7.v20150116:test
      [INFO] | | \- org.eclipse.jetty:jetty-servlet:jar:9.2.7.v20150116:test
      [INFO] | | \- org.eclipse.jetty:jetty-security:jar:9.2.7.v20150116:test
      [INFO] | +- javax.annotation:javax.annotation-api:jar:1.2:test
      [INFO] | +- org.ow2.asm:asm:jar:5.0.1:test
      [INFO] | \- org.ow2.asm:asm-commons:jar:5.0.1:test
      [INFO] | \- org.ow2.asm:asm-tree:jar:5.0.1:test
      

      I replaced version 4.1 with 5.0.1 on my local maven repository and seems to work ok. The problem is that I cannot change the dependency on my maven pom.xml because is hardcoded inside JettyArtifactResolver class.

      The exception I get starting the container is like:

      MultiException[java.lang.RuntimeException: Error scanning file LoggingAspect.class, java.lang.RuntimeException: Error scanning entry com/sun/activation/registries/LineTokenizer.class from jar file:/private/var/folders/17/7cjcty292rl77m4rlfrxzg740000gn/T/jetty-0.0.0.0-8080-aps-workflow-1.0.0-SNAPSHOT.war-_aps-workflow-any-2433468475153175819.dir/webapp/WEB-INF/lib/activation-1.1.jar, ..., < + hundreds of RuntimeExceptions as previous one>]
      at org.eclipse.jetty.annotations.AnnotationConfiguration.scanForAnnotations(AnnotationConfiguration.java:536)
      at org.eclipse.jetty.annotations.AnnotationConfiguration.configure(AnnotationConfiguration.java:447)
      at org.eclipse.jetty.webapp.WebAppContext.configure(WebAppContext.java:479)
      at org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1337)
      at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:741)
      at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:505)
      at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
      at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:132)
      at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:114)
      at org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:61)
      at org.eclipse.jetty.server.handler.ContextHandlerCollection.doStart(ContextHandlerCollection.java:163)
      at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
      at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:132)
      at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:114)
      at org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:61)
      at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
      at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:132)
      at org.eclipse.jetty.server.Server.start(Server.java:387)
      at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:114)
      at org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:61)
      at org.eclipse.jetty.server.Server.doStart(Server.java:354)
      at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:483)
      at org.codehaus.cargo.container.jetty.internal.JettyExecutorThread.run(JettyExecutorThread.java:69)
      

      Thanks
      Juan

        Attachments

          Activity

            People

            • Assignee:
              savasalitokmen Savas Ali Tokmen (Inactive)
              Reporter:
              juanhernandez Juan Hernandez (Inactive)
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: