That line of code appears to be working properly. I do not get a ClassNotFoundException on the call to the below code. Any thoughts on why this might be occurring? More information on my environment
IBM JDK 1.3 WebSphere 5.0 Thanks, Michael On 4/14/06, James Carman <[EMAIL PROTECTED]> wrote: > > Try this: > > Thread.currentThread().getContextClassLoader().loadClass( > "mycompany.service.ups.dto.UPSResponseDTO" ) > > Digester, by default, uses the thread context classloader. So, if it > can't > find the class, then Digester can't instantiate it. You can optionally > tell > Digester what classloader to use by calling setClassLoader(). Hope that > helps! > > James > > -----Original Message----- > From: Michael Rasmussen [mailto:[EMAIL PROTECTED] > Sent: Friday, April 14, 2006 3:49 PM > To: [email protected] > Subject: ClassNotFound [digester] > > Hello, > I am working with digester and when executing this line of code > > upsResponseDTO = xmlDigester.parse(new ByteArrayInputStream( > upsResponse.getBytes())); > > I get a ClassNotFoundException in digester > > org.apache.commons.digester.Digester TRAS0014I: The following exception > was > logged java.lang.ClassNotFoundException: > mycompany.service.ups.dto.UPSResponseDTO > at java.net.URLClassLoader.findClass(URLClassLoader.java(Compiled > Code)) > at java.lang.ClassLoader.loadClass(ClassLoader.java(Compiled Code)) > at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java(Compiled > Code)) > at java.lang.ClassLoader.loadClass(ClassLoader.java(Compiled Code)) > at org.apache.commons.digester.ObjectCreateRule.begin( > ObjectCreateRule.java:204) > at org.apache.commons.digester.Rule.begin(Rule.java:152) > at org.apache.commons.digester.Digester.startElement(Digester.java > :1286) > at org.apache.xerces.parsers.AbstractSAXParser.startElement( > AbstractSAXParser.java(Compiled Code)) > at org.apache.xerces.impl.XMLNamespaceBinder.startElement( > XMLNamespaceBinder.java(Compiled Code)) > at org.apache.xerces.impl.dtd.XMLDTDValidator.startElement( > XMLDTDValidator.java(Compiled Code)) > at > org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanStartElement( > XMLDocumentFragmentScannerImpl.java(Compiled Code)) > at > > org.apache.xerces.impl.XMLDocumentScannerImpl$ContentDispatcher.scanRootElem > entHook > (XMLDocumentScannerImpl.java:929) > at > > org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatc > her.dispatch > (XMLDocumentFragmentScannerImpl.java(Compiled Code)) > at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument( > XMLDocumentFragmentScannerImpl.java(Compiled Code)) > at org.apache.xerces.parsers.StandardParserConfiguration.parse( > StandardParserConfiguration.java:525) > at org.apache.xerces.parsers.StandardParserConfiguration.parse( > StandardParserConfiguration.java:581) > at org.apache.xerces.parsers.XMLParser.parse(XMLParser.java:147) > at org.apache.xerces.parsers.AbstractSAXParser.parse( > AbstractSAXParser.java:1158) > at org.apache.commons.digester.Digester.parse(Digester.java:1591) > at mycompany.service.ups.client.UPSXmlDigester.parse( > UPSXmlDigester.java > :84) > > > I can execute the following line in the same JVM instance with no > problems. > > UPSResponseDTO upsRp = new UPSResponseDTO(); > > I have verified that the import is the same as the ClassNotFound > > import mycompany.service.ups.dto.UPSResponseDTO; > > Is it possible that digester uses a different classpath or classloaded for > the classloading it does? I'm a little confused here (Actually very > confused) > > Thanks, > Michael > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > >
