我已经将包含来自Netbwans 8的EJB(RESTFul Web服务)的Web应用程序部署到Glassfish 4中。这包括跨源资源共享过滤器。我得到了#34; HTTP状态500 - 内部服务器错误"我尝试查看Web服务的输出时(直接从Web服务路径,而不是从客户端本身)浏览器中的错误。我在一个论坛中看到我可能会尝试在Netbeans的项目属性中取消检查Jersey选项,但我看不到这样的选项。我在日志中找到的唯一一件事就是:
Info: WELD-000900 2.0.0 (SP1)
Warning: Class 'javax.ejb.PostActivate' not found, interception based on it is not enabled
Warning: Class 'javax.ejb.PrePassivate' not found, interception based on it is not enabled
Info: Registering the Jersey servlet application, named com.mycompany.enterprisesample.service.ApplicationConfig, at the servlet mapping /webresources/*, with the Application class of the same name.
Aug 21, 2014 11:31:10 AM com.sun.enterprise.glassfish.bootstrap.osgi.BundleProvisioner$DefaultCustomizer getLocations
WARNING: Skipping entry because it is not an absolute URI.
Aug 21, 2014 11:31:10 AM com.sun.enterprise.glassfish.bootstrap.osgi.BundleProvisioner$DefaultCustomizer getLocations
WARNING: Skipping entry because it is not an absolute URI.
Registered com.sun.enterprise.glassfish.bootstrap.osgi.EmbeddedOSGiGlassFishRuntime@5c8edb94 in service registry.
答案 0 :(得分:2)
添加
<jvm-options>-Djavax.xml.accessExternalSchema=all</jvm-options>
domain.xml
文件夹<{1}}文件夹中的代码行
在glassfish4\glassfish\domains\domain1\config\domain.xml
内标记为: -
<java-config> </java-config>
注意: - 在domain.xml文件的-D .....代码的最后添加上面的代码行。在随机位置添加它可能无法保证这将起作用。