Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.0-beta-1
    • Labels:
      None
    • Environment:
      Windows XP SP2, Maven 2, Java 1.5_12
    • Number of attachments :
      1

      Description

      The tomcat:run goal fails on my machine with the attache stacktrace.

        Activity

        Hide
        Mark Hobson added a comment -

        Yep, I've also experienced this - it's due to the embedded tomcat classloader inheriting classes loaded from maven, specifically the tomcat-maven-log commons-logging implementation. We need to isolate the tomcat classloader.

        Show
        Mark Hobson added a comment - Yep, I've also experienced this - it's due to the embedded tomcat classloader inheriting classes loaded from maven, specifically the tomcat-maven-log commons-logging implementation. We need to isolate the tomcat classloader.
        Hide
        Matthew Payne added a comment -

        Also have this problem.

        Runs fine in jetty:run, and deploying the war to tomcat.
        Note tomcat run does work in another app using struts2.
        (this was tapestry 4.0.2)
        Stack trace snippet.

        [ERROR] Exception starting filter redirect
        java.lang.ClassCastException: org.apache.tapestry.RedirectFilter cannot be cast
        to javax.servlet.Filter
        at org.apache.catalina.core.ApplicationFilterConfig.getFilter(Applicatio
        nFilterConfig.java:210)
        at org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(Applica
        tionFilterConfig.java:304)
        at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFi
        lterConfig.java:77)
        at org.apache.catalina.core.StandardContext.filterStart(StandardContext.
        java:3598)
        at org.apache.catalina.core.StandardContext.start(StandardContext.java:4
        168)
        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(AbstractRunMo
        jo.java:253)
        at org.codehaus.mojo.tomcat.AbstractRunMojo.execute(AbstractRunMojo.java
        :113)
        at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPlugi
        nManager.java:443)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(Defa
        ultLifecycleExecutor.java:539)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandalone
        Goal(DefaultLifecycleExecutor.java:493)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(Defau
        ltLifecycleExecutor.java:463)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHan
        dleFailures(DefaultLifecycleExecutor.java:311)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegmen
        ts(DefaultLifecycleExecutor.java:278)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLi
        fecycleExecutor.java:143)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:334)
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:125)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:280)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
        java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
        sorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
        at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)

        Show
        Matthew Payne added a comment - Also have this problem. Runs fine in jetty:run, and deploying the war to tomcat. Note tomcat run does work in another app using struts2. (this was tapestry 4.0.2) Stack trace snippet. [ERROR] Exception starting filter redirect java.lang.ClassCastException: org.apache.tapestry.RedirectFilter cannot be cast to javax.servlet.Filter at org.apache.catalina.core.ApplicationFilterConfig.getFilter(Applicatio nFilterConfig.java:210) at org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(Applica tionFilterConfig.java:304) at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFi lterConfig.java:77) at org.apache.catalina.core.StandardContext.filterStart(StandardContext. java:3598) at org.apache.catalina.core.StandardContext.start(StandardContext.java:4 168) 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(AbstractRunMo jo.java:253) at org.codehaus.mojo.tomcat.AbstractRunMojo.execute(AbstractRunMojo.java :113) at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPlugi nManager.java:443) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(Defa ultLifecycleExecutor.java:539) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandalone Goal(DefaultLifecycleExecutor.java:493) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(Defau ltLifecycleExecutor.java:463) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHan dleFailures(DefaultLifecycleExecutor.java:311) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegmen ts(DefaultLifecycleExecutor.java:278) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLi fecycleExecutor.java:143) at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:334) at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:125) at org.apache.maven.cli.MavenCli.main(MavenCli.java:280) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl. java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces sorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315) at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
        Hide
        Mark Hobson added a comment -

        This is essentially fixed by MOJO-1106 since Tomcat 6 no longer uses JCL. I've now removed all JCL adapter code.

        Show
        Mark Hobson added a comment - This is essentially fixed by MOJO-1106 since Tomcat 6 no longer uses JCL. I've now removed all JCL adapter code.
        Hide
        Olivier Lamy added a comment -

        reopen to set fixed version

        Show
        Olivier Lamy added a comment - reopen to set fixed version
        Hide
        r351574nc3 added a comment -

        Is this the same problem as I am experiencing? This is what my log is spitting out? Looks like it says delegate is 'false'. I thought this is 'true' by default. I tried explicitly setting to 'true'. that doesn't help. Looks like it's having trouble mixing sun.misc.Launcher$AppClassLoader@61e63e3d and WebappClassLoader. Is this a new issue or the same as this one?

        Jul 1, 2011 2:47:06 PM org.apache.catalina.startup.Embedded start
        INFO: Starting tomcat server
        Jul 1, 2011 2:47:06 PM org.apache.catalina.core.StandardEngine start
        INFO: Starting Servlet Engine: Apache Tomcat/6.0.29
        log4j:ERROR A "org.apache.log4j.ConsoleAppender" object is not assignable to a "org.apache.log4j.Appender" variable.
        log4j:ERROR The class "org.apache.log4j.Appender" was loaded by
        log4j:ERROR [ClassRealm[plugin>org.codehaus.mojo:tomcat-maven-plugin:1.1, parent: sun.misc.Launcher$AppClassLoader@61e63e3d]] whereas object of type
        log4j:ERROR "org.apache.log4j.ConsoleAppender" was loaded by [WebappClassLoader
        context: /kfs-dev
        delegate: false
        repositories:
        ----------> Parent Classloader:
        ClassRealm[plugin>org.codehaus.mojo:tomcat-maven-plugin:1.1, parent: sun.misc.Launcher$AppClassLoader@61e63e3d]
        ].
        log4j:ERROR Could not instantiate appender named "CONSOLE".
        log4j:ERROR A "org.apache.log4j.RollingFileAppender" object is not assignable to a "org.apache.log4j.Appender" variable.
        log4j:ERROR The class "org.apache.log4j.Appender" was loaded by
        log4j:ERROR [ClassRealm[plugin>org.codehaus.mojo:tomcat-maven-plugin:1.1, parent: sun.misc.Launcher$AppClassLoader@61e63e3d]] whereas object of type
        log4j:ERROR "org.apache.log4j.RollingFileAppender" was loaded by [WebappClassLoader
        context: /kfs-dev
        delegate: false
        repositories:

        Show
        r351574nc3 added a comment - Is this the same problem as I am experiencing? This is what my log is spitting out? Looks like it says delegate is 'false'. I thought this is 'true' by default. I tried explicitly setting to 'true'. that doesn't help. Looks like it's having trouble mixing sun.misc.Launcher$AppClassLoader@61e63e3d and WebappClassLoader. Is this a new issue or the same as this one? Jul 1, 2011 2:47:06 PM org.apache.catalina.startup.Embedded start INFO: Starting tomcat server Jul 1, 2011 2:47:06 PM org.apache.catalina.core.StandardEngine start INFO: Starting Servlet Engine: Apache Tomcat/6.0.29 log4j:ERROR A "org.apache.log4j.ConsoleAppender" object is not assignable to a "org.apache.log4j.Appender" variable. log4j:ERROR The class "org.apache.log4j.Appender" was loaded by log4j:ERROR [ClassRealm [plugin>org.codehaus.mojo:tomcat-maven-plugin:1.1, parent: sun.misc.Launcher$AppClassLoader@61e63e3d] ] whereas object of type log4j:ERROR "org.apache.log4j.ConsoleAppender" was loaded by [WebappClassLoader context: /kfs-dev delegate: false repositories: ----------> Parent Classloader: ClassRealm [plugin>org.codehaus.mojo:tomcat-maven-plugin:1.1, parent: sun.misc.Launcher$AppClassLoader@61e63e3d] ]. log4j:ERROR Could not instantiate appender named "CONSOLE". log4j:ERROR A "org.apache.log4j.RollingFileAppender" object is not assignable to a "org.apache.log4j.Appender" variable. log4j:ERROR The class "org.apache.log4j.Appender" was loaded by log4j:ERROR [ClassRealm [plugin>org.codehaus.mojo:tomcat-maven-plugin:1.1, parent: sun.misc.Launcher$AppClassLoader@61e63e3d] ] whereas object of type log4j:ERROR "org.apache.log4j.RollingFileAppender" was loaded by [WebappClassLoader context: /kfs-dev delegate: false repositories:

          People

          • Assignee:
            Mark Hobson
            Reporter:
            Ricardo Gladwell
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: