You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jackrabbit.apache.org by "Daniel Bloomfield Ramagem (JIRA)" <ji...@apache.org> on 2007/02/23 15:42:05 UTC
[jira] Created: (JCR-763) Unable to create and login to different
workspaces
Unable to create and login to different workspaces
--------------------------------------------------
Key: JCR-763
URL: https://issues.apache.org/jira/browse/JCR-763
Project: Jackrabbit
Issue Type: Bug
Components: jca
Affects Versions: 1.2.1
Environment: Geronimo 1.1.1, Java 5r10, Windows XP
Reporter: Daniel Bloomfield Ramagem
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());
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());
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (JCR-763) Unable to create and login to different
workspaces
Posted by "Daniel Bloomfield Ramagem (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/JCR-763?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Daniel Bloomfield Ramagem updated JCR-763:
------------------------------------------
Attachment: stacktrace.txt
The stack trace from line 24 of TestServlet.java. This is what happens when you execute the servlet.
> Unable to create and login to different workspaces
> --------------------------------------------------
>
> Key: JCR-763
> URL: https://issues.apache.org/jira/browse/JCR-763
> Project: Jackrabbit
> Issue Type: Bug
> Components: jca
> Affects Versions: 1.2.1
> Environment: Geronimo 1.1.1, Java 5r10, Windows XP
> Reporter: Daniel Bloomfield Ramagem
> Attachments: stacktrace.txt, testservlet.war
>
>
> 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());
> 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());
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Resolved: (JCR-763) Unable to create and login to different
workspaces
Posted by "Daniel Bloomfield Ramagem (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/JCR-763?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Daniel Bloomfield Ramagem resolved JCR-763.
-------------------------------------------
Resolution: Invalid
Finally figured out the problem. It turns out that it was a matter of properly configuring the Geronimo v1.1.1 (the application server I use) J2EE Connector pool settings for the Jackrabbit resource adapter.
The geronimo-ra.xml plan I was using to deploy jackrabbit-jca-1.2.1.rar had two issues: 1) "thread-caching" was configured for the XA-transactions; and 2) the "single-pool" was being set "match-one". This caused the same "connection" to the Jackrabbit repository to be returned.
For future reference, if you're deploying Jackrabbit JCA/RAR in Geronimo be sure to configure your Geronimo deployment plan correctly (refer to: http://www.chariotsolutions.com/geronimo/geronimo-1.1/connectors.html).
Daniel.
> Unable to create and login to different workspaces
> --------------------------------------------------
>
> Key: JCR-763
> URL: https://issues.apache.org/jira/browse/JCR-763
> Project: Jackrabbit
> Issue Type: Bug
> Components: jca
> Affects Versions: 1.2.1
> Environment: Geronimo 1.1.1, Java 5r10, Windows XP
> Reporter: Daniel Bloomfield Ramagem
> Attachments: stacktrace.txt, testservlet.war
>
>
> 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());
> 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());
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Closed: (JCR-763) Unable to create and login to different
workspaces
Posted by "Daniel Bloomfield Ramagem (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/JCR-763?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Daniel Bloomfield Ramagem closed JCR-763.
-----------------------------------------
> Unable to create and login to different workspaces
> --------------------------------------------------
>
> Key: JCR-763
> URL: https://issues.apache.org/jira/browse/JCR-763
> Project: Jackrabbit
> Issue Type: Bug
> Components: jca
> Affects Versions: 1.2.1
> Environment: Geronimo 1.1.1, Java 5r10, Windows XP
> Reporter: Daniel Bloomfield Ramagem
> Attachments: stacktrace.txt, testservlet.war
>
>
> 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());
> 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());
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (JCR-763) Unable to create and login to different
workspaces
Posted by "Daniel Bloomfield Ramagem (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/JCR-763?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Daniel Bloomfield Ramagem updated JCR-763:
------------------------------------------
Attachment: testservlet.war
Simple test Servlet for demonstrating the reported problem, with the source code inside. This WAR has a Geronimo deployment plan inside. The Jackrabbit JCA Resource Adapter must have already been installed in the server.
> Unable to create and login to different workspaces
> --------------------------------------------------
>
> Key: JCR-763
> URL: https://issues.apache.org/jira/browse/JCR-763
> Project: Jackrabbit
> Issue Type: Bug
> Components: jca
> Affects Versions: 1.2.1
> Environment: Geronimo 1.1.1, Java 5r10, Windows XP
> Reporter: Daniel Bloomfield Ramagem
> Attachments: stacktrace.txt, testservlet.war
>
>
> 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());
> 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());
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.