As I understand it the jaxb.index file is not relevant in this scenario, or at least doesn't exist in the standalone version that works. So in this case, is the problem when trying to load ObjectFactory.class caused by a similar issue?
Gavin Ellis From: Martin Gainty [mailto:[email protected]] Sent: 03 June 2009 17:03 To: Gavin Ellis Subject: RE: JAXBException..... doesn't contain ObjectFactory.class or jaxb.index --a definite bug The javadoc for JAXBContext.newInstance(String,ClassLoader) needs to more clearly specify the expected format of the class names listed in "jaxb.index". Right now, the RI is expecting classnames of the form: "ClassName.class" The attached test case is failing because the index file contains: "fully.qualified.ClassName" also "modify the RI to work for "ClassName" rather than "ClassName.class" specifying classname without package. prefix or .class suffix is the fix http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6314008 so it seems the workaround is to use "ClassName.class" and not PackageName.ClassName.class (patch was supposed to be applied in JAXB 2) does this help? Martin Gainty ______________________________________________ Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen. Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le destinataire prévu, nous te demandons avec bonté que pour satisfaire informez l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est interdite. Ce message sert à l'information seulement et n'aura pas n'importe quel effet légalement obligatoire. Étant donné que les email peuvent facilement être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité pour le contenu fourni. ________________________________ From: [email protected] To: [email protected] Date: Wed, 3 Jun 2009 15:41:59 +0100 Subject: JAXBException..... doesn't contain ObjectFactory.class or jaxb.index I'm currently experiencing an issue when trying to initialise a jaxb context inside a jar dependency inside an axis aar module i.e. axis.war\WEB-INF\services\myService.aar!\lib\myDependency.jar!\com.mycompany.MyClass.class I have tested this lib standalone and everything works fine, the jaxb context is initialised as expected. However when it is referenced inside an aar module inside axis, then the following exception is thrown: javax.xml.bind.JAXBException: "com.mfuse.novo.transactions.adapter.orbis.oxi.generated" doesnt contain ObjectFactory.class or jaxb.index at com.sun.xml.bind.v2.ContextFactory.createContext(ContextFactory.java:183) 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:597) at javax.xml.bind.ContextFinder.newInstance(ContextFinder.java:128) at javax.xml.bind.ContextFinder.find(ContextFinder.java:277) at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:372) at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:337) at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:244) at com.mfuse.novo.adapters.connections.jaxb.JaxbConnectionImpl.initMarshaller(JaxbConnectionImpl.java:70) ... 34 more I have debugged into the code and attempted to load ObjectFactory manually and it appears to be on the classpath. I've also inspected the package inside the jar and it contains ObjectFactory.class. I noticed that axis WEB-INF/lib already contains an earlier version of jaxb, which I thought might possibly be causing a conflict here so tried swapping these out for the ones that I used in the lib, but this made no difference. Has anyone else experienced a similar issue? Regards, Gavin Ellis ________________________________ The information contained in this message is confidential and is intended for the addressee only. Any unauthorised dissemination or copying or use or disclosure of information contained herein is strictly prohibited and may be illegal. If you are not the named or intended recipient please notify us immediately by telephone (+44 207 154 2070) or return e-mail. We have installed active virus software but do not accept liability or responsibility for the security or reliability of transmission or for any virus transmitted; as such you should carry out your own virus checks before opening any attachment. Mfuse Limited registered in England and Wales, company number 04468412. Registered Office: 3rd Floor, Mitre House, 177 Regent Street, London W1B 4JN ________________________________ Windows Live(tm) SkyDrive(tm): Get 25 GB of free online storage. Get it on your BlackBerry or iPhone.<http://windowslive.com/online/skydrive?ocid=TXT_TAGLM_WL_SD_25GB_062009> ________________________________ The information contained in this message is confidential and is intended for the addressee only. Any unauthorised dissemination or copying or use or disclosure of information contained herein is strictly prohibited and may be illegal. If you are not the named or intended recipient please notify us immediately by telephone (+44 207 154 2070) or return e-mail. We have installed active virus software but do not accept liability or responsibility for the security or reliability of transmission or for any virus transmitted; as such you should carry out your own virus checks before opening any attachment. Mfuse Limited registered in England and Wales, company number 04468412. Registered Office: 3rd Floor, Mitre House, 177 Regent Street, London W1B 4JN
