Tomcat 7 Start up problem in Eclispse for maven project - eclipse

I m getting this intermittent problem in eclipse, when i try to run a maven project in tomcat
Details are as follows :
Eclipse version : 3.6
Maven version : 2.2.1
Tomcat version : 7
Error log :
java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1362)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1208)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3712)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4216)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1014)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:736)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1014)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
at org.apache.catalina.core.StandardService.start(StandardService.java:448)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:700)
at org.apache.catalina.startup.Catalina.start(Catalina.java:552)
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.apache.catalina.startup.Bootstrap.start(Bootstrap.java:295)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:433)
Deleting and Recreating the server solves the problem, but still i would like to know why this error is created.

This error usually occurs when Spring misses a jar file on the classpath. The main reason for this is that Eclipse not always deploys a project correctly to its Tomcat server. Instead of deleting the server, you can also clean the server and redeploy the application.

Thanks for your reply. Well my problem was fixed by doing a mvn eclipse:clean eclipse:eclipse

I encountered the same error
I added my spring library in deployment assembly and build path of the project.
I think your server did not detect the library and restarting it made the server check for the build paths.

Related

Jetty Startup issue: WebAppContext:Failed startup of context o.e.j.w.WebAppContext{/,null}

I´m trying to start a new project war with maven and spring into Spring Tool Suite IDE, I downloaded the project from Git Hub, the project was made on macs and I´m working in windows.
This is what I´m getting when I try to start the Jetty server:
2013-09-03 10:01:47.161:INFO:oejs.Server:jetty-8.1.12.v20130726
2013-09-03 10:01:47.179:INFO:oejdp.ScanningAppProvider:Deployment monitor C:\Users\HP\Documents\workspace-sts-3.3.0.RELEASE\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\webapps at interval 1
2013-09-03 10:01:47.183:INFO:oejdp.ScanningAppProvider:Deployment monitor C:\Users\HP\Documents\workspace-sts-3.3.0.RELEASE\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\contexts at interval 1
2013-09-03 10:01:47.187:INFO:oejd.DeploymentManager:Deployable added: C:\Users\HP\Documents\workspace-sts-3.3.0.RELEASE\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\contexts\moca-console.xml
2013-09-03 10:01:47.238:WARN:oejw.WebInfConfiguration:Web application not found C:\Users\HP\Documents\workspace-sts-3.3.0.RELEASE\.metadata\.plugins\org.eclipse.wst.server.core\tmp0/wtpwebapps/moca-console
2013-09-03 10:01:47.239:WARN:oejw.WebAppContext:Failed startup of context o.e.j.w.WebAppContext{/,null},C:\Users\HP\Documents\workspace-sts-3.3.0.RELEASE\.metadata\.plugins\org.eclipse.wst.server.core\tmp0/wtpwebapps/moca-console
java.io.FileNotFoundException: C:\Users\HP\Documents\workspace-sts-3.3.0.RELEASE\.metadata\.plugins\org.eclipse.wst.server.core\tmp0/wtpwebapps/moca-console
at org.eclipse.jetty.webapp.WebInfConfiguration.unpack(WebInfConfiguration.java:502)
at org.eclipse.jetty.webapp.WebInfConfiguration.preConfigure(WebInfConfiguration.java:71)
at org.eclipse.jetty.webapp.WebAppContext.preConfigure(WebAppContext.java:457)
at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:493)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)
at org.eclipse.jetty.deploy.bindings.StandardStarter.processBinding(StandardStarter.java:39)
at org.eclipse.jetty.deploy.AppLifeCycle.runBindings(AppLifeCycle.java:186)
at org.eclipse.jetty.deploy.DeploymentManager.requestAppGoal(DeploymentManager.java:494)
at org.eclipse.jetty.deploy.DeploymentManager.addApp(DeploymentManager.java:141)
at org.eclipse.jetty.deploy.providers.ScanningAppProvider.fileAdded(ScanningAppProvider.java:145)
at org.eclipse.jetty.deploy.providers.ScanningAppProvider$1.fileAdded(ScanningAppProvider.java:56)
at org.eclipse.jetty.util.Scanner.reportAddition(Scanner.java:615)
at org.eclipse.jetty.util.Scanner.reportDifferences(Scanner.java:540)
at org.eclipse.jetty.util.Scanner.scan(Scanner.java:403)
at org.eclipse.jetty.util.Scanner.doStart(Scanner.java:337)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)
at org.eclipse.jetty.deploy.providers.ScanningAppProvider.doStart(ScanningAppProvider.java:121)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)
at org.eclipse.jetty.deploy.DeploymentManager.startAppProvider(DeploymentManager.java:555)
at org.eclipse.jetty.deploy.DeploymentManager.doStart(DeploymentManager.java:230)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)
at org.eclipse.jetty.util.component.AggregateLifeCycle.doStart(AggregateLifeCycle.java:81)
at org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:58)
at org.eclipse.jetty.server.handler.HandlerWrapper.doStart(HandlerWrapper.java:96)
at org.eclipse.jetty.server.Server.doStart(Server.java:282)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)
at org.eclipse.jetty.xml.XmlConfiguration$1.run(XmlConfiguration.java:1259)
at java.security.AccessController.doPrivileged(Native Method)
at org.eclipse.jetty.xml.XmlConfiguration.main(XmlConfiguration.java:1182)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.eclipse.jetty.start.Main.invokeMain(Main.java:473)
at org.eclipse.jetty.start.Main.start(Main.java:615)
at org.eclipse.jetty.start.Main.main(Main.java:96)
2013-09-03 10:01:47.277:INFO:oejs.AbstractConnector:Started SelectChannelConnector#0.0.0.0:8080
I have tried a bunch of possible solutions without success. Any suggestion will be welcome.
It seems that your eclipse STS workspace is out of sync with the content published in the server. Try to clean the server, clean the working directory, clean all projects and Republish the project into the server.
If this does not work, try these steps to regenerate your eclipse workspace:
close eclipse and do a maven clean install from the command line
delete all eclipse related files: .project, .classpath and .settings
reopen eclipse, and configure maven to use the same maven as the command line
import the project using 'Import as Maven Project'
scrap your Jetty and redownload a clean one
Create a new Jetty server, point it to the new Jetty and add your application to it
Republish the application and start the server
Yep it looks like problem with plugins. So just close STS.
Deleting workspace or plugin's is not good idea. It can create problem to other projects.
And follow these steps-
right click on project in project explorer.
select maven->update->tick all enable check box's->press ok
This will update all plugin's that are creating problem.
Best of Luck

Fundamental bug rendering latest M2E entirely unusable?

Eclipse: Juno (3.8.0)
M2E build: 1.2.0.20120903-1050
When I try to right click on a Maven Project and select Maven > Update Project... and then click OK , I get the following showstopping error:
'Updating Maven Project has encountered a problem. An internal error
occured during: "Updating Maven Project".
This one is straight from the box - so it must be fundamentally broken? This error presents the following exception:
java.lang.NoClassDefFoundError: Lorg/codehaus/plexus/archiver/jar/JarArchiver;
at java.lang.Class.getDeclaredFields0(Native Method)
at java.lang.Class.privateGetDeclaredFields(Unknown Source)
at java.lang.Class.getDeclaredFields(Unknown Source)
at com.google.inject.spi.InjectionPoint.getInjectionPoints(InjectionPoint.java:651)
at com.google.inject.spi.InjectionPoint.forInstanceMethodsAndFields(InjectionPoint.java:358)
at com.google.inject.internal.ConstructorBindingImpl.getInternalDependencies(ConstructorBindingImpl.java:155)
at com.google.inject.internal.InjectorImpl.getInternalDependencies(InjectorImpl.java:585)
at com.google.inject.internal.InjectorImpl.cleanup(InjectorImpl.java:542)
at com.google.inject.internal.InjectorImpl.initializeJitBinding(InjectorImpl.java:528)
at com.google.inject.internal.InjectorImpl.createJustInTimeBinding(InjectorImpl.java:833)
at com.google.inject.internal.InjectorImpl.createJustInTimeBindingRecursive(InjectorImpl.java:758)
at com.google.inject.internal.InjectorImpl.getJustInTimeBinding(InjectorImpl.java:255)
at com.google.inject.internal.InjectorImpl.getBindingOrThrow(InjectorImpl.java:204)
at com.google.inject.internal.InjectorImpl.getProviderOrThrow(InjectorImpl.java:954)
at com.google.inject.internal.InjectorImpl.getProvider(InjectorImpl.java:987)
at com.google.inject.internal.InjectorImpl.getProvider(InjectorImpl.java:950)
at com.google.inject.internal.InjectorImpl.getInstance(InjectorImpl.java:1000)
at org.sonatype.guice.bean.reflect.AbstractDeferredClass.get(AbstractDeferredClass.java:45)
at com.google.inject.internal.ProviderInternalFactory.provision(ProviderInternalFactory.java:84)
at com.google.inject.internal.InternalFactoryToInitializableAdapter.provision(InternalFactoryToInitializableAdapter.java:52)
at com.google.inject.internal.ProviderInternalFactory$1.call(ProviderInternalFactory.java:70)
at com.google.inject.internal.ProvisionListenerStackCallback$Provision.provision(ProvisionListenerStackCallback.java:100)
at org.sonatype.guice.plexus.lifecycles.PlexusLifecycleManager.onProvision(PlexusLifecycleManager.java:138)
at com.google.inject.internal.ProvisionListenerStackCallback$Provision.provision(ProvisionListenerStackCallback.java:108)
at com.google.inject.internal.ProvisionListenerStackCallback.provision(ProvisionListenerStackCallback.java:55)
at com.google.inject.internal.ProviderInternalFactory.circularGet(ProviderInternalFactory.java:68)
at com.google.inject.internal.InternalFactoryToInitializableAdapter.get(InternalFactoryToInitializableAdapter.java:45)
at com.google.inject.internal.InjectorImpl$3$1.call(InjectorImpl.java:965)
at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1011)
at com.google.inject.internal.InjectorImpl$3.get(InjectorImpl.java:961)
at com.google.inject.Scopes$1$1.get(Scopes.java:59)
at org.sonatype.guice.bean.locators.LazyBeanEntry.getValue(LazyBeanEntry.java:83)
at org.sonatype.guice.plexus.locators.LazyPlexusBean.getValue(LazyPlexusBean.java:49)
at org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:253)
at org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:245)
at org.apache.maven.plugin.internal.DefaultMavenPluginManager.getConfiguredMojo(DefaultMavenPluginManager.java:455)
at org.eclipse.m2e.core.internal.embedder.MavenImpl.getConfiguredMojo(MavenImpl.java:344)
at org.sonatype.m2e.mavenarchiver.internal.AbstractMavenArchiverConfigurator.reflectManifestGeneration(AbstractMavenArchiverConfigurator.java:406)
at org.sonatype.m2e.mavenarchiver.internal.AbstractMavenArchiverConfigurator.generateManifest(AbstractMavenArchiverConfigurator.java:364)
at org.sonatype.m2e.mavenarchiver.internal.AbstractMavenArchiverConfigurator.mavenProjectChanged(AbstractMavenArchiverConfigurator.java:183)
at org.sonatype.m2e.mavenarchiver.internal.AbstractMavenArchiverConfigurator.mavenProjectChanged(AbstractMavenArchiverConfigurator.java:170)
at org.eclipse.m2e.core.internal.project.ProjectConfigurationManager.mavenProjectChanged(ProjectConfigurationManager.java:888)
at org.eclipse.m2e.core.internal.project.registry.ProjectRegistryManager.notifyProjectChangeListeners(ProjectRegistryManager.java:729)
at org.eclipse.m2e.core.internal.project.registry.ProjectRegistryManager.applyMutableProjectRegistry(ProjectRegistryManager.java:852)
at org.eclipse.m2e.core.internal.project.registry.ProjectRegistryManager.refresh(ProjectRegistryManager.java:281)
at org.eclipse.m2e.core.internal.project.registry.MavenProjectManager.refresh(MavenProjectManager.java:58)
at org.eclipse.m2e.core.internal.builder.MavenBuilder.build(MavenBuilder.java:87)
at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:728)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:199)
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:239)
at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:292)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:295)
at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:351)
at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:374)
at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:143)
at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:241)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)
Caused by: java.lang.ClassNotFoundException: org.codehaus.plexus.archiver.jar.JarArchiver
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 java.lang.ClassLoader.loadClassInternal(Unknown Source)
... 59 more
I have come across the same error.
When I first created the maven project using m2e, the maven installation was configured to my local apache-maven-3.0.3 folder.
Recently I switched ide to spring tool suite, which has apache-maven-3.0.4 bundled. So I use 3.0.4 instead, then the error "java.lang.NoClassDefFoundError: Lorg/codehaus/plexus/archiver/jar/JarArchiver;" appears. Now I get the configuration back to previous version of maven, the error disappears.
I'm using m2e 1.2.0 without problems, so it must be a local problem on your PC. Try:
Try restarting Eclipse
A colleague had a similar problem yesterday on a Linux machine. To my surprise, a reboot fixed it.
Make sure that the JAR files in ~/.m2/repository/org/codehaus/plexus/plexus-archiver/ aren't corrupt.
When you do the last step, make sure you look in the correct repository. It's possible to configure the two Maven's (Eclipse's and the one on the command line) differently. Check the "Maven" preferences in Eclipse for the paths of the settings files.

java.lang.NoClassDefFoundError: org/apache/juli/logging/LogFactory [duplicate]

This question already has answers here:
java.lang.NoClassDefFoundError: org/apache/juli/logging/LogFactory
(5 answers)
Closed 6 years ago.
Seem to have a problem starting my Java app:
Exception in thread "main" java.lang.NoClassDefFoundError:
org/apache/juli/logging/LogFactory at
org.apache.catalina.util.LifecycleBase.(LifecycleBase.java:37)
Caused by: java.lang.ClassNotFoundException:
org.apache.juli.logging.LogFactory at
java.net.URLClassLoader$1.run(URLClassLoader.java:366) at
java.net.URLClassLoader$1.run(URLClassLoader.java:355) at
java.security.AccessController.doPrivileged(Native Method) at
java.net.URLClassLoader.findClass(URLClassLoader.java:354) at
java.lang.ClassLoader.loadClass(ClassLoader.java:423) at
sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308) at
java.lang.ClassLoader.loadClass(ClassLoader.java:356) ... 1 more
Tried the solution here:
java.lang.NoClassDefFoundError: org/apache/juli/logging/LogFactory
But I see tomcat-juli.jar already. Also I'm using Tomcat 7. What might be wrong?
Your vm does not find the class org/apache/juli/logging/LogFactory check if this class is present in the tomcat-juli.jar that you use (unzip it and search the file), if it's not present download the library from apache web site else if it's present put the tomcat-juli.jar in a path (the lib directory) that Tomcat use to load classes. If your Tomcat does not find it you can copy the jar in the lib directory of the JRE that you are using.
I ran into this problem when using tomcat-embed-core::7.0.47, from Maven. I'm not sure why they didn't add tomcat-util as a runtime dependency, so I added my own runtime dependency to my own project.
<dependency>
<groupId>org.apache.tomcat</groupId>
<artifactId>tomcat-util</artifactId>
<version><!-- version from tomcat-embed-core --></version>
<scope>runtime</scope>
</dependency>
This happened to me because I was using a Tomcat 5.5 catalina.sh file with a Tomcat 7 installation. Using the catalina.sh that came with the Tomcat 7 install fixed the problem.
If you are using jsvc to run tomcat as tomcat (run /etc/init.d/tomcat as root), edit /etc/init.d/tomcat and add $CATALINA_HOME/bin/tomcat-juli.jar to CLASSPATH.
I had the same problem, What helped me was:
Right click on the project.
Click 'Properties'
Go to 'Java Build Path'
And then: 'Libraries'
In there, Click: Add External Jars
Add: ''Path/To/Tomcat/Bin/tomcat-juli.jar
Done .
In our case, the wrong version of the Sysdeo Tomcat plugin for Eclipse 3.5 was being used. The fix:
Use tomcatPluginV33 instead of tomcatPluginV321 (extract to C:\eclipse\dropins)
Ensure that DevloaderTomcat7.jar was placed in the tomcat lib folder
In Window > Preferences > Tomcat, set the Tomcat version to 7.x
This problem may have been unique to our environment; but, I'll record it here anyway, for posterity's sake.
On Ubuntu 14.04 LTS
/usr/share# mv /opt/tomcat/apache-tomcat-7.0.56/ tomcat7
fixed the issue for me. There was a symbolic link there to /opt. Inside that opt directory there where ../../java links that would not point to /usr/share/java since the files physically were in /opt

Tomcat not starting

i always get the following error when trying to start Tomcat in eclipse (or also from the terminal with this specific war file)the build using ant is successful of course:
08.08.2011 08:21:02 org.apache.catalina.core.StandardContext loadOnStartup
SCHWERWIEGEND: Servlet threw load() exception
java.lang.ClassNotFoundException: dea.alo.aloWeb.spring.StxxDelegatingRequestProcessor
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1678)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1523)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:169)
at com.oroad.stxx.plugin.StxxPlugin.initRequestProcessorClass(StxxPlugin.java:153)
at com.oroad.stxx.plugin.StxxPlugin.init(StxxPlugin.java:102)
at org.apache.struts.action.ActionServlet.initModulePlugIns(ActionServlet.java:1158)
at org.apache.struts.action.ActionServlet.init(ActionServlet.java:473)
at javax.servlet.GenericServlet.init(GenericServlet.java:160)
at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1216)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1135)
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1031)
at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4957)
at org.apache.catalina.core.StandardContext$3.call(StandardContext.java:5284)
at org.apache.catalina.core.StandardContext$3.call(StandardContext.java:5279)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:680)
It runs perfectly on a pc using linux and eclipse galileo, but not on my mac using eclipse indigo. the libraries are all in place..does anyone have an idea what the problem might be?
Looks like I syncyronisation problem I often have.
Refresh the Workspace
Project Build (most time not needed) - But make sure that there are no build errors
Then run the two tasks from the Servers/(tomcat) Context menu
Clean...
Clean Tomcat Working Directory
If this all does not help, then Remove the application from the Server, clean the Server and Deploy the application again to the server.
The class StxxDelegatingRequestProcessor is missing in your classpath -> "ClassNotFoundException: dea.alo.aloWeb.spring.StxxDelegatingRequestProcessor"
I think you copied the struts conf from a site but not the class :)

NoClassDefFoundError when running Tomcat + Spring + Maven project (Eclipse)

What I get is:
java.lang.NoClassDefFoundError: com/mongodb/DB
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Class.java:2427)
at java.lang.Class.getDeclaredMethods(Class.java:1791)
at org.springframework.util.ReflectionUtils.doWithMethods(ReflectionUtils.java:446)
at org.springframework.util.ReflectionUtils.doWithMethods(ReflectionUtils.java:430)
at org.springframework.util.ReflectionUtils.getAllDeclaredMethods(ReflectionUtils.java:475)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.getTypeForFactoryMethod(AbstractAutowireCapableBeanFactory.java:634)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.predictBeanType(AbstractAutowireCapableBeanFactory.java:573)
at org.springframework.beans.factory.support.AbstractBeanFactory.isFactoryBean(AbstractBeanFactory.java:1319)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanNamesForType(DefaultListableBeanFactory.java:315)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeansOfType(DefaultListableBeanFactory.java:394)
at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:594)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:407)
at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:442)
at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:458)
at org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:339)
at org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:306)
at org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:127)
at javax.servlet.GenericServlet.init(GenericServlet.java:212)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1173)
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:993)
at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4420)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4733)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:840)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:463)
at org.apache.catalina.core.StandardService.start(StandardService.java:525)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:754)
at org.apache.catalina.startup.Catalina.start(Catalina.java:595)
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.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)
This class is inside maven jar (from M2 repository). I added Maven Dependencies to DeploymentAssembly (before I did it i got: java.lang.ClassNotFoundException: org.springframework.web.filter.CharacterEncodingFilter). I use m2e plugin and have my project configured as Maven project. My app is deployed to standard location /.metadata/.plugins/.../tmp0. Inside of WEB-INF/lib I have all necessary jars. Project compiles with no error. What could I do wrong?
One quasi-solution is to add necessary libraries to Tomcat lib directory but I don't want to do that. I want to force Tomcat to use project libraries.
I have had a similar issue when trying to run the mcv-ajax and mvc-basic samples, distributed with Spring 3 (both available at https://src.springframework.org/svn/spring-samples - need an SVN client to download them, something like TortoiseSVN).
I was getting this ClassNotFoundException in my Tomcat6 startup log.
SEVERE: Exception starting filter characterEncodingFilter java.lang.ClassNotFoundException: org.springframework.web.filter.CharacterEncodingFilter
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1680)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1526)
at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:269)
at org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:422)
at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:115)
at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4071)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4725)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:840)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:463)
at org.apache.catalina.core.StandardService.start(StandardService.java:525)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:754)
at org.apache.catalina.startup.Catalina.start(Catalina.java:595)
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.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)
Feb 17, 2012 10:36:18 AM org.apache.catalina.core.StandardContext start
SEVERE: Error filterStart
Feb 17, 2012 10:36:18 AM org.apache.catalina.core.StandardContext start
SEVERE: Context [/mvc-basic] startup failed due to previous errors
I could run both Maven Clean and Maven Install goals, with no errors, and the project did not have any classpath errors.
I also installed the eclipse Maven Integration for WTP available under the Maven Integration for Eclipse Extras package, as instructed here, but still no luck...
The problem in my case, could be seen in the Markers tab in Eclipse, as a warning (yellow eclamation mark) with a description of Classpath Dependency validator Message
and an actual issue of classpath entry org.eclipse.maven2_classpath.container will not be exported or published. Runtime ClassNotFoundExceptions may result.
To solve this issue
right-click on the problem description, and selected quick fix.
Select Mark the associated raw classpath entry as a publish/export dependency
Click on Finish
Do a maven-clean and a maven-install
right click on project, select run on server. Select Tomcat server to run on, and you should see the initial page.
Conclusion
The steps described above, worked for me in making the project run successfully in my Eclispe Development Environment. Please give it a try to see if it will work for you.
An alternative solution which also seems to work, is
delete the project from eclipse, including all associated files in the workspace. (delete project directory from workspace as well)
Check the project out again from SVN into the workspace
Import new project in eclipse, but choose Maven\Existing Maven Project
Select the project from the disk and import.
Kind regards,
ta6hbe
It looks like You didn't install the m2eclipse WTP integration.
If so, than this may me the source of wrong deployment. When WTP integration is installed You shouldn't need to change anythong in the deployment descriptor - the plugin should configure Your project automatically. If not, try RMB -> Maven -> Update project configuration, but be sure to install the WTP integration first.