Apache Tomcat 访问文件夹时出现 AccessDeniedException
Apache Tomcat AccessDeniedException on accessing folder
我目前正在尝试将 GWT 网络应用程序部署到 tomcat 实例,但该程序 运行 不正确。仔细检查 tomcat 日志,看起来 Tomcat 是 运行 进入 AccessDeniedException。
SEVERE: Exception while dispatching incoming RPC call
com.google.gwt.user.client.rpc.SerializationException: Type
'java.nio.file.AccessDeniedException' was not included in the set of
types which can be serialized by this SerializationPolicy or its Class
object could not be loaded. For security purposes, this type will not
be serialized.: instance = java.nio.file.AccessDeniedException:
/luceneIndex
不过我很困惑,因为 tomcat 应该可以轻松访问该文件夹。
drwxrwxrwx 4 tomcat tomcat 4096 Mar 14 20:32 SearchTest
-rwxrwxrwx 1 tomcat tomcat 602 Mar 12 20:14 SearchTest.css
-rwxrwxrwx 1 tomcat tomcat 3038 Mar 13 23:13 SearchTest.html
drwxrwxrwx 5 tomcat tomcat 4096 Mar 14 20:24 WEB-INF
-rwxrwxrwx 1 tomcat tomcat 1082 Mar 12 20:14 favicon.ico
drwxrwxrwx 2 tomcat tomcat 4096 Mar 14 20:24 luceneFiles
drwxrwxrwx 2 tomcat tomcat 4096 Mar 14 20:24 luceneIndex
是什么导致了这个问题?
您是否在客户端代码中使用 'java.nio.file.AccessDeniedException'? GWT 编译器将所有客户端 Java 代码翻译成 Java 脚本。由于并非所有 Java 功能都可以在 Web 浏览器中使用,因此 GWT 仅支持 Java 运行时库的一个子集。
你可以看看这两页JRE Compatablity and JRE Emulation。
据我所知,java.nio 包中 类 的 none 是模拟的。这可能是您出错的原因。
我目前正在尝试将 GWT 网络应用程序部署到 tomcat 实例,但该程序 运行 不正确。仔细检查 tomcat 日志,看起来 Tomcat 是 运行 进入 AccessDeniedException。
SEVERE: Exception while dispatching incoming RPC call com.google.gwt.user.client.rpc.SerializationException: Type 'java.nio.file.AccessDeniedException' was not included in the set of types which can be serialized by this SerializationPolicy or its Class object could not be loaded. For security purposes, this type will not be serialized.: instance = java.nio.file.AccessDeniedException: /luceneIndex
不过我很困惑,因为 tomcat 应该可以轻松访问该文件夹。
drwxrwxrwx 4 tomcat tomcat 4096 Mar 14 20:32 SearchTest
-rwxrwxrwx 1 tomcat tomcat 602 Mar 12 20:14 SearchTest.css
-rwxrwxrwx 1 tomcat tomcat 3038 Mar 13 23:13 SearchTest.html
drwxrwxrwx 5 tomcat tomcat 4096 Mar 14 20:24 WEB-INF
-rwxrwxrwx 1 tomcat tomcat 1082 Mar 12 20:14 favicon.ico
drwxrwxrwx 2 tomcat tomcat 4096 Mar 14 20:24 luceneFiles
drwxrwxrwx 2 tomcat tomcat 4096 Mar 14 20:24 luceneIndex
是什么导致了这个问题?
您是否在客户端代码中使用 'java.nio.file.AccessDeniedException'? GWT 编译器将所有客户端 Java 代码翻译成 Java 脚本。由于并非所有 Java 功能都可以在 Web 浏览器中使用,因此 GWT 仅支持 Java 运行时库的一个子集。
你可以看看这两页JRE Compatablity and JRE Emulation。
据我所知,java.nio 包中 类 的 none 是模拟的。这可能是您出错的原因。