Uploaded image for project: 'Maven WAR Plugin'
  1. Maven WAR Plugin
  2. MWAR-191

CannotResolveClassException when switching to tomcat deployment with context.xml

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Duplicate
    • None
    • None
    • None
    • None
    • linux, java 1.4.2

    Description

      I have the following profile in my pom, which when enabled, seems to cause this. I first compile and deploy my project to tomcat, without this profile enabled. Then, when I enable it, if I do not first do "mvn clean", I get the exception that follows...

      <profile>
      <id>local</id>
      <build>
      <plugins>
      <plugin>
      <groupId>org.codehaus.mojo</groupId>
      <artifactId>tomcat-maven-plugin</artifactId>
      <configuration>
      <mode>context</mode>
      </configuration>
      </plugin>
      <plugin>
      <groupId>org.apache.maven.plugins</groupId>
      <artifactId>maven-war-plugin</artifactId>
      <version>2.1-alpha-1</version>
      <configuration>
      <webResources>
      <resource>
      <directory>src/main/</directory>
      <!-- override the destination directory for this resource -->
      <targetPath>META-INF</targetPath>
      <!-- enable filtering -->
      <filtering>true</filtering>
      <includes>
      <include>context.xml</include>
      </includes>
      </resource>
      </webResources>
      </configuration>
      </plugin>
      </plugins>
      </build>
      </profile>

      trenta@reuben /MyDocuments/java/oros/oros-gcap $ mvn -Ddebug.package=ca.montage.banner.server.RemoteProgram -Plocal-aucm,inproc,local package tomcat:deploy
      [INFO] Scanning for projects...
      [INFO] Reactor build order:
      [INFO] oros
      [INFO] oros rmi component
      [INFO] oros web component
      [INFO] Searching repository for plugin with prefix: 'tomcat'.
      [INFO] ------------------------------------------------------------------------
      [INFO] Building oros
      [INFO] task-segment: [package, tomcat:deploy]
      [INFO] ------------------------------------------------------------------------
      [INFO] [site:attach-descriptor]
      [INFO] Preparing tomcat:deploy
      [INFO] [site:attach-descriptor]
      [INFO] [tomcat:deploy]
      [INFO] Skipping non-war project
      [INFO] ------------------------------------------------------------------------
      [INFO] Building oros rmi component
      [INFO] task-segment: [package, tomcat:deploy]
      [INFO] ------------------------------------------------------------------------
      [INFO] [resources:resources]
      [WARNING] File encoding has not been set, using platform encoding ANSI_X3.4-1968, i.e. build is platform dependent!
      [WARNING] Using platform encoding (ANSI_X3.4-1968 actually) to copy filtered resources, i.e. build is platform dependent!
      [INFO] Copying 5 resources
      [INFO] [compiler:compile]
      [INFO] Nothing to compile - all classes are up to date
      [INFO] [rmic:rmic

      {execution: rmi compilation}

      ]
      [INFO] No out of date rmi classes to process.
      [INFO] [resources:testResources]
      [WARNING] Using platform encoding (ANSI_X3.4-1968 actually) to copy filtered resources, i.e. build is platform dependent!
      [INFO] skip non existing resourceDirectory /data/MyDocuments/java/oros/oros-gcap/rmi/src/test/resources
      [INFO] [compiler:testCompile]
      [INFO] Not compiling test sources
      [INFO] [surefire:test]
      [INFO] Tests are skipped.
      [INFO] [jar:jar]
      [INFO] Building jar: /data/MyDocuments/java/oros/oros-gcap/rmi/target/oros-rmi.jar
      [INFO] [rmic:package

      {execution: rmi package}

      ]
      [INFO] Building RMI stub jar: /data/MyDocuments/java/oros/oros-gcap/rmi/target/oros-rmi-client.jar
      [INFO] Building jar: /data/MyDocuments/java/oros/oros-gcap/rmi/target/oros-rmi-client.jar
      [INFO] Preparing tomcat:deploy
      [INFO] [resources:resources]
      [WARNING] File encoding has not been set, using platform encoding ANSI_X3.4-1968, i.e. build is platform dependent!
      [WARNING] Using platform encoding (ANSI_X3.4-1968 actually) to copy filtered resources, i.e. build is platform dependent!
      [INFO] Copying 5 resources
      [INFO] [compiler:compile]
      [INFO] Nothing to compile - all classes are up to date
      [INFO] [rmic:rmic

      {execution: rmi compilation}

      ]
      [INFO] No out of date rmi classes to process.
      [INFO] [resources:testResources]
      [WARNING] Using platform encoding (ANSI_X3.4-1968 actually) to copy filtered resources, i.e. build is platform dependent!
      [INFO] skip non existing resourceDirectory /data/MyDocuments/java/oros/oros-gcap/rmi/src/test/resources
      [INFO] [compiler:testCompile]
      [INFO] Not compiling test sources
      [INFO] [surefire:test]
      [INFO] Tests are skipped.
      [INFO] [jar:jar]
      [INFO] Building jar: /data/MyDocuments/java/oros/oros-gcap/rmi/target/oros-rmi.jar
      [INFO] [rmic:package

      {execution: rmi package}

      ]
      [INFO] Building RMI stub jar: /data/MyDocuments/java/oros/oros-gcap/rmi/target/oros-rmi-client.jar
      [INFO] Building jar: /data/MyDocuments/java/oros/oros-gcap/rmi/target/oros-rmi-client.jar
      [INFO] [tomcat:deploy]
      [INFO] Skipping non-war project
      [INFO] ------------------------------------------------------------------------
      [INFO] Building oros web component
      [INFO] task-segment: [package, tomcat:deploy]
      [INFO] ------------------------------------------------------------------------
      [INFO] [resources:resources]
      [WARNING] File encoding has not been set, using platform encoding ANSI_X3.4-1968, i.e. build is platform dependent!
      [WARNING] Using platform encoding (ANSI_X3.4-1968 actually) to copy filtered resources, i.e. build is platform dependent!
      [INFO] Copying 3 resources
      [INFO] Copying 5 resources
      [INFO] [compiler:compile]
      [INFO] Nothing to compile - all classes are up to date
      [INFO] [resources:testResources]
      [WARNING] Using platform encoding (ANSI_X3.4-1968 actually) to copy filtered resources, i.e. build is platform dependent!
      [INFO] skip non existing resourceDirectory /data/MyDocuments/java/oros/oros-gcap/web/src/test/resources
      [INFO] [compiler:testCompile]
      [INFO] Not compiling test sources
      [INFO] [surefire:test]
      [INFO] Tests are skipped.
      [INFO] [war:war]
      [INFO] Packaging webapp
      [INFO] ------------------------------------------------------------------------
      [ERROR] FATAL ERROR
      [INFO] ------------------------------------------------------------------------
      [INFO] dependenciesInfo : dependenciesInfo
      ---- Debugging information ----
      message : dependenciesInfo : dependenciesInfo
      cause-exception : com.thoughtworks.xstream.mapper.CannotResolveClassException
      cause-message : dependenciesInfo : dependenciesInfo
      class : org.apache.maven.plugin.war.util.WebappStructure
      required-type : org.apache.maven.plugin.war.util.WebappStructure
      path : /webapp-structure/dependenciesInfo
      line number : 292
      -------------------------------
      [INFO] ------------------------------------------------------------------------
      [INFO] Trace
      com.thoughtworks.xstream.converters.ConversionException: dependenciesInfo : dependenciesInfo
      ---- Debugging information ----
      message : dependenciesInfo : dependenciesInfo
      cause-exception : com.thoughtworks.xstream.mapper.CannotResolveClassException
      cause-message : dependenciesInfo : dependenciesInfo
      class : org.apache.maven.plugin.war.util.WebappStructure
      required-type : org.apache.maven.plugin.war.util.WebappStructure
      path : /webapp-structure/dependenciesInfo
      line number : 292
      -------------------------------
      at com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshaller.java:63)
      at com.thoughtworks.xstream.core.AbstractReferenceUnmarshaller.convert(AbstractReferenceUnmarshaller.java:45)
      at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:46)
      at com.thoughtworks.xstream.core.TreeUnmarshaller.start(TreeUnmarshaller.java:117)
      at com.thoughtworks.xstream.core.ReferenceByXPathMarshallingStrategy.unmarshal(ReferenceByXPathMarshallingStrategy.java:29)
      at com.thoughtworks.xstream.XStream.unmarshal(XStream.java:846)
      at com.thoughtworks.xstream.XStream.unmarshal(XStream.java:833)
      at com.thoughtworks.xstream.XStream.fromXML(XStream.java:781)
      at org.apache.maven.plugin.war.util.WebappStructureSerializer.fromXml(WebappStructureSerializer.java:48)
      at org.apache.maven.plugin.war.AbstractWarMojo.buildWebapp(AbstractWarMojo.java:346)
      at org.apache.maven.plugin.war.AbstractWarMojo.buildExplodedWebapp(AbstractWarMojo.java:317)
      at org.apache.maven.plugin.war.WarMojo.performPackaging(WarMojo.java:166)
      at org.apache.maven.plugin.war.WarMojo.execute(WarMojo.java:130)
      at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:453)
      at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:559)
      at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:500)
      at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:479)
      at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:331)
      at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:292)
      at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:142)
      at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:336)
      at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:129)
      at org.apache.maven.cli.MavenCli.main(MavenCli.java:301)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:324)
      at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
      at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
      at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
      at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
      Caused by: com.thoughtworks.xstream.mapper.CannotResolveClassException: dependenciesInfo : dependenciesInfo
      at com.thoughtworks.xstream.mapper.DefaultMapper.realClass(DefaultMapper.java:49)
      at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:26)
      at com.thoughtworks.xstream.mapper.ClassAliasingMapper.realClass(ClassAliasingMapper.java:76)
      at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:26)
      at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:26)
      at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:26)
      at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:26)
      at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:26)
      at com.thoughtworks.xstream.mapper.DynamicProxyMapper.realClass(DynamicProxyMapper.java:60)
      at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:26)
      at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:26)
      at com.thoughtworks.xstream.mapper.ArrayMapper.realClass(ArrayMapper.java:76)
      at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:26)
      at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:26)
      at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:26)
      at com.thoughtworks.xstream.mapper.CachingMapper.realClass(CachingMapper.java:34)
      at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.determineType(AbstractReflectionConverter.java:296)
      at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.doUnmarshal(AbstractReflectionConverter.java:178)
      at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.unmarshal(AbstractReflectionConverter.java:125)
      at com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshaller.java:56)
      ... 30 more
      [INFO] ------------------------------------------------------------------------
      [INFO] Total time: 10 seconds
      [INFO] Finished at: Thu Apr 09 16:08:22 GMT-07:00 2009
      [INFO] Final Memory: 28M/61M
      [INFO] ------------------------------------------------------------------------

      Attachments

        Issue Links

          Activity

            People

              snicoll Stephane Nicoll
              trent Trent Nelson
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: