I would at least try two thing.

System.out the classloaders of the getSession() class and the Typecasted
class. That way you know for sure.  If the two classloaders is

sun.misc.AppClassLoader    and the other is
ContextClassloader (or something like that)  then you know that one class is
loaded by
jvm classloader, and the other is by jetty.

What that mean is that you either have some jar files in you classpath or in
WEB-INF/lib or you have some classes in WEB-INF/classes that uses jar files
in you classpath.

get if it don“t worx

/Flemming



On 6/29/07, Watter <[EMAIL PROTECTED]> wrote:



Flemming Boller wrote:
>
> Hi
>
> Well after some   debugging, searching nabble.com etc.. I finally
> found out what the problem was.
>
> After printing out the classloaders of the
> MySession.class.getClassloader()
> and the GetSesion().getClass().getCla...  I found out it was 2
> differentclassloaders.
>
> Reading at some Jetty forums about other similar problems I found out
that
> because
> my Intellij was setup (by me :-) to compile output to WEB-INF/classes,
> that
> would require the wicket.jar files (and others) to be placed under
> WEB-INF/lib.
>
> BUT Intellij did not do that. It just referenced the jar files in my
local
> maven repo.
>
> So, after setting Intellij to compile to project-root/classes it worx
now.
>
> I hope somebody can use this, because...dammit this has taken time...
>
> Well thanks for you quick responses!
>
> /Flemming
>
Flemming,

I wonder if you might explain what caused your problem in a little more
detail as my rather simple mind didn't quite comprehend. ;)

I am receiving the exact same error as you and I suspect that the cause
lies
in something like the same area, however our situations do appear to be at
least slightly different.

I am using the ReloadingWicketFilter. One of the dangers one must watch
out
for when using it is loading the same class in two different classloaders
exactly as you described. I am using Maven 2 and "mvn jetty:run" to deploy
my application for local testing. Everything seems to work fine until I
use
my browser back button and click on a link from the page I went back to;
any
link. At that point I receive the exact same exception you described
earlier
in this thread. If I disable the ReloadingWicketFilter, then the
application
behaves normally and I do not receive an error.

I compile my classes to the default location (i.e.
module_home/target/classes) and I see that when maven starts, this
location
is added to the classpath. For additional information, one could look at
the
thread where I've been hashing through this:

http://www.nabble.com/http://www.nabble.com/Re%3A-Using-hot-reloading-of-classes-with-Spring-%28Was%3A-Has-something-changed-in-markup-inheritance-%29-p11335416.html

Clearly, I'm loading my custom WebSession class into two different
classloaders, but for the life me I can't figure out where or how. Given
your experience, do you have any suggestions?

Matt





--
View this message in context:
http://www.nabble.com/Classcastexception-and-getSession-tf3979399.html#a11352814
Sent from the Wicket - User mailing list archive at Nabble.com.


-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user

Reply via email to