java - Maven module as dependency on a Web Application -
ich have tree modules projec, server,client , core. core module should imported jar dependency in other modules. on eclipse see no warnings, if i'm starting application i'm getting following error :
caused by: org.springframework.beans.factory.cannotloadbeanclassexception: error loading class [at.ac.tuwien.inso.verteilte.service.helloserviceimpl] bean name 'helloserviceimpl' defined in servletcontext resource [/web-inf/appcontext.xml]: problem class file or dependent class; nested exception java.lang.noclassdeffounderror: at/ac/tuwien/inso/verteilte/services/ihelloservice caused by: java.lang.classnotfoundexception: at.ac.tuwien.inso.verteilte.services.ihelloservice
this interface imported on helloserviceimpl. helloserviceimpl created on beans following :
<jaxws:endpoint id="helloservice" implementorclass="at.ac.tuwien.inso.verteilte.service.helloserviceimpl">
i have removed namespaces because of link protection of stackoverflow :) way, pom.xml's :
for core :
<project> <modelversion>4.0.0</modelversion> <parent> <artifactid>verteiltepaxen-parent</artifactid> <groupid>at.ac.inso.tuwien.verteiltepraxen</groupid> <version>1.0-snapshot</version> </parent> <groupid>at.ac.inso.tuwien.verteiltepraxen</groupid> <artifactid>core</artifactid> <version>1.0-snapshot</version> <name>core</name> <packaging>jar</packaging> <description>verteilte praxen - core</description> <build> <finalname>core-1.0-snapshot</finalname> </build> </project>
server :
<project> <modelversion>4.0.0</modelversion> <parent> <artifactid>verteiltepaxen-parent</artifactid> <groupid>at.ac.inso.tuwien.verteiltepraxen</groupid> <version>1.0-snapshot</version> </parent> <groupid>at.ac.inso.tuwien.verteiltepraxen</groupid> <artifactid>server</artifactid> <version>1.0-snapshot</version> <packaging>war</packaging> <name>server</name> <description>verteilte praxen - server</description> <dependencies> <dependency> <groupid>at.ac.inso.tuwien.verteiltepraxen</groupid> <artifactid>core</artifactid> <version>1.0-snapshot</version> <type>jar</type> <scope>compile</scope> <exclusions> <exclusion> <artifactid>core</artifactid> <groupid>at.ac.inso.tuwien.verteiltepraxen</groupid> </exclusion> </exclusions> </dependency> </dependencies> <dependencymanagement> <dependencies> </dependencies> </dependencymanagement> <build> <finalname>server-1.0-snapshot</finalname> </build> </project>
client :
<project> <modelversion>4.0.0</modelversion> <parent> <artifactid>verteiltepaxen-parent</artifactid> <groupid>at.ac.inso.tuwien.verteiltepraxen</groupid> <version>1.0-snapshot</version> </parent> <groupid>at.ac.inso.tuwien.verteiltepraxen</groupid> <artifactid>client</artifactid> <version>1.0-snapshot</version> <packaging>war</packaging> <name>client</name> <description>verteilte praxen - client</description> <dependencies> <dependency> <groupid>at.ac.inso.tuwien.verteiltepraxen</groupid> <artifactid>core</artifactid> <version>1.0-snapshot</version> <type>jar</type> <scope>compile</scope> </dependency> </dependencies> <dependencymanagement> <dependencies> </dependencies> </dependencymanagement> <build> <finalname>client-1.0-snapshot</finalname> </build> </project>
and parent pom :
<project> <modelversion>4.0.0</modelversion> <groupid>at.ac.inso.tuwien.verteiltepraxen</groupid> <artifactid>verteiltepaxen-parent</artifactid> <packaging>pom</packaging> <version>1.0-snapshot</version> <name>verteiltepaxen maven webapp</name> <properties> <cxf.version>2.2.3</cxf.version> <spring.version>2.5.6.sec02</spring.version> </properties> <dependencies> ... other dependencies ... </dependencies> <repositories> ... repositories ... </repositories> <build> <plugins> <plugin> <groupid>org.apache.maven.plugins</groupid> <artifactid>maven-eclipse-plugin</artifactid> <version>2.8</version> <configuration> <projectnametemplate>verteiltepaxen-parent-1.0-snapshot</projectnametemplate> <wtpmanifest>true</wtpmanifest> <wtpapplicationxml>true</wtpapplicationxml> <wtpversion>2.0</wtpversion> </configuration> </plugin> <plugin> <groupid>org.apache.maven.plugins</groupid> <artifactid>maven-compiler-plugin</artifactid> <version>2.0.2</version> <configuration> <source>1.5</source> <target>1.5</target> <encoding>utf-8</encoding> </configuration> </plugin> <plugin> <groupid>org.mortbay.jetty</groupid> <artifactid>maven-jetty-plugin</artifactid> <version>6.1.8</version> <configuration> <!-- configure webapp --> <contextpath>/verteiltepaxen</contextpath> </configuration> </plugin> </plugins> <finalname>verteiltepaxen-parent-1.0snapshot</finalname> </build> <modules> <module>client</module> <module>server</module> <module>core</module> </modules> </project>
thanks helps :)
thank your help, i've removed error same
<dependencies> <dependency> <groupid>at.ac.inso.tuwien.verteiltepraxen</groupid> <artifactid>core</artifactid> <version>1.0-snapshot</version> <type>jar</type> <scope>compile</scope> </dependency> </dependencies>
i'm not sure do, in server's pom listing core dependency , excluding it:
<dependency> <groupid>at.ac.inso.tuwien.verteiltepraxen</groupid> <artifactid>core</artifactid> <version>1.0-snapshot</version> <type>jar</type> <scope>compile</scope> <exclusions> <exclusion> <artifactid>core</artifactid> <groupid>at.ac.inso.tuwien.verteiltepraxen</groupid> </exclusion> </exclusions> </dependency>
why this? exclusions used tell maven ignore dependencies dragged in other dependencies in build.try removing exclusion.
Comments
Post a Comment