法使用NetBeans和Glassfish服务器部署WebSer

法使用NetBeans和Glassfish服务器部署WebSer

本文介绍了无法使用NetBeans和Glassfish服务器部署WebService的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在研究java netbeans webservice。
我正在部署webservice,但是当我按下Test Web Service时。我在附图中看到错误。
在玻璃鱼服务器输出它抛出异常,但我不知道如何解决它们。







这是glassfish服务器的输出:

 信息:使用http:// localhost:8080 / AppleStoreServer调用wsimport / ShoppingWS?WSDL 
信息:解析WSDL ...
信息:[WARNING] schema_reference:无法读取模式文档'ShoppingWS?xsd = 1',因为由于限制不允许'http'访问由accessExternalSchema属性设置。
信息:第7行http:// localhost:8080 / AppleStoreServer / ShoppingWS?WSDL#types?schema1
警告:StandardWrapperValve [ShoppingWS]:Servlet.service()for servlet ShoppingWS抛出异常
java.lang.AssertionError:org.xml.sax.SAXParseException; systemId:bundle://218.0:1 / com / sun / tools / xjc / reader / xmlschema / bindinfo / binding.xsd; lineNumber:52; columnNumber:88; schema_reference:无法读取模式文档'xjc.xsd',因为由于accessExternalSchema属性设置的限制,不允许捆绑访问。
at com.sun.tools.xjc.SchemaCache.newValidator(SchemaCache.java:80)
at com.sun.tools.xjc.reader.internalizer.SCDBasedBindingSet.apply(SCDBasedBindingSet.java:237)
at com.sun.tools.xjc.ModelLoader.createXSOM(ModelLoader.java:541)
at com.sun.tools.xjc.api.impl.s2j.SchemaCompilerImpl.bind(SchemaCompilerImpl.java: 269)
at com.sun.tools.xjc.api.impl.s2j.SchemaCompilerImpl.bind(SchemaCompilerImpl.java:95)
at com.sun.tools.ws.processor.modeler.wsdl。 JAXBModelBuilder.bind(JAXBModelBuilder.java:142)
处com.sun.tools com.sun.tools.ws.processor.modeler.wsdl.WSDLModeler.buildJAXBModel(WSDLModeler.java:2298)
。 ws.processor.modeler.wsdl.WSDLModeler.internalBuildModel(WSDLModeler.java:198)
在com.sun.tools.ws.processor.modeler.wsdl.WSDLModeler.buildModel(WSDLModeler.java:141)
at com.sun.tools.ws.wscompile.WsimportTool.buildWsdlModel(WsimportTool.java:444)
at com.sun.tools.ws.wscompile.WsimportTool.run(Wsi mportTool.java:205)
at com.sun.tools.ws.wscompile.WsimportTool.run(WsimportTool.java:183)
at com.sun.tools.ws.util.WSToolsObjectFactoryImpl.wsimport( WSToolsObjectFactoryImpl.java:60)
处org.glassfish.webservices.monitoring.WebServiceTesterServlet.wsImport com.sun.tools.ws.spi.WSToolsObjectFactory.wsimport(WSToolsObjectFactory.java:88)
(WebServiceTesterServlet。 Java的:642)
在org.glassfish.webservices.monitoring.WebServiceTesterServlet.initializePort(WebServiceTesterServlet.java:528)在org.glassfish.webservices.monitoring.WebServiceTesterServlet.doGet
(WebServiceTesterServlet.java:169)
at org.glassfish.webservices.monitoring.WebServiceTesterServlet.invoke(WebServiceTesterServlet.java:104)
at org.glassfish.webservices.JAXWSServlet.doGet(JAXWSServlet.java:210)
at javax .servlet.http.HttpServlet.service(HttpServlet.java:687)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
at org .apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1682)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:318)
at org.apache.catalina .core.StandardContextValve.invoke(StandardContextValve.java:160)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:734)
at org.apache.catalina.core.StandardPipeline .invoke(StandardPipeline.java:673)
at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:99)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve .java:174)
at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:357)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:260 )
at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:188)
at org.glassfish.grizzly.http.server.HttpHandler.runService(HttpHandler.java :191)在org.glassfish
.grizzly.http.server.HttpHandler.doHandle(HttpHandler.java:168)$ or
org.glassfish.grizzly.http.server.HttpServerFilter.handleRead(HttpServerFilter.java:189)
org.glassfish .grizzly.filterchain.ExecutorResolver $ 9.execute(ExecutorResolver.java:119)维持在org.glassfish.grizzly org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:288)

。 filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:206)
处org.glassfish.grizzly.filterchain.DefaultFilterChain org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:136)
。在org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent(TCPNIOTransport。)上处理(DefaultFilterChain.java:114)
在org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:77)
。 java:838)
at org.glassfish.grizzly.strategies.AbstractIOStrategy.fireIOEvent(AbstractIOStrategy.java:113)
at org.gl assfish.grizzly.strategies.WorkerThreadIOStrategy.run0(WorkerThreadIOStrategy.java:115)
at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.access $ 100(WorkerThreadIOStrategy.java:55)
at org.glassfish.grizzly .strategies.WorkerThreadIOStrategy $ WorkerThreadRunnable.run(WorkerThreadIOStrategy.java:135)
at org.glassfish.grizzly.threadpool.AbstractThreadPool $ Worker.doWork(AbstractThreadPool.java:564)
at org.glassfish.grizzly .threadpool.AbstractThreadPool $ Worker.run(AbstractThreadPool.java:544)$ b $在java.lang.Thread.run(Thread.java:744)
导致:org.xml.sax.SAXParseException; systemId:bundle://218.0:1 / com / sun / tools / xjc / reader / xmlschema / bindinfo / binding.xsd; lineNumber:52; columnNumber:88; schema_reference:无法读取模式文档'xjc.xsd',因为由于accessExternalSchema属性设置的限制,不允许捆绑访问。
at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:203)
at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper。 fatalError(ErrorHandlerWrapper.java:177)
at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:441)
at com.sun.org.apache。 xerces.internal.impl.xs.traversers.XSDHandler.reportSchemaErr(XSDHandler.java:4162)
at com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.reportSchemaFatalError(XSDHandler.java :4141)
at com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.getSchemaDocument(XSDHandler.java:2168)
at com.sun.org.apache.xerces .internal.impl.xs.traversers.XSDHandler.resolveSchema(XSDHandler.java:2078)
at com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.constructTrees(XSDHandler.java: 1008)
at com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHan d com.un.org.apache.xerces.internal.impl.xs.XMLSchemaLoader.loadSchema(XMLSchemaLoader.java:616)
com.sun上的
(xSDHandler.java:620) org.apache.xerces.internal.impl.xs.XMLSchemaLoader.loadGrammar(XMLSchemaLoader.java:574)
at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaLoader.loadGrammar(XMLSchemaLoader.java :540)
at com.sun.org.apache.xerces.internal.jaxp.validation.XMLSchemaFactory.newSchema(XMLSchemaFactory.java:255)
at javax.xml.validation.SchemaFactory.newSchema(SchemaFactory .java:638)
at javax.xml.validation.SchemaFactory.newSchema(SchemaFactory.java:670)
at com.sun.tools.xjc.SchemaCache.newValidator(SchemaCache.java:77)
... 47 more


解决方案

https://netbeans.org/kb/docs/websvc/jax-ws.html



这是一个netbeans和glassfish的bug,你需要修改一些文件来解决这个问题。


I'm working on java netbeans webservice.I'm deploying the webservice successfully, but when I press Test Web Service. I get the error in the attached image.in the glassfish server output it's throw exceptions but I dont't know how to solve them.

img1

img2

this is the glassfish server output:

    Info:   Invoking wsimport with http://localhost:8080/AppleStoreServer/ShoppingWS?WSDL
Info:   parsing WSDL...
Info:   [WARNING] schema_reference: Failed to read schema document 'ShoppingWS?xsd=1', because 'http' access is not allowed due to restriction set by the accessExternalSchema property.
Info:   line 7 of http://localhost:8080/AppleStoreServer/ShoppingWS?WSDL#types?schema1
Warning:   StandardWrapperValve[ShoppingWS]: Servlet.service() for servlet ShoppingWS threw exception
java.lang.AssertionError: org.xml.sax.SAXParseException; systemId: bundle://218.0:1/com/sun/tools/xjc/reader/xmlschema/bindinfo/binding.xsd; 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.
    at com.sun.tools.xjc.SchemaCache.newValidator(SchemaCache.java:80)
    at com.sun.tools.xjc.reader.internalizer.SCDBasedBindingSet.apply(SCDBasedBindingSet.java:237)
    at com.sun.tools.xjc.ModelLoader.createXSOM(ModelLoader.java:541)
    at com.sun.tools.xjc.api.impl.s2j.SchemaCompilerImpl.bind(SchemaCompilerImpl.java:269)
    at com.sun.tools.xjc.api.impl.s2j.SchemaCompilerImpl.bind(SchemaCompilerImpl.java:95)
    at com.sun.tools.ws.processor.modeler.wsdl.JAXBModelBuilder.bind(JAXBModelBuilder.java:142)
    at com.sun.tools.ws.processor.modeler.wsdl.WSDLModeler.buildJAXBModel(WSDLModeler.java:2298)
    at com.sun.tools.ws.processor.modeler.wsdl.WSDLModeler.internalBuildModel(WSDLModeler.java:198)
    at com.sun.tools.ws.processor.modeler.wsdl.WSDLModeler.buildModel(WSDLModeler.java:141)
    at com.sun.tools.ws.wscompile.WsimportTool.buildWsdlModel(WsimportTool.java:444)
    at com.sun.tools.ws.wscompile.WsimportTool.run(WsimportTool.java:205)
    at com.sun.tools.ws.wscompile.WsimportTool.run(WsimportTool.java:183)
    at com.sun.tools.ws.util.WSToolsObjectFactoryImpl.wsimport(WSToolsObjectFactoryImpl.java:60)
    at com.sun.tools.ws.spi.WSToolsObjectFactory.wsimport(WSToolsObjectFactory.java:88)
    at org.glassfish.webservices.monitoring.WebServiceTesterServlet.wsImport(WebServiceTesterServlet.java:642)
    at org.glassfish.webservices.monitoring.WebServiceTesterServlet.initializePort(WebServiceTesterServlet.java:528)
    at org.glassfish.webservices.monitoring.WebServiceTesterServlet.doGet(WebServiceTesterServlet.java:169)
    at org.glassfish.webservices.monitoring.WebServiceTesterServlet.invoke(WebServiceTesterServlet.java:104)
    at org.glassfish.webservices.JAXWSServlet.doGet(JAXWSServlet.java:210)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:687)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
    at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1682)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:318)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:160)
    at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:734)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:673)
    at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:99)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:174)
    at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:357)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:260)
    at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:188)
    at org.glassfish.grizzly.http.server.HttpHandler.runService(HttpHandler.java:191)
    at org.glassfish.grizzly.http.server.HttpHandler.doHandle(HttpHandler.java:168)
    at org.glassfish.grizzly.http.server.HttpServerFilter.handleRead(HttpServerFilter.java:189)
    at org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:119)
    at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:288)
    at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:206)
    at org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:136)
    at org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:114)
    at org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:77)
    at org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent(TCPNIOTransport.java:838)
    at org.glassfish.grizzly.strategies.AbstractIOStrategy.fireIOEvent(AbstractIOStrategy.java:113)
    at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.run0(WorkerThreadIOStrategy.java:115)
    at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.access$100(WorkerThreadIOStrategy.java:55)
    at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy$WorkerThreadRunnable.run(WorkerThreadIOStrategy.java:135)
    at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:564)
    at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:544)
    at java.lang.Thread.run(Thread.java:744)
Caused by: org.xml.sax.SAXParseException; systemId: bundle://218.0:1/com/sun/tools/xjc/reader/xmlschema/bindinfo/binding.xsd; 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.
    at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:203)
    at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.fatalError(ErrorHandlerWrapper.java:177)
    at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:441)
    at com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.reportSchemaErr(XSDHandler.java:4162)
    at com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.reportSchemaFatalError(XSDHandler.java:4141)
    at com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.getSchemaDocument(XSDHandler.java:2168)
    at com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.resolveSchema(XSDHandler.java:2078)
    at com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.constructTrees(XSDHandler.java:1008)
    at com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.parseSchema(XSDHandler.java:620)
    at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaLoader.loadSchema(XMLSchemaLoader.java:616)
    at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaLoader.loadGrammar(XMLSchemaLoader.java:574)
    at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaLoader.loadGrammar(XMLSchemaLoader.java:540)
    at com.sun.org.apache.xerces.internal.jaxp.validation.XMLSchemaFactory.newSchema(XMLSchemaFactory.java:255)
    at javax.xml.validation.SchemaFactory.newSchema(SchemaFactory.java:638)
    at javax.xml.validation.SchemaFactory.newSchema(SchemaFactory.java:670)
    at com.sun.tools.xjc.SchemaCache.newValidator(SchemaCache.java:77)
    ... 47 more
解决方案

https://netbeans.org/kb/docs/websvc/jax-ws.html

It's a bug with netbeans and glassfish, u need to modify some files to fix that.

这篇关于无法使用NetBeans和Glassfish服务器部署WebService的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-24 12:22