【问题标题】:How can i resolve the "HTTP Status 500 - Internal Server Error" in my web service app on glassfish?如何在 glassfish 上的 Web 服务应用程序中解决“HTTP 状态 500 - 内部服务器错误”?
【发布时间】:2014-08-21 15:36:44
【问题描述】:

我已经将一个包含 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.

【问题讨论】:

    标签: java jakarta-ee glassfish


    【解决方案1】:

    添加

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

    domain.xml 文件中 glassfish4\glassfish\domains\domain1\config\domain.xml 文件夹中的代码行

    &lt;java-config&gt; &lt;/java-config&gt; 内标记为:-

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

    注意:- 在 domain.xml 文件的 –D..... 代码的最后添加上面的代码行。在随机位置添加它可能不能保证这会起作用。

    【讨论】:

      猜你喜欢
      • 2015-03-24
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-02-08
      相关资源
      最近更新 更多