You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jackrabbit.apache.org by Dave Sykes <Da...@elateral.com> on 2006/04/13 18:01:22 UTC

Problem with Deployment Model 2

Hi,
I am quite new to Jackrabbit and have come across a problem.
I am trying to get the Deployment Model 2 (Shared) scenario to work (I have
got Model 1 working fine)
I am using Tomcat 5.5.16, and get a
java.lang.ClassCastException:
org.apache.jackrabbit.core.jndi.BindableRepository
exception thrown when I try to cast the looked up repository to
javax.jcr.Repository.
I can lookup the repository fine, if I just get it as an Object instance
and don't cast it.
According to the eclipse debugger the object returned is a
BindableRepository, and the configFilePath and repHomeDir have been set to
the correct values, so all looks OK, just when I cast it to a Repository it
throws that exception.

Does anyone have any ideas of what I am doing wrong?

Thanks,

Dave Sykes
Head of Research
+44 (0)1252 740721




Re: Problem with Deployment Model 2

Posted by Björn Bength <bj...@curalia.se>.
Dave Sykes wrote:

>Hi,
>I am quite new to Jackrabbit and have come across a problem.
>I am trying to get the Deployment Model 2 (Shared) scenario to work (I have
>got Model 1 working fine)
>I am using Tomcat 5.5.16, and get a
>java.lang.ClassCastException:
>org.apache.jackrabbit.core.jndi.BindableRepository
>exception thrown when I try to cast the looked up repository to
>javax.jcr.Repository.
>I can lookup the repository fine, if I just get it as an Object instance
>and don't cast it.
>According to the eclipse debugger the object returned is a
>BindableRepository, and the configFilePath and repHomeDir have been set to
>the correct values, so all looks OK, just when I cast it to a Repository it
>throws that exception.
>
>Does anyone have any ideas of what I am doing wrong?
>
>  
>

you get an object created by another classloader so they are different 
object although they seem
the same.

I would suggest putting the dependant jar-files in a shared directory 
under tomcat.
and/(or?) trying with the crossContext-support in your "client" 
webapp-context in server.xml.

i.e.
...
<host ...>
    <context crossContext="true" docBase="..." path="..."/>
</host>

or put them in the same the webapp directory
/björn





>Thanks,
>
>Dave Sykes
>Head of Research
>+44 (0)1252 740721
>
>
>  
>