I have developed a dynamic web application in spring tool suit using Spring MVC architecture. I added the required jars to develop the application and even installed the tomcat 7.0 to make the application run on server. However, when I try to run the application on server I am unable to run the Application. I am unable to understand what may be the reason. I am also getting an error that the dispatcher servlet is not found.
java.lang.ClassNotFoundException: org.springframework.web.servlet.DispatcherServlet
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1720)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1571)
at org.apache.catalina.core.DefaultInstanceManager.loadClass(DefaultInstanceManager.java:529)
at org.apache.catalina.core.DefaultInstanceManager.loadClassMaybePrivileged(DefaultInstanceManager.java:511)
at org.apache.catalina.core.DefaultInstanceManager.newInstance(DefaultInstanceManager.java:139)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1148)
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1087)
at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:5210)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5493)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549)
at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
The jars are:
commons-logging-api-1.1.1
jstl-1.1.2 (1)
org.springframework.web.servlet.view.xdocreport-1.0.4
org.springframework.web.servlet-3.0.5.RELEASE
servlet-api-2.5
spring-asm-3.0.7.RELEASE
spring-beans-4.0.6.RELEASE
spring-context-4.0.6.RELEASE
spring-core-4.0.6.RELEASE
spring-expression-4.0.6.RELEASE
spring-web-4.0.6.RELEASE
spring-webmvc-3.1.1.RELEASE
Related
I get the following error when running tomcat with seam 2.1.2 (old I know), but
I'm trying to get the rest services working with it:
Apr 18, 2018 7:06:11 PM org.apache.catalina.core.StandardContext
listenerStart SEVERE: Exception sending context initialized event to
listener instance of class [org.jboss.seam.servlet.SeamListener]
java.lang.VerifyError: (class:
org/jboss/seam/resteasy/ResteasyBootstrap_$$_javassist_seam_0, method:
_d27sessionWillPassivate signature: (Ljavax/servlet/http/HttpSessionEvent;)V) Illegal use of nonvirtual
function call at java.lang.Class.getDeclaredFields0(Native Method)
at java.lang.Class.privateGetDeclaredFields(Unknown Source) at
java.lang.Class.getField0(Unknown Source) at
java.lang.Class.getField(Unknown Source) at
org.jboss.seam.util.ProxyFactory.setField(ProxyFactory.java:363) at
org.jboss.seam.util.ProxyFactory.createClass3(ProxyFactory.java:352)
at
org.jboss.seam.util.ProxyFactory.createClass2(ProxyFactory.java:325)
at
org.jboss.seam.util.ProxyFactory.createClass(ProxyFactory.java:284)
at org.jboss.seam.Component.createProxyFactory(Component.java:2426)
at org.jboss.seam.Component.getProxyFactory(Component.java:1513) at
org.jboss.seam.Component.wrap(Component.java:1504) at
org.jboss.seam.Component.instantiateJavaBean(Component.java:1442) at
org.jboss.seam.Component.instantiate(Component.java:1359) at
org.jboss.seam.Component.newInstance(Component.java:2122) at
org.jboss.seam.contexts.Contexts.startup(Contexts.java:304) at
org.jboss.seam.contexts.Contexts.startup(Contexts.java:278) at
org.jboss.seam.contexts.ServletLifecycle.endInitialization(ServletLifecycle.java:113)
at org.jboss.seam.init.Initialization.init(Initialization.java:740)
at
org.jboss.seam.servlet.SeamListener.contextInitialized(SeamListener.java:36)
at
org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4637)
at
org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5099)
at
org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at
org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1425)
at
org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1415)
at java.util.concurrent.FutureTask.run(Unknown Source) at
org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
at java.util.concurrent.AbstractExecutorService.submit(Unknown
Source) at
org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:941)
at
org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:839)
at
org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at
org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1425)
at
org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1415)
at java.util.concurrent.FutureTask.run(Unknown Source)
When I remove the resteasy jars I get the following error:
Caused by: java.lang.NoClassDefFoundError:
org/jboss/resteasy/specimpl/UriInfoImpl at
java.lang.Class.getDeclaredMethods0(Native Method) at
java.lang.Class.privateGetDeclaredMethods(Unknown Source) at
java.lang.Class.getDeclaredMethods(Unknown Source) at
org.jboss.seam.Component.initMembers(Component.java:550) at
org.jboss.seam.Component.(Component.java:244) at
org.jboss.seam.Component.(Component.java:205) at
org.jboss.seam.init.Initialization.addComponent(Initialization.java:1186)
So I guess I need to know the exact dependencies ?
This is the jars list:
I've solved the problem by downgrade from tomcat 9 to tomcat 7 and by using the original jars came with the seam package.
I followed below article to set up appinsights to java dynamic web project:
Quickstart: Get started with Application Insights in a Java web project
However I get the below mentioned error. Error Stack trace:
Jan 05, 2017 5:40:07 PM org.apache.catalina.core.StandardContext filterStart
SEVERE: Exception starting filter ApplicationInsightsWebFilter
java.lang.ClassNotFoundException: com.microsoft.applicationinsights.web.internal.WebRequestTrackingFilter
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1714)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1559)
at org.apache.catalina.core.DefaultInstanceManager.loadClass(DefaultInstanceManager.java:532)
at org.apache.catalina.core.DefaultInstanceManager.loadClassMaybePrivileged(DefaultInstanceManager.java:514)
at org.apache.catalina.core.DefaultInstanceManager.newInstance(DefaultInstanceManager.java:133)
at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:257)
at org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:383)
at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:104)
at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4650)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5306)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
As a summary, seems that you had resolved the issue which might be caused by not automatically loading the added jar files on Tomcat via Eclipse. The solution is that as below.
Move to the Properties > Deployment Assembly of the current project, and check whether the dependencies exists there as Build Path entries or Archives.
Select the current project, and click Project > Clean at the menu bar, then restart the server.
I have developed one Rest Web Service application in java and deployed the WAR file. While starting the server, the following error occurs.
SEVERE: StandardWrapper.Throwable
java.lang.NoSuchFieldError: INCLUDE_ALL
at org.glassfish.jersey.server.ResourceConfig$State.<init>(ResourceConfig.java:109)
at org.glassfish.jersey.server.ResourceConfig.<init>(ResourceConfig.java:350)
at org.glassfish.jersey.servlet.WebComponent.createResourceConfig(WebComponent.java:425)
at org.glassfish.jersey.servlet.WebComponent.<init>(WebComponent.java:290)
at org.glassfish.jersey.servlet.ServletContainer.init(ServletContainer.java:167)
at org.glassfish.jersey.servlet.ServletContainer.init(ServletContainer.java:349)
at javax.servlet.GenericServlet.init(GenericServlet.java:158)
at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1282)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1195)
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1085)
at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:5318)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5610)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:147)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1572)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1562)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
I have added following jar files to my project.
I have downloaded jersey-common jar version 2.24.1.
I am not able to find where the actual issue is? Please help.
Your jersey-server.jar is 2.1 change it to 2.24.1.
All Jersey dependencies should be in the same version.
I'm developing a security mechanism to my project in java where I use AccessDeniedException to restrict access to users in some methods of project. I work with ws to publish this methods. I use tomcat 7 to deploy my ws. Now when I startup tomcat 7 to deploy my ws this is that show in console of my IDE Eclipse:
GRAVE: WSSERVLET11: failed to parse runtime descriptor: java.lang.NoClassDefFoundError: java/nio/file/AccessDeniedExceptionjava.lang.NoClassDefFoundError: java/nio/file/AccessDeniedException at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Unknown Source)
at com.sun.xml.ws.transport.http.DeploymentDescriptorParser.getImplementorClass(DeploymentDescriptorParser.java:545)
at com.sun.xml.ws.transport.http.DeploymentDescriptorParser.parseAdapters(DeploymentDescriptorParser.java:223)
at com.sun.xml.ws.transport.http.DeploymentDescriptorParser.parse(DeploymentDescriptorParser.java:147)
at com.sun.xml.ws.transport.http.servlet.WSServletContextListener.contextInitialized(WSServletContextListener.java:108)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4887)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5381)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549)
at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)Caused by: java.lang.ClassNotFoundException: java.nio.file.AccessDeniedException
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1714)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1559)
... 16 more
I use jre7 although I have imported jre6 and jre8 to my project too. I have imported java.nio.file.AccessDeniedException class in my code. I don't understand what is happened in this case. Is how if my project not found java.nio.file.AccessDeniedException class. Thanks ahead of time.
I am trying to set up a local tomcat (Apache Tomcat/7.0.47) server from eclipse.
I get my project from svn.
I set up the server and add the project into it.
Now I keep getting:
SEVERE: Exception starting filter MPIJSPFilter
java.lang.ClassNotFoundException: moreservlets.filters.MPIJSPFilter
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1702)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1547)
at org.apache.catalina.core.DefaultInstanceManager.loadClass(DefaultInstanceManager.java:532)
at org.apache.catalina.core.DefaultInstanceManager.loadClassMaybePrivileged(DefaultInstanceManager.java:514)
at org.apache.catalina.core.DefaultInstanceManager.newInstance(DefaultInstanceManager.java:142)
at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:260)
at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:107)
at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4775)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5452)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
and can not run the project or even when I run: localhost:8080/
I get: HTTP Status 404 - /
Any suggestions on how to solve this?