{"id":2351,"date":"2022-08-30T15:24:08","date_gmt":"2022-08-30T15:24:08","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2014\/01\/05\/tomcat7-jackson-webapp-deployment-crash-collection-of-common-programming-errors\/"},"modified":"2022-08-30T15:24:08","modified_gmt":"2022-08-30T15:24:08","slug":"tomcat7-jackson-webapp-deployment-crash-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2022\/08\/30\/tomcat7-jackson-webapp-deployment-crash-collection-of-common-programming-errors\/","title":{"rendered":"Tomcat7\/Jackson\/WebApp deployment crash\/-Collection of common programming errors"},"content":{"rendered":"<p>I&#8217;m trying to deploy a new version of my web app on a Ubuntu server (12.04) running Tomcat 7.0.26. Rather than include the jackson- libraries that I use (<code>-core<\/code>, <code>-annotations<\/code>, and <code>-databind<\/code>), I&#8217;m trying to place them in the <code>\/usr\/share\/tomcat7\/lib<\/code> area for use by other applications that I plan to deploy.<\/p>\n<p>I can start the server, and deploy my app. However, once I do, the app crashes and takes down Tomcat. Clearly the ObjectMapper is not being properly loaded, but it exists in the databind jar file (I&#8217;ve jar tvf&#8217;d it to check)&#8230;<\/p>\n<p>The response to the client is:<\/p>\n<pre><code>HTTP Status 500 -\ntype Exception report\nmessage\ndescription The server encountered an internal error () that prevented it from fulfilling this request.\nexception\njava.lang.NullPointerException\n    org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)\n    org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)\n    org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:927)\n    org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)\n    org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:987)\n    org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:579)\n    org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:309)\n    java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1146)\n    java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)\n    java.lang.Thread.run(Thread.java:679)\n<\/code><\/pre>\n<p>And, the catalina.out log file shows the following after the app is executed:<\/p>\n<pre><code>Mar 11, 2013 1:42:55 AM org.apache.coyote.AbstractProtocol pause\nINFO: Pausing ProtocolHandler [\"http-bio-8080\"]\nMar 11, 2013 1:42:55 AM org.apache.catalina.core.StandardService stopInternal\nINFO: Stopping service Catalina\nMar 11, 2013 1:42:57 AM org.apache.coyote.AbstractProtocol stop\nINFO: Stopping ProtocolHandler [\"http-bio-8080\"]\nMar 11, 2013 1:42:57 AM org.apache.catalina.loader.WebappClassLoader loadClass\nINFO: Illegal access: this web application instance has been stopped already.  Could not load com.fasterxml.jackson.databind.ObjectMapper.  The eventual following stack trace is caused by an error thrown for debugging purposes as well as to attempt to terminate the thread which caused the illegal access, and has no functional impact.\njava.lang.IllegalStateException\n    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1587)\n    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1546)\n    at org.comtor.authserv.APIServer.doPost(APIServer.java:150)\n    at javax.servlet.http.HttpServlet.service(HttpServlet.java:641)\n    at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)\n    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)\n    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)\n    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:224)\n    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:169)\n    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)\n    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168)\n    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)\n    at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:927)\n    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)\n    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)\n    at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:987)\n    at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:579)\n    at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:309)\n    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1146)\n    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)\n    at java.lang.Thread.run(Thread.java:679)\nMar 11, 2013 1:42:57 AM org.apache.coyote.AbstractProtocol destroy\nINFO: Destroying ProtocolHandler [\"http-bio-8080\"]\n<\/code><\/pre>\n<p>Any help here is appreciated. I&#8217;m attempting to learn what is going wrong, how I can prevent it, and also prevent the server from going down (crashing) when the web application is executed and this happens.<\/p>\n<p>Thanks.<\/p>\n<ol>\n<li>\n<p>I had a similar issue with the Jersey REST libraries. It turned out that Tomcat was crashing my app because there was a version conflict between some jars I included in my WAR file and jars I had moved to Tomcat&#8217;s lib folder.<\/p>\n<p>I recommend that you troubleshoot this on a local development machine first because it is quicker and easier to move jar files around. Start with just the libraries Tomcat comes with and all of your required libraries packed into your war file. Your app should run fine. Then move jar files from your app to Tomcat lib. You can do this without re-building your app. Just open your war file with an unzip utility like 7-zip and delete the files from your war file as you move them to Tomcat\/lib. You probably need to restart Tomcat every time but I found it didn&#8217;t take me long to get a working configuration this way. Now my war file is only 735KB instead of 8MB, which matters to me because I&#8217;m working with a slow upload speed.<\/p>\n<\/li>\n<\/ol>\n<p id=\"rop\"><small>Originally posted 2014-01-05 22:04:03. <\/small><\/p>","protected":false},"excerpt":{"rendered":"<p>I&#8217;m trying to deploy a new version of my web app on a Ubuntu server (12.04) running Tomcat 7.0.26. Rather than include the jackson- libraries that I use (-core, -annotations, and -databind), I&#8217;m trying to place them in the \/usr\/share\/tomcat7\/lib area for use by other applications that I plan to deploy. I can start the [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-2351","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/2351","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=2351"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/2351\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=2351"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=2351"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=2351"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}