[ https://issues.apache.org/jira/browse/XMLBEANS-476?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13409608#comment-13409608 ]
Michael Bishop commented on XMLBEANS-476: ----------------------------------------- This might work. You can build NetBeans modules without using OSGi; we're not using it in our project. Still, if that's the solution, we'd look into leveraging it. Another thought (without being intimately familiar with XMLBeans' source) is to be able to "supply" the ClassLoader in the Factory methods or the call to scomp. NetBeans has a "system" class loader that can access all modules. This class loader can be referenced using their Lookup API: ClassLoader syscl = Lookup.getDefault().lookup(ClassLoader.class); If I did: A.Factory.newInstance(sysCl), then I could assume every class loaded from my instance of A (including those in B) would use the supplied class loader. Another idea is to have each JAR use its own classloader: myA.addNewB() would leverage B's class loader instead of A's. > Loading XMLBeans resources across different class loaders. > ---------------------------------------------------------- > > Key: XMLBEANS-476 > URL: https://issues.apache.org/jira/browse/XMLBEANS-476 > Project: XMLBeans > Issue Type: Improvement > Components: Tools > Affects Versions: unspecified > Environment: Any operating system, NetBeans platform. > Reporter: Michael Bishop > Assignee: Jacob Danner > Priority: Minor > > In the NetBeans environment, each NetBeans module has its own class loader. > When you have multiple dependent schemas (i.e., Schema A depends on Schema B, > thus A.jar will depend on B.jar), and place each schema JAR in its own > module, NPEs are thrown because A cannot "load" classes from B. > See: > http://bits.netbeans.org/dev/javadoc/org-openide-modules/org/openide/modules/doc-files/classpath.html -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@xmlbeans.apache.org For additional commands, e-mail: dev-h...@xmlbeans.apache.org