PDA

View Full Version : jwsdp-2.0 compatible?



res1st
Jun 1st, 2006, 05:35 AM
Hi!

I'm using the jaxb libraries from jwsdp-2.0. But it's not possible to instantiate the jaxbMarshaller bean.

1722 [ContainerBackgroundProcessor[StandardEngine[Catalina]]] ERROR context.ContextLoader - Context initialization failed
org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'getAddressEndpoint' defined in ServletContext resource [/WEB-INF/applicationContext-ws.xml]: Cannot resolve reference to bean 'jaxbMarshaller' while setting bean property 'marshaller'; nested exception is org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'jaxbMarshaller' defined in ServletContext resource [/WEB-INF/applicationContext-ws.xml]: Invocation of init method failed; nested exception is java.lang.UnsupportedOperationException
Caused by:
org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'jaxbMarshaller' defined in ServletContext resource [/WEB-INF/applicationContext-ws.xml]: Invocation of init method failed; nested exception is java.lang.UnsupportedOperationException
Caused by:
java.lang.UnsupportedOperationException
at com.sun.xml.bind.v2.runtime.unmarshaller.Unmarshal lerImpl.setValidating(UnmarshallerImpl.java:453)
at org.springframework.oxm.jaxb.JaxbMarshaller.afterP ropertiesSet(JaxbMarshaller.java:112)
at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.invokeInitMethods(Abstr actAutowireCapableBeanFactory.java:877)
at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.initializeBean(Abstract AutowireCapableBeanFactory.java:846)
at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.createBean(AbstractAuto wireCapableBeanFactory.java:419)
at org.springframework.beans.factory.support.Abstract BeanFactory.getBean(AbstractBeanFactory.java:241)
at org.springframework.beans.factory.support.Abstract BeanFactory.getBean(AbstractBeanFactory.java:152)
at org.springframework.beans.factory.support.BeanDefi nitionValueResolver.resolveReference(BeanDefinitio nValueResolver.java:219)
at org.springframework.beans.factory.support.BeanDefi nitionValueResolver.resolveValueIfNecessary(BeanDe finitionValueResolver.java:115)
at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.applyPropertyValues(Abs tractAutowireCapableBeanFactory.java:781)
at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.populateBean(AbstractAu towireCapableBeanFactory.java:572)
at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.createBean(AbstractAuto wireCapableBeanFactory.java:415)
at org.springframework.beans.factory.support.Abstract BeanFactory.getBean(AbstractBeanFactory.java:241)
at org.springframework.beans.factory.support.Abstract BeanFactory.getBean(AbstractBeanFactory.java:152)
at org.springframework.beans.factory.support.DefaultL istableBeanFactory.preInstantiateSingletons(Defaul tListableBeanFactory.java:253)
at org.springframework.context.support.AbstractApplic ationContext.refresh(AbstractApplicationContext.ja va:331)
at org.springframework.web.context.support.AbstractRe freshableWebApplicationContext.refresh(AbstractRef reshableWebApplicationContext.java:155)
at org.springframework.web.context.ContextLoader.crea teWebApplicationContext(ContextLoader.java:246)
at org.springframework.web.context.ContextLoader.init WebApplicationContext(ContextLoader.java:184)
at org.springframework.web.context.ContextLoaderListe ner.contextInitialized(ContextLoaderListener.java: 49)
at org.apache.catalina.core.StandardContext.listenerS tart(StandardContext.java:3729)
at org.apache.catalina.core.StandardContext.start(Sta ndardContext.java:4187)
at org.apache.catalina.core.ContainerBase.addChildInt ernal(ContainerBase.java:759)
at org.apache.catalina.core.ContainerBase.addChild(Co ntainerBase.java:739)
at org.apache.catalina.core.StandardHost.addChild(Sta ndardHost.java:524)
at org.apache.catalina.startup.HostConfig.deployWAR(H ostConfig.java:809)
at org.apache.catalina.startup.HostConfig.deployWARs( HostConfig.java:698)
at org.apache.catalina.startup.HostConfig.deployApps( HostConfig.java:472)
at org.apache.catalina.startup.HostConfig.check(HostC onfig.java:1190)
at org.apache.catalina.startup.HostConfig.lifecycleEv ent(HostConfig.java:292)
at org.apache.catalina.util.LifecycleSupport.fireLife cycleEvent(LifecycleSupport.java:119)
at org.apache.catalina.core.ContainerBase.backgroundP rocess(ContainerBase.java:1305)
at org.apache.catalina.core.ContainerBase$ContainerBa ckgroundProcessor.processChildren(ContainerBase.ja va:1569)
at org.apache.catalina.core.ContainerBase$ContainerBa ckgroundProcessor.processChildren(ContainerBase.ja va:1578)
at org.apache.catalina.core.ContainerBase$ContainerBa ckgroundProcessor.run(ContainerBase.java:1558)
at java.lang.Thread.run(Unknown Source)

I also wondering about the generated schema classes. My XSD specifies this

<complexType name="AddressObject">
<sequence>
<element name="key" type="long" nillable="false" minOccurs="1" maxOccurs="1"/>
<element name="firstName" type="string" nillable="true" minOccurs="0" maxOccurs="1"/>
<element name="lastName" type="string" nillable="true" minOccurs="0" maxOccurs="1"/>
</sequence>
</complexType>
but the generated files doesn't have a

setFirstName(String firstName)
method, instead they have this setter method.

public void setFirstName(JAXBElement<String> value) {
this.firstName = ((JAXBElement<String> ) value);
}
Any idea why? I doesn't want this JAXB dependency in my Endpoint class.

Cheers,

Ingo

Arjen Poutsma
Jun 1st, 2006, 05:43 AM
Hi!

I'm using the jaxb libraries from jwsdp-2.0. But it's not possible to instantiate the jaxbMarshaller bean.

1722 [ContainerBackgroundProcessor[StandardEngine[Catalina]]] ERROR context.ContextLoader - Context initialization failed
org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'getAddressEndpoint' defined in ServletContext resource [/WEB-INF/applicationContext-ws.xml]: Cannot resolve reference to bean 'jaxbMarshaller' while setting bean property 'marshaller'; nested exception is org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'jaxbMarshaller' defined in ServletContext resource [/WEB-INF/applicationContext-ws.xml]: Invocation of init method failed; nested exception is java.lang.UnsupportedOperationException
Caused by:
org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'jaxbMarshaller' defined in ServletContext resource [/WEB-INF/applicationContext-ws.xml]: Invocation of init method failed; nested exception is java.lang.UnsupportedOperationException
Caused by:
java.lang.UnsupportedOperationException
at com.sun.xml.bind.v2.runtime.unmarshaller.Unmarshal lerImpl.setValidating(UnmarshallerImpl.java:453)
at org.springframework.oxm.jaxb.JaxbMarshaller.afterP ropertiesSet(JaxbMarshaller.java:112)
at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.invokeInitMethods(Abstr actAutowireCapableBeanFactory.java:877)
at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.initializeBean(Abstract AutowireCapableBeanFactory.java:846)
at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.createBean(AbstractAuto wireCapableBeanFactory.java:419)
at org.springframework.beans.factory.support.Abstract BeanFactory.getBean(AbstractBeanFactory.java:241)
at org.springframework.beans.factory.support.Abstract BeanFactory.getBean(AbstractBeanFactory.java:152)
at org.springframework.beans.factory.support.BeanDefi nitionValueResolver.resolveReference(BeanDefinitio nValueResolver.java:219)
at org.springframework.beans.factory.support.BeanDefi nitionValueResolver.resolveValueIfNecessary(BeanDe finitionValueResolver.java:115)
at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.applyPropertyValues(Abs tractAutowireCapableBeanFactory.java:781)
at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.populateBean(AbstractAu towireCapableBeanFactory.java:572)
at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.createBean(AbstractAuto wireCapableBeanFactory.java:415)
at org.springframework.beans.factory.support.Abstract BeanFactory.getBean(AbstractBeanFactory.java:241)
at org.springframework.beans.factory.support.Abstract BeanFactory.getBean(AbstractBeanFactory.java:152)
at org.springframework.beans.factory.support.DefaultL istableBeanFactory.preInstantiateSingletons(Defaul tListableBeanFactory.java:253)
at org.springframework.context.support.AbstractApplic ationContext.refresh(AbstractApplicationContext.ja va:331)
at org.springframework.web.context.support.AbstractRe freshableWebApplicationContext.refresh(AbstractRef reshableWebApplicationContext.java:155)
at org.springframework.web.context.ContextLoader.crea teWebApplicationContext(ContextLoader.java:246)
at org.springframework.web.context.ContextLoader.init WebApplicationContext(ContextLoader.java:184)
at org.springframework.web.context.ContextLoaderListe ner.contextInitialized(ContextLoaderListener.java: 49)
at org.apache.catalina.core.StandardContext.listenerS tart(StandardContext.java:3729)
at org.apache.catalina.core.StandardContext.start(Sta ndardContext.java:4187)
at org.apache.catalina.core.ContainerBase.addChildInt ernal(ContainerBase.java:759)
at org.apache.catalina.core.ContainerBase.addChild(Co ntainerBase.java:739)
at org.apache.catalina.core.StandardHost.addChild(Sta ndardHost.java:524)
at org.apache.catalina.startup.HostConfig.deployWAR(H ostConfig.java:809)
at org.apache.catalina.startup.HostConfig.deployWARs( HostConfig.java:698)
at org.apache.catalina.startup.HostConfig.deployApps( HostConfig.java:472)
at org.apache.catalina.startup.HostConfig.check(HostC onfig.java:1190)
at org.apache.catalina.startup.HostConfig.lifecycleEv ent(HostConfig.java:292)
at org.apache.catalina.util.LifecycleSupport.fireLife cycleEvent(LifecycleSupport.java:119)
at org.apache.catalina.core.ContainerBase.backgroundP rocess(ContainerBase.java:1305)
at org.apache.catalina.core.ContainerBase$ContainerBa ckgroundProcessor.processChildren(ContainerBase.ja va:1569)
at org.apache.catalina.core.ContainerBase$ContainerBa ckgroundProcessor.processChildren(ContainerBase.ja va:1578)
at org.apache.catalina.core.ContainerBase$ContainerBa ckgroundProcessor.run(ContainerBase.java:1558)
at java.lang.Thread.run(Unknown Source)


Try the snapshort available here (http://static.springframework.org/spring-ws/snapshots/spring-ws-20060506.zip). JAXB 2.0 had some breaking api changes, so I had to split up the JaxbMarshalller into a Jaxb1Marshaller and a Jaxb2Marshaller. The one in jwsdp 2.0 is a jaxb 2 marshaller.

res1st
Jun 1st, 2006, 05:48 AM
wow, you were too fast for my edit. :)
ok, i'll try it.

what do you think about jaxb 2?
It it better, faster, ... or is it just an "annotations version"?

Ingo

Arjen Poutsma
Jun 1st, 2006, 06:16 AM
wow, you were too fast for my edit. :)
ok, i'll try it.

what do you think about jaxb 2?
It it better, faster, ... or is it just an "annotations version"?


It produces less files, so I think that's good. I haven't done any tests with it performance wise. However, there is a project which focusses on this stuff here (https://bindmark.dev.java.net/).

And with regard to your other JAXBElement<> question, i honestly have no idea. Try looking at the JAXB 2 samples, maybe that will show you why.

Cheers,

res1st
Jun 1st, 2006, 08:14 AM
I think the main change of jaxb2 is the annotation thing. I'm no big fan of annotations, that's why i stick with jax 1.6 at the moment. It's working wonderful. :)
But the binding benchmark project is very interessting for me. Thank you!