Hi

magnolia always tries to get the repository object via JNDI.
But sharing JNDI object at container level can only be achieved by sharing jndi context implementation between web applications.

magnolia configuration allows you to define context factory and jndi name so you can use any third party factory implementation.

jackrabbit do not provide JNDI factory as a separate implementation so either you need to extract JNDI library from jackrabbit jars or use magnolia EE which comes with the
jndi context factory implementation.

Hope this helps,

Regards,

Sameer Charles
Magnolia International Ltd.

------------------------------------------------------------------------ ---------
[EMAIL PROTECTED]       http://www.magnolia.info
Magnolia®  - Simple Enterprise Content Management
------------------------------------------------------------------------ ---------




On Sep 13, 2007, at 3:31 PM, Olivier Barillet wrote:

Hello,

I'm trying to access a Magnolia repository (using Derby DB) from another webapp,
both webapps are running under the same Tomcat 5.0.28 instance.
I've set up a "model 2" deployment model, as described on
http://jackrabbit.apache.org/doc/deploy/howto-model2.html

According to \WEB-INF\config\default\repositories.xml file, the JNDI name should be the webapp name (<param name="bindName" value="$ {magnolia.webapp}" />). But when trying to connect to the Magnolia repository from the other webapp (JNDI lookup with webapp name), it always throws a "NameNotFoundException".

Does Magnolia globaly expose its JCR connection so that it can be accessed
through the JNDI global pool by another webapp ?
If not, how to achieve this ?
Am I trying to achieve something impossible ? Any hints ?

Thank you for your help,
Oliver

------------------------------------------
Current settings applied to my Magnolia 3.1m3 instance:

- created a Magnolia webapp context file
(/Tomcat/conf/Catalina/localhost/magnoliaAuthor.xml):
<ResourceLink name="magnoliaAuthor" global="jcr/ magnoliaAuthorGlobal"
type="javax.jcr.Repository"/>

- added into the /tomcat/conf/server.xml section <GlobalNamingResources>:
    <Resource name="jcr/magnoliaAuthorGlobal" auth="Container"
type="javax.jcr.Repository"/>
    <ResourceParams name="jcr/magnoliaAuthorGlobal">

<parameter><name>factory</ name><value>org.apache.jackrabbit.core.jndi.BindableRepositoryFactory< /value></parameter>

<parameter><name>configFilePath</name><value>/test/repositories/ magnolia/repository/repository.xml</value></parameter>

<parameter><name>repHomeDir</name><value>/test/repositories/ magnolia/repository</value></parameter>
    </ResourceParams>

- added into the Test webapp web.xml file:
    <resource-env-ref>
      <description>Content Repository</description>
<resource-env-ref-name>jcr/magnoliaAuthorGlobal</resource-env- ref-name> <resource-env-ref-type>javax.jcr.Repository</resource-env-ref- type>
    </resource-env-ref>

----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.

----------------------------------------------------------------
for list details see
http://documentation.magnolia.info/docs/en/editor/stayupdated.html
----------------------------------------------------------------







----------------------------------------------------------------
for list details see
http://documentation.magnolia.info/docs/en/editor/stayupdated.html
----------------------------------------------------------------

Reply via email to