我编写了一个简单的 Web 服务程序,但无法在 glassfish 4.0 Web 服务器上测试它。
当我测试 Web 服务时,我看到以下消息:
确保服务已成功部署,并且服务器正在运行。
我可以在 glassfish Web 服务器上部署的 Web 服务列表中看到它。
我将此文件添加到 \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.
提前致谢
这对我有用:
- 在 NetBeans IDE 8 中,部署 Web 应用程序以启动 GlassFish(右键单击您的 Web 项目并选择“部署”)
- 在浏览器上打开 GlassFish 控制台 (
http://localhost:4848/common/index.jsf
如果您在本地使用默认配置工作)
- 创建一个新的 JVM 选项,其值为:-Djavax.xml.accessExternalSchema=all(我建议您阅读https://javaee.github.io/glassfish/doc/4.0/administration-guide.pdf https://javaee.github.io/glassfish/doc/4.0/administration-guide.pdf第 119 页)。不要忘记保存它。
- 重新启动 GlassFish(通过单击左上角附近的消息)
这一定足够了...所以,尝试再次测试您的网络服务。
我不知道 GlassFish 在哪里保存该更改......
对不起我的英语不好 :)
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)