It worked:

I needed to add the configurations Stefan said and updated the maven-plugin
to use the version 3.2.0.

And after that, using the configurations Steven sent the servlet started
working.

Thanks for all your help :)

2016-11-28 11:19 GMT-02:00 Steven Walters <[email protected]>:

> >Follow the configurations I am using:
> >
> >R6
> >
> >*@Component(service=Servlet.class,*
> >
> >*property = { *
> >
> >*     "sling.servlet.methods=GET",*
> >
> >*     "sling.servlet.paths=/system/mypath1",*
> >
> >*     "sling.servlet.paths=/system/mypath2",*
> >
> >*   },*
> >
> >*immediate=true*
> >
> >*)*
> >
> >
> >Am I missing some configuration?
> >
> >Does someone have an example of this kind of configuration?
>
> Updating an example project I already had on using OSGi R6, I was able
> to pretty much get the code you pasted to work as is at [1], with pom
> at [2].
>
> You should also make sure that you have "SCR (Declarative Services)"
> (according to the felix webconsole this is "Apache Felix Declarative
> Services (org.apache.felix.scr)") of version 2.x active within your
> OSGi framework (I'm currently running with outdated 2.0.2), as this is
> also required for R6 support.
>
> when I first used R6, I did try with maven-bundle-plugin 3.0.1, but
> there were some issues with it around the use of
> @ObjectClassDefinition.
> This issue was was fixed later (due to an update of underlying bnd),
> so was worth upgrading to 3.2.0 for.
>
> [1] https://github.com/kemuri-9/samples/blob/master/ds-
> annotations/src/main/java/net/kemuri9/samples/dsannotations/
> impl/SimpleSlingServlet.java
> [2] https://github.com/kemuri-9/samples/blob/master/ds-annotations/pom.xml
>



-- 
Francisco Ribeiro
*SCEA|SCJP|SCWCD|IBM Certified SOA Associate*

Reply via email to