One of the classes had no default constructor, this causes addition of the class to the Collections.emptyMap() I'll try to debug all cases like this and will report back if it helps or not
On Thu, May 14, 2015 at 9:28 PM, Daniel Kulp <[email protected]> wrote: > I think I see what’s going on. We have a couple variables initialized > like: > Map<String, Object> unmarshallerProperties = Collections.emptyMap(); > which means you cannot modify them. Easy fix for that. > > HOWEVER, you still have a parameter that is an invalid JAXB type > someplace. The code is failing in: > > Class<?> cls = JAXBUtils.getValidClass(claz); > if (cls == null && > ReflectionUtil.getDeclaredConstructors(claz).length > 0) { > //there is no init(), but other constructors > Object factory = createFactory(claz, > ReflectionUtil.getDeclaredConstructors(claz)[0]); > > unmarshallerProperties.put("com.sun.xml.bind.ObjectFactory", factory); > cls = claz; > } > > where we’re trying to create a factory of some sort to workaround the > issue of the class being invalid. I’d definitely breakpoint there and > look at the “claz” and see what needs to e done to make it a valid type. > > Dan > > > > > On May 14, 2015, at 10:23 AM, Daniel Kulp <[email protected]> wrote: > > > > > > For some reason, it’s trying to add a ‘null’ into the collection of > classes we need to create the JAXBContext. No idea why that would occur > and I don’t see anything different in the JAXB data binding between 3.0.1 > and 3.1.0 that would account for this. You may need to debug in and > breakpoint in the org.apache.cxf.jaxb.JAXBContextInitializer.addClass and > figure trace up the stack to see where the null is coming from. I can > tell you it has to do with the parameters to one of your methods, but > that’s all I can see from the trace. > > > > Dan > > > > > > > >> On May 13, 2015, at 1:40 AM, Maxim Solodovnik <[email protected]> > wrote: > >> > >> Hello All, > >> > >> Recently I have upgraded to CXF 3.1.0, unfortunately I got weird error > on > >> endpoint creation: > >> > >> Caused by: javax.xml.ws.WebServiceException: > >> java.lang.UnsupportedOperationException > >> at org.apache.cxf.jaxws.EndpointImpl.doPublish(EndpointImpl.java:375) > >> ~[cxf-rt-frontend-jaxws-3.1.0.jar:3.1.0] > >> at org.apache.cxf.jaxws.EndpointImpl.publish(EndpointImpl.java:255) > >> ~[cxf-rt-frontend-jaxws-3.1.0.jar:3.1.0] > >> at org.apache.cxf.jaxws.EndpointImpl.publish(EndpointImpl.java:543) > >> ~[cxf-rt-frontend-jaxws-3.1.0.jar:3.1.0] > >> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > >> ~[na:1.7.0_76] > >> at > >> > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) > >> ~[na:1.7.0_76] > >> at > >> > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) > >> ~[na:1.7.0_76] > >> at java.lang.reflect.Method.invoke(Method.java:606) ~[na:1.7.0_76] > >> at > >> > org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeCustomInitMethod(AbstractAutowireCapableBeanFactory.java:1682) > >> ~[spring-beans-4.0.8.RELEASE.jar:4.0.8.RELEASE] > >> at > >> > org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1621) > >> ~[spring-beans-4.0.8.RELEASE.jar:4.0.8.RELEASE] > >> at > >> > org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1550) > >> ~[spring-beans-4.0.8.RELEASE.jar:4.0.8.RELEASE] > >> ... 40 common frames omitted > >> Caused by: java.lang.UnsupportedOperationException: null > >> at java.util.AbstractMap.put(AbstractMap.java:203) ~[na:1.7.0_76] > >> at > >> > org.apache.cxf.jaxb.JAXBContextInitializer.addClass(JAXBContextInitializer.java:310) > >> ~[cxf-rt-databinding-jaxb-3.1.0.jar:3.1.0] > >> at > >> > org.apache.cxf.jaxb.JAXBContextInitializer.addType(JAXBContextInitializer.java:233) > >> ~[cxf-rt-databinding-jaxb-3.1.0.jar:3.1.0] > >> at > >> > org.apache.cxf.jaxb.JAXBContextInitializer.addType(JAXBContextInitializer.java:223) > >> ~[cxf-rt-databinding-jaxb-3.1.0.jar:3.1.0] > >> at > >> > org.apache.cxf.jaxb.JAXBContextInitializer.walkReferences(JAXBContextInitializer.java:383) > >> ~[cxf-rt-databinding-jaxb-3.1.0.jar:3.1.0] > >> at > >> > org.apache.cxf.jaxb.JAXBContextInitializer.addClass(JAXBContextInitializer.java:347) > >> ~[cxf-rt-databinding-jaxb-3.1.0.jar:3.1.0] > >> at > >> > org.apache.cxf.jaxb.JAXBContextInitializer.begin(JAXBContextInitializer.java:184) > >> ~[cxf-rt-databinding-jaxb-3.1.0.jar:3.1.0] > >> at > >> > org.apache.cxf.service.ServiceModelVisitor.visitOperation(ServiceModelVisitor.java:97) > >> ~[cxf-core-3.1.0.jar:3.1.0] > >> at > >> > org.apache.cxf.service.ServiceModelVisitor.walk(ServiceModelVisitor.java:74) > >> ~[cxf-core-3.1.0.jar:3.1.0] > >> at > org.apache.cxf.jaxb.JAXBDataBinding.initialize(JAXBDataBinding.java:315) > >> ~[cxf-rt-databinding-jaxb-3.1.0.jar:3.1.0] > >> at > >> > org.apache.cxf.service.factory.AbstractServiceFactoryBean.initializeDataBindings(AbstractServiceFactoryBean.java:86) > >> ~[cxf-core-3.1.0.jar:3.1.0] > >> at > >> > org.apache.cxf.wsdl.service.factory.ReflectionServiceFactoryBean.buildServiceFromClass(ReflectionServiceFactoryBean.java:467) > >> ~[cxf-rt-wsdl-3.1.0.jar:3.1.0] > >> at > >> > org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.buildServiceFromClass(JaxWsServiceFactoryBean.java:696) > >> ~[cxf-rt-frontend-jaxws-3.1.0.jar:3.1.0] > >> at > >> > org.apache.cxf.wsdl.service.factory.ReflectionServiceFactoryBean.initializeServiceModel(ReflectionServiceFactoryBean.java:527) > >> ~[cxf-rt-wsdl-3.1.0.jar:3.1.0] > >> at > >> > org.apache.cxf.wsdl.service.factory.ReflectionServiceFactoryBean.create(ReflectionServiceFactoryBean.java:261) > >> ~[cxf-rt-wsdl-3.1.0.jar:3.1.0] > >> at > >> > org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.create(JaxWsServiceFactoryBean.java:199) > >> ~[cxf-rt-frontend-jaxws-3.1.0.jar:3.1.0] > >> at > >> > org.apache.cxf.frontend.AbstractWSDLBasedEndpointFactory.createEndpoint(AbstractWSDLBasedEndpointFactory.java:102) > >> ~[cxf-rt-frontend-simple-3.1.0.jar:3.1.0] > >> at > >> > org.apache.cxf.frontend.ServerFactoryBean.create(ServerFactoryBean.java:168) > >> ~[cxf-rt-frontend-simple-3.1.0.jar:3.1.0] > >> at > >> > org.apache.cxf.jaxws.JaxWsServerFactoryBean.create(JaxWsServerFactoryBean.java:211) > >> ~[cxf-rt-frontend-jaxws-3.1.0.jar:3.1.0] > >> at org.apache.cxf.jaxws.EndpointImpl.getServer(EndpointImpl.java:460) > >> ~[cxf-rt-frontend-jaxws-3.1.0.jar:3.1.0] > >> at org.apache.cxf.jaxws.EndpointImpl.doPublish(EndpointImpl.java:338) > >> ~[cxf-rt-frontend-jaxws-3.1.0.jar:3.1.0] > >> ... 49 common frames omitted > >> > >> > >> maybe someone can help me to understand what is wrong? (Everything > works as > >> expected with version 3.0.1) > >> > >> Thanks in advance for any help! > >> > >> > >> -- > >> WBR > >> Maxim aka solomax > > > > -- > > Daniel Kulp > > [email protected] - http://dankulp.com/blog > > Talend Community Coder - http://coders.talend.com > > > > -- > Daniel Kulp > [email protected] - http://dankulp.com/blog > Talend Community Coder - http://coders.talend.com > > -- WBR Maxim aka solomax
