users@glassfish.java.net

JAXB annotation is placed on a method that is not a JAXB property

From: <glassfish_at_javadesktop.org>
Date: Thu, 18 Dec 2008 10:45:11 PST

Good day to all! Here is my story:

I recently switched from JBoss to Glassfish (Hallelujah, you might want to say). Anyway, I have nothing but nightmare for the past week with one particular error-"JAXB annotation is placed on a method that is not a JAXB property". I shall be brief:

'_at_javax.jws.WebService' is only used in the stateless bean LastKnownEventController (see #B below), and no where in the project, had I used '_at_javax.xml.bind.annotation.XmlTransient()'--certainly not on 'xxx.xxxxxx.xxxx.entity.bean.EventStateEntity'. So WHY am I being accused FALSELY of embellishing my classes--this is only one of many--with @XmlTransient when I have done no such thing?

Over to you, my friends, for your assistance. If you need additional info, just ask. In advance, I say to you, thanks a lot.

---------------------------------------------------------------------------------------------------------------------------------------------
#A. Dev. environment:
---------------------------------------------------------------------------------------------------------------------------------------------
OS: Linux(Centos 5.x)
IDE: Eclipse v3.4.1 (and JDeveloper 11g)
JPA: EclipseLink etc.

---------------------------------------------------------------------------------------------------------------------------------------------
#B: The Stacktrace JAXB annotation is placed on a method that is not a JAXB property
----------------------------------------------------------------------------------------------------------------------------------------------
[#|2008-12-18T16:53:34.489+0000|WARNING|sun-appserver2.1|javax.enterprise.system.stream.err|_ThreadID=14;_ThreadName=httpWorkerThread-4848-1;_RequestID=18f94c77-44d6-42e4-8fdc-02b70b472baf;|javax.xml.ws.WebServiceException: Unable to create JAXBContext
        at com.sun.xml.ws.model.AbstractSEIModelImpl.createJAXBContext(AbstractSEIModelImpl.java:158)
        at com.sun.xml.ws.model.AbstractSEIModelImpl.postProcess(AbstractSEIModelImpl.java:87)
        at com.sun.xml.ws.model.RuntimeModeler.buildRuntimeModel(RuntimeModeler.java:262)
        at com.sun.xml.ws.server.EndpointFactory.createSEIModel(EndpointFactory.java:322)
        at com.sun.xml.ws.server.EndpointFactory.createEndpoint(EndpointFactory.java:188)
        at com.sun.xml.ws.api.server.WSEndpoint.create(WSEndpoint.java:467)
        at com.sun.xml.ws.api.server.WSEndpoint.create(WSEndpoint.java:510)
        at com.sun.enterprise.webservice.EjbRuntimeEndpointInfo.prepareInvocation(EjbRuntimeEndpointInfo.java:301)
        at com.sun.enterprise.webservice.EjbRuntimeEndpointInfo.initRuntimeInfo(EjbRuntimeEndpointInfo.java:344)
        at com.sun.enterprise.webservice.WebServiceEjbEndpointRegistry.registerEjbWebServiceEndpoint(WebServiceEjbEndpointRegistry.java:122)
        at com.sun.ejb.containers.StatelessSessionContainer.initializeHome(StatelessSessionContainer.java:329)
        at com.sun.ejb.containers.ContainerFactoryImpl.createContainer(ContainerFactoryImpl.java:345)
        at com.sun.enterprise.server.AbstractLoader.loadEjbs(AbstractLoader.java:527)
        at com.sun.enterprise.server.ApplicationLoader.doLoad(ApplicationLoader.java:191)
        at com.sun.enterprise.server.TomcatApplicationLoader.doLoad(TomcatApplicationLoader.java:126)
        at com.sun.enterprise.server.ExtendedApplicationLoader.doLoad(ExtendedApplicationLoader.java:134)
        at com.sun.enterprise.server.AbstractLoader.load(AbstractLoader.java:238)
        at com.sun.enterprise.server.ApplicationManager.applicationDeployed(ApplicationManager.java:336)
        at com.sun.enterprise.server.ApplicationManager.applicationDeployed(ApplicationManager.java:210)
        at com.sun.enterprise.server.ApplicationManager.applicationDeployed(ApplicationManager.java:645)
        at com.sun.enterprise.admin.event.AdminEventMulticaster.invokeApplicationDeployEventListener(AdminEventMulticaster.java:959)
        at com.sun.enterprise.admin.event.AdminEventMulticaster.handleApplicationDeployEvent(AdminEventMulticaster.java:943)
        at com.sun.enterprise.admin.event.AdminEventMulticaster.processEvent(AdminEventMulticaster.java:467)
        at com.sun.enterprise.admin.event.AdminEventMulticaster.multicastEvent(AdminEventMulticaster.java:182)
        at com.sun.enterprise.admin.server.core.DeploymentNotificationHelper.multicastEvent(DeploymentNotificationHelper.java:308)
        at com.sun.enterprise.deployment.phasing.DeploymentServiceUtils.multicastEvent(DeploymentServiceUtils.java:231)
        at com.sun.enterprise.deployment.phasing.ServerDeploymentTarget.sendStartEvent(ServerDeploymentTarget.java:298)
        at com.sun.enterprise.deployment.phasing.ApplicationStartPhase.runPhase(ApplicationStartPhase.java:132)
        at com.sun.enterprise.deployment.phasing.DeploymentPhase.executePhase(DeploymentPhase.java:108)
        at com.sun.enterprise.deployment.phasing.PEDeploymentService.executePhases(PEDeploymentService.java:966)
        at com.sun.enterprise.deployment.phasing.PEDeploymentService.start(PEDeploymentService.java:609)
        at com.sun.enterprise.deployment.phasing.PEDeploymentService.start(PEDeploymentService.java:653)
        at com.sun.enterprise.admin.mbeans.ApplicationsConfigMBean.start(ApplicationsConfigMBean.java:773)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at com.sun.enterprise.admin.MBeanHelper.invokeOperationInBean(MBeanHelper.java:381)
        at com.sun.enterprise.admin.MBeanHelper.invokeOperationInBean(MBeanHelper.java:364)
        at com.sun.enterprise.admin.config.BaseConfigMBean.invoke(BaseConfigMBean.java:477)
        at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:836)
        at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:761)
        at sun.reflect.GeneratedMethodAccessor14.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at com.sun.enterprise.admin.util.proxy.ProxyClass.invoke(ProxyClass.java:90)
        at $Proxy1.invoke(Unknown Source)
        at com.sun.enterprise.admin.server.core.jmx.SunoneInterceptor.invoke(SunoneInterceptor.java:304)
        at com.sun.enterprise.interceptor.DynamicInterceptor.invoke(DynamicInterceptor.java:174)
        at com.sun.enterprise.admin.jmx.remote.server.callers.InvokeCaller.call(InvokeCaller.java:69)
        at com.sun.enterprise.admin.jmx.remote.server.MBeanServerRequestHandler.handle(MBeanServerRequestHandler.java:155)
        at com.sun.enterprise.admin.jmx.remote.server.servlet.RemoteJmxConnectorServlet.processRequest(RemoteJmxConnectorServlet.java:122)
        at com.sun.enterprise.admin.jmx.remote.server.servlet.RemoteJmxConnectorServlet.doPost(RemoteJmxConnectorServlet.java:193)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:754)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:847)
        at org.apache.catalina.core.ApplicationFilterChain.servletService(ApplicationFilterChain.java:427)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:315)
        at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:287)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:218)
        at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:648)
        at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:593)
        at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:94)
        at com.sun.enterprise.web.PESessionLockingStandardPipeline.invoke(PESessionLockingStandardPipeline.java:98)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:222)
        at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:648)
        at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:593)
        at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:587)
        at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1096)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:166)
        at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:648)
        at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:593)
        at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:587)
        at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1096)
        at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:288)
        at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.invokeAdapter(DefaultProcessorTask.java:647)
        at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.doProcess(DefaultProcessorTask.java:579)
        at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.process(DefaultProcessorTask.java:831)
        at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.executeProcessorTask(DefaultReadTask.java:341)
        at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doTask(DefaultReadTask.java:263)
        at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doTask(DefaultReadTask.java:214)
        at com.sun.enterprise.web.connector.grizzly.TaskBase.run(TaskBase.java:265)
        at com.sun.enterprise.web.connector.grizzly.WorkerThreadImpl.run(WorkerThreadImpl.java:116)
Caused by: java.security.PrivilegedActionException: com.sun.xml.bind.v2.runtime.IllegalAnnotationsException: 3 counts of IllegalAnnotationExceptions
JAXB annotation is placed on a method that is not a JAXB property <-------------------------------------------------Here is the case against me
        this problem is related to the following location:
                at @javax.xml.bind.annotation.XmlTransient()
                at xxx.xxxxxx.xxxx.entity.bean.EventStateEntity
                at public xxx.xxxxxx.xxxx.entity.bean.EventStateEntity xxx.xxxxxx.xxxx.entity.bean.LastKnownEventEntity.getEventStateIdEventState()
                at xxx.xxxxxx.xxxx.entity.bean.LastKnownEventEntity
                at public xxx.xxxxxx.xxxx.entity.bean.LastKnownEventEntity xxx.xxxxxx.xxxx.entity.bean|#]

----------------------------------------------------------------------------------------------------------------------------------------------
#C. EAR project stucture
----------------------------------------------------------------------------------------------------------------------------------------------
enity.jar --jpa stuffs (contains LastKnownEventEntity, EventStateEntity)
ejb-impl.jar --business logic implementation (contains LastKnownEventController.java)
ejb-intf.jar -- business interfaces (contains LastKnownEventRemote.java, LastKnownEventLocal.java)
etc...

----------------------------------------------------------------------------------------------------------------------------------------------
#B. Files LastKnownEventController
----------------------------------------------------------------------------------------------------------------------------------------------
@javax.jws.WebService(
name="LastKnownEventPortType",
portName="LastKnownEventPort",
serviceName = "LastKnownEventWebService",
targetNamespace="http://www.xxxxxx..com/xxxxws")
@javax.jws.soap.SOAPBinding(style = javax.jws.soap.SOAPBinding.Style.RPC)
@javax.jws.HandlerChain(file="com/xoftsystems/xxxx/jaxws/handlerConfig.xml")
@javax.ejb.TransactionManagement(value=javax.ejb.TransactionManagementType.CONTAINER)
@javax.ejb.ApplicationException
@javax.interceptor.Interceptors ({xxx.xxxxxx.xxxx.ejb.interceptor.AuditInterceptor.class})
@javax.ejb.Local({xxx.xxxxxx.xxxx.ejb.intf.LastKnownEventLocal.class})
@javax.ejb.Remote({xxx.xxxxxx.xxxx.ejb.intf.LastKnownEventRemote.class})

public class LastKnownEventController implements xxx.xxxxxx.xxxx.ejb.intf.LastKnownEventRemote, xxx.xxxxxx.xxxx.ejb.intf.LastKnownEventLocal,
java.io.Serializable{
....

@javax.jws.WebMethod
 @javax.ejb.TransactionAttribute(javax.ejb.TransactionAttributeType.NOT_SUPPORTED)
 public LastKnownEventEntity[] findByEventStateId(Long eventStateId) throws xxx.xxxxxx.xxxx.dao.exception.DAOException{
java.util.List<LastKnownEventEntity> retList = daoLastKnownEvent.findEntity("eventStateId", eventStateId);
return (LastKnownEventEntity[]) retList.toArray(new LastKnownEventEntity[retList.size()]);
}
}

----------------------------------------------------------------------------------------------------------------------------------------------
LastKnownEventEntity
----------------------------------------------------------------------------------------------------------------------------------------------
@javax.persistence.Table(name = "last_known_event", schema="xxxx")
@javax.persistence.Entity
@javax.persistence.DiscriminatorValue("LastKnownEvent")
@javax.persistence.PrimaryKeyJoinColumn(name="ID", referencedColumnName="ID")

@org.eclipse.persistence.annotations.OptimisticLocking(type=org.eclipse.persistence.annotations.OptimisticLockingType.CHANGED_COLUMNS)
@org.eclipse.persistence.annotations.ChangeTracking( org.eclipse.persistence.annotations.ChangeTrackingType.ATTRIBUTE)
@javax.persistence.EntityListeners(xxx.xxxxxx.xxxx.entity.listener.DocumentListener.class)

public class LastKnownEventEntity extends xxx.xxxxxx.xxxx.entity.bean.LastKnownTrailEntity
 implements java.io.Serializable{

private java.util.List<xxx.xxxxxx.xxxx.entity.bean.EmergencyEntity> emergencyAsList;

// The EventState referenced by this bean.
private xxx.xxxxxx.xxxx.entity.bean.EventStateEntity eventStateIdEventState;
....

/**
* Retrieves the EventStateEntity object from the last_known_event.event_state_id field.
*
* @return the associated EventStateEntity bean
*/
@javax.persistence.ManyToOne(cascade = javax.persistence.CascadeType.ALL, fetch = javax.persistence.FetchType.EAGER)
@javax.persistence.JoinColumn(name = "event_state_id", referencedColumnName = "id")
public xxx.xxxxxx.xxxx.entity.bean.EventStateEntity getEventStateIdEventState() {
return eventStateIdEventState;
}

}
----------------------------------------------------------------------------------------------------------------------------------------------
EventStateEntity
----------------------------------------------------------------------------------------------------------------------------------------------
@javax.persistence.Table(name = "event_state", schema="xxxx")
@javax.persistence.Entity
@javax.persistence.Inheritance( strategy = javax.persistence.InheritanceType.JOINED)
@javax.persistence.DiscriminatorColumn(name="DOMAIN_TYPE" , discriminatorType=javax.persistence.DiscriminatorType.INTEGER)
@javax.persistence.DiscriminatorValue("EventState")

@org.eclipse.persistence.annotations.Cache(type=org.eclipse.persistence.annotations.CacheType.SOFT_WEAK,expiry=600000,
alwaysRefresh=true,disableHits=true,coordinationType=org.eclipse.persistence.annotations.CacheCoordinationType.INVALIDATE_CHANGED_OBJECTS)
@org.eclipse.persistence.annotations.OptimisticLocking(type=org.eclipse.persistence.annotations.OptimisticLockingType.CHANGED_COLUMNS)
@org.eclipse.persistence.annotations.ChangeTracking( org.eclipse.persistence.annotations.ChangeTrackingType.ATTRIBUTE)

public class EventStateEntity implements java.io.Serializable{
...
}
[Message sent by forum member 'nuffsaidx' (nuffsaidx)]

http://forums.java.net/jive/thread.jspa?messageID=322453