Shalaka,

When running castor inside a Servlet or AppServer environment it is
typically needed to pass the appropriate ClassLoader to Castor.

Take one of the classes you have specified in the mapping file and get
the  ClassLoader from it as such:

Mapping mapping = new Mapping(Foo.class.getClassLoader());

Hope that helps.

--Keith


Shalaka Chaudhari wrote:
> 
> Hi Dave,
> 
>                 You helped me a lot in the problem related to the JDO
> configuration setup in servlets. I could not get it to work
> with Apache JServ. So, as suggested by you,  I switched to Tomcat.
> 
> In Tomcat, I have stored all my .xml files in the WEB-INF folder of my
> application and the class files as a .jar in the WEB-INF/lib folder.
> It contains all the classes that the marsahller / unmarshaller and the
> JDO will use.  The servlet classes are in the WEB-INF/classes folder.
> 
> Now, when i try to run my application it reads the mapping file and
> gives an error saying NoClassDefinitionFound. It lists the classes
> that have been mapped using the mapping file.
> So it does not find the classes. How do the classes need to be
> specified in the mapping file? I am not using any package statement so
> I haven't qualified the classes (like myapp.Customer)and they just
> appear by their name in the mapping file (like Customer) ?
> 
> Also, since the servlet is getting loaded on startup what will
> be the correct way to set the mapping files into the classes that
> use them?
> 
> PLEASE HELP.
> 
> Regards,
> Shalaka.
> 
> ----------------------------------------------------------------------
> MSN Photos is the easiest way to share and print your photos: Click
> Here
> ----------------------------------------------------------- If you
> wish to unsubscribe from this mailing, send mail to
> [EMAIL PROTECTED] with a subject of: unsubscribe castor-dev

----------------------------------------------------------- 
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
        unsubscribe castor-dev

Reply via email to