问题
I was following this blog to run a sample websocket application in glasshfish. The deployment failed with the following error. But the mentioned class file is available in the pom.xml and it is listed in the dependencies as well. Could you please help?
Error occurred during deployment: Exception while loading the app : java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: java.lang.NoClassDefFoundError: org/glassfish/websocket/spi/Endpoint. Please see server.log for more details.
The module has not been deployed.
See the server log for details.
at org.netbeans.modules.j2ee.deployment.devmodules.api.Deployment.deploy(Deployment.java:210)
at org.netbeans.modules.maven.j2ee.ExecutionChecker.performDeploy(ExecutionChecker.java:178)
at org.netbeans.modules.maven.j2ee.ExecutionChecker.executionResult(ExecutionChecker.java:130)
at org.netbeans.modules.maven.execute.MavenCommandLineExecutor.run(MavenCommandLineExecutor.java:212)
at org.netbeans.core.execution.RunClassThread.run(RunClassThread.java:153)
回答1:
Solved. You should not have the same jar in modules folder of glassfish and WEB-INF\lib folder.
回答2:
You may just need to clean and build your project.
来源:https://stackoverflow.com/questions/14826295/glassfish-java-lang-noclassdeffounderror