Any chance you can create a small example? Sounds like a bug of some sort.
Things to look for: make sure you have an asm jar on the classpath. For
that annotation to work on the method, you would need asm. Obviously make
sure you have the most recent CXF.
Not sure what else at this point. Would need to see a test case.
Dan
On Sunday, July 29, 2012 01:37:59 PM fahman_dude wrote:
> Hello, I have this property in a POJO that is used in a web method:
>
> @XmlJavaTypeAdapter(HoursAdapter.class)
> public Hours getTotalEffort() {
> return this.totalEffort;
> }
>
> the corresponding HoursAdapter looks like this:
>
> public class HoursAdapter extends XmlAdapter<Integer, Hours> {
> @Override
> public Hours unmarshal(Integer i) throws Exception {
> return Hours.hours(i);
> }
>
> @Override
> public Integer marshal(Hours i) throws Exception {
> return i.getHours();
> }
> }
>
> I get a marshalling error upon marshaling response at the end of execution
> of web method:
>
> DEBUG Invoking handleMessage on interceptor
> org.apache.cxf.interceptor.BareOutInterceptor@eccef1
> DEBUG Invoking handleFault on interceptor
> org.apache.cxf.interceptor.BareOutInterceptor@eccef1
> ...
> DEBUG Invoking handleFault on interceptor
> org.apache.cxf.ws.policy.PolicyOutInterceptor@4e40da
> WARN Interceptor for
> {http://.../SchedulerService}SchedulerService#{http://.../}processSchedule
> has thrown exception, unwinding now
> org.apache.cxf.interceptor.Fault: Marshalling Error: class
> org.joda.time.Hours nor any of its super class is known to this context.
> at
> org.apache.cxf.jaxb.JAXBEncoderDecoder.marshall(JAXBEncoderDecoder.java:26
> 1) at org.apache.cxf.jaxb.io.DataWriterImpl.write(DataWriterImpl.java:169)
> at ...
>
> Could anyone give me hint on how to fix this. I attempted @XmlSeeAlso with
> no success since I get compilation error that org.joda.time.Hours has no
> default parameterless constructor.
>
> thanks
> fahman
>
>
>
> --
> View this message in context:
> http://cxf.547215.n5.nabble.com/Marshalling-error-on-org-joda-time-Hours-
> tp5711707.html Sent from the cxf-user mailing list archive at Nabble.com.
--
Daniel Kulp
[email protected] - http://dankulp.com/blog
Talend Community Coder - http://coders.talend.com