Hi alexandru,

Alexandru Popescu wrote:
[quote]
Place the Jackrabbit jar file and all the dependencies (including the JCR API jar file) under [Tomcat folder]/common/lib.
[/quote]

Now my question is: is this really necessary? I am thinking that the only jar file needed in the common/lib is the jcr jar.


AFAIK, in order to run a shared jackrabbit instance all the classes must be loaded by the same classloader. In Tomcat in can be achieved by placing all the needed jars at the server level.

Considering 2 applications accessing the shared JCR, only the first one requesting from JNDI the repository will really need to provide the jackrabbit classes.
I'm not sure, I haven't tested it but I guess you would get a ClassNotFoundException if you try this configuration. AFAIK if you define a shared resource the shared jars must be placed under ${TOMCAT_HOME}/common/lib or any common path, see ${TOMCAT_HOME}/conf/catalina.properties#common.loader. The idea behind a shared resource is that no webapp need to know anything about the concrete implementation. Moreover in the scenario you are describing the correct behavior of your webapps would depend in the order in which the web applications are accessed, which doesn't seem to be a good option.

br,
edgar

ps, it's pretty much the same with other embedded resources.
e.g.
http://www-128.ibm.com/developerworks/db2/library/techarticle/dm-0508bader/ (The enterprise scenario)
http://db.apache.org/derby/integrate/DerbyTomcat5512JPetStor.html

thanks a lot in advance,

./alex
--
.w( the_mindstorm )p.





[1] http://incubator.apache.org/jackrabbit/doc/arch/deploy/howto-model2.html

Reply via email to