Hi Fabrizio

Fabrizio Scarcello schrieb:
> Hi to all,
> a quick question: where i have to put jdbc drivers, if i use an external db
> (not just the embedded derby)?
> I downloaded the Sling war distribution, extracted and configured it with
> PostegreSQL and then deployed it in a Tomcat instance under the context
> /sling. It works fine, as i can see the system/console page...
> But, trying to execute my scripts, i found that Sling searchs the
> PostegreSQL drivers, but can't find them (even if i put the jar in the /lib
> tomcat directory, where other webapps find and use it)...
> I have the following exception:
> 13.11.2009 12:11:04.858 *ERROR* [SCR Component Actor]
> org.apache.jackrabbit.core.RepositoryImpl failed to start Repository: Cannot
> instantiate persistence manager
> org.apache.jackrabbit.core.persistence.bundle.PostgreSQLPersistenceManager:
> Could not load class org.postgresql.Driver: org.postgresql.Driver
> 
> I think Sling has a different class loading engine and then different
> settings...

Yes, Sling is running inside an OSGi framework which is all about
encapsulation (amongst other things of course). So there is no global
class loader to which all class laoder delegate automagically as is
custom in a regular java application.

Otherwise all these nices things of dynamic bundle upgrades would not be
possible.

> Where i have to put the PostgreSQL driver jar to make it visible to Sling?

Point is, how do you make them available to the Jackrabbit-Server
bundle. I would suggest you create a Fragment bundle of the PostgreSQL
driver jar which you attach to the Jackrabbit-Server bundle.

The postgresql bundle contains the required drivers as private packages
(no need to Export-Package them) and the framework will take care to add
them to the class loader of the jackrabbit server bundle for the
Jackrabbit Core to see the classes.

Hope this helps.

Regards
Felix

Reply via email to