missing classes after publish web project into tomcat using eclipse wtp -


i have several dynamic web projects in workspace, each contains classes , refers other utility projects (simple java projects), , 3rd party jars.

these apps (dynamic web projects) deployed on tomcat v6.0.6 using eclipse wtp (helios 3.6)

when update workspace , new classes/resources/jars extracted svn repository, re-publish apps in tomcat apps, , restart it.

occasionally, when tomcat starts 1 of apps, throws classnotfoundexception, or complains other missing resource. see deployed resource (spring beans xml example) not date, , has 'old' content in it.

the common anti-voodoo-black-magic treatment use: * stop / start tomcat * clean (when right click on server configuration) * clean tomcat work directory * remove apps tomcat, clean, restart tomcat, add apps

i need run 'procedure' several time until problem solved.

do guys suffer ? known bug ? suggestions how tackle ? using jars instead of utility projects solve/reduce problems?

i consider using embedded jetty instead, want avoid proprietary scripts running jetty on 'production' environment.

-- yonatan

it happened me lot. wouldn't call voodoo. think eclipse wtp doesn't work when change stuff in background (e.g. maven build).

what solve avoid using altogether. instead use maven war plugin deploy application:

mvn war:inplace tomcat:inplace -dskiptests=true 

this works fast, doesn't need assemble, , package war.

then undeploy application:

mvn tomcat:undeploy 

i have scripts that

  • deploy , start tomact
  • undeploy , stop tomcat

it looks this:

start tomcat , deploy app:

#!/bin/sh  if [ -f $catalina_pid ];   echo "tomcat running pid " `cat $catalina_pid`   exit 1 fi  java -dmy.arg=val -dcatalina.home=<catalina-home> -dlog4j.configuration=file:///log4j.xml -classpath <path-to-tomcat-lib>/bootstrap.jar:/usr/lib/jvm/java-6-sun-1.6.0.20/lib/tools.jar org.apache.catalina.startup.bootstrap start &  echo $! > $catalina_pid  mvn war:inplace tomcat:inplace -dskiptests=true 

undeploy , stop tomcat:

#!/bin/sh  mvn tomcat:undeploy  <path-to-tomcat>/shutdown.sh -force  rm $catalina_pid 

the same other build script - matter of how code have write.

i chose maven's war:inplace goal since little, , runs quickly. see here: maven.apache.org/plugins/maven-war-plugin/usage.html.

btw, ant , gradle have war task/plugin can configured similar (i don't remember...)

hope helps.


Comments

Popular posts from this blog

asp.net - repeatedly call AddImageUrl(url) to assemble pdf document -

java - Android recognize cell phone with keyboard or not? -

iphone - How would you achieve a LED Scrolling effect? -