tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "" <>
Subject Re: Embedding Tomcat 7 in Apache OFBiz
Date Thu, 16 Jun 2011 18:14:51 GMT
Thanks Konstantin,

I'm using tomcat 7.0.14 and the code I'm migrate is actually done in this way.
Anyway I will check if it's working with your suggestions and if it's negative 
open a bug.


2011/6/16 <>:
Hi all,

I'm one of the Apache OFBiz committer and I'm trying to migrate our embedded
version of Tomcat 6 to 7 and I have discover a small issue when try to do this

StandardWrapper defaultServlet = new StandardWrapper();
defaultServlet.addInitParameter("debug", "0");
defaultServlet.addInitParameter("listing", "true");

I'll receive an NullPointerException on org.apache.catalina.core.

Any hint to solve it ?

1. What exactly version of Tomcat 7.0.x ?

2. Why are you using this internal Tomcat class? What do you do with
StandardWrapper later?

3. Apparently the line that fails is the following:
(line numbers in the most recent Tomcat version differ from the one
you are mentioning)


I think it fails because parent is null.

So either
a) Add StandardWrapper as a child to a context.

- See StandardContext#createWrapper()
- See
- o.a.c.startup.Tomcat#addServlet(..) (a helper class for embedding Tomcat)
- o.a.c.deploy.WebXml#configureContext(..)
- o.a.c.core.ApplicationContext#addServlet(String, Class)

b) If you want to change Tomcat code, file an issue in Bugzilla.

It should be easy to fix:  do not see why not to add parent!=null
check there. Though I do not know whether it will fail further down
the road.
The same may be said about similar code in removeMapping() method.

Best regards,
Konstantin Kolinko

To unsubscribe, e-mail:
For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message