Failed to start war in tomcat caused by IllegalArgumentException - java

Environment info
Tomcat: 8.5.9
JDK: 1.8.0_112-b16
The war file can be deployed using Tomcat Web Application Manager successfully, but failed to be started. The war file can be decompress just fine so I think it's a valid zip file.
The detailed exception is
16-Mar-2017 14:34:11.792 SEVERE [http-nio-8080-exec-4] org.apache.catalina.core.ApplicationContext.log FAIL - Application at context path /propertyMS-1.0 could not be started
org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/propertyMS-1.0]]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:167)
at org.apache.catalina.manager.ManagerServlet.start(ManagerServlet.java:1307)
at org.apache.catalina.manager.HTMLManagerServlet.start(HTMLManagerServlet.java:669)
at org.apache.catalina.manager.HTMLManagerServlet.doPost(HTMLManagerServlet.java:217)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:648)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:230)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165)
at org.apache.catalina.filters.CsrfPreventionFilter.doFilter(CsrfPreventionFilter.java:136)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165)
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165)
at org.apache.catalina.filters.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:108)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:198)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:591)
at org.apache.catalina.valves.RequestFilterValve.process(RequestFilterValve.java:319)
at org.apache.catalina.valves.RemoteAddrValve.invoke(RemoteAddrValve.java:88)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)
at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:624)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:349)
at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:783)
at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:789)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1437)
at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.IllegalArgumentException: The archive [jar:file:/Users/bruce/apache-tomcat-8.5.9/webapps/propertyMS-1.0.war!/] is malformed and will be ignored: an entry contains an illegal path [./] which was not expanded to [/Users/bruce/apache-tomcat-8.5.9/webapps/propertyMS-1.0] since that is outside of the defined docBase [/Users/bruce/apache-tomcat-8.5.9/webapps/propertyMS-1.0/]
at org.apache.catalina.startup.ExpandWar.expand(ExpandWar.java:141)
at org.apache.catalina.startup.ContextConfig.fixDocBase(ContextConfig.java:615)
at org.apache.catalina.startup.ContextConfig.beforeStart(ContextConfig.java:748)
at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:301)
at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:94)
at org.apache.catalina.util.LifecycleBase.setStateInternal(LifecycleBase.java:395)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:149)
... 35 more
Thanks.
Update:
As suggested I expanded the war into a folder then deployed the folder to same tomcat server and it works. I'm not sure what's wrong with the war file. It can be decompressed so it should be a valid zip file, at least.

all i can say is, make sure it includes only files from the project path.
when you add file to the the war i think there is some option to include original path structure (don't use that), because when tomcat try to extract the archive into that path (out of webapps/project dir) it will fail...
try to use a command to list archive entries and see if any of the entries have a path out of project dir

Related

500 Servlet error when running Spring-Boot Web App on Apache Tomcat - Unable to delete class file

I have been working on developing a web app using spring-boot, but suddenly ran into a possible permissions issue when deploying with apache tomcat (9.0.36). None of the code has changed, but suddenly Jasper cannot compile my JSP class files. It looks like it is trying to delete class files in the tomcat deployment directory, but fails.
I am not sure what could be causing this, but it happens both when running it through MyEclipse Tomcat, and using the embedded Tomcat server with Maven's spring-boot:run command. Here is an example of the error:
Fri Sep 04 11:04:00 EDT 2020
There was an unexpected error (type=Internal Server Error, status=500).
Unable to delete class file
Stack Trace:
2020-09-08 16:37:26.192 ERROR 21236 --- [nio-8080-exec-1] o.a.c.c.C.[.[localhost].[/].[jsp] : Servlet.service() for servlet [jsp] in context with path [] threw exception [org.apache.jasper.JasperException: Unable to compile class for JSP] with root cause
java.io.IOException: Unable to delete class file [C:\Users\ek040e\Documents\Work\apache-tomcat-9.0.36\work\Catalina\localhost\ROOT\org\apache\jsp\index_jsp.class]
at org.apache.jasper.compiler.SmapUtil$SDEInstaller.install(SmapUtil.java:180) ~[jasper.jar:9.0.36]
at org.apache.jasper.compiler.SmapUtil.installSmap(SmapUtil.java:142) ~[jasper.jar:9.0.36]
at org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:543) ~[jasper.jar:9.0.36]
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:392) ~[jasper.jar:9.0.36]
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:362) ~[jasper.jar:9.0.36]
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:346) ~[jasper.jar:9.0.36]
at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:605) ~[jasper.jar:9.0.36]
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:400) ~[jasper.jar:9.0.36]
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:385) ~[jasper.jar:9.0.36]
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:329) ~[jasper.jar:9.0.36]
at javax.servlet.http.HttpServlet.service(HttpServlet.java:741) ~[servlet-api.jar:na]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231) ~[catalina.jar:9.0.36]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[catalina.jar:9.0.36]
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53) ~[tomcat-websocket.jar:9.0.36]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[catalina.jar:9.0.36]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[catalina.jar:9.0.36]
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:202) ~[catalina.jar:9.0.36]
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96) [catalina.jar:9.0.36]
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:541) [catalina.jar:9.0.36]
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:139) [catalina.jar:9.0.36]
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92) [catalina.jar:9.0.36]
at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:690) [catalina.jar:9.0.36]
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:74) [catalina.jar:9.0.36]
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343) [catalina.jar:9.0.36]
at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:373) [tomcat-coyote.jar:9.0.36]
at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65) [tomcat-coyote.jar:9.0.36]
at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:868) [tomcat-coyote.jar:9.0.36]
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1590) [tomcat-coyote.jar:9.0.36]
at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) [tomcat-coyote.jar:9.0.36]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [na:1.8.0_112]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [na:1.8.0_112]
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) [tomcat-util.jar:9.0.36]
at java.lang.Thread.run(Thread.java:745) [na:1.8.0_112]
Stuff like this happens on local boxes. It could be your antivirus or some other process on your computer or parallel threads in your IDE. I wouldn't worry about it until it starts happening on a prod box. Sometimes you just need to nuke the whole thing and start over, especially when using eclipse. I wouldnt worry too much about it so long as everything works properly via maven and the command line.

Apache OfBiz Execution issues

Working with OfBiz on a 64-bit Win 7 machine and after I perform a fresh build, when the build is completed and I try to open any of the pages, my browser (both IE and Chrome) are blank. Any ideas?
OfBiz version 16.11.01
Snippet from the current log:
|W| Communication error with the client while processing the request: /webtools/control/main
org.apache.ofbiz.webapp.control.RequestHandlerException: Error in the response writer/output stream: freemarker.template.TemplateNotFoundException: Template not found for name "component://widget/templates/HtmlScreenMacroLibrary.ftl".
The name was interpreted by this TemplateLoader: MultiTemplateLoader(loader1 = org.apache.ofbiz.base.util.template.FreeMarkerWorker$FlexibleTemplateLoader#6e5ece55, loader2 = StringTemplateLoader(Map { })). (Template not found for name "component://widget/templates/HtmlScreenMacroLibrary.ftl".
The name was interpreted by this TemplateLoader: MultiTemplateLoader(loader1 = org.apache.ofbiz.base.util.template.FreeMarkerWorker$FlexibleTemplateLoader#6e5ece55, loader2 = StringTemplateLoader(Map { })).)
at org.apache.ofbiz.webapp.control.RequestHandler.renderView(RequestHandler.java:989) ~[ofbiz.jar:?]
at org.apache.ofbiz.webapp.control.RequestHandler.doRequest(RequestHandler.java:649) ~[ofbiz.jar:?]
at org.apache.ofbiz.webapp.control.ControlServlet.doGet(ControlServlet.java:210) [ofbiz.jar:?]
at javax.servlet.http.HttpServlet.service(HttpServlet.java:687) [javax.servlet-api-3.1.0.jar:3.1.0]
at javax.servlet.http.HttpServlet.service(HttpServlet.java:790) [javax.servlet-api-3.1.0.jar:3.1.0]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:292) [tomcat-catalina-8.0.37.jar:8.0.37]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207) [tomcat-catalina-8.0.37.jar:8.0.37]
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) [tomcat-embed-websocket-8.0.36.jar:8.0.36]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240) [tomcat-catalina-8.0.37.jar:8.0.37]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207) [tomcat-catalina-8.0.37.jar:8.0.37]
at org.apache.ofbiz.webapp.control.ContextFilter.doFilter(ContextFilter.java:209) [ofbiz.jar:?]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240) [tomcat-catalina-8.0.37.jar:8.0.37]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207) [tomcat-catalina-8.0.37.jar:8.0.37]
at org.apache.ofbiz.webapp.control.ControlFilter.doFilter(ControlFilter.java:156) [ofbiz.jar:?]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240) [tomcat-catalina-8.0.37.jar:8.0.37]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207) [tomcat-catalina-8.0.37.jar:8.0.37]
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:212) [tomcat-catalina-8.0.37.jar:8.0.37]
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:106) [tomcat-catalina-8.0.37.jar:8.0.37]
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502) [tomcat-catalina-8.0.37.jar:8.0.37]
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:141) [tomcat-catalina-8.0.37.jar:8.0.37]
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79) [tomcat-catalina-8.0.37.jar:8.0.37]
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88) [tomcat-catalina-8.0.37.jar:8.0.37]
at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:616) [tomcat-catalina-8.0.37.jar:8.0.37]
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:528) [tomcat-catalina-8.0.37.jar:8.0.37]
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1100) [tomcat-coyote-8.0.37.jar:8.0.37]
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:687) [tomcat-coyote-8.0.37.jar:8.0.37]
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1520) [tomcat-coyote-8.0.37.jar:8.0.37]
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1476) [tomcat-coyote-8.0.37.jar:8.0.37]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [?:1.8.0_121]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [?:1.8.0_121]
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) [tomcat-util-8.0.37.jar:8.0.37]
at java.lang.Thread.run(Thread.java:745) [?:1.8.0_121]
Caused by: freemarker.template.TemplateNotFoundException: Template not found for name "component://widget/templates/HtmlScreenMacroLibrary.ftl".
The name was interpreted by this TemplateLoader: MultiTemplateLoader(loader1 = org.apache.ofbiz.base.util.template.FreeMarkerWorker$FlexibleTemplateLoader#6e5ece55, loader2 = StringTemplateLoader(Map { })).
at freemarker.template.Configuration.getTemplate(Configuration.java:2430) ~[freemarker-2.3.24-incubating.jar:2.3.24]
at freemarker.template.Configuration.getTemplate(Configuration.java:2232) ~[freemarker-2.3.24-incubating.jar:2.3.24]
at org.apache.ofbiz.base.util.template.FreeMarkerWorker.getTemplate(FreeMarkerWorker.java:259) ~[ofbiz.jar:?]
at org.apache.ofbiz.base.util.template.FreeMarkerWorker.getTemplate(FreeMarkerWorker.java:253) ~[ofbiz.jar:?]
at org.apache.ofbiz.widget.renderer.macro.MacroScreenRenderer.<init>(MacroScreenRenderer.java:84) ~[ofbiz.jar:?]
at org.apache.ofbiz.widget.renderer.macro.MacroScreenViewHandler.loadRenderers(MacroScreenViewHandler.java:113) ~[ofbiz.jar:?]
at org.apache.ofbiz.widget.renderer.macro.MacroScreenViewHandler.render(MacroScreenViewHandler.java:152) ~[ofbiz.jar:?]
at org.apache.ofbiz.webapp.control.RequestHandler.renderView(RequestHandler.java:985) ~[ofbiz.jar:?]
... 31 more
So, I figured out the issue. I had moved the entire directory into my C:\Program Files directory which due to corporate admin restrictions was likely blocking permissions somewhere. That being said, I moved the directory to a 'normal' location, re-ran gradlew and I can navigate to the pages. Thanks for the ideas!
Check via the DevTools in Chrome what's the HTTP status code of the response and the page content if there is any. You can see it in the network panel in the column "status".
Check the OfBiz log files for any errors or stacktraces.
In fact the problem could be somewhere else.
When you store your ofbiz application under a folder with space inside, the common visual theme don't work. So the solution is to either change the current top-parent folder by erasing spaces within its name, or changing the folder (you did it without knowing exactly what was going exactly).
Regards.
i also face the same issue with OfBiz version 16.11.04 because of some admin side permission for the solution you need to put your project in c drive and start it. for me its working fine.

Servlet.service() throwing illegal argument exception

I am deploying my project on tomcat8 and when i hit localhost:8080 on my browser, it is saying internal server error. I found this trace in local host logs
27-Dec-2016 14:17:20.592 SEVERE [http-nio-8080-exec-2] org.apache.catalina.core.StandardWrapperValve.invoke Servlet.service() for servlet [spring] in context with path [] threw exception
java.lang.IllegalArgumentException: An invalid domain [.test.com] was specified for this cookie
at org.apache.tomcat.util.http.Rfc6265CookieProcessor.validateDomain(Rfc6265CookieProcessor.java:183)
at org.apache.tomcat.util.http.Rfc6265CookieProcessor.generateHeader(Rfc6265CookieProcessor.java:125)
at org.apache.catalina.connector.Response.generateCookieString(Response.java:989)
at org.apache.catalina.connector.Response.addCookie(Response.java:937)
at org.apache.catalina.connector.ResponseFacade.addCookie(ResponseFacade.java:386)
at com.snapdeal.rms.web.utils.CookieManager.setCookie(CookieManager.java:25)
at com.snapdeal.rms.web.utils.CookieManager.setCookie(CookieManager.java:17)
at com.snapdeal.rms.web.filter.RequestIdentifierFilter.doFilterInternal(RequestIdentifierFilter.java:79)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:198)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:474)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)
at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:624)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:349)
at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:783)
at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:789)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1437)
at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Thread.java:745)
Here test.com is a valid site. Could not find what cookie it was referring to

Issue with Manual unpacking of wars in tomcat

I am unpacking the application war manually in tomcat as I am specifying the context for the application in $CATALINA/conf/Catalina/host/ROOT.xml. The docBase is specified in here,
<?xml version="1.0"?>
<Context
path=""
docBase="/opt/tomcat/tc3/webapps/TC3"
reloadable="true"
/>
When the same war is unpacked by tomcat, i don't see any issues but when I unpack it manually using unzip command, i run into below jasper issue,
org.apache.jasper.JasperException: Unable to find taglib "html" for URI: /WEB-INF/struts-html.tld
at org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:55)
at org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:293)
at org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:80)
at org.apache.jasper.compiler.TagLibraryInfoImpl.<init>(TagLibraryInfoImpl.java:176)
at org.apache.jasper.compiler.Parser.parseTaglibDirective(Parser.java:434)
at org.apache.jasper.compiler.Parser.parseDirective(Parser.java:492)
at org.apache.jasper.compiler.Parser.parseElements(Parser.java:1448)
at org.apache.jasper.compiler.Parser.parse(Parser.java:145)
at org.apache.jasper.compiler.ParserController.doParse(ParserController.java:244)
at org.apache.jasper.compiler.ParserController.parse(ParserController.java:105)
at org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:201)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:372)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:349)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:333)
at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:600)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:368)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:385)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:329)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:230)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165)
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:198)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:108)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:522)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)
at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:620)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:349)
at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:1110)
at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:785)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1425)
at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Thread.java:745)
So clearly the issue is because of manual unpacking of war VS the way tomcat unpacks the war. How are WARs unpacked manually or is there a way to make tomcat unpack while specifying the docBase and the context path ?
I have externalized the manually exploded application. I had kept it in a location /opt/test/TC3 and made the changes in CONFIG_BASE to point the docBase to this location.
But that seems to not solve the issue. Is there a way to autoDeploy while specifying the context ?
I had this working by having different paths for appBase & docBase. docBase contained the path of the directory where my application is manually exploded.
Hopefully it helps someone.

Maven BasicDataSource Errors on Tomcat 8

We recently started converting a large webapp to Maven, and everything seemed to be working great, but no matter what we do, Maven doesn't recognize the tomcat-dbcp.jar file on the tomcat server. In my dependencies, I have set the following:
<dependency>
<groupId>org.apache.tomcat</groupId>
<artifactId>tomcat-dbcp</artifactId>
<version>8.0.26</version>
<scope>provided</scope>
</dependency>
But I get the following stacktrace:
Error: javax.servlet.jsp.JspException: java.lang.AbstractMethodError: oracle.jdbc.driver.T4CConnection.isValid(I)Z
URI: /as/CheckReport
Error Message: oracle.jdbc.driver.T4CConnection.isValid(I)Z
Status code: 500
org.apache.tomcat.dbcp.dbcp2.DelegatingConnection.isValid(DelegatingConnection.java:913)
org.apache.tomcat.dbcp.dbcp2.PoolableConnection.validate(PoolableConnection.java:226)
org.apache.tomcat.dbcp.dbcp2.PoolableConnectionFactory.validateConnection(PoolableConnectionFactory.java:302)
org.apache.tomcat.dbcp.dbcp2.BasicDataSource.validateConnectionFactory(BasicDataSource.java:2208)
org.apache.tomcat.dbcp.dbcp2.BasicDataSource.createPoolableConnectionFactory(BasicDataSource.java:2191)
org.apache.tomcat.dbcp.dbcp2.BasicDataSource.createDataSource(BasicDataSource.java:1945)
org.apache.tomcat.dbcp.dbcp2.BasicDataSource.getConnection(BasicDataSource.java:1412)
com.networkfleet.sre.common.db.Resource.getDBConnectionDEV(Resource.java:75)
com.networkfleet.sre.app.checkreport.CheckReportSrv.doGet(CheckReportSrv.java:63)
javax.servlet.http.HttpServlet.service(HttpServlet.java:622)
javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:291)
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239)
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:219)
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:106)
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:614)
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:142)
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)
org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:617)
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88)
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:518)
org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1091)
org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:668)
org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.doRun(AprEndpoint.java:2463)
org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:2452)
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
java.lang.Thread.run(Thread.java:745)
I should point out that this was never a problem before Maven, and we haven't made server side changes that should cause this.
I'm currently using a odjbc7.jar driver, which is up to date and has been installed through Maven, appears in my repository in the correct location, and is included in the app itself via a system scope. This is the identical driver file that is being used in the non-maven build, where this error does not appear.

Categories