我使用'xjc'生成了java代理类。 当我部署应用程序生产环境时,我得到一个“没有名称调试的属性”WebService Exception。 但是,在暂存环境中它工作正常。 我指的是来自两个环境的相同Web服务,因此端点URL& WSDL是一样的。
非常感谢任何帮助。
基于Java 6构建,部署在JBoss AS 6.x
上以下是我称之为webservices的客户端代码。
==========客户代码===========
ProcessAccountSiteUnitWSD service = new ProcessAccountSiteUnitWSD();
final ProcessAccountSiteUnitWSDPortType port = service.getGESFDCPWAccountSiteUnitServicesWebServicesProviderProcessAccountSiteUnitWSDPort();
final BindingProvider hB = ((BindingProvider) port);
hB.getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY,
resources.getString("endpoint_address"));
hB.getRequestContext().put(BindingProvider.USERNAME_PROPERTY,
resources.getString("username"));
hB.getRequestContext().put(BindingProvider.PASSWORD_PROPERTY,
resources.getString("password"));
AccountSiteUnitRequest req = new AccountSiteUnitRequest();
req.setContactSSO(userId);
AccountSiteUnitResponse resp = port.processAccountSiteUnit(req,"");
if(resp != null){
//process response
}
=============错误日志===============
javax.xml.ws.WebServiceException: class com.abc.xyz.abcxyz.ge_sfdc_pw_accountsiteunit_services.webservices.provider.processaccountsiteunit_wsd.ProcessAccountSiteUnit do not have a property of the name debug
at com.sun.xml.ws.client.sei.BodyBuilder$DocLit.<init>(BodyBuilder.java:245) [jaxws-rt.jar:2.2.8]
at com.sun.xml.ws.client.sei.StubHandler.<init>(StubHandler.java:132) [jaxws-rt.jar:2.2.8]
at com.sun.xml.ws.db.DatabindingImpl.initStubHandlers(DatabindingImpl.java:141) [jaxws-rt.jar:2.2.8]
at com.sun.xml.ws.db.DatabindingImpl.<init>(DatabindingImpl.java:104) [jaxws-rt.jar:2.2.8]
at com.sun.xml.ws.db.DatabindingProviderImpl.create(DatabindingProviderImpl.java:74) [jaxws-rt.jar:2.2.8]
at com.sun.xml.ws.db.DatabindingProviderImpl.create(DatabindingProviderImpl.java:58) [jaxws-rt.jar:2.2.8]
at com.sun.xml.ws.db.DatabindingFactoryImpl.createRuntime(DatabindingFactoryImpl.java:127) [jaxws-rt.jar:2.2.8]
at com.sun.xml.ws.client.WSServiceDelegate.buildRuntimeModel(WSServiceDelegate.java:863) [jaxws-rt.jar:2.2.8]
at com.sun.xml.ws.client.WSServiceDelegate.createSEIPortInfo(WSServiceDelegate.java:879) [jaxws-rt.jar:2.2.8]
at com.sun.xml.ws.client.WSServiceDelegate.addSEI(WSServiceDelegate.java:843) [jaxws-rt.jar:2.2.8]
at com.sun.xml.ws.client.WSServiceDelegate.getPort(WSServiceDelegate.java:446) [jaxws-rt.jar:2.2.8]
at com.sun.xml.ws.client.WSServiceDelegate.getPort(WSServiceDelegate.java:415) [jaxws-rt.jar:2.2.8]
at com.sun.xml.ws.client.WSServiceDelegate.getPort(WSServiceDelegate.java:397) [jaxws-rt.jar:2.2.8]
at javax.xml.ws.Service.getPort(Service.java:99) [jboss-jaxws-api_2.2_spec-2.0.1.Final-redhat-2.jar:2.0.1.Final-redhat-2]
at com.abc.xyz.abcxyz.ge_sfdc_pw_accountsiteunit_services.webservices.provider.processaccountsiteunit_wsd.ProcessAccountSiteUnitWSD.getGESFDCPWAccountSiteUnitServicesWebServicesProviderProcessAccountSiteUnitWSDPort(ProcessAccountSiteUnitWSD.java:72) [classes:]
at com.abc.xyz.abcxyz.repairreports.controller.RepairReportsController.getSerialNumberList(RepairReportsController.java:293) [classes:]
at com.abc.xyz.abcxyz.repairreports.controller.RepairReportsController.loadReportsList(RepairReportsController.java:84) [classes:]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.7.0_03]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) [rt.jar:1.7.0_03]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [rt.jar:1.7.0_03]
at java.lang.reflect.Method.invoke(Method.java:601) [rt.jar:1.7.0_03]
at org.springframework.web.method.support.InvocableHandlerMethod.invoke(InvocableHandlerMethod.java:213) [spring-web-3.1.1.RELEASE.jar:3.1.1.RELEASE]
at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:126) [spring-web-3.1.1.RELEASE.jar:3.1.1.RELEASE]
at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:96) [org.springframework.web.servlet-3.1.1.RELEASE.jar:3.1.1.RELEASE]
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:617) [org.springframework.web.servlet-3.1.1.RELEASE.jar:3.1.1.RELEASE]
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:578) [org.springframework.web.servlet-3.1.1.RELEASE.jar:3.1.1.RELEASE]
at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:80) [org.springframework.web.servlet-3.1.1.RELEASE.jar:3.1.1.RELEASE]
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:923) [org.springframework.web.servlet-3.1.1.RELEASE.jar:3.1.1.RELEASE]
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:852) [org.springframework.web.servlet-3.1.1.RELEASE.jar:3.1.1.RELEASE]
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:882) [org.springframework.web.servlet-3.1.1.RELEASE.jar:3.1.1.RELEASE]
at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:778) [org.springframework.web.servlet-3.1.1.RELEASE.jar:3.1.1.RELEASE]
at javax.servlet.http.HttpServlet.service(HttpServlet.java:734) [jboss-servlet-api_3.0_spec-1.0.2.Final-redhat-1.jar:1.0.2.Final-redhat-1]
at javax.servlet.http.HttpServlet.service(HttpServlet.java:847) [jboss-servlet-api_3.0_spec-1.0.2.Final-redhat-1.jar:1.0.2.Final-redhat-1]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:295) [jbossweb-7.2.2.Final-redhat-1.jar:7.2.2.Final-redhat-1]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214) [jbossweb-7.2.2.Final-redhat-1.jar:7.2.2.Final-redhat-1]
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230) [jbossweb-7.2.2.Final-redhat-1.jar:7.2.2.Final-redhat-1]
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:149) [jbossweb-7.2.2.Final-redhat-1.jar:7.2.2.Final-redhat-1]
at org.jboss.modcluster.container.jbossweb.JBossWebContext$RequestListenerValve.event(JBossWebContext.java:91)
at org.jboss.modcluster.container.jbossweb.JBossWebContext$RequestListenerValve.invoke(JBossWebContext.java:72)
at org.jboss.as.web.security.SecurityContextAssociationValve.invoke(SecurityContextAssociationValve.java:169) [jboss-as-web-7.2.1.Final-redhat-10.jar:7.2.1.Final-redhat-10]
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:145) [jbossweb-7.2.2.Final-redhat-1.jar:7.2.2.Final-redhat-1]
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:97) [jbossweb-7.2.2.Final-redhat-1.jar:7.2.2.Final-redhat-1]
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:102) [jbossweb-7.2.2.Final-redhat-1.jar:7.2.2.Final-redhat-1]
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:336) [jbossweb-7.2.2.Final-redhat-1.jar:7.2.2.Final-redhat-1]
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856) [jbossweb-7.2.2.Final-redhat-1.jar:7.2.2.Final-redhat-1]
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:653) [jbossweb-7.2.2.Final-redhat-1.jar:7.2.2.Final-redhat-1]
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:920) [jbossweb-7.2.2.Final-redhat-1.jar:7.2.2.Final-redhat-1]
at java.lang.Thread.run(Thread.java:722) [rt.jar:1.7.0_03]
Caused by: javax.xml.bind.JAXBException: debug is not a valid property on class com.abc.xyz.abcxyz.ge_sfdc_pw_accountsiteunit_services.webservices.provider.processaccountsiteunit_wsd.ProcessAccountSiteUnit
at com.sun.xml.bind.v2.runtime.JAXBContextImpl.getElementPropertyAccessor(JAXBContextImpl.java:985) [jaxb-impl.jar:2.2.7]
at com.sun.xml.ws.db.glassfish.JAXBRIContextWrapper.getElementPropertyAccessor(JAXBRIContextWrapper.java:120) [jaxws-rt.jar:2.2.8]
at com.sun.xml.ws.client.sei.BodyBuilder$DocLit.<init>(BodyBuilder.java:242) [jaxws-rt.jar:2.2.8]
=====================================
答案 0 :(得分:1)
几个月前我遇到了这个问题,结果发现使用xjc生成java代理类是个问题。我不确定原因是什么,但我建议您使用Apache Axis或CXF生成Java代理类,因为它解决了我的问题,无论环境如何。