You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by tobiasgp <to...@igd.fraunhofer.de> on 2013/08/26 15:00:43 UTC

ClassCast Exception

Dear all,

I have a question regarding a service consumer and the generated WSDL of the
service. I have published a webservice which is based on a data model
generated by ECore, including ECore data types. This works fine for me,
however, the problem lies in consuming the service. 

In the generated WSDL it says:
<xsd:complexType name="ArrayOfInt"><xsd:sequence><xsd:element
maxOccurs="unbounded" minOccurs="0" name="int" nillable="true"
type="xsd:int"/></xsd:sequence></xsd:complexType>
The ArrayOfInt data type is derived from EList<> which implements the
java.util.List interface.

When I try to access this list on the returned instance of the remote
service, I get the following error:

!ENTRY org.eclipse.osgi 4 0 2013-08-26 14:35:27.862
!MESSAGE An unexpected runtime error has occurred.
!STACK 0
java.lang.ClassCastException: java.util.ArrayList cannot be cast to
org.eclipse.emf.common.util.EList
	at com.sun.proxy.$Proxy12.getSensors(Unknown Source)
	at
xxxxx.serviceconsumer.ServiceConsumer.setDatamodelService(ServiceConsumer.java:37)
	at xxxxx.serviceconsumer.Activator$1.addingService(Activator.java:35)
	at
org.osgi.util.tracker.ServiceTracker$Tracked.customizerAdding(ServiceTracker.java:932)
	at
org.osgi.util.tracker.ServiceTracker$Tracked.customizerAdding(ServiceTracker.java:1)
	at
org.osgi.util.tracker.AbstractTracked.trackAdding(AbstractTracked.java:256)
	at org.osgi.util.tracker.AbstractTracked.track(AbstractTracked.java:229)
	at
org.osgi.util.tracker.ServiceTracker$Tracked.serviceChanged(ServiceTracker.java:894)
	at
org.eclipse.osgi.internal.serviceregistry.FilteredServiceListener.serviceChanged(FilteredServiceListener.java:107)
	at
org.eclipse.osgi.framework.internal.core.BundleContextImpl.dispatchEvent(BundleContextImpl.java:861)
	at
org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230)
	at
org.eclipse.osgi.framework.eventmgr.ListenerQueue.dispatchEventSynchronous(ListenerQueue.java:148)
	at
org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.publishServiceEventPrivileged(ServiceRegistry.java:819)
	at
org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.publishServiceEvent(ServiceRegistry.java:771)
	at
org.eclipse.osgi.internal.serviceregistry.ServiceRegistrationImpl.register(ServiceRegistrationImpl.java:130)
	at
org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.registerService(ServiceRegistry.java:214)
	at
org.eclipse.osgi.framework.internal.core.BundleContextImpl.registerService(BundleContextImpl.java:433)
	at
org.eclipse.osgi.framework.internal.core.BundleContextImpl.registerService(BundleContextImpl.java:451)
	at
org.apache.cxf.dosgi.dsw.service.RemoteServiceAdminCore.proxifyMatchingInterface(RemoteServiceAdminCore.java:322)
	at
org.apache.cxf.dosgi.dsw.service.RemoteServiceAdminCore.importService(RemoteServiceAdminCore.java:277)
	at
org.apache.cxf.dosgi.dsw.service.RemoteServiceAdminInstance$2.run(RemoteServiceAdminInstance.java:124)
	at
org.apache.cxf.dosgi.dsw.service.RemoteServiceAdminInstance$2.run(RemoteServiceAdminInstance.java:117)
	at java.security.AccessController.doPrivileged(Native Method)
	at
org.apache.cxf.dosgi.dsw.service.RemoteServiceAdminInstance.importService(RemoteServiceAdminInstance.java:117)
	at
org.apache.cxf.dosgi.topologymanager.importer.TopologyManagerImport.importService(TopologyManagerImport.java:282)
	at
org.apache.cxf.dosgi.topologymanager.importer.TopologyManagerImport.importServices(TopologyManagerImport.java:253)
	at
org.apache.cxf.dosgi.topologymanager.importer.TopologyManagerImport.access$300(TopologyManagerImport.java:53)
	at
org.apache.cxf.dosgi.topologymanager.importer.TopologyManagerImport$2.run(TopologyManagerImport.java:202)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
	at java.lang.Thread.run(Unknown Source)

Unfortunately, I am not able to remove the ECore dependencies from my model.
Calls on normal functions, such as returning an Int, etc. work fine.

I would appreciate any ideas on how to solve this problem. 

Best regards,
Tobias




--
View this message in context: http://cxf.547215.n5.nabble.com/ClassCast-Exception-tp5733040.html
Sent from the cxf-user mailing list archive at Nabble.com.