3

我编写了一个简单的 Web 服务程序,但无法在 glassfish 4.0 Web 服务器上对其进行测试。当我测试 Web 服务时,我看到此消息:确保服务已成功部署,并且服务器正在运行。

我可以在 glassfish 网络服务器上部署的网络服务列表中看到它。我将此文件添加到 \jdk1.8.0\jre\lib 以解决问题。

jaxp.properties

javax.xml.accessExternalSchema = All 但它不起作用

我也在测试页面的 url 中看到了这个错误:

lineNumber: 52; columnNumber: 88; schema_reference: Failed to read schema document 'xjc.xsd', because 'bundle' access is not allowed due to restriction set by the accessExternalSchema property. 

提前致谢

4

2 回答 2

4

这对我有用:

  1. 从 NetBeans IDE 8,部署您的 Web 应用程序以启动 GlassFish(右键单击您的 Web 项目并选择部署)
  2. 在浏览器上打开 GlassFish 控制台(http://localhost:4848/common/index.jsf如果您使用默认配置在本地工作)
  3. 创建一个新的 JVM 选项,其值为:-Djavax.xml.accessExternalSchema=all(我建议您阅读第 119 页的https://javaee.github.io/glassfish/doc/4.0/administration-guide.pdf)。不要忘记保存它。
  4. 重新启动 GlassFish(通过单击左上角附近的消息)

这一定足够了……所以,再次尝试测试您的 Web 服务。

我不知道 GlassFish 将更改保存在哪里...

对不起我的英语不好 :)

于 2014-12-02T10:32:44.607 回答
4

这是答案: https://netbeans.org/kb/docs/websvc/jax-ws.html#extschema 您应该直接配置 IDE 和 Glassfish 服务器。特别感谢巴勃罗

于 2014-06-12T11:23:54.953 回答