0
votes

Colleagues, could anybody help me with deploying application on tomcat server...

The situation is: 1. I have deployed app on tomcat. But there is no Undeploy button in admin panel. 2. I run mvn clean package tomcat7:redeploy and the result is:

[INFO] Deploying war to http://localhost:8080/app-ws Uploading: http://localhost:8080/manager/text/deploy?path=%2Fapp-ws&update=true Uploaded: http://localhost:8080/manager/text/deploy?path=%2Fapp-ws&update=true (11702 KB at 17334.8 KB/sec)

[INFO] tomcatManager status code:200, ReasonPhrase:OK [INFO] OK - Deployed application at context path /app-ws [INFO] ------------------------------------------------------------------------ [INFO] BUILD SUCCESS [INFO] ------------------------------------------------------------------------ [INFO] Total time: 01:08 min [INFO] Finished at: 2015-07-28T11:46:44+03:00 [INFO] Final Memory: 29M/260M [INFO] ---


Looks fine, but:

  1. when i run http://localhost:8080/app-ws i receive HTTP Status 404

  2. in C:\Program Files\Apache Software Foundation\Tomcat 7.0\webapps i have app-ws.war with actual creation date

  3. in the same folder I have C:\Program Files\Apache Software Foundation\Tomcat 7.0\webapps\app-ws folder, but with not actual date
  4. In C:\Program Files\Apache Software Foundation\Tomcat 7.0\conf\server.xml i have next attribute . May be the problem is here?

Have you any idea how to correctly deploy and run the application(web service) in described case?

Thank you for any comments and advices.

UPDATE

  1. I undeploy my app.
  2. No app-ws folder and war in C:\Program Files\Apache Software Foundation\Tomcat 7.0\webapps
  3. Run mvn clean package tomcat7:deploy and receive
[INFO] <<< tomcat7-maven-plugin:2.2:deploy (default-cli) < package @ app-ws <<<
[INFO]
[INFO] --- tomcat7-maven-plugin:2.2:deploy (default-cli) @ app-ws ---
[INFO] Deploying war to http://localhost:8080/app-ws
Uploading: http://localhost:8080/manager/text/deploy?path=%2Fapp-ws
Uploaded: http://localhost:8080/manager/text/deploy?path=%2Fapp-ws (11647 KB at 16085.6 KB/sec)

[INFO] tomcatManager status code:200, ReasonPhrase:OK
[INFO] FAIL - Deployed application at context path /app-ws but context failed to start
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 01:36 min
[INFO] Finished at: 2015-07-28T15:58:13+03:00
[INFO] Final Memory: 27M/259M
[INFO] ---

  1. I have next stack trace in C:\Program Files\Apache Software Foundation\Tomcat 7.0\logs\tomcat7-stderr.2015-07-28.log :

Jul 28, 2015 3:57:47 PM org.apache.catalina.startup.HostConfig deployWAR INFO: Deploying web application archive C:\Program Files\Apache Software Foundation\Tomcat 7.0\webapps\app-ws.war Jul 28, 2015 3:58:12 PM org.apache.catalina.loader.WebappClassLoader validateJarFile INFO: validateJarFile(C:\Program Files\Apache Software Foundation\Tomcat 7.0\webapps\app-ws\WEB-INF\lib\tomcat-embed-core-8.0.20.jar) - jar not loaded. See Servlet Spec 3.0, section 10.7.2. Offending class: javax/servlet/Servlet.class Jul 28, 2015 3:58:12 PM org.apache.catalina.loader.WebappClassLoader validateJarFile INFO: validateJarFile(C:\Program Files\Apache Software Foundation\Tomcat 7.0\webapps\app-ws\WEB-INF\lib\tomcat-embed-el-7.0.63.jar) - jar not loaded. See Servlet Spec 3.0, section 10.7.2. Offending class: javax/el/Expression.class Jul 28, 2015 3:58:12 PM org.apache.catalina.deploy.WebXml setVersion WARNING: Unknown version string [3.1]. Default version will be used. Jul 28, 2015 3:58:13 PM org.apache.catalina.core.ContainerBase addChildInternal SEVERE: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/app-ws]] at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:154) at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:652) at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:1090) at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:553) at org.apache.catalina.startup.HostConfig.check(HostConfig.java:1687) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:301) at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(Unknown Source) at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(Unknown Source) at org.apache.catalina.manager.ManagerServlet.check(ManagerServlet.java:1516) at org.apache.catalina.manager.ManagerServlet.deploy(ManagerServlet.java:739) at org.apache.catalina.manager.ManagerServlet.doPut(ManagerServlet.java:457) at javax.servlet.http.HttpServlet.service(HttpServlet.java:653) at javax.servlet.http.HttpServlet.service(HttpServlet.java:731) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) at org.apache.catalina.filters.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:108) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:614) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:170) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103) at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:950) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:423) at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1079) at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:620) at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:316) at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.lang.Thread.run(Unknown Source) Caused by: java.lang.NoSuchMethodError: javax.servlet.ServletContext.getVirtualServerName()Ljava/lang/String; at org.apache.tomcat.websocket.server.WsServerContainer.(WsServerContainer.java:147) at org.apache.tomcat.websocket.server.WsSci.init(WsSci.java:131) at org.apache.tomcat.websocket.server.WsSci.onStartup(WsSci.java:47) at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5517) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) ... 41 more

Jul 28, 2015 3:58:13 PM org.apache.catalina.startup.HostConfig deployWAR SEVERE: Error deploying web application archive C:\Program Files\Apache Software Foundation\Tomcat 7.0\webapps\app-ws.war java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/app-ws]] at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:904) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:652) at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:1090) at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:553) at org.apache.catalina.startup.HostConfig.check(HostConfig.java:1687) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:301) at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(Unknown Source) at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(Unknown Source) at org.apache.catalina.manager.ManagerServlet.check(ManagerServlet.java:1516) at org.apache.catalina.manager.ManagerServlet.deploy(ManagerServlet.java:739) at org.apache.catalina.manager.ManagerServlet.doPut(ManagerServlet.java:457) at javax.servlet.http.HttpServlet.service(HttpServlet.java:653) at javax.servlet.http.HttpServlet.service(HttpServlet.java:731) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) at org.apache.catalina.filters.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:108) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:614) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:170) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103) at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:950) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:423) at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1079) at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:620) at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:316) at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.lang.Thread.run(Unknown Source)

Jul 28, 2015 3:58:13 PM org.apache.catalina.startup.HostConfig deployWAR INFO: Deployment of web application archive C:\Program Files\Apache Software Foundation\Tomcat 7.0\webapps\app-ws.war has finished in 26,717 ms

UPDATE 1

Fixed this :

Jul 28, 2015 3:57:47 PM org.apache.catalina.startup.HostConfig deployWAR INFO: Deploying web application archive C:\Program Files\Apache Software Foundation\Tomcat 7.0\webapps\app-ws.war Jul 28, 2015 3:58:12 PM org.apache.catalina.loader.WebappClassLoader validateJarFile INFO: validateJarFile(C:\Program Files\Apache Software Foundation\Tomcat 7.0\webapps\app-ws\WEB-INF\lib\tomcat-embed-core-8.0.20.jar) - jar not loaded. See Servlet Spec 3.0, section 10.7.2. Offending class: javax/servlet/Servlet.class Jul 28, 2015 3:58:12 PM org.apache.catalina.loader.WebappClassLoader validateJarFile INFO: validateJarFile(C:\Program Files\Apache Software Foundation\Tomcat 7.0\webapps\app-ws\WEB-INF\lib\tomcat-embed-el-7.0.63.jar) - jar not loaded. See Servlet Spec 3.0, section 10.7.2. Offending class: javax/el/Expression.class Jul 28, 2015 3:58:12 PM org.apache.catalina.deploy.WebXml setVersion WARNING: Unknown version string [3.1]. Default version will be used.

by adding

<dependency>
                <groupId>org.apache.tomcat.embed</groupId>
                <artifactId>tomcat-embed-el</artifactId>
                <version>7.0.63</version>
                  <scope>provided</scope>
</dependency>

<dependency>
                <groupId>org.apache.tomcat.embed</groupId>
                <artifactId>tomcat-embed-core</artifactId>
                <version>8.0.24</version>
                  <scope>provided</scope>
</dependency>
1

1 Answers

0
votes

I too faced the same issue. then i done the following things

  1. Go to tomcat management page and go to "http://localhost:8000/manager/html" Then undeployed the my project. or manually delete the project (project.war and project folder) from web apps.
  2. Deployed the project again in the tomcat web apps folder.

Please note that this is applicable if server deployed the application successfully without any errors.