jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Yusuf Aaji <ya...@gso.org.sa>
Subject Re: Unable to cast to jackrabbitSession to get the UserManager
Date Sat, 22 Jan 2011 21:44:31 GMT
Thanks Justin,

Indeed I want the jackrabbit webapp to provide webdav access, and my webapp
for the fornt end.

In my webapp I don't include any jackrabbit libraries. I only needed to drop
jcr2.0.jar in the common lib tomcat folder and later on I had to drop the
jackrabbit-api-2.0.jar to be able to access the interface JackrabbitSession.

Is what I'm doing make any sense? or should I go with another approach?

In fact I saw that accessing the repository throw the jackrabbit webapp
context documented on jackrabbit website as one way to have local access to
the repository.


thanks for any feedback in advanced.

BR,
Yusuf

On Sun, Jan 23, 2011 at 12:18 AM, Justin Edelson
<justin@justinedelson.com>wrote:

> This seems like a pretty straightforward classloader problem. The
> classloader providing JackrabbitSession to the Jackrabbit webapp is \ not
> the same as the classloader providing JackrabbitSession to the webapp in
> which the code below runs.
>
> I'm not sure why you'd use two webapps to begin with. But if you must, this
> really isn't a question about Jackrabbit, it's about the servlet spec
> and/or
> your app server.
>
> Justin
>
> On Sat, Jan 22, 2011 at 3:55 PM, Yusuf Aaji <yusuf.aaji@gmail.com> wrote:
>
> > any idea guys? I'm stuck here.
> >
> > Shouldn't I use this way to access the repository if I need user
> > management?
> >
> > BR,
> > Yusuf
> >
> > On Sat, Jan 22, 2011 at 12:13 AM, Yusuf Aaji <yusuf.aaji@gmail.com>
> wrote:
> >
> > > Hi,
> > >
> > > When I try to cast the Session object to JackrabbitSession to get the
> > > UserManager I'm getting a classCastException
> > >
> > >  #{accessManager.addUser}: java.lang.ClassCastException:
> > > org.apache.jackrabbit.core.XASessionImpl cannot be cast to
> > > org.apache.jackrabbit.api.JackrabbitSession
> > >     at javax.faces.webapp.FacesServlet.service(FacesServlet.java:277)
> > >     at
> > >
> >
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
> > >     at
> > >
> >
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
> > >
> > > and this is how I'm getting my session:
> > >
> > > ServletContext context = (ServletContext)
> > > FacesContext.getCurrentInstance().getExternalContext().getContext();
> > > ServletContext jackrabbit = context.getContext("/jackrabbit");
> > > Repository repository = (Repository)
> > > jackrabbit.getAttribute(Repository.class.getName());
> > > contentSession = repository.login( jcrCredentials );
> > >
> > >
> > > any ideas? isn't XASessionImpl implement JackrabbitSession
> interface?!!!
> > >
> > > BR,
> > > Yusuf
> > >
> >
>



-- 



Eng. Yusuf Aaji

*Solutions Developer*
*P.O.* 85245 *Riyadh* 11691
*Tel:* (+9661) 274665 *Ext:* 405

*Mobile:* +966 56 1527193
*Email:* yaaji@gso.org.sa**

*Technical Services Department*
Kingdom of Saudi Arabia
*Tel: *(+9661) 2105394**

*Fax:* (+9661) 2105391

[image: G.S.O Logo]

WWW.GSO.ORG.SA <http://www.gso.org.sa/>

[image: cid:image002.png@01CBA9A6.4860A670]

Mime
  • Unnamed multipart/related (inline, None, 0 bytes)
View raw message