I am trying to connect JCR browser using client program . The client program using JNDI api to connect JCR.
I am trying to install magnolia-JNDI module in my system,but it is not installed in my system. The follow steps i follow to install JNDI module , but it is not istalled. 1)copy magnolia-jndi-1.0.1.jar,jcr-2.0.jar to tomcat\lib folder 2)add the below entry in apache-tomcat-6.0.32\webapps\magnoliaAuthor\WEB-INF\config\repositories.xml file <param name="contextFactoryClass" value="info.magnolia.jndi.InMemoryContextFactory" /> <param name="providerURL" value="http://www.magnolia.info/jcr" /> <param name="bindName" value="GlobalRepository" /> 3) restart the maglonia 4) after restarting server login the superuser account.But the instalation is not happen. I am also using a client program to connect the JCR usnig JNDI, the code is below it showing [b]javax.naming.NameNotFoundException[/b] import java.util.Hashtable; import javax.jcr.Repository; import javax.jcr.Session; import javax.jcr.SimpleCredentials; import javax.jcr.Workspace; import javax.naming.Context; import javax.naming.InitialContext; public class TestJCR { /** * @param args */ public static void main(String[] args) { // TODO Auto-generated method stub String contextFactoryClass = "info.magnolia.jndi.InMemoryContextFactory"; String providerURL = "http://www.magnolia.info/jcr"; final String bindName = "magnoliaAuthor"; final Hashtable env = new Hashtable(); env.put(Context.INITIAL_CONTEXT_FACTORY, contextFactoryClass); env.put(Context.PROVIDER_URL, providerURL); try { InitialContext ctx = new InitialContext(env); // first try to find the existing object if any System.out.print("context:" + ctx + "\\n "); Repository repository = (Repository) ctx.lookup(bindName); System.out.print("repository:" + ctx + "\\n "); SimpleCredentials credentials = new SimpleCredentials("superuser", "superuser".toCharArray()); Session jcrSession = repository.login(credentials); Workspace workspace = jcrSession.getWorkspace(); System.out.print("Got a workspace:" + workspace.getName() + "\\n"); } catch (Exception e) { throw new RuntimeException(e); } } } Kindly help me.I am waiting for yours positve response -- Context is everything: http://forum.magnolia-cms.com/forum/thread.html?threadId=9d7e6b5d-5bfd-4b50-a62b-3bc6b47b8641 ---------------------------------------------------------------- For list details, see: http://www.magnolia-cms.com/community/mailing-lists.html Alternatively, use our forums: http://forum.magnolia-cms.com/ To unsubscribe, E-mail to: <[email protected]> ----------------------------------------------------------------
