[
https://issues.apache.org/jira/browse/TUSCANY-2519?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12618738#action_12618738
]
Raymond Feng commented on TUSCANY-2519:
---------------------------------------
Hi,
We saw a similar issue before with IBM JDK 5. With IBM JDK 5, the
getAnnotation(Class) call will first get the string class name for the
annotation type and then later on try to load the class from the name again.
IIRC, it uses the JDK classloader to load the class when it fails.
> "throws Exception" causes failure in JAXB type generation
> ---------------------------------------------------------
>
> Key: TUSCANY-2519
> URL: https://issues.apache.org/jira/browse/TUSCANY-2519
> Project: Tuscany
> Issue Type: Bug
> Affects Versions: Java-SCA-1.3
> Environment: WinXP SP2 IBM JDK5.0
> Reporter: Simon Laws
> Fix For: Java-SCA-Next
>
> Attachments: TUSCANY-2519-reproduce.patch
>
>
> An interface with a method such as;
> public String hello(String name) throws Exception;
> Causes our WSDL generation code to bail out with;
> Caused by: java.lang.TypeNotPresentException: Type
> javax.xml.bind.annotation.XmlRootElement not present
> at
> com.ibm.oti.reflect.AnnotationHelper.getAnnotation(AnnotationHelper.java:38)
> at
> com.ibm.oti.reflect.AnnotationHelper.getDeclaredAnnotations(AnnotationHelper.java:50)
> at java.lang.Class.getDeclaredAnnotations(Class.java:1620)
> at java.lang.Class.getAnnotations(Class.java:1581)
> at java.lang.Class.getAnnotation(Class.java:1561)
> at
> com.sun.xml.bind.v2.model.annotation.RuntimeInlineAnnotationReader.getClassAnnotation(RuntimeInlineAnnotationReader.java:102)
> at
> com.sun.xml.bind.v2.model.annotation.RuntimeInlineAnnotationReader.getClassAnnotation(RuntimeInlineAnnotationReader.java:53)
> at
> com.sun.xml.bind.v2.model.impl.ModelBuilder.getTypeInfo(ModelBuilder.java:325)
> at
> com.sun.xml.bind.v2.runtime.JAXBContextImpl.getTypeInfoSet(JAXBContextImpl.java:432)
> at
> com.sun.xml.bind.v2.runtime.JAXBContextImpl.<init>(JAXBContextImpl.java:286)
> at
> com.sun.xml.bind.v2.ContextFactory.createContext(ContextFactory.java:139)
> at
> com.sun.xml.bind.v2.ContextFactory.createContext(ContextFactory.java:117)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:64)
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> at java.lang.reflect.Method.invoke(Method.java:615)
> at javax.xml.bind.ContextFinder.newInstance(ContextFinder.java:211)
> at javax.xml.bind.ContextFinder.find(ContextFinder.java:372)
> at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:574)
> at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:522)
> at
> org.apache.tuscany.sca.databinding.jaxb.JAXBContextCache.getJAXBContext(JAXBContextCache.java:275)
> at
> org.apache.tuscany.sca.databinding.jaxb.JAXBContextHelper.createJAXBContext(JAXBContextHelper.java:179)
> at
> org.apache.tuscany.sca.databinding.jaxb.JAXBContextHelper.createJAXBContext(JAXBContextHelper.java:211)
> at
> org.apache.tuscany.sca.databinding.jaxb.JAXBTypeHelper.getSchemaDefinitions(JAXBTypeHelper.java:238)
> ... 28 more
> Caused by: java.lang.ClassNotFoundException:
> javax.xml.bind.annotation.XmlRootElement
> at java.lang.Class.forName(Class.java:163)
> at
> com.ibm.oti.reflect.AnnotationHelper.getAnnotation(AnnotationHelper.java:33)
> ... 51 more
> The RI tooling seems to able to happily cope with this.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.