Getting An AccessDeniedException with Tomcat? - java

I want to have access to static resources outside my webapp so that they don't get destroyed every time I redeploy, but I can't seem to get them
I have a servlet that is meant to serve these images via a FileOutputStream, but it can't get the file when I deploy it on my tomcat server - it gives me a java.nio.file.AccessDeniedException.
Error from Catalina Log File
13-Feb-2020 16:53:10.621 SEVERE [http-nio-8080-exec-6] org.apache.catalina.core.StandardWrapperValve.invoke Servlet.service() for servlet [fileGetter] in context with path [] threw exception
java.nio.file.AccessDeniedException: C:\Users\micro\Pictures\WebsiteStuff\BlogPosts\Test Image 2020-02-12.jpg
at java.base/sun.nio.fs.WindowsException.translateToIOException(WindowsException.java:89)
at java.base/sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:103)
at java.base/sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:108)
at java.base/sun.nio.fs.WindowsFileSystemProvider.newByteChannel(WindowsFileSystemProvider.java:235)
at java.base/java.nio.file.Files.newByteChannel(Files.java:374)
at java.base/java.nio.file.Files.newByteChannel(Files.java:425)
at java.base/java.nio.file.spi.FileSystemProvider.newInputStream(FileSystemProvider.java:420)
at java.base/java.nio.file.Files.newInputStream(Files.java:159)
at java.base/java.nio.file.Files.copy(Files.java:3195)
at ImageGetterServlet.doGet(ImageGetterServlet.java:37)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:634)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:741)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:199)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:543)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:139)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:81)
at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:678)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343)
at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:609)
at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65)
at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:810)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1623)
at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.base/java.lang.Thread.run(Thread.java:830)
This is especially strange given that I have allowed permission to the directory in my Catalina.policy file.
Catalina.Policy
grant {
...
permission java.io.FilePermission "C:${file.separator}Users${file.separator}micro${file.separator}Pictures${file.separator}WebsiteStuff", "read, write";
};
For whatever reason, this exact same code (minus the permission) works perfectly in Intellij. However, here it is not able to access the file.
Could anyone let me know why this is happening? Did I set the wrong permission/put the permission in the wrong place?
EDIT: It is NOT a permission problem
I granted everything in Catalina.policy java.security.AllPermission but to no avail, I’m getting the same exception.

I found out what was wrong. Tomcat cannot access anything inside the Users folder - probably a Windows 10 specific problem.
I just put my directory in question in the C: drive so that the path is now C:/WebsiteStuff and everything worked fine.

Related

Genexus QueryViewer

I have the following runtime error. This happens when I run a web panel that contains a queryviewer.
The project is deployed on a Tomcat 8 server.
The database is SQLServer 2011
Genexus 16 (Upgrade 11)
Error: java.sql.SQLException: Invalid SQL statement or JDBC escape, terminating '"' not found. at net.sourceforge.jtds.jdbc.SQLParser.parse(SQLParser.java:1155) at net.sourceforge.jtds.jdbc.SQLParser.parse(SQLParser.java:156) at net.sourceforge.jtds.jdbc.JtdsPreparedStatement.(JtdsPreparedStatement.java:104) at net.sourceforge.jtds.jdbc.ConnectionJDBC2.prepareStatement(ConnectionJDBC2.java:2221) at net.sourceforge.jtds.jdbc.ConnectionJDBC2.prepareStatement(ConnectionJDBC2.java:2179) at com.genexus.db.driver.GXConnection.prepareStatement(GXConnection.java:882) at com.genexus.db.driver.PreparedStatementCache.createStatement(PreparedStatementCache.java:77) at com.genexus.db.driver.PreparedStatementCache.getStatement(PreparedStatementCache.java:120) at com.genexus.db.driver.GXConnection.getStatement(GXConnection.java:789) at com.genexus.db.driver.GXConnection.getStatement(GXConnection.java:801) at com.genexus.db.SentenceProvider.getPreparedStatement(SentenceProvider.java:16) at com.genexus.db.ForEachCursor.preExecute(ForEachCursor.java:159) at com.genexus.db.DataStoreProvider.execute(DataStoreProvider.java:233) at com.genexus.db.DataStoreProvider.execute(DataStoreProvider.java:204) at qviewer.services.gxpl_DBAccess.ExecuteSQL(gxpl_DBAccess.java:95) at qviewer.services.gxpl_DBAccess.ExecuteSQL(gxpl_DBAccess.java:225) at qviewer.services.Sdtgxpl_DBAccess.executesql(Sdtgxpl_DBAccess.java:67) at qviewer.services.data.recordset.gxpl_getrecordsetquery.privateExecute(gxpl_getrecordsetquery.java:101) at qviewer.services.data.recordset.gxpl_getrecordsetquery.execute_int(gxpl_getrecordsetquery.java:75) at qviewer.services.data.recordset.gxpl_getrecordsetquery.execute(gxpl_getrecordsetquery.java:55) at qviewer.services.data.recordset.gxpl_getrecordset.privateExecute(gxpl_getrecordset.java:166) at qviewer.services.data.recordset.gxpl_getrecordset.execute_int(gxpl_getrecordset.java:112) at qviewer.services.data.recordset.gxpl_getrecordset.execute(gxpl_getrecordset.java:77) at qviewer.services.gxpl_getrecordsetpagedata.privateExecute(gxpl_getrecordsetpagedata.java:179) at qviewer.services.gxpl_getrecordsetpagedata.execute_int(gxpl_getrecordsetpagedata.java:162) at qviewer.services.gxpl_getrecordsetpagedata.execute(gxpl_getrecordsetpagedata.java:107) at qviewer.services.gxpl_getpagedatafortable_logic.privateExecute(gxpl_getpagedatafortable_logic.java:105) at qviewer.services.gxpl_getpagedatafortable_logic.execute_int(gxpl_getpagedatafortable_logic.java:83) at qviewer.services.gxpl_getpagedatafortable_logic.execute(gxpl_getpagedatafortable_logic.java:60) at qviewer.services.gxpl_getpagedatafortable.privateExecute(gxpl_getpagedatafortable.java:71) at qviewer.services.gxpl_getpagedatafortable.execute_int(gxpl_getpagedatafortable.java:52) at qviewer.services.gxpl_getpagedatafortable.execute(gxpl_getpagedatafortable.java:35) at qviewer.services.gxpl_get_main.privateExecute(gxpl_get_main.java:88) at qviewer.services.gxpl_get_main.execute_int(gxpl_get_main.java:52) at qviewer.services.gxpl_get_main.execute(gxpl_get_main.java:35) at qviewer.services.agxpl_get_impl.privateExecute(agxpl_get_impl.java:53) at qviewer.services.agxpl_get_impl.webExecute(agxpl_get_impl.java:43) at com.genexus.webpanels.GXWebObjectBase.doExecute(GXWebObjectBase.java:218) at qviewer.services.agxpl_get.doExecute(agxpl_get.java:22) at com.genexus.webpanels.GXWebObjectStub.callDoExecute(GXWebObjectStub.java:242) at com.genexus.webpanels.GXWebObjectStub.callExecute(GXWebObjectStub.java:124) at com.genexus.webpanels.GXWebObjectStub.doPost(GXWebObjectStub.java:40) at javax.servlet.http.HttpServlet.service(HttpServlet.java:661) at javax.servlet.http.HttpServlet.service(HttpServlet.java:742) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) at com.genexus.filters.ExpiresFilter.doFilter(ExpiresFilter.java:1241) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:199) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:493) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:81) at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:660) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343) at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:798) at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66) at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:808) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1498) at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.lang.Thread.run(Thread.java:748)
I had the exact same problem with a Linux implementation, don't know if it's your case but here is what I found: it turns that the XML files "com.app.QueryViewerObjects.xml", "com.app.QueryViewerQueries.xml" and "com.app.QueryViewerSecurity.xml" had the BOM mark. Once removed the mark, the QV worked like a charm.
There could be another reason for this error and has to do with the lifetime of the KB. Sometimes an upgrade or a new version of Genexus comes with new versions of JARs, and sometimes comes with the exact same JAR BUT with the names with uppercases instead of lowercases as previous versions. In Windows there is no problem because the JAR are overwritten, but in Linux nope. So you've end with two JARs in the WEB-INF/lib folder of two diferents versions. It happend to me with following the QueryViewers JARs:
QueryViewerServicesCommon.jar
QueryviewerServicesCommon.jar
and
QueryViewerServicesRuntime.jar
QueryviewerServicesRuntime.jar
That "v" uppercase/lowercase in Linux makes the files differents.

Keycloak error with Spring Boot: "not a subtype" on tomcat

While developing a spring boot app we are using keycloak. When starting it with the embedded tomcat in vscode everything works as it should.
On time of deployment we want to put it on a standalone tomcat server, so we copy the war file over and the application gets started.
We get a redirect to the keycloak server and after completing the login the redirect back to the page works fine.
Up on loading the page we get the following error:
20-Aug-2021 13:15:31.341 SCHWERWIEGEND [http-nio-8080-exec-10] org.apache.catalina.core.StandardHostValve.invoke Exception Processing /myapplicationpath/
java.util.ServiceConfigurationError: org.keycloak.adapters.authorization.ClaimInformationPointProviderFactory: org.keycloak.adapters.authorization.cip.ClaimsInformationPointProviderFactory not a subtype
at java.base/java.util.ServiceLoader.fail(ServiceLoader.java:590)
at java.base/java.util.ServiceLoader$LazyClassPathLookupIterator.hasNextService(ServiceLoader.java:1237)
at java.base/java.util.ServiceLoader$LazyClassPathLookupIterator.hasNext(ServiceLoader.java:1265)
at java.base/java.util.ServiceLoader$2.hasNext(ServiceLoader.java:1300)
at java.base/java.util.ServiceLoader$3.hasNext(ServiceLoader.java:1385)
at org.keycloak.adapters.authorization.PolicyEnforcer.loadClaimInformationPointProviders(PolicyEnforcer.java:134)
at org.keycloak.adapters.authorization.PolicyEnforcer.<init>(PolicyEnforcer.java:87)
at org.keycloak.adapters.KeycloakDeploymentBuilder$1.call(KeycloakDeploymentBuilder.java:154)
at org.keycloak.adapters.KeycloakDeploymentBuilder$1.call(KeycloakDeploymentBuilder.java:147)
at org.keycloak.adapters.KeycloakDeployment.getPolicyEnforcer(KeycloakDeployment.java:537)
at org.keycloak.adapters.AuthenticatedActionsHandler.isAuthorized(AuthenticatedActionsHandler.java:150)
at org.keycloak.adapters.AuthenticatedActionsHandler.handledRequest(AuthenticatedActionsHandler.java:60)
at org.keycloak.adapters.tomcat.AbstractAuthenticatedActionsValve.invoke(AbstractAuthenticatedActionsValve.java:62)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:607)
at org.keycloak.adapters.tomcat.AbstractKeycloakAuthenticatorValve.invoke(AbstractKeycloakAuthenticatorValve.java:181)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:139)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92)
at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:678)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:74)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343)
at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:408)
at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:853)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1587)
at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.base/java.lang.Thread.run(Thread.java:835)
This is our current keycloak.json file:
{
"realm": "realmname",
"auth-server-url": "https://ourkeycloakserver.com/auth/",
"ssl-required": "none",
"resource": "clientname",
"verify-token-audience": true,
"credentials": {
"secret": "secret"
},
"use-resource-role-mappings": true,
"confidential-port": 0,
"policy-enforcer": {}
}
Any idea what we should look at?
The keycloak configuration is in our application.properties of spring and works fine with embedded tomcat.
I have the same problem as you.I found that I use tomcat keycloak adapter, but I also import the springboot-keycloak-adapter in pom.xml, I deleted this in my pom.xml, package again and deploy.my program works fine... Maybe you could check it out.

How do I fix SEVERE: Allocate exception for servlet after Project clean?

I am working on a dynamic web project using JSP and multiple servlets with tomcat Apache and Eclipse.
I was having multiple problems with Eclipse today and I ran a clean on the project to try to fix some of the issues that I was having and ever since, I'm getting the following error every time a servlet is called.
SEVERE: Allocate exception for servlet [RegisterServlet]
java.lang.ClassNotFoundException: com.ogi.controller.RegisterServlet
at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1372)
at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1195)
at org.apache.catalina.core.DefaultInstanceManager.loadClass(DefaultInstanceManager.java:545)
at org.apache.catalina.core.DefaultInstanceManager.loadClassMaybePrivileged(DefaultInstanceManager.java:526)
at org.apache.catalina.core.DefaultInstanceManager.newInstance(DefaultInstanceManager.java:150)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1044)
at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:763)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:134)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:97)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:544)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:143)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:81)
at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:698)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:78)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:353)
at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:616)
at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65)
at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:831)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1629)
at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.base/java.lang.Thread.run(Thread.java:830)
This project was working completely fine on localhost before the clean and I have all of the servlets defined in my web.xml file. CATALINA has an environmental variable and I already have the Jar files in my project.
I'm not sure why these errors are occurring and would appreciate some direction on how to attempt to fix this.

Tomcat can't find Log4j library

I'm trying to deploy a .war using Tomcat 8.5.56 (I have to use this version for company policy), it logs with Log4j and it is all setted at WEB-INF/web.xml as you can see here:
...
<env-entry>
<env-entry-name>LogClassName</env-entry-name>
<env-entry-value>com.lutris.logging.Log4jLogger</env-entry-value>
<env-entry-type>java.lang.String</env-entry-type>
</env-entry>
<env-entry>
<env-entry-name>Log4j</env-entry-name>
<env-entry-value>../conf/log4j.xml</env-entry-value>
<env-entry-type>java.lang.String</env-entry-type>
</env-entry>
...
When I search the application url, I got a 500 Server error with the next message:
javax.servlet.ServletException: Initialization of logger failed
caused by class com.lutris.util.ConfigException: Key "LogFile" not found in configuration.
com.lutris.appserver.server.httpPresentation.servlet.HttpPresentationServlet.throwServletException(Unknown Source)
com.lutris.appserver.server.httpPresentation.servlet.HttpPresentationServlet.init(Unknown Source)
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:543)
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:81)
org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:690)
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343)
org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:615)
org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65)
org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:818)
org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1627)
org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
java.lang.Thread.run(Thread.java:748)
After a long search I found that this problem comes up because it cant't find the LogClassName class and try to use the default logger, but all the .jars files are at the lib path in tomcat_folder/lib. At first I thought it would be solved if I put that .jars at the app lib folder (tomcat_folder/webapps/application/WEB-INF/lib) but the problem is still there.
Any help would be greatly appreciated.

java.lang.NoClassDefFoundError when referencing an external library in Eclipse

Edit:
I found the answer and I am posting it here in case anybody googles it in future: Turns out that Tomcat does not look up external libraries in Eclipse and they should be copied to [TomcatInstallDir]/lib.
Here is my code (which is for a servlet running on Tomcat server):
import com.google.gson.Gson;
public class AddCourse extends HttpServlet {
public void doPost(HttpServletRequest req, HttpServletResponse res) throws IOException{
Gson gson = new Gson();
//Some code
}
I have tried to export other libraries as well as same library with different version and had the same problem. Here is a picture of Build path:
I read that when writing a Dynamic Web Application (Which I am doing) then we should put the jars under Web-Content/lib, I did that also and it did not help.
Here is the stacktrace:
Apr 19, 2020 5:27:34 PM org.apache.catalina.core.StandardWrapperValve invoke
SEVERE: Servlet.service() for servlet [AddCourse] in context with path [/MTHDB] threw exception [Servlet execution threw an exception] with root cause
java.lang.Error: Unresolved compilation problems:
Gson cannot be resolved to a type
Gson cannot be resolved to a type
at servlets.AddCourse.doPost(AddCourse.java:26)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:660)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:741)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:202)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:541)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:139)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92)
at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:688)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:74)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343)
at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:373)
at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65)
at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:868)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1594)
at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Thread.java:748)
Edit:
I noticed that my MANIFEST.MF' contents looks like this:
Manifest-Version: 1.0
Class-Path:
Should not there be a mention the the JARs?
I found the answer and I am posting it here in case anybody googles it in future: Turns out that Tomcat does not look up external libraries in Eclipse and they should be copied to [TomcatInstallDir]/lib.

Categories