If xstream is loaded by a classloader that is a parent to the classloader that
loaded your class, then it will not see your classes, hence
ClassNotFoundException. I don't know anything about xstream... Are you
distributing xstream with your web service? Is the xstream jar also
distributed elsewhere such that it can be found via the normal classloader
delegation model? If you answer both to these, then that's your problem. An
enhancement that I just described in an earlier mail will fix this.
Otherwise, some applications use the current thread context classloader (TCL).
You might what to try to set the TCL to the classloader that loaded your class
before calling xstream to see if that makes a difference.
ClassLoader prevClazzLoader =
Thread.currentThread().getContextClassLoader();
Thread.currentThread().setContextClassLoader(this.getClass().getClassLoader());
... call xstream
Thread.currentThread().setContextClassLoader(prevClazzLoader);
Hope that helps.
-----Original Message-----
From: Karsten Klein [mailto:[EMAIL PROTECTED]
Sent: Monday, December 05, 2005 4:24 PM
To: [email protected]
Subject: Re: axis2 classloading issue
Hi Ajith, hi Deepal,
I think it is not really an axis2 issue im facing here. Sorry for the confusion.
However I still have not solved this issue to my satisfaction. My service is
using xstream to deserialize complex objects and that causes the problem.
The XStream mapper cannot instantiate the class for whatever reason (while I
can instantiate the class in my service implementation). In my investigations I
tried to replace the xstream classmapper with my own one and still was not able
to load the class. Unfortunately it is going off topic here, so I no longer
whine here about my 'strange' issues.
Perhaps I should have a closer look into ADB... ;)
Cheers,
Karsten
--
Lust, ein paar Euro nebenbei zu verdienen? Ohne Kosten, ohne Risiko!
Satte Provisionen für GMX Partner: http://www.gmx.net/de/go/partner