Problems with ModeShape 3.0.0.Alpha4 and AS 7 integration
cluxig Jun 4, 2012 5:23 AMHi,
i didn't get the ModeShape 3.0.0.Alpha4 running within a JBoss 7.1.1.Final environment. I set up the following in the standalone:
<subsystem xmlns="urn:jboss:domain:infinispan:1.2" default-cache-container="hibernate"> <cache-container name="modeshape"> <local-cache name="Data"> <transaction mode="NON_XA"/> <file-store relative-to="jboss.server.data.dir" path="modeshape/store/Data" passivation="false"/> </local-cache> </cache-container> </subsystem> <subsystem xmlns="urn:jboss:domain:modeshape:1.0"> <repository name="Data" cache-name="Data" cache-container="modeshape"> <workspaces default-workspace="data"> <workspace name="data"/> </workspaces> </repository> </subsystem> <subsystem xmlns="urn:jboss:domain:security:1.1"> <security-domains> <security-domain name="modeshape-security" cache-type="default"> <authentication> <login-module code="UsersRoles" flag="required"> <module-option name="usersProperties" value="modeshape-users.properties"/> <module-option name="rolesProperties" value="modeshape-roles.properties"/> </login-module> </authentication> </security-domain> </security-domains> </subsystem>
Note: Only the modeshape-relevant parts are left in the above configuration.
At first, i don't be able to get the repository with Collections.singletonMap(JndiRepositoryFactory.URL, "jndi:jcr/local/Data") as properties by using the RepositoryFactory approach.
The org.modeshape.jcr.api.JndiRepositoryFactory.getRepositoryFromJndi(URL, Map) produces a NamingException "javax.naming.NotContextException: jcr/local" (Line 280). The exception itself is surpressed and null is returned instead of a repository.
The second approach with the following properties for RepositoryFactory:
Map<String, String> params = new HashMap<String, String>(); params.put(JndiRepositoryFactory.URL, "jndi:jcr/local"); params.put(JndiRepositoryFactory.REPOSITORY_NAME, "Data");
returns me a NOT_RUNNING repository, but this is at least not null. The problem now is, that i can't login to this repository.
If i use repository.login(new javax.jcr.SimpleCredentials("admin", "admin".toCharArray()), "data") the JcrRepository implementation is trying to start the the repository. It ends up in creating the RepositoryCache for a system workspace. In line 131 of RepositoryCache, the ChildReference "systemRef" becomes null, which ends up in a NullPointerException at line 135 (systemKey = systemRef.getKey()). The problem is, that on line 131 systemRoot.getChildReferences returns an instance of ImmutableChildReference.EMPTY_CHILD_REFERENCES, which at the end has no children. So null is returned.
What is my mistake here? Is there a configuration missing? Even if I pre-define a workspace with name "system", it does not work either. Do you have an example for an AS7-integrated ModeShape 3?
Thanks for reply
Carsten