Adding bootdelegation during startup requires restart of instance

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Adding bootdelegation during startup requires restart of instance

Jörg Hoh
Hi,

I want to automate the initial deployment of a Sling instance (AEM 6.3),
and some bundles require that I provide additional bootdelegation
statements. I want to provide this information before the first startup and
it would be great, if after this startup the application would be 100%
working.

But it looks like that in order to make the bootdelegation effective I need
to restart the instance. Before the restart the bundle in question is on
resolved state and fails with a ClassNotFoundException on a class contained
in the package I added with the bootdelegation.

sling.bootdelegation.class.com.rsa.jsafe.provider.JsafeJCE = com.rsa.*

The exception:
...
Caused by: java.lang.ClassNotFoundException: com.rsa.asn1.ASN_Exception not
found ...


What I did:

* Place all files in place
* Added my bootdelegation statements to ${sling.home}/sling.properties
* started up the instance

The instance starts up fine, and I can also see in the webconsole
(/system/console/status-slingprops) that my bootdelegation statements are
picked up.
But the bundle stays in resolved, throwing the mentioned
ClassNotFoundExceptions.  After a restart of the instance everything is
fine.


Is it possible to make the bootdelegation taking effect immediately or do I
really need to restart the instance first?

thanks,
Jörg

--
Cheers,
Jörg Hoh,

http://cqdump.wordpress.com
Twitter: @joerghoh
Reply | Threaded
Open this post in threaded view
|

Re: Adding bootdelegation during startup requires restart of instance

Bertrand Delacretaz
Hi Joerg,

On Wed, Jul 5, 2017 at 4:06 PM, Jörg Hoh <[hidden email]> wrote:
> ...What I did:
> * Place all files in place
> * Added my bootdelegation statements to ${sling.home}/sling.properties
> * started up the instance...

AFAIK if you don't have a pre-existing sling state folder that should
cause bootdelegation to be set on the first startup of the OSGi
framework.

Debugging the startup code should help confirm that, and if I'm
correct it's something else that's preventing your bundle from
starting.

-Bertrand
Reply | Threaded
Open this post in threaded view
|

Re: Adding bootdelegation during startup requires restart of instance

Jörg Hoh
Hi Bertrand,

I don't think that the bundle startup is prevented by another issue:

10.07.2017 16:03:04.273 *INFO* [OsgiInstallerImpl]
org.apache.sling.installer.core.impl.tasks.BundleStartTask Could not start
bundle adobe-aemfd-signatures [595]. Reason: {}. Will retry.

org.osgi.framework.BundleException: Activator start error in bundle
adobe-aemfd-signatures [595].

                at
org.apache.felix.framework.Felix.activateBundle(Felix.java:2277)

                at
org.apache.felix.framework.Felix.startBundle(Felix.java:2145)

                at
org.apache.felix.framework.BundleImpl.start(BundleImpl.java:998)

                at
org.apache.felix.framework.BundleImpl.start(BundleImpl.java:984)

                at
org.apache.sling.installer.core.impl.tasks.BundleStartTask.execute(BundleStartTask.java:97)

                at
org.apache.sling.installer.core.impl.OsgiInstallerImpl.doExecuteTasks(OsgiInstallerImpl.java:894)

                at
org.apache.sling.installer.core.impl.OsgiInstallerImpl.executeTasks(OsgiInstallerImpl.java:729)

                at
org.apache.sling.installer.core.impl.OsgiInstallerImpl.run(OsgiInstallerImpl.java:286)

                at java.lang.Thread.run(Thread.java:745)

Caused by: java.lang.NoClassDefFoundError: com/rsa/asn1/ASN_Exception

                at
com.adobe.fd.signatures.activator.Activator.start(Activator.java:34)

                at
org.apache.felix.framework.util.SecureAction.startActivator(SecureAction.java:697)

                at
org.apache.felix.framework.Felix.activateBundle(Felix.java:2227)

                ... 8 common frames omitted

Caused by: java.lang.ClassNotFoundException: com.rsa.asn1.ASN_Exception not
found by adobe-aemfd-signatures [595]

                at
org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1574)

                at
org.apache.felix.framework.BundleWiringImpl.access$400(BundleWiringImpl.java:79)

                at
org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.loadClass(BundleWiringImpl.java:2018)

                at java.lang.ClassLoader.loadClass(ClassLoader.java:357)

                ... 11 common frames omitted

And as said, I already have the relevant bootdelegation statement in use
and it's even displayed; but it requires a restart and only then everything
is fine.

Jörg




2017-07-10 11:32 GMT+02:00 Bertrand Delacretaz <[hidden email]>:

> Hi Joerg,
>
> On Wed, Jul 5, 2017 at 4:06 PM, Jörg Hoh <[hidden email]> wrote:
> > ...What I did:
> > * Place all files in place
> > * Added my bootdelegation statements to ${sling.home}/sling.properties
> > * started up the instance...
>
> AFAIK if you don't have a pre-existing sling state folder that should
> cause bootdelegation to be set on the first startup of the OSGi
> framework.
>
> Debugging the startup code should help confirm that, and if I'm
> correct it's something else that's preventing your bundle from
> starting.
>
> -Bertrand
>



--
Cheers,
Jörg Hoh,

http://cqdump.wordpress.com
Twitter: @joerghoh
Reply | Threaded
Open this post in threaded view
|

Re: Adding bootdelegation during startup requires restart of instance

Bertrand Delacretaz
Hi Joerg,

On Mon, Jul 10, 2017 at 4:19 PM, Jörg Hoh <[hidden email]> wrote:
> ...as said, I already have the relevant bootdelegation statement in use
> and it's even displayed...

Ok, I got that - my suggestion was to verify, by debugging the Sling
startup code, that that statement is correctly passed to the OSGi
framework on the first startup. I think that should happen in the
org.apache.sling.launchpad.base.impl.Sling class.

-Bertrand