0
votes

I have the following error when I try to test web service JAXBException: not a valid property on class org.tempuri.BillPull

This is a 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;
}

}

public class ReceivePaymentNotification {

@XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "", propOrder = { "guid", "paymentNotification", "username", "password" }) @XmlRootElement(name = "ReceivePaymentNotification")

public class 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`
}

} }

logs......

"WSHttpBinding_IBillerServices" failed to preload on startup in Web application: "IBillerWebService_GlassfishRelase.war". javax.xml.ws.WebServiceException: class org.tempuri.ReceivePaymentNotification do not have a property of the name guid at com.sun.xml.ws.server.sei.EndpointArgumentsBuilder$DocLit.(EndpointArgumentsBuilder.java:513) at com.sun.xml.ws.server.sei.EndpointMethodHandlerImpl.createArgumentsBuilder(EndpointMethodHandlerImpl.java:144) at com.sun.xml.ws.server.sei.EndpointMethodHandlerImpl.(EndpointMethodHandlerImpl.java:117) at com.sun.xml.ws.server.sei.EndpointMethodHandlerFactory.create(EndpointMethodHandlerFactory.java:15) at com.sun.xml.ws.server.sei.PayloadQNameBasedDispatcher.(PayloadQNameBasedDispatcher.java:118) at com.sun.xml.ws.server.sei.EndpointMethodDispatcherGetter.(EndpointMethodDispatcherGetter.java:83) at com.sun.xml.ws.server.sei.SEIInvokerTube.(SEIInvokerTube.java:82) at weblogic.wsee.jaxws.WLSContainer$WLSEndpointFactory$1.createServer(WLSContainer.java:800) at weblogic.wsee.jaxws.ServerLateInitTube.postCreateEndpoint(ServerLateInitTube.java:57) at weblogic.wsee.jaxws.EndpointAwareLateInitTube.postCreateEndpoint(EndpointAwareLateInitTube.java:46) at weblogic.wsee.jaxws.JAXWSServlet.registerEndpoint(JAXWSServlet.java:150) at weblogic.wsee.jaxws.JAXWSServlet.init(JAXWSServlet.java:64) at weblogic.wsee.jaxws.JAXWSDeployedServlet.init(JAXWSDeployedServlet.java:54) at javax.servlet.GenericServlet.init(GenericServlet.java:241) at weblogic.servlet.internal.StubSecurityHelper$ServletInitAction.run(StubSecurityHelper.java:283) at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321) at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120) at weblogic.servlet.internal.StubSecurityHelper.createServlet(StubSecurityHelper.java:64) at weblogic.servlet.internal.StubLifecycleHelper.createOneInstance(StubLifecycleHelper.java:58) at weblogic.servlet.internal.StubLifecycleHelper.(StubLifecycleHelper.java:48) at weblogic.servlet.internal.ServletStubImpl.prepareServlet(ServletStubImpl.java:539) at weblogic.servlet.internal.WebAppServletContext.preloadServlet(WebAppServletContext.java:1985) at weblogic.servlet.internal.WebAppServletContext.loadServletsOnStartup(WebAppServletContext.java:1959) at weblogic.servlet.internal.WebAppServletContext.preloadResources(WebAppServletContext.java:1878) at weblogic.servlet.internal.WebAppServletContext.start(WebAppServletContext.java:3153) at weblogic.servlet.internal.WebAppModule.startContexts(WebAppModule.java:1508) at weblogic.servlet.internal.WebAppModule.start(WebAppModule.java:482) at weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:425) at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:52) at 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.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:425) at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:52) at weblogic.application.internal.flow.ModuleStateDriver.start(ModuleStateDriver.java:119) at weblogic.application.internal.flow.StartModulesFlow.activate(StartModulesFlow.java:27) at weblogic.application.internal.BaseDeployment$2.next(BaseDeployment.java:636) at 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.internal.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.commit(AbstractOperation.java:323) at weblogic.deploy.internal.targetserver.DeploymentManager.handleDeploymentCommit(DeploymentManager.java:844) at weblogic.deploy.internal.targetserver.DeploymentManager.activateDeploymentList(DeploymentManager.java:1253) at weblogic.deploy.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(DeploymentReceiverCallbackDeliverer.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.ExecuteThread.execute(ExecuteThread.java:209) at weblogic.work.ExecuteThread.run(ExecuteThread.java:178) Caused by: javax.xml.bind.JAXBException: guid is not a valid property on class org.tempuri.ReceivePaymentNotification at com.sun.xml.bind.v2.runtime.JAXBContextImpl.getElementPropertyAccessor(JAXBContextImpl.java:973) at com.sun.xml.ws.server.sei.EndpointArgumentsBuilder$DocLit.(EndpointArgumentsBuilder.java:502) ... 55 more

1
Welcome to StackOverflow. A full stacktrace of your error might reveal more insight. And please try to format all your sourcecode correctly :-)Jan
well the exception is a bit obvious , the class ReceivePaymentNotification has 2 fields which are not defined via @XmlElement thus it fails to load / serialize the classes . If you want to exclude those fields from marshalling then mark them as \@TransientAntJavaDev
Thanks AntJavDev I marked the fields as @Transient to no avail. Your help appreciated! :)Yazan Mohammad

1 Answers

0
votes

I share Yazan's opinion but this way, without logs, I would bet the problem is that you have set this:

@XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "", propOrder = { "guid", "billPullRequest"

And inside your class appears this

@XmlElement(name = "BillPullRequest") protected BillPull.BillPullRequest billPullRequest;

And "BillPullRequest" is not same string as "billPullRequest"

Anyway, if it wouldn't be the problem, try to copy us the error's full stacktrace


NEW AFTER UPDATING


If you take a look at the current error log for your new code you can see this:

class org.tempuri.ReceivePaymentNotification do not have a property of the name guid at com.sun.xml.ws.server.sei.EndpointArgumentsBuilder$DocLit.(EndpointArgumentsBuilder.java:513) at

What probably means that jax-b doesn't know what to do with the no-annotated guid field.

Please, try this

@XmlElement
protected String guid;
@XmlElement
protected ReceivePaymentNotification.PaymentNotification paymentNotification;
@XmlElement(required = true)
protected String username;
@XmlElement(required = true)
protected String password;

And, of course, the related getters and setters (automatic with any IDE)