[ 
https://issues.apache.org/jira/browse/CXF-1032?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Garry Watkins updated CXF-1032:
-------------------------------


Here is the rest of the stack trace.  It looks like it is in the sun code.  It 
did not give me this error when I used @WebMethod(exclude = true).

        at 
com.sun.xml.bind.v2.runtime.IllegalAnnotationsException$Builder.check(IllegalAnnotationsException.java:66)
        at 
com.sun.xml.bind.v2.runtime.JAXBContextImpl.getTypeInfoSet(JAXBContextImpl.java:389)
        at 
com.sun.xml.bind.v2.runtime.JAXBContextImpl.<init>(JAXBContextImpl.java:236)
        at 
com.sun.xml.bind.v2.ContextFactory.createContext(ContextFactory.java:76)
        at 
com.sun.xml.bind.v2.ContextFactory.createContext(ContextFactory.java:55)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:585)
        at javax.xml.bind.ContextFinder.newInstance(ContextFinder.java:210)
        at javax.xml.bind.ContextFinder.find(ContextFinder.java:366)
        at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:574)
        at 
org.apache.cxf.jaxb.JAXBDataBinding.createJAXBContext(JAXBDataBinding.java:348)
        at 
org.apache.cxf.jaxb.JAXBDataBinding.initialize(JAXBDataBinding.java:177)

> @WebMethod (exclude = true)  are not being excluded
> ---------------------------------------------------
>
>                 Key: CXF-1032
>                 URL: https://issues.apache.org/jira/browse/CXF-1032
>             Project: CXF
>          Issue Type: Bug
>          Components: JAXB Databinding
>    Affects Versions: 2.0.1
>         Environment: Mac OS/X JDK 1.5
>            Reporter: Garry Watkins
>
> Methods with @WebMethod(exclude = true) are still being included when 
> bringing in classes that will have WSDL generated.  I have tracked down the 
> issue to the org.apache.cxf.jaxb.JAXBContextInitializer class.
> I have included the replacement method here 
>     private void walkReferences(Class<?> cls) {
>         if (cls.getName().startsWith("java.")
>             || cls.getName().startsWith("javax.")) {
>             return;
>         }
>         //walk the public fields/methods to try and find all the classes.  
> JAXB will only load the 
>         //EXACT classes in the fields/methods if they are in a different 
> package.   Thus,
>         //subclasses won't be found and the xsi:type stuff won't work at all.
>         //We'll grab the public field/method types and then add the 
> ObjectFactory stuff 
>         //as well as look for jaxb.index files in those packages.
>         
>         Field fields[] = cls.getFields();
>         for (Field f : fields) {
>             addType(f.getGenericType());
>         }
>         Method methods[] = cls.getMethods();
>         for (Method m : methods) {  
>                 // START The following  lines were added by GW
>               WebMethod wm = m.getAnnotation(WebMethod.class);  
>               if (null != wm){
>                       if (wm.exclude()){
>                               System.out.println("Skipping method " + 
> m.toString());
>                               continue;
>                       }
>               }
>                 //END GW
>             addType(m.getGenericReturnType());
>             for (Type t : m.getGenericParameterTypes()) {
>                 addType(t);
>             }
>         }
>     }

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

Reply via email to