当我尝试测试Web服务JAXBException时出现以下错误:不是类org.tempuri.BillPull上的有效属性
这是一个org.tempuri.BillPull
public BillPull {
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "", propOrder = {
"guid",
"billPullRequest",
"username",
"password"
})
@XmlRootElement(name = "BillPull")
public class BillPull {
//@XmlElement(name = "GUID")
protected String guid;
@XmlElement(name = "BillPullRequest")
protected BillPull.BillPullRequest billPullRequest;
@XmlElement(required = true)
protected String username;
@XmlElement(required = true)
protected String password;
/**
* Gets the value of the guid property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getGUID() {
return guid;
}
/**
* Sets the value of the guid property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setGUID(String value) {
this.guid = value;
}
}
公共类ReceivePaymentNotification {
@XmlAccessorType(XmlAccessType.FIELD) @XmlType(name ="",propOrder = { " GUID&#34 ;, " paymentNotification&#34 ;, "用户名&#34 ;, "密码" }) @XmlRootElement(name =" ReceivePaymentNotification")
公共类ReceivePaymentNotification {
protected String guid;
protected ReceivePaymentNotification.PaymentNotification paymentNotification;
@XmlElement(required = true)
protected String username;
@XmlElement(required = true)
protected String password;
/**
* Gets the value of the guid property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getGuid() {
return guid;
}
/**
* Sets the value of the guid property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setGuid(String value) {
this.guid = value;`enter code here`
}
} }
日志......
" WSHttpBinding_IBillerServices"无法在Web应用程序启动时预加载:" IBillerWebService_GlassfishRelase.war"。 javax.xml.ws.WebServiceException:class org.tempuri.ReceivePaymentNotification在com的com.sun.xml.ws.server.sei.EndpointArgumentsBuilder $ DocLit。(EndpointArgumentsBuilder.java:513)中没有名称为guid的属性。 sun.xml.ws.server.sei.EndpointMethodHandlerImpl.createArgumentsBuilder(EndpointMethodHandlerImpl.java:144)在com.sun.xml.ws.server.sei.EndpointMethodHandlerImpl。(EndpointMethodHandlerImpl.java:117)在com.sun.xml.ws位于com.sun.xml.ws.server.sei的com.sun.xml.ws.server.sei.PayloadQNameBasedDispatcher。(PayloadQNameBasedDispatcher.java:118)中的.server.sei.EndpointMethodHandlerFactory.create(EndpointMethodHandlerFactory.java:15)。 EndpointMethodDispatcherGetter(EndpointMethodDispatcherGetter.java:83)在com.sun.xml.ws.server.sei.SEIInvokerTube。(SEIInvokerTube.java:82)在weblogic.wsee.jaxws.WLSContainer $ WLSEndpointFactory $ 1.createServer(WLSContainer.java:800 )在weblogic.wsee.jaxws.Endp的weblogic.wsee.jaxws.ServerLateInitTube.postCreateEndpoint(ServerLateInitTube.java:57)位于weblogic.wsee.waxws的weblogic.wsee.jaxWS。位于weblogic.security的weblogic.servlet.internal.StubSecurityHelper $ ServletInitAction.run(StubSecurityHelper.java:283)的javax.servlet.GenericServlet.init(GenericServlet.java:241)中的.JAXWSDeployedServlet.init(JAXWSDeployedServlet.java:54)。 acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)at weblogic.servome.StubSecurityHelper.createServlet(StubSecurityHelper.java:64)at weblogic .loglet.internal.StubLifecycleHelper.createOneInstance(StubLifecycleHelper.java:58)位于weblogic的网站上的weblogic.servlet.internal.StubLifecycleHelper。(StubLifecycleHelper.java:48)中的weblogic.servlet.internal.ServletStubImpl.prepareServlet(ServletStubImpl.java:539) .servlet.intern位于weblogic.servlet上的weblogic.servlet.internal.WebAppServletContext.preloadResources(WebAppServletContext.java:1878)的weblogic.servlet.internal.WebAppServletContext.loadServletsOnStartup(WebAppServletContext.java:1959)中的al.WebAppServletContext.preloadServlet(WebAppServletContext.java:1985) .internal.WebAppServletContext.start(WebAppServletContext.java:3153)处的WebLogic weblogic.servlet.internal.WebAppModule.startContexts(WebAppModule.java:1508)在weblogic.servlet.internal.WebAppModule.start(WebAppModule.java:482)。 application.internal.flow.ModuleStateDriver $ 3.next(ModuleStateDriver.java:425)在weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:52)在weblogic.application.internal.flow.ModuleStateDriver.start(ModuleStateDriver.java :119)at weblogic.application.internal.flow.ScopedModuleDriver.start(ScopedModuleDriver.java:200)at weblogic.application.internal.flow.ModuleListenerInvoker.start(ModuleListenerInvoker.java:247)at weblogic.application.inter nal.flow.ModuleStateDriver $ 3.next(ModuleStateDriver.java:425)在weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:52)在weblogic.application.internal.flow.ModuleStateDriver.start(ModuleStateDriver.java:119 )在weblogic.application.internal.flow.StartModulesFlow.activate(StartModulesFlow.java:27)在weblogic.application.internal.BaseDeployment $ 2.next(BaseDeployment.java:636)在weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver .java:52)at weblogic.application.internal.BaseDeployment.activate(BaseDeployment.java:205)at weblogic.application.internal.SingleModuleDeployment.activate(SingleModuleDeployment.java:43)at weblogic.application.internal.DeploymentStateChecker.activate( DeploymentStateChecker.java:161)at weblogic.deploy.internal.targetserver.AppContainerInvoker.activate(AppContainerInvoker.java:79)at weblogic.deploy.internal.targetserver.operations.AbstractOperation.activate(AbstractOperation.java:569)at weblogic.deploy 。在netnal.targetserver.operations.ActivateOperation.activateDeployment(ActivateOperation.java:150)at weblogic.deploy.internal.targetserver.operations.ActivateOperation.doCommit(ActivateOperation.java:116)at weblogic.deploy.internal.targetserver.operations.AbstractOperation。在weblogic.deploy.deploy.inget.targetserver.DeployManager.activleDeploymentList(DeploymentManager.java:1253)的weblogic.deploy.internal.targetserver.DeploymentManager.handleDeploymentCommit(DeploymentManager.java:844)的weblogic.deploy上提交(AbstractOperation.java:323) .internal.targetserver.DeploymentManager.handleCommit(DeploymentManager.java:440)at weblogic.deploy.internal.targetserver.DeploymentServiceDispatcher.commit(DeploymentServiceDispatcher.java:163)at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.doCommitCallback(DeploymentReceiverCallbackDeliverer) .java:195)at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.access $ 100(DeploymentRec) eiverCallbackDeliverer.java:13)at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer $ 2.run(DeploymentReceiverCallbackDeliverer.java:68)at weblogic.work.SelfTuningWorkManagerImpl $ WorkAdapterImpl.run(SelfTuningWorkManagerImpl.java:528)at weblogic.work。 weblogic.work.ExecuteThread.run上的ExecuteThread.execute(ExecuteThread.java:209)(ExecuteThread.java:178)引起:javax.xml.bind.JAXBException:guid不是类org.tempuri.ReceivePaymentNotification上的有效属性Com.sun.xml.bind.v2.runtime.JAXBContextImpl.getElementPropertyAccessor(JAXBContextImpl.java:973)at com.sun.xml.ws.server.sei.EndpointArgumentsBuilder $ DocLit。(EndpointArgumentsBuilder.java:502) ... 55更
答案 0 :(得分:0)
我赞同Yazan的观点,但是这样,没有日志,我敢打赌问题是你设置了这个:
@XmlAccessorType(XmlAccessType.FIELD)@XmlType(name ="",propOrder = {" guid"," billPullRequest &# 34;
在课堂上出现这个
@XmlElement(name =" BillPullRequest ") protected BillPull.BillPullRequest billPullRequest;
" BillPullRequest"与" billPullRequest"
不是同一个字符串无论如何,如果它不是问题,请尝试将错误复制给我们完整的堆栈跟踪
新的更新后
如果您查看新代码的当前错误日志,可以看到:
class org.tempuri.ReceivePaymentNotification 在com.sun.xml.ws.server.sei.EndpointArgumentsBuilder $ DocLit。(EndpointArgumentsBuilder.java:513)中没有名称为guid的属性
可能意味着jax-b不知道如何处理未注释的 guid 字段。
请试试这个
@XmlElement
protected String guid;
@XmlElement
protected ReceivePaymentNotification.PaymentNotification paymentNotification;
@XmlElement(required = true)
protected String username;
@XmlElement(required = true)
protected String password;
当然还有相关的getter和setter(可以自动使用任何IDE)