You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by Robert Munteanu <ro...@apache.org> on 2015/08/04 12:24:56 UTC

SlingRepositoryServer configuration no longer picked up after moving org.apache.sling.installer.factory.configuration to boot feature

Hi,

(sorry for the long email, I'm unable to condense the problem description more)

After my changes for SLING-4556 [1] the Jackrabbit-based launchpad no
longer starts the repository. Those changes have been reverted but I'd
like to bring them back in a way that works for both Jackrabbit and
Jackrabbit Oak .

My understanding of what happens is:

1. org.apache.sling.jcr.jackrabbit.server.impl.Activator [2] creates a
default config for the
org.apache.sling.jcr.jackrabbit.server.SlingServerRepository component
if none is available
2. That component [3] requires a ConfigurationPolicy so once it's
available the repository is started
3. With my changes the configuration is not detected ( by the SCR
Runtime ? ) when created so the repository is not started. It's not
present in the web console either ( Status -> Configurations )
However, using the ConfigAdmin Java API to list the matching
configurations finds that config.
4. The failure occurs on a fresh install only. When restarting the
Sling instance, a second configuration is created and the repository
is started.

I have tried

- moving the default config creation to a SCR component
- delaying the config creation until after the bundle is started
- moving the default configuration to the provisioning model instead
but there is some logic in the code that I can't emulate ( creation of
a directory for jackrabbit )

but none of this worked. I _could_ try creating another bundle which
controls the config creation and start at a later start level, but I
really don't like it as it works around an issue I don't fully
understand.

Any help in understanding what goes on would be appreciated.

Thanks,

Robert


[1]: https://svn.apache.org/r1693392
[2]:http://svn.apache.org/repos/asf/sling/trunk/bundles/jcr/jackrabbit-server/src/main/java/org/apache/sling/jcr/jackrabbit/server/impl/Activator.java
[3]: http://svn.apache.org/repos/asf/sling/trunk/bundles/jcr/jackrabbit-server/src/main/java/org/apache/sling/jcr/jackrabbit/server/impl/SlingServerRepositoryManager.java

Re: SlingRepositoryServer configuration no longer picked up after moving org.apache.sling.installer.factory.configuration to boot feature

Posted by Robert Munteanu <ro...@apache.org>.
On Tue, 2015-08-04 at 17:13 +0200, Bertrand Delacretaz wrote:
> On Tue, Aug 4, 2015 at 4:56 PM, Bertrand Delacretaz
> <bd...@apache.org> wrote:
> > 
> > ...It looks like it is started, but for some reason (interaction 
> > with the
> > config writeback??) the OSGi installer then deletes its config...
> 
> Definitely an issue with the ConfigRemoveTask that's triggered
> wrongly, apparently right after the installer writes back the config
> to the repository which just appeared. I have created
> https://issues.apache.org/jira/browse/SLING-4925 to track this.

Great find, thanks for looking into this!

Robert


Re: SlingRepositoryServer configuration no longer picked up after moving org.apache.sling.installer.factory.configuration to boot feature

Posted by Bertrand Delacretaz <bd...@apache.org>.
On Tue, Aug 4, 2015 at 4:56 PM, Bertrand Delacretaz
<bd...@apache.org> wrote:
>
> ...It looks like it is started, but for some reason (interaction with the
> config writeback??) the OSGi installer then deletes its config...

Definitely an issue with the ConfigRemoveTask that's triggered
wrongly, apparently right after the installer writes back the config
to the repository which just appeared. I have created
https://issues.apache.org/jira/browse/SLING-4925 to track this.

-Bertrand

Re: SlingRepositoryServer configuration no longer picked up after moving org.apache.sling.installer.factory.configuration to boot feature

Posted by Bertrand Delacretaz <bd...@apache.org>.
Hi,

> On Tue, Aug 4, 2015 at 12:24 PM, Robert Munteanu <ro...@apache.org> wrote:
>> ...3. With my changes the configuration is not detected ( by the SCR
>> Runtime ? ) when created so the repository is not started...

It looks like it is started, but for some reason (interaction with the
config writeback??) the OSGi installer then deletes its config, here's
what I see in error.log on a fresh startup:

$ egrep 'verifyConfig|SlingServer.*REGISTERED|Deleted.*SlingServer|Repository
has been' sling/logs/error.log

04.08.2015 16:36:32.198 *INFO* [OsgiInstallerImpl]
org.apache.sling.jcr.jackrabbit.server.impl.Activator
verifyConfiguration: Created configuration
org.apache.sling.jcr.jackrabbit.server.SlingServerRepository.98b4bd1c-11f8-49e7-a5ed-684abf3acfc6
for org.apache.sling.jcr.jackrabbit.server.SlingServerRepository

04.08.2015 16:36:37.482 *INFO* [OsgiInstallerImpl]
org.apache.sling.jcr.jackrabbit.server Service
[org.apache.sling.jcr.jackrabbit.server.SlingServerRepository.98b4bd1c-11f8-49e7-a5ed-684abf3acfc6,229,
[org.apache.sling.jcr.api.SlingRepository, javax.jcr.Repository,
org.apache.jackrabbit.api.management.RepositoryManager]] ServiceEvent
REGISTERED

04.08.2015 16:36:38.783 *INFO* [CM Event Dispatcher (Fire
ConfigurationEvent:
pid=org.apache.sling.jcr.jackrabbit.server.SlingServerRepository.98b4bd1c-11f8-49e7-a5ed-684abf3acfc6)]
org.apache.jackrabbit.core.RepositoryImpl Repository has been shutdown

04.08.2015 16:45:25.610 *INFO* [OsgiInstallerImpl]
org.apache.sling.audit.osgi.installer Deleted configuration
org.apache.sling.jcr.jackrabbit.server.SlingServerRepository.org.apache.sling.jcr.jackrabbit.server.SlingServerRepository.98b4bd1c-11f8-49e7-a5ed-684abf3acfc6
from resource TaskResource(url=jcrinstall:/apps/sling/install/org.apache.sling.jcr.jackrabbit.server.SlingServerRepository-98b4bd1c-11f8-49e7-a5ed-684abf3acfc6.config,
entity=config:org.apache.sling.jcr.jackrabbit.server.SlingServerRepository.org.apache.sling.jcr.jackrabbit.server.SlingServerRepository.98b4bd1c-11f8-49e7-a5ed-684abf3acfc6,
state=UNINSTALL,
attributes=[service.factoryPid=org.apache.sling.jcr.jackrabbit.server.SlingServerRepository,
installation.hint=launchpad:resources/install.jackrabbit/15/org.apache.sling.jcr.jackrabbit.server-2.2.1-SNAPSHOT.jar,
resource.uri.hint=org.apache.sling.jcr.jackrabbit.server.SlingServerRepository-98b4bd1c-11f8-49e7-a5ed-684abf3acfc6,
service.pid=org.apache.sling.jcr.jackrabbit.server.SlingServerRepository.98b4bd1c-11f8-49e7-a5ed-684abf3acfc6],
digest=588c513978ea07a8a9091048913e231e)

I'm still digging deeper to find out why that happens...

-Bertrand

Re: SlingRepositoryServer configuration no longer picked up after moving org.apache.sling.installer.factory.configuration to boot feature

Posted by Bertrand Delacretaz <bd...@apache.org>.
Hi Robert,

On Tue, Aug 4, 2015 at 12:24 PM, Robert Munteanu <ro...@apache.org> wrote:
> ...3. With my changes the configuration is not detected ( by the SCR
> Runtime ? ) when created so the repository is not started...

I'm testing with your revision 1693392, the repository does come up
after manually restarting the org.apache.sling.jcr.jackrabbit.server
bundle - looks like some wrong timing/startup order assumptions
somewhere. I'll dig deeper.

-Bertrand