简体   繁体   English

如何在Glassfish的Web服务应用程序中解决“ HTTP状态500-内部服务器错误”?

[英]How can i resolve the “HTTP Status 500 - Internal Server Error” in my web service app on glassfish?

I have deployed a web app including an EJB (RESTFul web service) from Netbwans 8 into Glassfish 4. This includes a cross origin resource sharing filter. 我已经将一个包含EJB(RESTFul Web服务)的Web应用程序从Netbwans 8部署到了Glassfish 4中。这包括一个跨源资源共享过滤器。 I am getting the "HTTP Status 500 - Internal Server Error" error in the browser when i try to view the output of the web service (directly from the web service path, not from a client per se). 当我尝试查看Web服务的输出(直接从Web服务路径而不是从客户端本身)时,在浏览器中收到“ HTTP状态500-内部服务器错误”错误。 I saw in a forum that i might try un-checking a Jersey option in my project properties in Netbeans but i see no such option. 我在一个论坛上看到,我可能会尝试在Netbeans的项目属性中取消选中“ Jersey”选项,但没有看到这样的选项。 The only thing I've found in the logs is: 我在日志中找到的唯一内容是:

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.

Add

<jvm-options>-Djavax.xml.accessExternalSchema=all</jvm-options> 

line of code in the domain.xml file at glassfish4\\glassfish\\domains\\domain1\\config\\domain.xml folder glassfish4\\glassfish\\domains\\domain1\\config\\domain.xml文件夹中的domain.xml文件中的代码行

inside <java-config> </java-config> tag as :- <java-config> </java-config>标记内:

<java-config>
.
.
<jvm-options>-Djavax.xml.accessExternalSchema=all</jvm-options>
</java-config>

Note:- add the above line of code at the last of the –D..... code of the domain.xml file. 注意:-在domain.xml文件的–D .....代码的最后添加上述代码行。 Adding it at random position may not gurantee that this will work. 将其添加到随机位置可能无法保证这会起作用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM