cxf-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Daniel Kulp (JIRA)" <j...@apache.org>
Subject [jira] Commented: (CXF-2769) Must use Java static nested class for faultbean when using JAX-WS java first
Date Wed, 05 May 2010 16:57:02 GMT

    [ https://issues.apache.org/jira/browse/CXF-2769?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12864398#action_12864398
] 

Daniel Kulp commented on CXF-2769:
----------------------------------


Actually, this is working per spec.    Per spec, the beans the JAXB creates MUST have a default,
no arg constructor.   It's impossible to have that with a non-static nested class as there
is always an implied pointer to the outer as the first arg to the constructors.    You cannot
instantiate an instance of the inner class outside the scope of the outter class.   That is
required by JAXB.

HelloFault3 is already working as far as I can tell.   

That said, per spec, if you are using a faultDetails thing, you SHOULD have a constructor
of:

public HelloFault(String msg, HelloFaultDetails details)  {
....
}

That would be called by the runtime when it's being unmarshalled.   Without that constructor,
we try to go through a bunch of reflection things to copy the data into the fields and such.
  Not the most reliable.   




> Must use Java static nested class for faultbean when using JAX-WS java first
> ----------------------------------------------------------------------------
>
>                 Key: CXF-2769
>                 URL: https://issues.apache.org/jira/browse/CXF-2769
>             Project: CXF
>          Issue Type: Bug
>          Components: JAX-WS Runtime
>    Affects Versions: 2.2.7
>            Reporter: Eric Pederson
>         Attachments: cxf2769.tar
>
>
> You have to use a Java static nested class of the Exception class for a faultbean when
using JAX-WS java first.   All other types of classes result in errors of the type
> org.apache.cxf.interceptor.Fault: Could not find JAXB information for bean class <bean
class> in context.   Make sure it follows JAXB conventions.
> You should be able to use any class if it follows the guidelines of JAX-WS section 3.7
 
> Better yet CXF should be able to generate the bean classes off the Exception classes
dynamically.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message