Uploaded image for project: 'Struts 2'
  1. Struts 2
  2. WW-4029

Do not log ex trace when an optional class could not be loaded

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.3.12
    • 2.3.14
    • Core Actions
    • None

    Description

      With Struts > 2.3.8 the following stacktrace is printed to the logfile when an optional class was not available. While the application still works, it might lead to confusion.

      2013-03-26 14:29:12,515 DEBUG [CommonsLogger.java:72] : Loaded
      type:org.apache.struts2.dispatcher.multipart.MultiPartRequest
      name:jakarta impl:org.apache.struts2.dispatcher.multipart.JakartaMultiPartRequest
      2013-03-26 14:29:12,516 DEBUG [CommonsLogger.java:72] : Loaded
      type:org.apache.struts2.views.TagLibrary name:s
      impl:org.apache.struts2.views.DefaultTagLibrary
      2013-03-26 14:29:12,519 DEBUG [CommonsLogger.java:72] : Loaded type:
      name:struts impl:org.apache.struts2.views.freemarker.FreemarkerManager
      2013-03-26 14:29:12,521 DEBUG [CommonsLogger.java:80] : Unable to load
      optional class: org.apache.struts2.views.velocity.VelocityManager
      java.lang.NoClassDefFoundError: org/apache/velocity/tools/view/ToolboxManager
      at java.lang.Class.getDeclaredConstructors0(Native Method)
      at java.lang.Class.privateGetDeclaredConstructors(Class.java:2398)
      at java.lang.Class.getDeclaredConstructors(Class.java:1838)
      at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.register(XmlConfigurationProvider.java:235)
      at org.apache.struts2.config.StrutsXmlConfigurationProvider.register(StrutsXmlConfigurationProvider.java:102)
      at com.opensymphony.xwork2.config.impl.DefaultConfiguration.reloadContainer(DefaultConfiguration.java:226)
      at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:67)
      at org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(Dispatcher.java:429)
      at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:473)
      at org.apache.struts2.dispatcher.ng.InitOperations.initDispatcher(InitOperations.java:74)
      at org.apache.struts2.dispatcher.ng.filter.StrutsPrepareFilter.init(StrutsPrepareFilter.java:50)
      at org.eclipse.jetty.servlet.FilterHolder.doStart(FilterHolder.java:99)
      at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:58)
      at org.eclipse.jetty.servlet.ServletHandler.initialize(ServletHandler.java:740)
      at org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:245)
      at org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1158)
      at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:587)
      at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:436)
      at org.mortbay.jetty.plugin.JettyWebAppContext.doStart(JettyWebAppContext.java:180)
      at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:58)
      at org.eclipse.jetty.server.handler.HandlerCollection.doStart(HandlerCollection.java:226)
      at org.eclipse.jetty.server.handler.ContextHandlerCollection.doStart(ContextHandlerCollection.java:164)
      at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:58)
      at org.eclipse.jetty.server.handler.HandlerCollection.doStart(HandlerCollection.java:226)
      at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:58)
      at org.eclipse.jetty.server.handler.HandlerWrapper.doStart(HandlerWrapper.java:93)
      at org.eclipse.jetty.server.Server.doStart(Server.java:253)
      at org.mortbay.jetty.plugin.JettyServer.doStart(JettyServer.java:67)
      at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:58)
      at org.mortbay.jetty.plugin.AbstractJettyMojo.startJetty(AbstractJettyMojo.java:468)
      at org.mortbay.jetty.plugin.AbstractJettyMojo.execute(AbstractJettyMojo.java:408)
      at org.mortbay.jetty.plugin.JettyRunMojo.execute(JettyRunMojo.java:589)
      at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)
      at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
      at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
      at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
      at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
      at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
      at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
      at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
      at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320)
      at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
      at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
      at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
      at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
      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:597)
      at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
      at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
      at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
      at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
      Caused by: java.lang.ClassNotFoundException:
      org.apache.velocity.tools.view.ToolboxManager
      at org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy.loadClass(SelfFirstStrategy.java:50)
      at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:244)
      at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:230)
      at org.eclipse.jetty.webapp.WebAppClassLoader.loadClass(WebAppClassLoader.java:420)
      at org.eclipse.jetty.webapp.WebAppClassLoader.loadClass(WebAppClassLoader.java:373)
      ... 53 more
      2013-03-26 14:29:12,523 DEBUG [CommonsLogger.java:72] : Loaded type:
      name:default impl:org.apache.struts2.components.template.TemplateEngineManager

      Attachments

        Activity

          People

            grobmeier Christian Grobmeier
            grobmeier Christian Grobmeier
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: