我已经将一个包含EJB(RESTFul Web服务)的Web应用程序从Netbwans 8部署到了Glassfish 4中。这包括一个跨源资源共享过滤器。当我尝试查看Web服务的输出(直接从Web服务路径而不是从客户端本身)时,在浏览器中收到“ HTTP状态500-内部服务器错误”错误。我在一个论坛上看到,我可能会尝试在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.
添加
<jvm-options>-Djavax.xml.accessExternalSchema=all</jvm-options>
domain.xml
文件glassfish4\glassfish\domains\domain1\config\domain.xml
夹中文件中的代码行
内部<java-config> </java-config>
标签为:-
<java-config>
.
.
<jvm-options>-Djavax.xml.accessExternalSchema=all</jvm-options>
</java-config>
注意:-将以上代码行添加到domain.xml文件的–D .....代码的末尾。将其添加到随机位置可能无法保证这会起作用。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句