Hi Sameer, I understood your answer (I'm disappointed...), but is there any way to send a HTTP request to a specific servlet (like the MVCServlet) in order to add content to a specific paragraph???
NB: For the moment I'm looking to the MVCServlet class and its DialogMVCServlet subclass... Thx Benjamin -----Message d'origine----- De : [email protected] [mailto:[EMAIL PROTECTED] Envoyé : mardi, 16. mai 2006 10:53 À : [email protected] Objet : Re: [magnolia-user] Adding content to paragraph - Lock file problem Hi Benjamin, my answer was on an assumption that both applications are under single jvm, you can connect to remote object but it depends on the context factory you are using, not sure if there are generic implementation available otherwise if you can write your own using RMI. (something like org.jboss.naming.ExternalContext) If you dont share Repository you will always run a risk of corrupting it, atleast jackrabbit implementation. Hope this helps, - Sameer On May 16, 2006, at 10:39 AM, Benjamin Sempere wrote: > Hello Sameer, > > Thanks for your answer. > I have followed your advice but now I get a > javax.naming.NameNotFoundException when I run this code: > > // Register the repository in JNDI > Hashtable<String, String> env = new Hashtable<String, String>(); > env.put(Context.INITIAL_CONTEXT_FACTORY, initialContextFactory); > env.put(Context.PROVIDER_URL, providerURL); > InitialContext ctx = new InitialContext(env); > > // Obtain the repository through a JNDI lookup > Repository r = (Repository) ctx.lookup("websiteAuthor"); > > // Create a new repository session, after authenticating > Session session = r.login(new SimpleCredentials(login, password > .toCharArray()), null); > > Node rootNode = session.getRootNode(); > > Where "websiteAuthor" is the bindName of the magnolia default website > repository... > > Note that the code above runs outside the container in which > magnolia author > is deployed... > > Regards > Benjamin > > > > -----Message d'origine----- > De : [email protected] [mailto:[EMAIL PROTECTED] > Envoyé : mardi, 16. mai 2006 10:17 > À : [email protected] > Objet : Re: [magnolia-user] Adding content to paragraph - Lock file > problem > > Sure, its meant to be like this otherwise you will end up in a broken > repository. > >> RegistryHelper.registerRepository(ctx, "myRep", configFile, >> repHomeDir, true); > > > why are you registering the repository when its already registered by > magnolia, when you start magnolia it registers the repository (if > needed) and binds this object > with the JNDI context you provide. > > so instead of registering your own repository, get it from JNDI. > lookup on the name as defined in magnolia/WEB-INF/config/default/ > repositories.xml > > > Regards, > - Sameer > > > On May 16, 2006, at 10:08 AM, Benjamin Sempere wrote: > >> Hello everybody, >> >> I'm developing a Java application that will access data of a >> specific page's >> paragraph. >> >> The code that I use to connect to the repository is the following: >> // Register the repository in JNDI >> Hashtable<String, String> env = new Hashtable<String, String>(); >> env.put(Context.INITIAL_CONTEXT_FACTORY, initialContextFactory); >> env.put(Context.PROVIDER_URL, providerURL); >> InitialContext ctx = new InitialContext(env); >> >> RegistryHelper.registerRepository(ctx, "myRep", configFile, >> repHomeDir, true); >> >> // Obtain the repository through a JNDI lookup >> Repository r = (Repository) ctx.lookup("myRep"); >> >> //Access paragraph data... >> >> This works fine when the author instance is not running. >> However, when this instance runs, I got the following error: >> Existing lock file at >> C:\tomcat\webapps\magnoliaAuthor\repositories\website\.lock >> deteteced. >> Repository was not shutdown properly. >> >> I need to access these specific pages while the author instance is >> running, >> Can you help me resolving this problem? >> >> Thanks in advance >> >> >> >> ---------------------------------------------------------------- >> for list details see >> http://www.magnolia.info/en/magnolia/developer.html >> ---------------------------------------------------------------- > > > ---------------------------------------------------------------- > for list details see > http://www.magnolia.info/en/magnolia/developer.html > ---------------------------------------------------------------- > > > ---------------------------------------------------------------- > for list details see > http://www.magnolia.info/en/magnolia/developer.html > ---------------------------------------------------------------- ---------------------------------------------------------------- for list details see http://www.magnolia.info/en/magnolia/developer.html ---------------------------------------------------------------- ---------------------------------------------------------------- for list details see http://www.magnolia.info/en/magnolia/developer.html ----------------------------------------------------------------
