jackrabbit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lists <li...@digby.net>
Subject ClassCastException when getting Repository from InitialContext (Sorry if this is a repost)
Date Thu, 25 Aug 2005 14:37:15 GMT

Another query:

I've set up Jackrabbit to run in Tomcat 5.5 and have set up the resource 
in server.xml and context.xml. All looks good. I can get the 
BindableRepository back from the context, but I can't cast it to a 

The weird thing is, if I cast to an object, I can see that is is a 
BindableRepository, I can see that one of the interfaces it implements 
is Repository, i.e.

InitialContext context = new InitialContext();
Context environment = (Context) context.lookup("java:comp/env");
Object repository = (Object) environment.lookup("jcr/repository");

gives "interface javax.jcr.Repository"


out.println(repository instanceof javax.jcr.Repository);

gives false

And the cast causes a ClassCastException. Can anyone shed any light on 
this? Is it something to do with the BindableRepository having default 

Many thanks,


View raw message