There is something that I don't understand

My project contains a web.xml file located here

gateway-osgi-1.2.2-SNAPSHOT/WEB-INF/web.xml

including a Listener and Servlet

<listener>

<listener-class>io.apiman.gateway.platforms.war.listeners.WarGatewayBootstrapper</listener-class>
  </listener>

  <!-- Gateway Servlet -->
  <servlet>
    <servlet-name>GatewayServlet</servlet-name>

<servlet-class>io.apiman.gateway.platforms.war.servlets.WarGatewayServlet</servlet-class>
  </servlet>
  <servlet-mapping>
    <servlet-name>GatewayServlet</servlet-name>
    <url-pattern>/*</url-pattern>
  </servlet-mapping>

but the Servlet or Listener are never called by Pax Web (tested with remote
debugger)

[  90] [Active     ] [            ] [       ] [   30] OPS4J Pax Web - API
(3.2.5)
[  91] [Active     ] [            ] [       ] [   30] OPS4J Pax Web -
Service SPI (3.2.5)
[  92] [Active     ] [            ] [       ] [   30] OPS4J Pax Web -
Runtime (3.2.5)
[  93] [Active     ] [            ] [       ] [   30] OPS4J Pax Web - Jetty
(3.2.5)
[  94] [Active     ] [            ] [       ] [   30] OPS4J Pax Web - Jsp
Support (3.2.5)
[  95] [Active     ] [            ] [       ] [   30] OPS4J Pax Web -
Extender - Whiteboard (3.2.5)
[ 244] [Active     ] [            ] [       ] [   30] OPS4J Pax Web -
Extender - WAR (3.2.5)
[ 245] [Active     ] [            ] [       ] [   30] OPS4J Pax Web -
FileInstall Deployer (3.2.5)
[ 246] [Active     ] [            ] [       ] [   30] OPS4J Pax Url - war
(2.4.2)

[ 281] [Active     ] [            ] [       ] [   80] Apiman :: OSGI ::
Gateway Module (1.2.2.SNAPSHOT)

xxxx:karaf@root> web:list
   ID   State         Web-State       Level  Web-ContextPath           Name
[ 281] [Active     ] [Deploying  ]  [   80] [/gateway                ]
Apiman :: OSGI :: Gateway Module (1.2.2.SNAPSHOT)

and of course no error is reported within the log file

Here is the packaging

lr target/gateway-osgi-1.2.2-SNAPSHOT
target/gateway-osgi-1.2.2-SNAPSHOT
target/gateway-osgi-1.2.2-SNAPSHOT/META-INF
target/gateway-osgi-1.2.2-SNAPSHOT/WEB-INF
target/gateway-osgi-1.2.2-SNAPSHOT/WEB-INF/classes
target/gateway-osgi-1.2.2-SNAPSHOT/WEB-INF/classes/META-INF
target/gateway-osgi-1.2.2-SNAPSHOT/WEB-INF/classes/META-INF/MANIFEST.MF
target/gateway-osgi-1.2.2-SNAPSHOT/WEB-INF/classes/io
target/gateway-osgi-1.2.2-SNAPSHOT/WEB-INF/classes/io/apiman
target/gateway-osgi-1.2.2-SNAPSHOT/WEB-INF/classes/io/apiman/gateway
target/gateway-osgi-1.2.2-SNAPSHOT/WEB-INF/classes/io/apiman/gateway/platforms
target/gateway-osgi-1.2.2-SNAPSHOT/WEB-INF/classes/io/apiman/gateway/platforms/war
target/gateway-osgi-1.2.2-SNAPSHOT/WEB-INF/classes/io/apiman/gateway/platforms/war/WarEngineAccessor.class
target/gateway-osgi-1.2.2-SNAPSHOT/WEB-INF/classes/io/apiman/gateway/platforms/war/WarEngineConfig.class
target/gateway-osgi-1.2.2-SNAPSHOT/WEB-INF/classes/io/apiman/gateway/platforms/war/WarGateway.class
target/gateway-osgi-1.2.2-SNAPSHOT/WEB-INF/classes/io/apiman/gateway/platforms/war/WarPlatform.class
target/gateway-osgi-1.2.2-SNAPSHOT/WEB-INF/classes/io/apiman/gateway/platforms/war/WarPlatformAccessor.class
target/gateway-osgi-1.2.2-SNAPSHOT/WEB-INF/classes/io/apiman/gateway/platforms/war/filters
target/gateway-osgi-1.2.2-SNAPSHOT/WEB-INF/classes/io/apiman/gateway/platforms/war/filters/HttpRequestThreadLocalFilter.class
target/gateway-osgi-1.2.2-SNAPSHOT/WEB-INF/classes/io/apiman/gateway/platforms/war/i18n
target/gateway-osgi-1.2.2-SNAPSHOT/WEB-INF/classes/io/apiman/gateway/platforms/war/i18n/Messages.class
target/gateway-osgi-1.2.2-SNAPSHOT/WEB-INF/classes/io/apiman/gateway/platforms/war/listeners
target/gateway-osgi-1.2.2-SNAPSHOT/WEB-INF/classes/io/apiman/gateway/platforms/war/listeners/WarGatewayBootstrapper.class
target/gateway-osgi-1.2.2-SNAPSHOT/WEB-INF/classes/io/apiman/gateway/platforms/war/servlets
target/gateway-osgi-1.2.2-SNAPSHOT/WEB-INF/classes/io/apiman/gateway/platforms/war/servlets/WarGatewayServlet.class

headers 281

Apiman :: OSGI :: Gateway Module (281)
--------------------------------------
Archiver-Version = Plexus Archiver
Web-ContextPath = /gateway
Embed-Transitive = true
Created-By = Apache Maven Bundle Plugin
Manifest-Version = 1.0
Bnd-LastModified = 1454581354797
Build-Jdk = 1.8.0_45
Embed-Dependency = *;artifactId=!junit|mockito-all
Embedded-Artifacts =
WEB-INF/lib/apiman-common-config-1.2.2-SNAPSHOT.jar;g="io.apiman";a="apiman-common-config";
....
Embed-Directory = WEB-INF/lib
Built-By = chmoulli
Tool = Bnd-2.3.0.201405100607
Webapp-Context = /gateway

Bundle-ManifestVersion = 2
Bundle-SymbolicName = io.apiman.gateway-osgi
Bundle-Version = 1.2.2.SNAPSHOT
Bundle-Name = Apiman :: OSGI :: Gateway Module
Bundle-Description = Open Source API Management
Bundle-ClassPath =
.,WEB-INF/classes,WEB-INF/lib/apiman-common-config-1.2.2-SNAPSHOT.jar,WEB-INF/lib/apiman-common-util-1.2.2-SNAPSHOT.jar,...

Require-Capability =
org.ops4j.pax.cdi.extension;filter:=(&(extension=pax-cdi-extension)(version>=0.11)(!(version>=0.12))),
osgi.extender;filter:=(osgi.extender=pax.cdi),
osgi.ee;filter:=(&(osgi.ee=JavaSE)(version=1.6))

Import-Package =
com.codahale.metrics;resolution:=optional,
com.codahale.metrics.health;resolution:=optional,
com.google.protobuf;resolution:=optional,
com.spatial4j.core.context;resolution:=optional,
com.spatial4j.core.context.jts;resolution:=optional,
com.spatial4j.core.exception;resolution:=optional,
com.spatial4j.core.shape;resolution:=optional,

On Thu, Feb 4, 2016 at 9:12 AM, Charles Moulliard <ch0...@gmail.com> wrote:

> I will create a use case as I'm not sure that it work. BTW, the scan
> should be done here not only by Pax Web but also by Pax CDI. This is
> perhaps my issue as there is a Servlet within the project and also CDI
> Annotated classes into the jar files packaged under the WEB-INF/lib
> directory
>
> On Wed, Feb 3, 2016 at 7:32 PM, Achim Nierbeck <bcanh...@googlemail.com>
> wrote:
>
>> Hi,
>>
>> I wouldn't know why it shouldn't work.
>> Pax-Web scans transitive for jsps and tlds in the classpath.
>> AFAIRC this is also done for bean.xml's
>>
>> regards, Achim
>>
>>
>> 2016-02-03 19:25 GMT+01:00 Charles Moulliard <ch0...@gmail.com>:
>>
>>> Hi,
>>>
>>> Can Pax CDI scans a bundle packaged as a WAB where the WEB-INF/lib
>>> folder contains the jar files to be scanned ?
>>>
>>> The Bundle-ClassPath of the manifest file includes the jar files
>>>
>>> Bundle-ClassPath: WEB-INF/classes,.,WEB-INF/lib/annotations-2.0.1.jar,WE
>>>  B-INF/lib/apiman-common-config-1.2.2-SNAPSHOT.jar,WEB-INF/lib/apiman-co
>>>  mmon-plugin-1.2.2-SNAPSHOT.jar, ....
>>>
>>> Require-Capability: org.ops4j.pax.cdi.extension;filter:="(&(extension=pa
>>>  x-cdi-extension)(version>=0.11)(!(version>=0.12)))",osgi.extender;filte
>>>  r:="(osgi.extender=pax.cdi)",osgi.ee;filter:="(&(osgi.ee=JavaSE)(versio
>>>  n=1.6))"
>>> Web-ContextPath: /gateway
>>>
>>> Regards,
>>>
>>> --
>>> Charles Moulliard
>>> Apache Committer & PMC / Architect @RedHat
>>> Twitter : @cmoulliard | Blog :  http://cmoulliard.github.io
>>>
>>>
>>
>>
>> --
>>
>> Apache Member
>> Apache Karaf <http://karaf.apache.org/> Committer & PMC
>> OPS4J Pax Web <http://wiki.ops4j.org/display/paxweb/Pax+Web/> Committer
>> & Project Lead
>> blog <http://notizblog.nierbeck.de/>
>> Co-Author of Apache Karaf Cookbook <http://bit.ly/1ps9rkS>
>>
>> Software Architect / Project Manager / Scrum Master
>>
>>
>
>
> --
> Charles Moulliard
> Apache Committer & PMC / Architect @RedHat
> Twitter : @cmoulliard | Blog :  http://cmoulliard.github.io
>
>


-- 
Charles Moulliard
Apache Committer & PMC / Architect @RedHat
Twitter : @cmoulliard | Blog :  http://cmoulliard.github.io

Reply via email to