You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by Tobias Bocanegra <to...@day.com> on 2008/01/27 00:45:57 UTC

servlet registration

hi,
i'm trying to cope with the new resource resolution, which basically works fine.
but there is probably some startup-sequence issue:

i have a servlet that is registered with a primary type of a node.
just after startup, a request to a node with that primary type shows
the dump of the default servlet. after i restart my bundle that
contains the servlet (stop/start) the next request is then handled by
my servlet.

regards, toby
-- 
-----------------------------------------< tobias.bocanegra@day.com >---
Tobias Bocanegra, Day Management AG, Barfuesserplatz 6, CH - 4001 Basel
T +41 61 226 98 98, F +41 61 226 98 97
-----------------------------------------------< http://www.day.com >---

Re: servlet registration

Posted by Felix Meschberger <fm...@gmail.com>.
Hi,

Am Montag, den 28.01.2008, 09:43 +0100 schrieb Bertrand Delacretaz:
> On Jan 28, 2008 9:27 AM, Felix Meschberger <fm...@gmail.com> wrote:
> 
> > ...So we would have:
> >
> >      .../resources/bundles1 - start level 1 bundles such as logging,
> > sling console and
> >                        OSGi services
> >      .../resources/bundles10 - for Sling infrastructure
> >      .../resources/bundles20 - for extended services like WebDAV
> >      .../resources/bundles30 - for user code
> >
> > WDYT ?
> 
> I like the idea.
> 
> IIUC there's no way to specify a "default start level" in a bundle's
> metadata? That would be useful.

No, there isn't as per the spec because modularization and StartLevel
service are two separated things, yet interconnected ...  And I agree,
that it would be usefull.

Regards
Felix


Re: servlet registration

Posted by Bertrand Delacretaz <bd...@apache.org>.
On Jan 28, 2008 9:27 AM, Felix Meschberger <fm...@gmail.com> wrote:

> ...So we would have:
>
>      .../resources/bundles1 - start level 1 bundles such as logging,
> sling console and
>                        OSGi services
>      .../resources/bundles10 - for Sling infrastructure
>      .../resources/bundles20 - for extended services like WebDAV
>      .../resources/bundles30 - for user code
>
> WDYT ?

I like the idea.

IIUC there's no way to specify a "default start level" in a bundle's
metadata? That would be useful.

-Bertrand

Re: servlet registration

Posted by Felix Meschberger <fm...@gmail.com>.
Hi,

The problem here is, that the JcrResolverFactoryImpl is trying to bind
ServletResourceProvider instances which causes NPEs because the
component is not activated yet.

Am Montag, den 28.01.2008, 09:10 +0100 schrieb Bertrand Delacretaz:
> On Jan 28, 2008 12:13 AM, Felix Meschberger <fm...@gmail.com> wrote:
> 
> > ...The main question is, whether the ServletResolver bundle is launched
> > before or after the bundle containing your servlet....
> 
> Could we make use of OSGi's run levels to better control this?
> Assuming bundles with a lower run levels are always started first, but
> I don't know if that's specified.

That would be one solution, yet it would not be very stable as you
cannot force all users to correctly set start levels. To me start levels
are an instrument for the system administration to be able to control
which services are started or not, just like the run levels in a *nix
system.

If we use start levels to handle dependencies, we have IMHO a problem.

> 
> I'm not sure how we can specify this level when creating bundles, but
> if it's easy we could define some standard run levels, i.e. 10 for
> Sling infrasctructure, 20 for services like WebDAV, 30 for user code,
> etc.

This would make sense from an administrative point of view, and in fact
was the intent initially but was lost over time. We might want to
reintroduce this with specific setup in Launchpad, e.g. by defining
multitple bundle resource folders.

Today we have .../resources/corebundles and .../resources/bundles. To
support start levels we might have .../resources/bundles${level} where
${level} would be the startlevel to be used for the bundles contained.
So we would have:

     .../resources/bundles1 - start level 1 bundles such as logging,
sling console and
                       OSGi services
     .../resources/bundles10 - for Sling infrastructure
     .../resources/bundles20 - for extended services like WebDAV
     .../resources/bundles30 - for user code

WDYT ?

Regards
Felix


Re: servlet registration

Posted by Bertrand Delacretaz <bd...@apache.org>.
On Jan 28, 2008 12:13 AM, Felix Meschberger <fm...@gmail.com> wrote:

> ...The main question is, whether the ServletResolver bundle is launched
> before or after the bundle containing your servlet....

Could we make use of OSGi's run levels to better control this?
Assuming bundles with a lower run levels are always started first, but
I don't know if that's specified.

I'm not sure how we can specify this level when creating bundles, but
if it's easy we could define some standard run levels, i.e. 10 for
Sling infrasctructure, 20 for services like WebDAV, 30 for user code,
etc.

-Bertrand

Re: servlet registration

Posted by Felix Meschberger <fm...@gmail.com>.
Thanks.
Am Montag, den 28.01.2008, 01:06 +0100 schrieb Tobias Bocanegra:
> https://issues.apache.org/jira/browse/SLING-206
> 
> regards, toby
> 
> On 1/28/08, Felix Meschberger <fm...@gmail.com> wrote:
> > Hi Toby,
> >
> > This is strange and I would qualify this a bug. Could you please file an
> > issue in JIRA attaching the output of the "Configuration
> > Status" ( /sling/status ) page to it ?
> >
> > The main question is, whether the ServletResolver bundle is launched
> > before or after the bundle containing your servlet.
> >
> > Regards
> > Felix
> >
> > Am Sonntag, den 27.01.2008, 00:45 +0100 schrieb Tobias Bocanegra:
> > > hi,
> > > i'm trying to cope with the new resource resolution, which basically works fine.
> > > but there is probably some startup-sequence issue:
> > >
> > > i have a servlet that is registered with a primary type of a node.
> > > just after startup, a request to a node with that primary type shows
> > > the dump of the default servlet. after i restart my bundle that
> > > contains the servlet (stop/start) the next request is then handled by
> > > my servlet.
> > >
> > > regards, toby
> >
> >
> 
> 


Re: servlet registration

Posted by Tobias Bocanegra <to...@day.com>.
https://issues.apache.org/jira/browse/SLING-206

regards, toby

On 1/28/08, Felix Meschberger <fm...@gmail.com> wrote:
> Hi Toby,
>
> This is strange and I would qualify this a bug. Could you please file an
> issue in JIRA attaching the output of the "Configuration
> Status" ( /sling/status ) page to it ?
>
> The main question is, whether the ServletResolver bundle is launched
> before or after the bundle containing your servlet.
>
> Regards
> Felix
>
> Am Sonntag, den 27.01.2008, 00:45 +0100 schrieb Tobias Bocanegra:
> > hi,
> > i'm trying to cope with the new resource resolution, which basically works fine.
> > but there is probably some startup-sequence issue:
> >
> > i have a servlet that is registered with a primary type of a node.
> > just after startup, a request to a node with that primary type shows
> > the dump of the default servlet. after i restart my bundle that
> > contains the servlet (stop/start) the next request is then handled by
> > my servlet.
> >
> > regards, toby
>
>


-- 
-----------------------------------------< tobias.bocanegra@day.com >---
Tobias Bocanegra, Day Management AG, Barfuesserplatz 6, CH - 4001 Basel
T +41 61 226 98 98, F +41 61 226 98 97
-----------------------------------------------< http://www.day.com >---

Re: servlet registration

Posted by Felix Meschberger <fm...@gmail.com>.
Hi Toby,

This is strange and I would qualify this a bug. Could you please file an
issue in JIRA attaching the output of the "Configuration
Status" ( /sling/status ) page to it ?

The main question is, whether the ServletResolver bundle is launched
before or after the bundle containing your servlet.

Regards
Felix

Am Sonntag, den 27.01.2008, 00:45 +0100 schrieb Tobias Bocanegra:
> hi,
> i'm trying to cope with the new resource resolution, which basically works fine.
> but there is probably some startup-sequence issue:
> 
> i have a servlet that is registered with a primary type of a node.
> just after startup, a request to a node with that primary type shows
> the dump of the default servlet. after i restart my bundle that
> contains the servlet (stop/start) the next request is then handled by
> my servlet.
> 
> regards, toby