click-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bob Schellink (JIRA)" <>
Subject [jira] Closed: (CLK-540) ClassCastException in XmlConfigService
Date Fri, 01 May 2009 09:36:30 GMT


Bob Schellink closed CLK-540.

       Resolution: Invalid
    Fix Version/s:     (was: 2.1.0)

Since the packages are the same my only conclusion is this is a ClassLoader issue. What I
mean by that is if a class are loaded by two different ClassLoaders the JVM will see them
as two different, incompatible classes, e.g one cannot cast one class to the other.

In servlet containers one often find a ClassLoader hierarchy where a global classloader is
used to load classes which is global to all web applications, and each web application also
have their own separate classloader. If the click.jar is (somehow) placed in the common lib
folder it will be loaded by the global classloader. If the click.jar is made part of the WAR,
the same classes will be loaded again by the web application class loader and the above error
can occur.

I'm no Eclipse expert but know that with Eclipse Ganymede they ship an internal Jetty server
which might be causing problems? Also Eclipse might be copying the click.jar to the shared
Jetty library folder? But I'm just guessing and might even lead you down the wrong path :)

Anyway I'm closing this issue and I'm quite certain this is not a Click bug. You might also
want to check on the user mailing list if anyone else has run into this issue.


> ClassCastException in XmlConfigService
> --------------------------------------
>                 Key: CLK-540
>                 URL:
>             Project: Click
>          Issue Type: Bug
>          Components: core
>    Affects Versions: 2.1.0
>         Environment: Windows XP Professional,
> eclipse ganymede,
> jdk1.6.0,
> tried to run with jetty 6 and tomcat 6.
>            Reporter: Luiz Eduardo Martins Rodrigues
>            Priority: Critical
>   Original Estimate: 168h
>  Remaining Estimate: 168h
> java.lang.ClassCastException: cannot be cast to
> 	at
> 	at
> 	at
> 	at
> 	at
> 	at br.ufpr.hc.infra.hibernate.HibernateClickServlet.init(
> 	at javax.servlet.GenericServlet.init(
> 	at org.mortbay.jetty.servlet.ServletHolder.initServlet(
> 	at org.mortbay.jetty.servlet.ServletHolder.doStart(
> 	at org.mortbay.component.AbstractLifeCycle.start(
> 	at org.mortbay.jetty.servlet.ServletHandler.initialize(
> 	at org.mortbay.jetty.servlet.Context.startContext(
> 	at org.mortbay.jetty.webapp.WebAppContext.startContext(
> 	at org.mortbay.jetty.handler.ContextHandler.doStart(
> 	at org.mortbay.jetty.webapp.WebAppContext.doStart(
> 	at org.mortbay.component.AbstractLifeCycle.start(
> 	at org.mortbay.jetty.handler.HandlerWrapper.doStart(
> 	at org.mortbay.jetty.Server.doStart(
> 	at org.mortbay.component.AbstractLifeCycle.start(
> 	at runjettyrun.Bootstrap.main(
> at the same time, I´ve created a main method inside the project with these lines:
> String classname = "";
> Class deployClass = ClickUtils.classForName(classname);
> Control control = (Control) deployClass.newInstance();
> and it worked...

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message