jackrabbit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "kazim_ssuet@yahoo.com" <kazim_ss...@yahoo.com>
Subject Local vs Remote access while creating Namespace and Node Types
Date Wed, 13 Oct 2010 15:07:57 GMT

I have following code that creates a new namespace:

NamespaceRegistry nsReg = session.getWorkspace().getNamespaceRegistry();
nsReg.registerNamespace("csi", "http://www.csi.com");

I created namespace using local access (creating repository using
repository.xml location and repository folder).

Question 1: This namespace (created as local access) is not visible in
remote access when I run standalone server and use RMI API, why?

I had to register namespace again using remote repository access through

Question 2: Why do I have to create namespace in same repository for each
access type? it is same repository no matter how you access it, right?

Then I tried to create new node types using following code:

JackrabbitNodeTypeManager  manager = (JackrabbitNodeTypeManager )
manager.registerNodeTypes(new FileInputStream(cndFileName),

Turned out I couldn't register node types using above code through RMI, so
ran it using local access. Nodes types were loaded fine. But still those
node types created through local access are not available remotely.

Question 3: If there is no way to create node types remotely, and node types
created locally are no visible remotely, then how can I create node types
that are available remotely?

I tried creating node (using local access) of newly created node types
locally and was able to create nodes then I tried to browse repository using
http://localhost:8080/ provided by standalone server and there was nothing
in standalone server's repository. I could fetch nodes through API (using
local access), so nodes are there.

Question 4: Why nodes created using local API access are not visible through
standalone server's http access?

Seems like standalone server and locally accessed API are running against
different repositories? Is it possible? I must be doing something wrong

In case I am doing something wrong while getting repositories I am posting
the code that I use to get local and remote repository below.

My repository.xml is at:

My standalone server is at:

Standalone server created this folder when ran first time:

Here are the two methods that I use to get local and remote repositories:

private static Repository getRemoteRepository() throws MalformedURLException
	return (Repository) new URLRemoteRepository("http://localhost:8080/rmi");
private static Repository getLocalRepository() throws NamingException,
	String configFile = "C:\\JCR\\jackrabbit\\repository.xml";
	String repHomeDir = "C:\\JCR\\jackrabbit\\repository";

	Hashtable env = new Hashtable();

 		 "org.apache.jackrabbit.core.jndi" +

	env.put(Context.PROVIDER_URL, "localhost");

	InitialContext ctx = new InitialContext(env);


	return (Repository) ctx.lookup("repo");

I am cluless, please help.
View this message in context: http://jackrabbit.510166.n4.nabble.com/Local-vs-Remote-access-while-creating-Namespace-and-Node-Types-tp2993831p2993831.html
Sent from the Jackrabbit - Dev mailing list archive at Nabble.com.

View raw message