please have a look of the SCR metadata for your servlet is generated and part 
of the JAR file. look for a file OSGI-INF\<server-class>.xml.

if it does not exist check your maven configuration of maven-bundle-plugin.
afaik bnd only generates the SCR metadata for OSGI annotations if the 
properties _dsannotations and _metatypeannotations are set. see [1] for an 
example.

additionaly check in the XML file if your array of paths is generated correctly 
- i'm not sure if it is correct to have two "sling.servlet.paths" property 
entries to achieve this.

stefan

[1] 
https://github.com/wcm-io/wcm-io-tooling/blob/develop/maven/aem-global-parent/pom.xml#L238


>-----Original Message-----
>From: Júnior [mailto:[email protected]]
>Sent: Monday, November 28, 2016 12:19 PM
>To: [email protected]
>Subject: Sling Servlet using OSGI R6 annotations
>
>Hi,
>
>I'm trying to register a servlet using the OSGI r6 annotations but It is
>not working.
>
>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*
>
>*)*
>
>
>But When I use the @SlingServlet annotation it works:
>
>*@SlingServlet(paths={"/system/mypath1", "/system/mypath2"},
>methods={"GET"})*
>
>Am I missing some configuration?
>
>Does someone have an example of this kind of configuration?
>
>Thanks
>--
>Francisco Ribeiro
>*SCEA|SCJP|SCWCD|IBM Certified SOA Associate*

Reply via email to