I'm guessing that you put Wink in either common or shared folder of Tomcat.
Thus Class.forName classloader, that Wink uses, isn't aware of your web
application (war).
The easiest solution is putting Wink inside of your war.


On Thu, Jan 21, 2010 at 6:35 AM, bharathchinnadurai <
[email protected]> wrote:

> Hi All, I am facing a very strange issue for quiet some time and have been
> doing some work around in wink common/server or classpath settings. When
> RestServlet is initialized I am getting the following error, *1095
> [http-8080-1] ERROR
> org.apache.wink.common.internal.application.ApplicationFileLoader -
> com.test.TestResource is not a class. Ignoring.* The above message is
> because of a ClassNotFoundException thrown from ApplicationFileLoader when
> it tries to load the resource classes defined in the 'application' property
> file. I am getting this issue in both Tomcat and WAS 6.1 Below is the source
> code which tries to load the resource classes, *//ApplicationFileLoader.java 
> ... Class cls = null; try { cls =
> Class.forName(line); ....* I can get it working by modifying the above to,
> * //ApplicationFileLoader.java ... Class cls = null; try { cls =
> Thread.currentThread().getContextClassLoader().loadClass(line); ....* The
> difference is in the class loaders used. In the later case the class loader
> used is tomcats, WebappClassLoader were as in the former case it is some
> default class loader. I guess WebappClassLoader knows where exactly to look
> for its classes (/WEB-INF/classes) while the other doesnt, and requires me
> to manually set the class path entry. This is the same case where ever
> Class.forName is used in wink codebase. RestServlet reads the
> deploymentConfiguration init param to load the handler configuration class
> which againg throws CNFException. PS: I am also surprised how its only me
> who is facing this issue :), correct me if i am missing some thing here.
> ------------------------------
> View this message in context: ClassNotFoundException & 
> Class.forName<http://n2.nabble.com/ClassNotFoundException-Class-forName-tp4431734p4431734.html>
> Sent from the Apache Wink Users mailing list 
> archive<http://n2.nabble.com/Apache-Wink-Users-f3471013.html>at Nabble.com.
>

Reply via email to