[PAX-WEB] Warning "failed to parse and instantiate of javax.servlet.ServletContainerInitializer in classpath"

714 views
Skip to first unread message

Jan Van den Bergh

unread,
Oct 2, 2015, 7:54:44 AM10/2/15
to OPS4J
Hi,

When we start up our OSGi container, we get the warning  "failed to parse and instantiate of javax.servlet.ServletContainerInitializer in classpath". Upon investigation it seems the following is happening:
  • The JettyServerWrapper.addContext() method goes over all the imported bundles (transitively) and checks if they define a javax.servlet.ServletContainerInitializer file.
  • All classes referred to in this file are loaded by the class loader of (a) the bundle itself or (b) the jetty bundle. 
  • However, the referred class is loaded from a transitive bundle and is not directly imported by our bundle. As such it cannot be found by the classloader of the bundle.
How can we resolve this problem? We are using pax-web 4.2.1.

Kind regards,

Jan Van den Bergh

Achim Nierbeck

unread,
Oct 5, 2015, 7:51:10 AM10/5/15
to op...@googlegroups.com
Hi Jan, 

you can resolve this issue by making sure the class is available to the Bundle that actually contains this ServletContainerInitializer file. 
Or you make sure this file doesn't a) contain the reference to that class or doesn't exist at all. 
Cause why would you like to have a ServletContainerInitializer available in your web-application but keep the Class out of reach?

regards, Achim 



--
--
------------------
OPS4J - http://www.ops4j.org - op...@googlegroups.com

---
You received this message because you are subscribed to the Google Groups "OPS4J" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ops4j+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--

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 

Jan Van den Bergh

unread,
Oct 22, 2015, 5:39:14 AM10/22/15
to OPS4J
Hi,

In the end we simply removed the warning in our logging configuration. Everything works fine, but having the warning in the log could upset our customers.

Jan.

Op maandag 5 oktober 2015 13:51:10 UTC+2 schreef Achim Nierbeck:
Reply all
Reply to author
Forward
0 new messages