You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Pete <pe...@gmail.com> on 2007/02/07 18:54:46 UTC

tomcat-maven-plugin and tomcat:run

1) I'm trying to use the tomcat-maven-plugin  all is fine using

mvn tomcat:deploy

however if I try the new

mvn tomcat:run

which I understand is supposed to be like the  jetty:run, I get an
error, see end of email.

2) I assume this puts a tomcat instance in  target/tomcat

however I notice the tomcat manager isn't enable in the
target\tomcat\conf\tomcat-users.xml

3) Is there any documentation on this tomcat:run goal ?  none at
http://mojo.codehaus.org/tomcat-maven-plugin/

cheers
Pete

[INFO] [tomcat:run]
[INFO] Using existing Tomcat server configuration at
C:\dev\odin\odin-web\target/tomcat
[INFO] Starting tomcat server
[INFO] Starting Servlet Engine: Apache Tomcat/5.5.15
[INFO] XML validation disabled
[ERROR] Exception starting filter ResponseOverrideFilter
java.lang.ClassCastException: org.displaytag.filter.ResponseOverrideFilter
        at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:210)
        at org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:304)
        at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:77)
        at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:3598)
        at org.apache.catalina.core.StandardContext.start(StandardContext.java:4168)
        at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1012)
        at org.apache.catalina.core.StandardHost.start(StandardHost.java:718)
        at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1012)
        at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:442)
        at org.apache.catalina.startup.Embedded.start(Embedded.java:821)
        at org.codehaus.mojo.tomcat.AbstractRunMojo.startContainer(AbstractRunMojo.java:253)
        at org.codehaus.mojo.tomcat.AbstractRunMojo.execute(AbstractRunMojo.java:113)
        at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:412)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:534)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandaloneGoal(DefaultLifecycleExecutor.java:488)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:458)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:306)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:273)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:140)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:322)
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:115)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:256)
        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:585)
        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)

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: tomcat-maven-plugin and tomcat:run

Posted by Pete <pe...@gmail.com>.
thanks Mark, fixed that.

When using tomcat:run , it picks up changes to jsps ok which is great,
but using the jetty:run plugin I found that I could also rebuild a
serverside jar (which for a WAR would have been in web-inf/lib) using
'mvn install' it would then go into my local repo, which Jetty had on
its classpath (you can see this at jetty start up - all jars come from
local repository) , so when new jar gets installed, jetty picks up the
change and redeploys.  Where as I think the tomcat launch is using the

target\myWebapp\WEB-INF\lib

folder for these jars?

I guess it's not possible for tomcat to pick up the jars from local
repo ? it would be great if it could.

If not, I need a way to refresh it JAR, I tried a 'mvn package' on the
WAR project, when tomcat:run is still open in another window. I can
see the jar timestamps change, but tomcat doesn't realise. So then I
thought maybe I could use Tomcat manager to reload e.g.
http://localhost:8080/manager/reload?path=/myWebapp
but I don't think the manager is available in this Tomcat configuration?

I tried changing the tomcat-users.xml  , added

<user username="admin" password="" roles="tomcat,manager,admin"/>

then   mvn tomcat:run but manager still not available

Any thoughts on how to ease rapid development with Tomcat appreciated.

Pete

Pete

On 07/02/07, Mark Hobson <ma...@gmail.com> wrote:
> Hi Pete,
>
> On 07/02/07, Pete <pe...@gmail.com> wrote:
> > 1) I'm trying to use the tomcat-maven-plugin  all is fine using
> >
> > mvn tomcat:deploy
> >
> > however if I try the new
> >
> > mvn tomcat:run
> >
> > which I understand is supposed to be like the  jetty:run, I get an
> > error, see end of email.
>
> Looks like your webapp is using a different version of servlet-api,
> hence a class cast exception when tomcat tries to cast your filter.
> Ensure you're using servlet-api 2.4 which tomcat 5.5 uses.
>
> > 2) I assume this puts a tomcat instance in  target/tomcat
> >
> > however I notice the tomcat manager isn't enable in the
> > target\tomcat\conf\tomcat-users.xml
>
> Nope, tomcat manager isn't deployed using tomcat:run.  Feel free to
> raise an issue if you need this functionality.  I didn't think this
> was too useful since the container is rather transient.
>
> > 3) Is there any documentation on this tomcat:run goal ?  none at
> > http://mojo.codehaus.org/tomcat-maven-plugin/
>
> See:
>
> http://mojo.codehaus.org/tomcat-maven-plugin/deployment.html#Running%20a%20WAR%20project
> http://mojo.codehaus.org/tomcat-maven-plugin/run-mojo.html
>
> Cheers,
>
> Mark
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: tomcat-maven-plugin and tomcat:run

Posted by Mark Hobson <ma...@gmail.com>.
Hi Pete,

On 07/02/07, Pete <pe...@gmail.com> wrote:
> 1) I'm trying to use the tomcat-maven-plugin  all is fine using
>
> mvn tomcat:deploy
>
> however if I try the new
>
> mvn tomcat:run
>
> which I understand is supposed to be like the  jetty:run, I get an
> error, see end of email.

Looks like your webapp is using a different version of servlet-api,
hence a class cast exception when tomcat tries to cast your filter.
Ensure you're using servlet-api 2.4 which tomcat 5.5 uses.

> 2) I assume this puts a tomcat instance in  target/tomcat
>
> however I notice the tomcat manager isn't enable in the
> target\tomcat\conf\tomcat-users.xml

Nope, tomcat manager isn't deployed using tomcat:run.  Feel free to
raise an issue if you need this functionality.  I didn't think this
was too useful since the container is rather transient.

> 3) Is there any documentation on this tomcat:run goal ?  none at
> http://mojo.codehaus.org/tomcat-maven-plugin/

See:

http://mojo.codehaus.org/tomcat-maven-plugin/deployment.html#Running%20a%20WAR%20project
http://mojo.codehaus.org/tomcat-maven-plugin/run-mojo.html

Cheers,

Mark

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org