jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Daniel Bloomfield Ramagem" <daniel.rama...@gmail.com>
Subject Re: Jackrabbit Resource Adapter + Working with Multiple Workspaces
Date Thu, 22 Feb 2007 21:12:09 GMT
Ack, to make matters worse, when I comment out the lines for the creation of
the second workspace (ws2), the code runs fine but I can't seem to login to
ws1.  On the file system the "ws1" workspace directory got created OK.   But
the System.out.println prints "default" for the workspace name)

Context ctx = new InitialContext();
Repository repository = (Repository) ctx.lookup("java:comp/env/jackrabbit");
Credentials credentials = new SimpleCredentials("username",
"password".toCharArray());
Session session = repository.login(credentials);
Workspace workspace = session.getWorkspace();
JackrabbitWorkspace jws = (JackrabbitWorkspace) workspace;
jws.createWorkspace("ws1");
//jws.createWorkspace ("ws2");
Session s1 = repository.login(credentials, "ws1");
//Session s2 = repository.login(credentials, "ws2");
System.out.println("s1.getWorkspace().getName() = " +
s1.getWorkspace().getName());
//System.out.println("s2.getWorkspace().getName() = " + s2.getWorkspace
().getName());

On 2/22/07, Daniel Bloomfield Ramagem <daniel.ramagem@gmail.com> wrote:
>
> I'm using the Jackrabbit 1.2.1 JCA adapter and trying to have a Servlet
> create and use two separate workspaces.  I get a "
> java.lang.IllegalStateException: Inactive logical session handle called"
> error when running the code below:
>
> Context ctx = new InitialContext();
> Repository repository = (Repository) ctx.lookup
> ("java:comp/env/jackrabbit");
> Credentials credentials = new SimpleCredentials("username",
> "password".toCharArray());
> Session session = repository.login(credentials);
> Workspace workspace = session.getWorkspace();
> JackrabbitWorkspace jws = (JackrabbitWorkspace) workspace;
> jws.createWorkspace("ws1");
> jws.createWorkspace ("ws2");
> Session s1 = repository.login(credentials, "ws1");
> Session s2 = repository.login(credentials, "ws2");
> System.out.println("s1.getWorkspace().getName() = " + s1.getWorkspace().getName());
> System.out.println("s2.getWorkspace().getName() = " + s2.getWorkspace
> ().getName());
>
> Any thoughts?
>
> Daniel.
>

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