History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: XFIRE-161
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Dan Diephouse
Reporter: Igor Pavin
Votes: 1
Watchers: 3
Operations

If you were logged in you would be able to see more operations.
XFire

Binding to parameterized Map types throws ClassCastException

Created: 09/Nov/05 07:02 AM   Updated: 25/Nov/05 09:17 AM
Component/s: Aegis Module
Affects Version/s: 1.0-M5
Fix Version/s: 1.0-M6

Time Tracking:
Not Specified

Environment: spring, jsr181, jdk 1.5.0_05-b05


 Description  « Hide
The following code

@WebMethod(operationName = "echoOperation")
@WebResult(name = "echoResult")
public String echo(@WebParam(name = "map") Map<String, ?> map) { return "test passed"; }

throws ClassCastException.

12:37:28,828 [ERROR] [org.springframework.web.context.ContextLoader] - Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'handlerMappingForWebServices' defined in ServletContext resource [/WEB-INF/applicationContext-webServices.xml]: Initialization of bean failed; nested exception is org.codehaus.xfire.XFireRuntimeException: Couldn't load provider.. Nested exception is java.lang.ClassCastException: sun.reflect.generics.reflectiveObjects.ParameterizedTypeImpl
org.codehaus.xfire.XFireRuntimeException: Couldn't load provider.. Nested exception is java.lang.ClassCastException: sun.reflect.generics.reflectiveObjects.ParameterizedTypeImpl
java.lang.ClassCastException: sun.reflect.generics.reflectiveObjects.ParameterizedTypeImpl
at org.codehaus.xfire.aegis.type.AbstractTypeCreator.createMapType(AbstractTypeCreator.java:135)
at org.codehaus.xfire.aegis.type.AbstractTypeCreator.createTypeForClass(AbstractTypeCreator.java:67)
at org.codehaus.xfire.aegis.type.AbstractTypeCreator.createType(AbstractTypeCreator.java:207)
at org.codehaus.xfire.aegis.AegisBindingProvider.getParameterType(AegisBindingProvider.java:184)
at org.codehaus.xfire.aegis.AegisBindingProvider.initializeMessage(AegisBindingProvider.java:128)
at org.codehaus.xfire.aegis.AegisBindingProvider.initialize(AegisBindingProvider.java:96)
at org.codehaus.xfire.service.binding.ObjectServiceFactory.create(ObjectServiceFactory.java:243)
at org.codehaus.xfire.annotations.AnnotationServiceFactory.create(AnnotationServiceFactory.java:117)
at org.codehaus.xfire.service.binding.ObjectServiceFactory.create(ObjectServiceFactory.java:150)
at org.codehaus.xfire.spring.remoting.Jsr181HandlerMapping.initApplicationContext(Jsr181HandlerMapping.java:66)

Not quietly sure, but the problem seem to be in the following:

org.codehaus.xfire.aegis.type.AbstractTypeCreator

protected Type createMapType(TypeClassInfo info)

{ //... MapType type = new MapType(schemaType, (Class) info.getKeyType(), (Class) info.getGenericType()); //... }

(Class) info.getGenericType() is the reason of bad class cast

Sorry, can't figure out the real reason.



 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
Guillaume Nodet - 25/Nov/05 09:12 AM
Fixed in CVS head ( but i have not developer access on xfire yet, so i can not solve this issue).