Brent, There aren't getter/setters for the marshallerProperties. I just added them. I'll get that merged to 2.0.4. Thanks for reporting it.
Dan On Thursday 10 January 2008, bdm wrote: > All, > > I am trying to set an xml processing instruction in the result from a > web service call. I have gone through the JAXB instructions in the > user guide and have not been able to set the marshallerProperties > property on the JAXBDataBinding class. In looking at the code in SVN > it seems that there is a setter for contextProperties in the > JAXBDataBinding class, but not one for marshallerProperties even > though the map is created in the class. Am I missing something? > > I have tried both the 2.0.4 and 2.1 snapshot versions of the jars but > still no initialization works. > > This context file initializes correctly (modified version of the > sample from the web page): > > ...snip... > <jaxws:endpoint id="PersonRestService" > implementor="#PersonRestServiceImpl" > address="/PersonRest" > bindingUri="http://apache.org/cxf/binding/http"> > <jaxws:serviceFactory> > <bean > class="org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean"> > <property name="wrapped" value="true"/> > <property name="dataBinding"> > <bean class="org.apache.cxf.jaxb.JAXBDataBinding"> > <property name="contextProperties"> > <map> > <entry> > > <key><value>com.sun.xml.bind.defaultNamespaceRemap</value></key> > <value>uri:ultima:thule</value> > </entry> > </map> > </property> > </bean> > </property> > </bean> > </jaxws:serviceFactory> > </jaxws:endpoint> > > ...snip... > > This one doesn't work - Spring throws the error below: > > ...snip... > <jaxws:endpoint id="PersonRestService" > implementor="#PersonRestServiceImpl" > address="/PersonRest" > bindingUri="http://apache.org/cxf/binding/http"> > <jaxws:serviceFactory> > <bean > class="org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean"> > <property name="wrapped" value="true"/> > <property name="dataBinding"> > <bean class="org.apache.cxf.jaxb.JAXBDataBinding"> > <property name="marshallerProperties"> > <map> > <entry> > > <key><value>com.sun.xml.bind.xmlHeaders</value></key> > <value><![CDATA[<?xml-stylesheet > type="text/xsl" href="test.xsl"?>]]></value> > </entry> > </map> > > </property> > </bean> > </property> > </bean> > </jaxws:serviceFactory> > </jaxws:endpoint> > > ...snip... > > > Spring throws this error: > > 14:37:17,194 ERROR main [[/personService]] Exception sending context > initialized event to listener instance of class > org.springframework.web.context.ContextLoaderListener > org.springframework.beans.factory.BeanCreationException: Error > creating bean with name > 'org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean' defined in URL > [file:/opt/workspace/personService-cxf-ws/target/personService-ws/WEB- >INF/classes/serviceContext.xml]: Cannot create inner bean > 'org.apache.cxf.jaxb.JAXBDataBinding#c0f654' while setting bean > property 'dataBinding'; nested exception is > org.springframework.beans.factory.BeanCreationException: Error > creating bean with name 'org.apache.cxf.jaxb.JAXBDataBinding#c0f654' > defined in URL > [file:/opt/workspace/personService-cxf-ws/target/personService-ws/WEB- >INF/classes/serviceContext.xml]: Error setting property values; nested > exception is > org.springframework.beans.NotWritablePropertyException: Invalid > property 'marshallerProperties' of bean class > [org.apache.cxf.jaxb.JAXBDataBinding]: Bean property > 'marshallerProperties' is not writable or has an invalid setter > method. Does the parameter type of the setter match the return type of > the getter? > Caused by: > org.springframework.beans.factory.BeanCreationException: Error > creating bean with name 'org.apache.cxf.jaxb.JAXBDataBinding#c0f654' > defined in URL > [file:/opt/workspace/personService-cxf-ws/target/personService-ws/WEB- >INF/classes/serviceContext.xml]: Error setting property values; nested > exception is > org.springframework.beans.NotWritablePropertyException: Invalid > property 'marshallerProperties' of bean class > [org.apache.cxf.jaxb.JAXBDataBinding]: Bean property > 'marshallerProperties' is not writable or has an invalid setter > method. Does the parameter type of the setter match the return type of > the getter? > Caused by: > org.springframework.beans.NotWritablePropertyException: Invalid > property 'marshallerProperties' of bean class > [org.apache.cxf.jaxb.JAXBDataBinding]: Bean property > 'marshallerProperties' is not writable or has an invalid setter > method. Does the parameter type of the setter match the return type of > the getter? > at > org.springframework.beans.BeanWrapperImpl.setPropertyValue(BeanWrapper >Impl.java:748) at > org.springframework.beans.BeanWrapperImpl.setPropertyValue(BeanWrapper >Impl.java:606) at > org.springframework.beans.AbstractPropertyAccessor.setPropertyValue(Ab >stractPropertyAccessor.java:49) at > org.springframework.beans.AbstractPropertyAccessor.setPropertyValues(A >bstractPropertyAccessor.java:74) at > ...snip... > > > Any ideas? > > Thanks in advance > > Brent -- J. Daniel Kulp Principal Engineer, IONA [EMAIL PROTECTED] http://www.dankulp.com/blog
