You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Delian Krustev <to...@krustev.net> on 2008/01/28 00:42:44 UTC

Null pointer in manager web app. Tomcat 6.0.14

	Hi,

This seems to happen when there is a broken WAR inside a vhost.
Other vhosts work fine at the same time.

2008-01-27 23:21:07.556049500 INFO: HTMLManager: list: Listing contexts for virtual host 'DOMAIN'
2008-01-27 23:21:07.556050500 Jan 27, 2008 11:21:07 PM org.apache.catalina.core.StandardWrapperValve invoke
2008-01-27 23:21:07.556052500 SEVERE: Servlet.service() for servlet HTMLManager threw exception
2008-01-27 23:21:07.556053500 java.lang.NullPointerException
2008-01-27 23:21:07.556054500   at org.apache.catalina.manager.HTMLManagerServlet.list(HTMLManagerServlet.java:437)
2008-01-27 23:21:07.556068500   at org.apache.catalina.manager.HTMLManagerServlet.doGet(HTMLManagerServlet.java:136)
2008-01-27 23:21:07.556070500   at javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
2008-01-27 23:21:07.556071500   at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
2008-01-27 23:21:07.556072500   at sun.reflect.GeneratedMethodAccessor274.invoke(Unknown Source)
2008-01-27 23:21:07.556073500   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
2008-01-27 23:21:07.556079500   at java.lang.reflect.Method.invoke(Method.java:597)
2008-01-27 23:21:07.556080500   at org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:244)
2008-01-27 23:21:07.556082500   at java.security.AccessController.doPrivileged(Native Method)
2008-01-27 23:21:07.556083500   at javax.security.auth.Subject.doAsPrivileged(Subject.java:517)
2008-01-27 23:21:07.556091500   at org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:276)
2008-01-27 23:21:07.556093500   at org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:162)
2008-01-27 23:21:07.556094500   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:283)
2008-01-27 23:21:07.556096500   at org.apache.catalina.core.ApplicationFilterChain.access$000(ApplicationFilterChain.java:56)
2008-01-27 23:21:07.556102500   at org.apache.catalina.core.ApplicationFilterChain$1.run(ApplicationFilterChain.java:189)
2008-01-27 23:21:07.556103500   at java.security.AccessController.doPrivileged(Native Method)
2008-01-27 23:21:07.556104500   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:185)
2008-01-27 23:21:07.556106500   at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
2008-01-27 23:21:07.556112500   at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
2008-01-27 23:21:07.556113500   at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:525)
2008-01-27 23:21:07.556115500   at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
2008-01-27 23:21:07.556116500   at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
2008-01-27 23:21:07.556150500   at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
2008-01-27 23:21:07.556151500   at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:263)
2008-01-27 23:21:07.556153500   at org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:190)
2008-01-27 23:21:07.556154500   at org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:283)
2008-01-27 23:21:07.556160500   at org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:767)
2008-01-27 23:21:07.556161500   at org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:697)
2008-01-27 23:21:07.556163500   at org.apache.jk.common.ChannelSocket$SocketConnection.runIt(ChannelSocket.java:889)
2008-01-27 23:21:07.556164500   at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:690)
2008-01-27 23:21:07.556170500   at java.lang.Thread.run(Thread.java:619)

It is Tomcat 6.0.14 started with its security manager enabled.

The host configuration is as follows:

<Host
        deployXML="false"
        deployOnStartup="false"
        autoDeploy="false"
        unpackWARs="false"
        appBase="/home/USER/web-root"
        workDir="work/Catalina/USER/DOMAIN"
        name="DOMAIN">

    <Alias>www.DOMAIN</Alias>

        <Context
                path=""
                docBase="/home/USER/web-root"
                privileged="false"
        />

        <Context
                path="/BROKENWAR"
                docBase="/home/USER/web-root/BROKENWAR.war"
                privileged="false"
        />

        <Context
                path="/MANAGER"
                docBase="/home/tomcat/default/webapps/manager"
                privileged="true"
        />
</Host>



Cheers
--
Delian

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Null pointer in manager web app. Tomcat 6.0.14

Posted by Hassan Schroeder <ha...@gmail.com>.
On Jan 28, 2008 11:34 AM, Delian Krustev <to...@krustev.net> wrote:

> > having a docBase == appBase is totally  wrong, and /will/ cause ugly
> problems.

> It doesn't cause any problems.

And yet you're reporting one :-)

> My post is actually a bug report. Not a question.

I'd think it hard to claim some behavior constitutes a bug when you've
deliberately misconfigured your server, but whatever. Best of luck :-)

-- 
Hassan Schroeder ------------------------ hassan.schroeder@gmail.com

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Null pointer in manager web app. Tomcat 6.0.14

Posted by Delian Krustev <to...@krustev.net>.
On Mon, 28 Jan 2008 22:01:37 +0000 Mark Thomas wrote:
> With your specific configuration you might be OK but appBase==docBase is
> something that usually always cause pain.

Yes, *usually*. And I'm aware of this ;)

> My main concern is making sure 
> that people reading this thread in the archives don't go away thinking that
> appBase==docBase is ever a good idea.

People tend to omit the docs. Taking care for random zealots pasting 
configuration from mailings lists might be a waste of time though.

> I replied a few hours after you sent the message asking you for more info.
> Looks like it didn't get through. I'll re-send it.

I got it this time and will look at it.


Cheers
--
Delian


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Null pointer in manager web app. Tomcat 6.0.14

Posted by Mark Thomas <ma...@apache.org>.
Delian Krustev wrote:
>> appBase == docBase is unsupported. Period. The servlet spec allows (might
>> even be requires I don't recall off-hand) any directory to treated as a
>> webapp so as soon as you have an WAR exploded into the appBase you end up
>> with multiple contexts which will cause problems.
> 
> I don't see a conflict here.
Using appBase==docBase with expanded apps causes unexpected context 
mappings. If you want to test it, set appBase==docBase, put an expanded 
ROOT webapp in the appBase and then look in the manager app to see how many 
contexts you have. There will be one for each directory in the appBase.

> Have you looked at the configuration I've posted ?
Yes.

> 	workDir="work/Catalina/USER/DOMAIN"
> 
> Wars are expanded in the work dir, which is not anywhere under the appBase
With your config, WARs shouldn't be expanded anywhere. I assume you mean 
JSPs are compiled in the work dir since you don't appear to be using any of 
the anti-locking features that would otherwise cause things to be expanded 
in the work dir.

> appBase in my case is completely irrelevant. I could point it to anywhere and 
> it won't make any difference.
With your specific configuration you might be OK but appBase==docBase is 
something that usually always cause pain. My main concern is making sure 
that people reading this thread in the archives don't go away thinking that 
appBase==docBase is ever a good idea.

> BTW, Mark. Still haven't received a reply from you on the Juli CVE issue. Have 
> you received my message, stating the fix is not sufficient ?
I replied a few hours after you sent the message asking you for more info. 
Looks like it didn't get through. I'll re-send it.

Mark


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Null pointer in manager web app. Tomcat 6.0.14

Posted by Delian Krustev <to...@krustev.net>.
On Mon, 28 Jan 2008 20:16:14 +0000 Mark Thomas wrote:
> Delian Krustev wrote:
> > I'm pretty sure
> > there is a functionality which could not be achieved otherwise, although
> > I could not remember which one at this very moment.
>
> No, there isn't. If there is, that is a bug that needs to be fixed.
>
> > It doesn't cause any problems. And has been working since the early 6.0.x
> > releases. Some problems might appear if you have some sort of automatic
> > deployment/reloading.
>
> appBase == docBase is unsupported. Period. The servlet spec allows (might
> even be requires I don't recall off-hand) any directory to treated as a
> webapp so as soon as you have an WAR exploded into the appBase you end up
> with multiple contexts which will cause problems.

I don't see a conflict here.

Have you looked at the configuration I've posted ?

	workDir="work/Catalina/USER/DOMAIN"

Wars are expanded in the work dir, which is not anywhere under the appBase

Additionally:

	unpackWARs="false"
        deployXML="false"
        deployOnStartup="false"
        autoDeploy="false"


> You need to fix your configuration.

appBase in my case is completely irrelevant. I could point it to anywhere and 
it won't make any difference.

Well, I'm not sure I'll find the time to experiment with the contexts in 
separate files especially when it did not work for me. I'm sorry I haven't 
filed a bug report then. 

I'd prefer to spend more time with my 12 days old daughter than chasing tomcat 
bugs ;)

> Those NPEs have been fixed in svn and will be in the next release.

Here we go. Thank you :-)

BTW, Mark. Still haven't received a reply from you on the Juli CVE issue. Have 
you received my message, stating the fix is not sufficient ?


Cheers
--
Delian

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Null pointer in manager web app. Tomcat 6.0.14

Posted by Mark Thomas <ma...@apache.org>.
Delian Krustev wrote:
> On Sun, 27 Jan 2008 16:01:28 -0800 Hassan Schroeder wrote:
>> Aside from the fact that putting Context elements in server.xml is
>> strongly discouraged
> 
> I'm pretty sure 
> there is a functionality which could not be achieved otherwise, although I 
> could not remember which one at this very moment.
No, there isn't. If there is, that is a bug that needs to be fixed.

> It doesn't cause any problems. And has been working since the early 6.0.x 
> releases. Some problems might appear if you have some sort of automatic 
> deployment/reloading.

appBase == docBase is unsupported. Period. The servlet spec allows (might 
even be requires I don't recall off-hand) any directory to treated as a 
webapp so as soon as you have an WAR exploded into the appBase you end up 
with multiple contexts which will cause problems.

You need to fix your configuration.

> My post is actually a bug report. Not a question.
Those NPEs have been fixed in svn and will be in the next release.

Mark


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Null pointer in manager web app. Tomcat 6.0.14

Posted by Delian Krustev <to...@krustev.net>.
On Sun, 27 Jan 2008 16:01:28 -0800 Hassan Schroeder wrote:
> Aside from the fact that putting Context elements in server.xml is
> strongly discouraged

Various people tend to claim the same thing on this list. I'm pretty sure 
there is a functionality which could not be achieved otherwise, although I 
could not remember which one at this very moment. I've been doing 
conf/Catalina/HOST/CONTEXT.xml stuff for some time and  reverted back to the 
Contexts defined in server.xml . 
I want the automatic reloads/deployment completely disabled and it might have 
been something related with it.

> having a docBase == appBase is totally  wrong, and /will/ cause ugly 
problems.
>
> >         <Context
> >                 path=""
> >                 docBase="/home/USER/web-root"


It doesn't cause any problems. And has been working since the early 6.0.x 
releases. Some problems might appear if you have some sort of automatic 
deployment/reloading.

My post is actually a bug report. Not a question.


Cheers
--
Delian

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Null pointer in manager web app. Tomcat 6.0.14

Posted by Hassan Schroeder <ha...@gmail.com>.
On Jan 27, 2008 3:42 PM, Delian Krustev <to...@krustev.net> wrote:

> It is Tomcat 6.0.14 started with its security manager enabled.
>
> The host configuration is as follows:
>
> <Host

>         appBase="/home/USER/web-root"

Aside from the fact that putting Context elements in server.xml is
strongly discouraged, having a docBase == appBase is totally
wrong, and /will/ cause ugly problems.

>         <Context
>                 path=""
>                 docBase="/home/USER/web-root"

-- 
Hassan Schroeder ------------------------ hassan.schroeder@gmail.com

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org