tomcat - jetty-maven-plugin NoClassDefFoundError -


i created maven parent module 2 maven children. web based application in war output deployed tomcat directory.the problem testing war file have start tomcat , test app. scenario decided use jetty maven plugin in parent pom.xml file. here how looks like:

<modules>     <module>hellojavaworld</module>     <module>application</module> </modules>       <plugin>     <groupid>org.apache.maven.plugins</groupid>     <artifactid>maven-compiler-plugin</artifactid>     <configuration>       <source>1.5</source>       <target>1.5</target>     </configuration>   </plugin>     <plugin>        <groupid>org.eclipse.jetty</groupid>        <artifactid>jetty-maven-plugin</artifactid>        <version>9.2.11.v20150529</version>       <configuration>             <scanintervalseconds>10</scanintervalseconds>              <webapp>               <contextpath>/hellojavaworld</contextpath>                         </webapp>             <war>c:\apache-tomcat-7.0.64\webapps\hellojavaworld.war</war>         </configuration>   </plugin> 

if start tomcat manually , use http://localhost:8080/hellojavaworld works fine. on other hand when used

mvn jetty:run-war

it works,but got stucks on error:

http error 500 problem accessing /hellojavaworld/helloservlet. reason:   server error  caused by: java.lang.noclassdeffounderror: org/apache/log4j/level 

i know problem common,because of missing jars. know these jars placed in c:\apache-tomcat-7.0.64\lib\ folder.

so question how tell jetty use folder external jars war file?

note: tomcat runs,there problem jetty.

jetty doesn't use log4j.

why expect web container provide webapp logging outside of servlet spec?

see various servletcontext.log() methods actual servlet spec logging

suggestion: put log4j jar files in webapp's web-inf/lib/


Comments

Popular posts from this blog

javascript - Chart.js (Radar Chart) different scaleLineColor for each scaleLine -

apache - Error with PHP mail(): Multiple or malformed newlines found in additional_header -

java - Android – MapFragment overlay button shadow, just like MyLocation button -