Fundamental bug rendering latest M2E entirely unusable? - eclipse

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.

Related

Eclipse Oxygen and Scala IDE 4.7 crashes with play framework 2.6.6 project in workspace

There are two scenarios where my eclipse ide or scala ide (downloaded directly from scala site) crashes when play/maven project is in workspace.
Here's the issue:
Upon reboot of eclipse/scala ide it says:
"An Error has occurred. See the log file /.metadata/.log"
Here's the content of that log file:
!ENTRY org.eclipse.mylyn.tasks.ui 4 0 2017-11-14 12:05:24.743
!MESSAGE FrameworkEvent ERROR
!STACK 0
org.osgi.framework.BundleException: Exception in org.eclipse.mylyn.internal.tasks.ui.TasksUiPlugin.stop() of bundle org.eclipse.mylyn.tasks.ui.
at org.eclipse.osgi.internal.framework.BundleContextImpl.stop(BundleContextImpl.java:855)
at org.eclipse.osgi.internal.framework.EquinoxBundle.stopWorker0(EquinoxBundle.java:947)
at org.eclipse.osgi.internal.framework.EquinoxBundle$EquinoxModule.stopWorker(EquinoxBundle.java:314)
at org.eclipse.osgi.container.Module.doStop(Module.java:636)
at org.eclipse.osgi.container.Module.stop(Module.java:498)
at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.decStartLevel(ModuleContainer.java:1675)
at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.doContainerStartLevel(ModuleContainer.java:1594)
at org.eclipse.osgi.container.SystemModule.stopWorker(SystemModule.java:270)
at org.eclipse.osgi.internal.framework.EquinoxBundle$SystemBundle$EquinoxSystemModule.stopWorker(EquinoxBundle.java:147)
at org.eclipse.osgi.container.Module.doStop(Module.java:636)
at org.eclipse.osgi.container.Module.stop(Module.java:498)
at org.eclipse.osgi.container.SystemModule.stop(SystemModule.java:202)
at org.eclipse.osgi.internal.framework.EquinoxBundle$SystemBundle$EquinoxSystemModule$1.run(EquinoxBundle.java:165)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.ExceptionInInitializerError
at org.eclipse.mylyn.internal.tasks.ui.TasksUiPlugin.stop(TasksUiPlugin.java:816)
at org.eclipse.osgi.internal.framework.BundleContextImpl$4.run(BundleContextImpl.java:835)
at org.eclipse.osgi.internal.framework.BundleContextImpl$4.run(BundleContextImpl.java:1)
at java.security.AccessController.doPrivileged(Native Method)
at org.eclipse.osgi.internal.framework.BundleContextImpl.stop(BundleContextImpl.java:828)
... 13 more
Caused by: org.eclipse.swt.SWTException: Invalid thread access
at org.eclipse.swt.SWT.error(SWT.java:4533)
at org.eclipse.swt.SWT.error(SWT.java:4448)
at org.eclipse.swt.SWT.error(SWT.java:4419)
at org.eclipse.swt.widgets.Display.error(Display.java:1089)
at org.eclipse.swt.widgets.Display.createDisplay(Display.java:840)
at org.eclipse.swt.widgets.Display.create(Display.java:823)
at org.eclipse.swt.graphics.Device.<init>(Device.java:129)
at org.eclipse.swt.widgets.Display.<init>(Display.java:722)
at org.eclipse.swt.widgets.Display.<init>(Display.java:713)
at org.eclipse.swt.widgets.Display.getDefault(Display.java:1419)
at org.eclipse.mylyn.commons.ui.compatibility.CommonColors.<clinit>(CommonColors.java:28)
... 18 more
Root exception:
java.lang.ExceptionInInitializerError
at org.eclipse.mylyn.internal.tasks.ui.TasksUiPlugin.stop(TasksUiPlugin.java:816)
at org.eclipse.osgi.internal.framework.BundleContextImpl$4.run(BundleContextImpl.java:835)
at org.eclipse.osgi.internal.framework.BundleContextImpl$4.run(BundleContextImpl.java:1)
at java.security.AccessController.doPrivileged(Native Method)
at org.eclipse.osgi.internal.framework.BundleContextImpl.stop(BundleContextImpl.java:828)
at org.eclipse.osgi.internal.framework.EquinoxBundle.stopWorker0(EquinoxBundle.java:947)
at org.eclipse.osgi.internal.framework.EquinoxBundle$EquinoxModule.stopWorker(EquinoxBundle.java:314)
at org.eclipse.osgi.container.Module.doStop(Module.java:636)
at org.eclipse.osgi.container.Module.stop(Module.java:498)
at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.decStartLevel(ModuleContainer.java:1675)
at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.doContainerStartLevel(ModuleContainer.java:1594)
at org.eclipse.osgi.container.SystemModule.stopWorker(SystemModule.java:270)
at org.eclipse.osgi.internal.framework.EquinoxBundle$SystemBundle$EquinoxSystemModule.stopWorker(EquinoxBundle.java:147)
at org.eclipse.osgi.container.Module.doStop(Module.java:636)
at org.eclipse.osgi.container.Module.stop(Module.java:498)
at org.eclipse.osgi.container.SystemModule.stop(SystemModule.java:202)
at org.eclipse.osgi.internal.framework.EquinoxBundle$SystemBundle$EquinoxSystemModule$1.run(EquinoxBundle.java:165)
at java.lang.Thread.run(Thread.java:745)
Caused by: org.eclipse.swt.SWTException: Invalid thread access
at org.eclipse.swt.SWT.error(SWT.java:4533)
at org.eclipse.swt.SWT.error(SWT.java:4448)
at org.eclipse.swt.SWT.error(SWT.java:4419)
at org.eclipse.swt.widgets.Display.error(Display.java:1089)
at org.eclipse.swt.widgets.Display.createDisplay(Display.java:840)
at org.eclipse.swt.widgets.Display.create(Display.java:823)
at org.eclipse.swt.graphics.Device.<init>(Device.java:129)
at org.eclipse.swt.widgets.Display.<init>(Display.java:722)
at org.eclipse.swt.widgets.Display.<init>(Display.java:713)
at org.eclipse.swt.widgets.Display.getDefault(Display.java:1419)
at org.eclipse.mylyn.commons.ui.compatibility.CommonColors.<clinit>(CommonColors.java:28)
... 18 more
I tested it with both ScalaIDE and Eclipse
1) Install Scala IDE 4.7. import existing play/maven project. Notice bunch of scala complier errors in IDE Error Log. Restart and you see eclipse can't boot same workspace. It can boot other workspaces. Even if I remove all eclipse files (.settings, .classpath, .project) from play-maven project it crashes. Only soln is to remove .metadata from workspace and re-import project. But issue happens again after next restart.
2) Install Eclipse Oxygen. import existing play/maven project. Install Scala IDE 4.7 plugin which requires eclipse to restart. Upon restart it crashes for that workspace. Same workaround as 1.
PS - as I mentioned on top, eclipse/scala-id start up fine if I choose any other workspace which doesn't have play-maven project inside.
Let me know if I need to share any other detail.
I don't know what you mean by "install eclipse oxygen" but I think in case of this sort of problem is better to download Scala IDE from here http://scala-ide.org/download/sdk.html as zip and unpack it. Hope it helps

Eclipse cant find some of the JUnit files

I have a maven project with spring. And we also have alot of JUnit test classes. We are using Eclipse. Every now and then - quite often actually - eclipse shows some (not all) of the test classes as red... Claiming it cant find imports. Looking at Eclipse error log, I can see alot of these error messages (but for different test-classes ofc).
What is happening? My collegue who works with the same project does not get this error. We are using Eclipse Juno SR2.
org.eclipse.core.runtime.CoreException: File not found: C:\xxx\target\test-classes\com\yyy\vet\zzz\service\TradeWashTest.class.
at org.eclipse.core.internal.filesystem.Policy.error(Policy.java:55)
at org.eclipse.core.internal.filesystem.local.LocalFile.openInputStream(LocalFile.java:377)
at org.eclipse.core.internal.localstore.FileSystemResourceManager.read(FileSystemResourceManager.java:797)
at org.eclipse.core.internal.resources.File.getContents(File.java:289)
at org.eclipse.jdt.internal.core.util.Util.getResourceContentsAsByteArray(Util.java:1132)
at org.eclipse.jdt.internal.core.builder.IncrementalImageBuilder.writeClassFileCheck(IncrementalImageBuilder.java:888)
at org.eclipse.jdt.internal.core.builder.IncrementalImageBuilder.writeClassFileContents(IncrementalImageBuilder.java:830)
at org.eclipse.jdt.internal.core.builder.AbstractImageBuilder.writeClassFile(AbstractImageBuilder.java:857)
at org.eclipse.jdt.internal.core.builder.AbstractImageBuilder.acceptResult(AbstractImageBuilder.java:188)
at org.eclipse.jdt.internal.compiler.Compiler.compile(Compiler.java:510)
at org.eclipse.jdt.internal.core.builder.AbstractImageBuilder.compile(AbstractImageBuilder.java:365)
at org.eclipse.jdt.internal.core.builder.IncrementalImageBuilder.compile(IncrementalImageBuilder.java:329)
at org.eclipse.jdt.internal.core.builder.AbstractImageBuilder.compile(AbstractImageBuilder.java:302)
at org.eclipse.jdt.internal.core.builder.IncrementalImageBuilder.build(IncrementalImageBuilder.java:134)
at org.eclipse.jdt.internal.core.builder.JavaBuilder.buildDeltas(JavaBuilder.java:265)
at org.eclipse.jdt.internal.core.builder.JavaBuilder.build(JavaBuilder.java:193)
at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:726)
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:53)
Caused by: java.io.FileNotFoundException: C:\dev\xxx\target\test-classes\com\yyy\vet\zzz\service\TradeWashTest.class (The system cannot find the path specified)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.<init>(Unknown Source)
at org.eclipse.core.internal.filesystem.local.LocalFile.openInputStream(LocalFile.java:368)
... 26 more
The problem could be in the jars dependencies (especially if you're using mocks). You need to perform two steps to figure out what the problem is:
1.Run unit tests using maven (in case it works you can go to step2);
2. Look into jars order in the Eclipse (projects setting-> java build path-> order and settings).
In case you said that it works for your colleague you need to compare order of your jars with jar's order of you colleague

"no J3D in java.library.path" in Maven Eclipse

The error I'm getting is well discussed here, but I still can't seem to get a grip on what I'm doing wrong.
I'm trying to run a simple code with java3d. I added the jard to the Maven Dependencies and they are showing up. No errors are displayed and everything seems fine.
But when I'm trying to compile the code, all of a sudden the message
Exception in thread "main" java.lang.UnsatisfiedLinkError: no J3D in java.library.path
at java.lang.ClassLoader.loadLibrary(Unknown Source)
at java.lang.Runtime.loadLibrary0(Unknown Source)
at java.lang.System.loadLibrary(Unknown Source)
at javax.media.j3d.MasterControl$22.run(MasterControl.java:889)
at java.security.AccessController.doPrivileged(Native Method)
at javax.media.j3d.MasterControl.loadLibraries(MasterControl.java:886)
at javax.media.j3d.VirtualUniverse.<clinit>(VirtualUniverse.java:229)
at de.act.gui.Skelett3D.main(Skelett3D.java:15)
appears.
Apparently I'm just missing some trivial error. Since the question has been asked so many times, the answer should be somewhere.
I added the Jars via the pom.xml with
<dependency>
<groupId>java3d</groupId>
<artifactId>j3d-core-utils</artifactId>
<version>1.3.1</version>
</dependency>
You are missing a native library (i.e. a dll or so file).
I do not know how to correctly reference that from maven (apparently there is something like a NAR that you can built, but I have not researched that yet).
A quick solution for eclipse is to add the dll as a native dependency to your Maven Dependencies library in eclipse:
In the "Libraries" tab in "Java Build Path" in the project properties, expand "Maven Dependencies" and edit "Native library location" to point to the directory containing your native library.
If the above solution is not working try to manually install maven and j3d, or reinstall it.
a missing file is sometimes a really bad sign, because sometimes if 1 file is missing maybe you haven't installed propertly and other files will be missing later on so i suggest you reinstalling.

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.

Tomcat 7 Start up problem in Eclispse for maven project

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.