Yes, i looked at the javadoc of the ClassLoader class and indeed the method "getClassLoader()" may return "null", but it seems that is not ok with Castor, or why else would it throw a NullPointerException and not catch the exception and do something about it - for example get the SystemClassLoader or something like that?
I mean Castor is not expecting the getClassLoader() to return "null". Marko Kurm -----Original Message----- From: Godmar Back [mailto:[email protected]] Sent: Wednesday, February 11, 2009 3:39 PM To: [email protected] Subject: Re: [castor-user] Castor ClassLoader problems Look at line 677 in Configuration.java, that's where the problem lies. It's okay for getClassLoader() to return null for system classes, such as java.lang.Object.class On Wed, Feb 11, 2009 at 4:57 AM, Marko Kurm <[email protected]> wrote: > Hi, > > > > Im developed a litte java plugin that uses castor to Access a web-service. > It worked perfectly. > > > > Now i'm trying to incorporate that plugin into an application that uses it's > own custom classLoader and i keep getting the following error: > > > > org.castor.core.util.Configuration.getObjectArray(Configuration.java:677) > java.lang.NullPointerException > > org.castor.mapping.MappingLoaderRegistry.<init>(MappingLoaderRegistry.java:54) > > org.castor.mapping.MappingUnmarshaller.<init>(MappingUnmarshaller.java:80) > > org.exolab.castor.xml.Unmarshaller.setMapping(Unmarshaller.java:540) > > ee.microlink.livelink.mobilesign.util.XmlUtil.configure(XmlUtil.java:87) > > ee.microlink.livelink.mobilesign.util.XmlUtil.<init>(XmlUtil.java:102) > > ee.microlink.livelink.mobilesign.MobileSignImpl.prepareMobileSign(MobileSignImpl.java:122) > > > > It seems that the NullPointerException is caused because the > „getClass().getClassLoader());" returns null: > > > > public MappingLoaderRegistry(final Configuration config) { > > Object[] objects = config.getObjectArray( > > CoreConfiguration.MAPPING_LOADER_FACTORIES, > getClass().getClassLoader()); > > for (int i = 0; i < objects.length; i++) { > > _mappingLoaderFactories.add(objects[i]); > > } > > } > > > > Anyone have any suggestions on how to resolve this problem? > > > > Best Regards! > > Marko Kurm --------------------------------------------------------------------- To unsubscribe from this list, please visit: http://xircles.codehaus.org/manage_email --------------------------------------------------------------------- To unsubscribe from this list, please visit: http://xircles.codehaus.org/manage_email

