Hi again,
thanks for your fast replies.. :-)

> > i'm surfing the sling mail archive and
> > i'm convinced that you are the real Apache Felix! ;-)
>
> Well, I am a member of the Apache Felix PMC but the project and me got
> their names completely independently of each other ;-)


eheh.. :-D


> Maybe the solution is very simple: If you start the fragment after the
> host bundle, the host bundle is (probably) not aware of the fragment
> yet. So you might want to refresh the jackrabbit-server bundle from
> within the web console.
>
> This should attacht the fragment and then add the contents of the bundle
> to the jackrabbit-server bundle's class loader.
>

I fear i have an error somewhere...
I already refreshed the "Apache Sling Jackrabbit Embedded Repository" bundle
prior to write the mail... (sincerely i also restarted tomcat, even if i
know it's absolutely NOT necessary in OSGI... :-)).
Now my fragment is in Resolved state (while it was Installed when i uploaded
it in the web console), but the embedded Jackrabbit still can't see it and
continue to throw the error while trying to start...
On the bundle information page i can't see the org.postgres package in the
lists of imported packages and classpath entries...

At now the only two interesting headers in my MANIFEST.MF are:
Private-Package: org.postgresql
Fragment-Host: org.apache.sling.jcr.jackrabbit.server
Have i to put some other information in the manifest (like a classpath
entry..)?
Have i to declare in the Private-Package header all the packages contained
in the postgresql.jar, too? (i only declared org.postgresql, that is the
package containing the org.postgresql.Driver class...)

Please, note that fragments attached to a host bundle are only in
> resolve state and not in started state.
>

> PS: Only the MANIFEST.MF file is important for OSGi, the DISCLAIMER,
> LICENSE and NOTICE.txt files are required by Apache for our artifacts
> for licensing reasons.
>
>
Ok, many thanks..  :-)
Greetings,
Fabris.

>

>> 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