"no J3D in java.library.path" in Maven Eclipse - 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.

Related

Class Not found : org.springframework.web.servlet.DispatcherServlet

In spring-hibernate project, I have added all jars required in some User created library in eclipse. But still it is giving the exception that,
ServletDispatcher is not available. Below all jar files included are shown, just help me which one I left.
org.springframework.aop-3.0.4.RELEASE.jar
org.springframework.asm-3.0.4.RELEASE.jar
org.springframework.aspects-3.0.4.RELEASE.jar
org.springframework.beans-3.0.4.RELEASE.jar
org.springframework.context.support-3.0.4.RELEASE.jar
org.springframework.context-3.0.4.RELEASE.jar
org.springframework.core-3.0.4.RELEASE.jar
org.springframework.expression-3.0.4.RELEASE.jar
org.springframework.instrument.tomcat-3.0.4.RELEASE.jar
org.springframework.instrument-3.0.4.RELEASE.jar
org.springframework.jdbc-3.0.4.RELEASE.jar
org.springframework.jms-3.0.4.RELEASE.jar
org.springframework.orm-3.0.4.RELEASE.jar
org.springframework.oxm-3.0.4.RELEASE.jar
org.springframework.test-3.0.4.RELEASE.jar
org.springframework.transaction-3.0.4.RELEASE.jar
org.springframework.web.portlet-3.0.4.RELEASE.jar
org.springframework.web.servlet-3.0.4.RELEASE.jar
org.springframework.web.struts-3.0.4.RELEASE.jar
org.springframework.web-3.0.4.RELEASE.jar
hibernate3.jar
jstl.jar
standard.jar
org.springframework.webflow-2.2.1.RELEASE.jar
StackTrace is:
SEVERE: Servlet /PersonLoanManegment threw load() exception
java.lang.ClassNotFoundException: org.springframework.web.servlet.DispatcherServlet
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1711)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1556)
at org.apache.catalina.core.DefaultInstanceManager.loadClass(DefaultInstanceManager.java:525)
at org.apache.catalina.core.DefaultInstanceManager.loadClassMaybePrivileged(DefaultInstanceManager.java:507)
at org.apache.catalina.core.DefaultInstanceManager.newInstance(DefaultInstanceManager.java:124)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1136)
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1080)
at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:5015)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5302)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1566)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1556)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
at java.util.concurrent.FutureTask.run(FutureTask.java:166)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
at java.lang.Thread.run(Thread.java:722)
I found adding to the POM:
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
<version>${spring-framework.version}</version>
</dependency>
Added the needing file and IntelliJ was able to resolve the DispatcherServlet.
You need jar spring-web-3.0.4.RELEASE.jar in your classpath. With Maven:
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
<version>3.0.4.RELEASE</version>
</dependency>
Regards
You need jar org.springframework.web.servlet-3.0.4.RELEASE.jar in your classpath. Which contains org.springframework.web.servlet.DispatcherServlet
This is a very old question
According to an article I read "Most probably the necessary Spring MVC related jar files are not loaded and deployed on tomcat startup. But note: these files are in your classpath and hence you are not getting any error in Eclipse IDE during development time. Happens only during runtime."
This is how I resolved mine:
Right Click on Project.
Choose Properties.
Click Deployment Assembly.
Click on Add.
Select "Java Build Path Entries"
Select Maven Dependencies and finish.
Clean the project and you are good to go.
Maybe, it's not because you lost dependency configuration. you should check whether the jar is really available, follow this:
package your project, then unzip it, check: /WEB-INF/lib, see if the org.springframework.web.servlet-3.0.4.RELEASE.jar exists! if yes, unzip this jar, see if it's corrupt! it it's not existing or corrupt, check your maven repository, you can remove this artifact from your maven repository, and rebuild, let maven re-download it. Good luck!
Whenever you come across ClassNotFound exceptions try to find the missing jar using the various online tools like jarFinder

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

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

Problem running a GWT 2.4 App on Tomcat

I have a problem running my gwt2.4rc1 application in a tomcat. The problem occurs when I try to make a requestfactory call. Then I get the exception at the bottom.
When I run GWT in development mode everything works fine. The gwt-dev. jar is in the lib folder of my webapp. I am using maven for dependency management. Could there be a problem with my configuration? I already had the error with gwt2.4 beta. If there are any other information required to solve this problem I am glad to provide them.
Regards,
Arne
SEVERE: Unexpected error
com.google.web.bindery.requestfactory.server.UnexpectedException: Unexpected checked exception
at com.google.web.bindery.requestfactory.server.ServiceLayerDecorator.die(ServiceLayerDecorator.java:216)
at com.google.web.bindery.requestfactory.server.ServiceLayerCache.getOrCache(ServiceLayerCache.java:242)
at com.google.web.bindery.requestfactory.server.ServiceLayerCache.resolveRequestFactory(ServiceLayerCache.java:198)
at com.google.web.bindery.requestfactory.server.SimpleRequestProcessor.process(SimpleRequestProcessor.java:201)
at com.google.web.bindery.requestfactory.server.SimpleRequestProcessor.process(SimpleRequestProcessor.java:125)
at com.google.web.bindery.requestfactory.server.RequestFactoryServlet.doPost(RequestFactoryServlet.java:133)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:641)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
at com.google.inject.servlet.ServletDefinition.doService(ServletDefinition.java:261)
at com.google.inject.servlet.ServletDefinition.service(ServletDefinition.java:175)
at com.google.inject.servlet.ManagedServletPipeline.service(ManagedServletPipeline.java:91)
at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:62)
at org.apache.shiro.web.servlet.AdviceFilter.executeChain(AdviceFilter.java:108)
at org.apache.shiro.web.servlet.AdviceFilter.doFilterInternal(AdviceFilter.java:137)
at org.apache.shiro.web.servlet.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:81)
at com.google.inject.servlet.FilterDefinition.doFilter(FilterDefinition.java:162)
at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:58)
at com.google.inject.servlet.ManagedFilterPipeline.dispatch(ManagedFilterPipeline.java:118)
at com.google.inject.servlet.GuiceFilter.doFilter(GuiceFilter.java:113)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:242)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:240)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:203)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:164)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:108)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:558)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:379)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:242)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:259)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:281)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
at java.lang.Thread.run(Thread.java:636)
Caused by: java.lang.NoClassDefFoundError: com/google/gwt/dev/util/StringKey
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:634)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:2804)
at org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:1144)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1639)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1517)
at com.google.web.bindery.requestfactory.server.RequestFactoryInterfaceValidator.validateProxy(RequestFactoryInterfaceValidator.java:1594)
at com.google.web.bindery.requestfactory.server.RequestFactoryInterfaceValidator.validateEntityProxy(RequestFactoryInterfaceValidator.java:828)
at com.google.web.bindery.requestfactory.server.RequestFactoryInterfaceValidator.maybeCheckProxyType(RequestFactoryInterfaceValidator.java:1540)
at com.google.web.bindery.requestfactory.server.RequestFactoryInterfaceValidator.getDomainType(RequestFactoryInterfaceValidator.java:1374)
at com.google.web.bindery.requestfactory.server.RequestFactoryInterfaceValidator.createDomainMethod(RequestFactoryInterfaceValidator.java:1192)
at com.google.web.bindery.requestfactory.server.RequestFactoryInterfaceValidator.checkClientMethodInDomain(RequestFactoryInterfaceValidator.java:1079)
at com.google.web.bindery.requestfactory.server.RequestFactoryInterfaceValidator.validateRequestContext(RequestFactoryInterfaceValidator.java:909)
at com.google.web.bindery.requestfactory.server.RequestFactoryInterfaceValidator.validateRequestFactory(RequestFactoryInterfaceValidator.java:964)
at com.google.web.bindery.requestfactory.server.ResolverServiceLayer.resolveRequestFactory(ResolverServiceLayer.java:187)
at com.google.web.bindery.requestfactory.server.ServiceLayerDecorator.resolveRequestFactory(ServiceLayerDecorator.java:172)
at com.google.web.bindery.requestfactory.server.ServiceLayerDecorator.resolveRequestFactory(ServiceLayerDecorator.java:172)
at com.google.web.bindery.requestfactory.server.ServiceLayerDecorator.resolveRequestFactory(ServiceLayerDecorator.java:172)
at com.google.web.bindery.requestfactory.server.ServiceLayerDecorator.resolveRequestFactory(ServiceLayerDecorator.java:172)
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:616)
at com.google.web.bindery.requestfactory.server.ServiceLayerCache.getOrCache(ServiceLayerCache.java:233)
... 32 more
Caused by: java.lang.ClassNotFoundException: com.google.gwt.dev.util.StringKey
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1672)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1517)
... 57 more
There's a fix for this on its way over from RC to trunk. In the mean time, remove gwt-servlet from your dependencies and use requestfactory-servlet.jar instead.
I've always understood gwt-dev.jar to be the compiler and other development tools. If you believe that, there should be no dependency on it from your own code, and there is no reason for it to be in the WEB-INF/lib folder of your war file.
I see from this question that at least one other contributer to SO feels the same way, but the belief doesn't appear to be universal.
I'll update this answer if I can find anything one way or the other in the GWT docs.
Update:
The closest thing I could find was Organize Projects which shows gwt-dev as a referenced library not present in WEB-INF/lib. I can't find anything official that says either that you can or can't deploy it to your web server. In an old book GWT In Action (Hanson, 2007), page 551 says
You should never deploy the gwt-user.jar and gwt-dev.jar files to your server,
because they will interfere with your server; these JAR files contain their own
Tomcat server code, which is used when you're testing in hosted mode.
This is clearly out of date, since hosted mode isn't called that anymore and uses an embedded Jetty server rather than Tomcat, but that's the basis for my belief.
Ok I made it working :)
I used the gwt version compiled from here:
http://code.google.com/p/google-web-toolkit/source/browse/#svn%2Freleases%2F2.4
I did put gwt-servlet.jar and requestfactory-servlet.jar as dependencies in my project. The problem in the other thread occured because I used my own group-id for the compiled jars, so these were not used by gin and the gwt-maven-plugin. No everything works fine :)
Thanks for the help though!!