繁体   English   中英

JavaEE:Web服务已成功部署,但Tester无法正常工作

[英]JavaEE: Web Service Deployed Successfully but Tester is not Working

我是一名学生,并且是JavaEE开发的新手。 我创建了一个独立的EJB项目,并在其中创建了Web服务。 我正在使用Web Service WSDLJava Web Application项目中使用该服务

当我部署EJB项目时,我得到了类似的东西。 即成功部署。

Info:   file:/media/benison/EXTRA/8th Sem Java Project/Projects/BusinessFacade/build/classes/_BusinessFacadePU logout successful
Info:   visiting unvisited references
Info:   visiting unvisited references
Info:   Entity.YearSemesterStudent actually got transformed
Info:   Entity.YearSemesterStudentPK actually got transformed
Info:   Entity.YearSemester actually got transformed
Info:   Entity.Student actually got transformed
Info:   Entity.CollegeCategory actually got transformed
Info:   Entity.Faculty actually got transformed
Info:   Entity.StudentMark actually got transformed
Info:   Entity.Exam actually got transformed
Info:   Entity.Setting actually got transformed
Info:   Entity.College actually got transformed
Info:   Entity.Subject actually got transformed
Info:   Entity.Contact actually got transformed
Info:   Entity.UserGroup actually got transformed
Info:   Entity.SubjectTeachingFaculty actually got transformed
Info:   Entity.SubjectTeachingFacultyPK actually got transformed
Info:   Entity.TeachingFaculty actually got transformed
Info:   Entity.DepartmentCourse actually got transformed
Info:   Entity.Event actually got transformed
Info:   Entity.News actually got transformed
Info:   Entity.Department actually got transformed
Info:   Entity.Employee actually got transformed
Info:   Entity.Course actually got transformed
Info:   Entity.UserType actually got transformed
Info:   Entity.User actually got transformed
Info:   EclipseLink, version: Eclipse Persistence Services - 2.5.0.v20130507-3faac2b
Info:   file:/media/benison/EXTRA/8th Sem Java Project/Projects/BusinessFacade/build/classes/_BusinessFacadePU login successful
Warning:   Container org.glassfish.webservices.JAXWSContainer@63cb3e9d doesn't support class com.sun.xml.ws.api.server.Module
Info:   EJB5181:Portable JNDI names for EJB UserRegistration: [java:global/BusinessFacade/UserRegistration!WebService.UserRegistration, java:global/BusinessFacade/UserRegistration]
Warning:   Container org.glassfish.webservices.JAXWSContainer@27add948 doesn't support class com.sun.xml.ws.api.server.Module
Info:   EJB5181:Portable JNDI names for EJB BLCollege: [java:global/BusinessFacade/BLCollege!EJB.BusinessLogic.IBLCollegeLocal, java:global/BusinessFacade/BLCollege]
Warning:   Container org.glassfish.webservices.JAXWSContainer@6b9b0733 doesn't support class com.sun.xml.ws.api.server.Module
Info:   EJB5181:Portable JNDI names for EJB ALContact: [java:global/BusinessFacade/ALContact, java:global/BusinessFacade/ALContact!EJB.ApplicationLogic.IALContactLocal]
Warning:   Container org.glassfish.webservices.JAXWSContainer@69591e98 doesn't support class com.sun.xml.ws.api.server.Module
Info:   EJB5181:Portable JNDI names for EJB ALSetting: [java:global/BusinessFacade/ALSetting, java:global/BusinessFacade/ALSetting!EJB.ApplicationLogic.IALSetting]
Warning:   Container org.glassfish.webservices.JAXWSContainer@72f12b2 doesn't support class com.sun.xml.ws.api.server.Module
Info:   EJB5181:Portable JNDI names for EJB BLFaculty: [java:global/BusinessFacade/BLFaculty!EJB.BusinessLogic.IBLFacultyLocal, java:global/BusinessFacade/BLFaculty]
Warning:   Container org.glassfish.webservices.JAXWSContainer@1e6656ed doesn't support class com.sun.xml.ws.api.server.Module
Info:   EJB5181:Portable JNDI names for EJB ALEvent: [java:global/BusinessFacade/ALEvent, java:global/BusinessFacade/ALEvent!EJB.ApplicationLogic.IALEventLocal]
Warning:   Container org.glassfish.webservices.JAXWSContainer@64061112 doesn't support class com.sun.xml.ws.api.server.Module
Info:   EJB5181:Portable JNDI names for EJB BLExam: [java:global/BusinessFacade/BLExam!EJB.BusinessLogic.IBLExamLocal, java:global/BusinessFacade/BLExam]
Warning:   Container org.glassfish.webservices.JAXWSContainer@487ec88a doesn't support class com.sun.xml.ws.api.server.Module
Info:   EJB5181:Portable JNDI names for EJB BLSubject: [java:global/BusinessFacade/BLSubject!EJB.BusinessLogic.IBLSubjectLocal, java:global/BusinessFacade/BLSubject]
Warning:   Container org.glassfish.webservices.JAXWSContainer@39b16787 doesn't support class com.sun.xml.ws.api.server.Module
Info:   EJB5181:Portable JNDI names for EJB ALUserGroup: [java:global/BusinessFacade/ALUserGroup!EJB.ApplicationLogic.IALUserGroupLocal, java:global/BusinessFacade/ALUserGroup]
Warning:   Container org.glassfish.webservices.JAXWSContainer@67305b5a doesn't support class com.sun.xml.ws.api.server.Module
Info:   EJB5181:Portable JNDI names for EJB BLStudent: [java:global/BusinessFacade/BLStudent!EJB.BusinessLogic.IBLStudentLocal, java:global/BusinessFacade/BLStudent]
Info:   EJB Endpoint deployed BusinessFacade
  listening at address at http://benison-VirtualBox:8080/BLExamService/ExamService
Info:   EJB Endpoint deployed BusinessFacade
  listening at address at http://benison-VirtualBox:8080/BLSubjectService/SubjectService
Info:   EJB Endpoint deployed BusinessFacade
  listening at address at http://benison-VirtualBox:8080/BLStudentService/StudentService
Info:   EJB Endpoint deployed BusinessFacade
  listening at address at http://benison-VirtualBox:8080/ALUserGroupService/UserGroupService
Info:   EJB Endpoint deployed BusinessFacade
  listening at address at http://benison-VirtualBox:8080/ALEventService/EventService
Info:   EJB Endpoint deployed BusinessFacade
  listening at address at http://benison-VirtualBox:8080/ALSettingService/SettingService
Info:   EJB Endpoint deployed BusinessFacade
  listening at address at http://benison-VirtualBox:8080/BLFacultyService/FacultyService
Info:   EJB Endpoint deployed BusinessFacade
  listening at address at http://benison-VirtualBox:8080/BLCollegeService/CollegeService
Info:   EJB Endpoint deployed Busines![enter image description here][1]sFacade
  listening at address at http://benison-VirtualBox:8080/UserRegistration/UserRegistration
Info:   EJB Endpoint deployed BusinessFacade
  listening at address at http://benison-VirtualBox:8080/ALContactService/ContactService
Info:   BusinessFacade was successfully deployed in 4,027 milliseconds.


但是,当我尝试测试Web服务时,它会显示以下对话框:


在此处输入图片说明


Glassfish日志说:


Info:   Invoking wsimport with http://localhost:8080/BLExamService/ExamService?WSDL
Info:   parsing WSDL...
Info:   [WARNING] schema_reference: Failed to read schema document 'ExamService?xsd=1', because 'http' access is not allowed due to restriction set by the accessExternalSchema property.
Info:   line 4 of http://localhost:8080/BLExamService/ExamService?WSDL#types?schema1
Severe:   service exception:
java.lang.AssertionError:     org.xml.sax.SAXParseException; systemId: bundle://300.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.Schema    compilerImpl.bind(Schema    compilerImpl.java:269)
at     com.sun.tools.xjc.api.impl.s2j.Schema    compilerImpl.bind(Schema    compilerImpl.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.ws    compile.WsimportTool.buildWsdlModel(WsimportTool.java:444)
at     com.sun.tools.ws.ws    compile.WsimportTool.run(WsimportTool.java:205)
at     com.sun.tools.ws.ws    compile.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.EjbWebServiceServlet.service(EjbWebServiceServlet.java:136)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
at     org.glassfish.grizzly.servlet.ServletHandler.doServletService(ServletHandler.java:242)
at     org.glassfish.grizzly.servlet.ServletHandler.service(ServletHandler.java:193)
at     com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:246)
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:745)
Caused by:     org.xml.sax.SAXParseException; systemId: bundle://300.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)
... 39 more


所以我永远被困在这里。 任何人都可以请对此有所说明,例如可能是什么问题以及为什么会这样。 任何提示都会有所帮助。

编辑:

我还尝试如下所示访问我的WSDL,它返回WSDL XML,如下所示:


在此处输入图片说明


然后我尝试直接访问测试仪,但是会发生以下情况:


在此处输入图片说明

所有的Web服务都一样。 他们都没有工作。

注意:我正在使用@WebService(name =“ <Service Name>”)批注来使用我作为Web Service创建的EJB。

朋友,我为我的问题找到了解决方案...


Java SDK 7(具有最新更新)或Java SDK 8的用户可能会遇到此问题。

出现此问题时,可以使用以下步骤:

步骤1:修改IDE配置文件( netbeans.conf ),将以下开关添加到netbeans_default_options。

-J-Djavax.xml.accessExternalSchema =所有

注意:您可以在$ {nb-install} / etc /目录中找到netbeans.conf文件。 更多信息

步骤2:打开GlassFish配置文件,并添加以下JVM选项元素。 您将需要重新启动服务器以使更改生效。

<java的配置>
...
<jvm-options> -Djavax.xml.accessExternalSchema = all </ jvm-options>
</ java的配置>


步骤3:/path/to/jdk1.8.0/jre/lib下创建一个名为jaxp.properties的文件(如果不存在),然后在其中写入以下行:

javax.xml.accessExternalSchema =全部


我从以下链接获得了此解决方案:

我认为您需要使用以下内容更新Glassfish服务器的domain.xml文件:

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

可能还需要进行其他一些设置。 有关更多信息,请参见https://netbeans.org/kb/docs/websvc/jax-ws.html 希望能帮助到你!!

您是否仔细阅读过玻璃鱼堆的痕迹?

       [WARNING] schema_reference: Failed to read schema document 'ExamService?xsd=1', because 'http' access is not allowed due to restriction set by the accessExternalSchema property

看起来不允许使用“ http”访问,并且必须使用SSL协议。

暂无
暂无

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

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