You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by "bzbridge@dslextreme.com" <bz...@dslextreme.com> on 2003/12/12 19:47:01 UTC

JK2 and NoClassDefFoundError of HttpMessages

Hi,

I am trying Tomcat 5.0.16 with mod_jk2v2.0.2, Apache 2.0.47 on Fodora
Linux Core1.

When I start Tomcat without -security, I have no problem.
When I start Tomcat with -security and I use
domain_name:8080/servlet/ListRoomsServlet, again I have no problem
(ListRoomsServlet is the servlet I am trying).

When I start Tomcat with -security and use
domain_name/servlet/ListRoomsServlet, I have the next error message:

exception

javax.servlet.ServletException: org/apache/tomcat/util/http/HttpMessages
	org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:324)
	org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:200)


root cause

java.lang.NoClassDefFoundError: org/apache/tomcat/util/http/HttpMessages
	org.apache.jk.server.JkCoyoteHandler.appendHead(JkCoyoteHandler.java:350)
	org.apache.jk.server.JkCoyoteHandler.action(JkCoyoteHandler.java:402)
	org.apache.coyote.Response.action(Response.java:226)
	org.apache.coyote.Response.sendHeaders(Response.java:418)
	org.apache.jk.server.JkCoyoteHandler.doWrite(JkCoyoteHandler.java:240)
	org.apache.coyote.Response.doWrite(Response.java:586)
	org.apache.coyote.tomcat5.OutputBuffer.realWriteBytes(OutputBuffer.java:405)
	org.apache.tomcat.util.buf.ByteChunk.flushBuffer(ByteChunk.java:428)
	org.apache.coyote.tomcat5.OutputBuffer.doFlush(OutputBuffer.java:361)
	org.apache.coyote.tomcat5.OutputBuffer.close(OutputBuffer.java:325)
	org.apache.coyote.tomcat5.CoyoteWriter.close(CoyoteWriter.java:130)
	ListRoomsServlet.doGet(ListRoomsServlet.java:714)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:743)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
	sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	java.lang.reflect.Method.invoke(Method.java:324)
	org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:284)
	java.security.AccessController.doPrivileged(Native Method)
	javax.security.auth.Subject.doAsPrivileged(Subject.java:500)
	org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:306)
	org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:200)

Is there something I might forget to add to classpath or to add conf/catalina.policy?
Thank you in advance.

Sam



---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Re: JK2 and NoClassDefFoundError of HttpMessages

Posted by "bzbridge@dslextreme.com" <bz...@dslextreme.com>.
I found the cause: around the end of my servlet, I had put

out.close();

(where out is PrintWriter object obtained from response)

I deleted out.close(), and now my servlet works with -security even if
I load the servlet first.

I did not have this problem with Tomcat 4.x. It was strange, but
sometimes occurs at upgrade of application servers.

Sam

bzbridge@dslextreme.com wrote:

> Thank you for reply.
> I found that Tomcat servlet examples work with -security option on 
> Fedora.
> So my web application should work with -security option.
>
> After I load Tomcat servlet examples first, I can immediately see my 
> web application from my browser.
> But when I try to load my web application first, I cannot see it and 
> get the error message.
> There is something wrong for the configuration of my web application.
>
> I hope I will find the problem.
>
> Sam
>
>
>
> Yansheng Lin wrote:
>
>> Hi,
>> You got it working yet? It seems you are having trouble using apache 
>> as the
>> server. You said when you use domainname:8080/something, you can see 
>> the pages,
>> but not domainname/something. That's because Tomcat is serving the pages
>> instead of Apache.
>>
>> I need to go home to test this on Fedora, but in your 
>> conf/workers2.properties
>> file, you need to specify a connection between apache and tomcat, 
>> much like the
>> example from the other thread:
>>
>> --------------------------------
>> [uri:/examples/*]
>> info=tomcat examples
>> context=/examples
>> worker=ajp13:localhost:8009
>> debug=0
>> --------------------------------
>>
>> Hope this helps.
>>
>> -----Original Message-----
>> From: bzbridge@dslextreme.com [mailto:bzbridge@dslextreme.com] Sent: 
>> Friday, December 12, 2003 11:47 AM
>> To: tomcat-user@jakarta.apache.org
>> Subject: JK2 and NoClassDefFoundError of HttpMessages
>>
>>
>> Hi,
>>
>> I am trying Tomcat 5.0.16 with mod_jk2v2.0.2, Apache 2.0.47 on Fodora
>> Linux Core1.
>>
>> When I start Tomcat without -security, I have no problem.
>> When I start Tomcat with -security and I use
>> domain_name:8080/servlet/ListRoomsServlet, again I have no problem
>> (ListRoomsServlet is the servlet I am trying).
>>
>> When I start Tomcat with -security and use
>> domain_name/servlet/ListRoomsServlet, I have the next error message:
>>
>> exception
>>
>> javax.servlet.ServletException: org/apache/tomcat/util/http/HttpMessages
>> org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:324)
>>
>> org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:200) 
>>
>>
>>
>> root cause
>>
>> java.lang.NoClassDefFoundError: org/apache/tomcat/util/http/HttpMessages
>>
>> org.apache.jk.server.JkCoyoteHandler.appendHead(JkCoyoteHandler.java:350) 
>>
>> org.apache.jk.server.JkCoyoteHandler.action(JkCoyoteHandler.java:402)
>> org.apache.coyote.Response.action(Response.java:226)
>> org.apache.coyote.Response.sendHeaders(Response.java:418)
>> org.apache.jk.server.JkCoyoteHandler.doWrite(JkCoyoteHandler.java:240)
>> org.apache.coyote.Response.doWrite(Response.java:586)
>>
>> org.apache.coyote.tomcat5.OutputBuffer.realWriteBytes(OutputBuffer.java:405) 
>>
>> org.apache.tomcat.util.buf.ByteChunk.flushBuffer(ByteChunk.java:428)
>> org.apache.coyote.tomcat5.OutputBuffer.doFlush(OutputBuffer.java:361)
>> org.apache.coyote.tomcat5.OutputBuffer.close(OutputBuffer.java:325)
>> org.apache.coyote.tomcat5.CoyoteWriter.close(CoyoteWriter.java:130)
>> ListRoomsServlet.doGet(ListRoomsServlet.java:714)
>> javax.servlet.http.HttpServlet.service(HttpServlet.java:743)
>> javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
>> sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>
>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) 
>>
>>
>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.jav 
>>
>> a:25)
>> java.lang.reflect.Method.invoke(Method.java:324)
>> org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:284)
>> java.security.AccessController.doPrivileged(Native Method)
>> javax.security.auth.Subject.doAsPrivileged(Subject.java:500)
>> org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:306)
>>
>> org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:200) 
>>
>>
>> Is there something I might forget to add to classpath or to add
>> conf/catalina.policy?
>> Thank you in advance.
>>
>> Sam
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
>> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
>> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>>
>>
>>
>>
>>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>
>
>



---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Re: JK2 and NoClassDefFoundError of HttpMessages

Posted by "bzbridge@dslextreme.com" <bz...@dslextreme.com>.
Thank you for reply.
I found that Tomcat servlet examples work with -security option on Fedora.
So my web application should work with -security option.

After I load Tomcat servlet examples first, I can immediately see my web 
application from my browser.
But when I try to load my web application first, I cannot see it and get 
the error message.
There is something wrong for the configuration of my web application.

I hope I will find the problem.

Sam



Yansheng Lin wrote:

>Hi, 
>
>You got it working yet?  It seems you are having trouble using apache as the
>server.  You said when you use domainname:8080/something, you can see the pages,
>but not domainname/something.  That's because  Tomcat is serving the pages
>instead of Apache.
>
>I need to go home to test this on Fedora, but in your conf/workers2.properties
>file, you need to specify a connection between apache and tomcat, much like the
>example from the other thread:
>
>--------------------------------
>[uri:/examples/*]
>info=tomcat examples
>context=/examples
>worker=ajp13:localhost:8009
>debug=0
>--------------------------------
>
>Hope this helps.
>
>-----Original Message-----
>From: bzbridge@dslextreme.com [mailto:bzbridge@dslextreme.com] 
>Sent: Friday, December 12, 2003 11:47 AM
>To: tomcat-user@jakarta.apache.org
>Subject: JK2 and NoClassDefFoundError of HttpMessages
>
>
>Hi,
>
>I am trying Tomcat 5.0.16 with mod_jk2v2.0.2, Apache 2.0.47 on Fodora
>Linux Core1.
>
>When I start Tomcat without -security, I have no problem.
>When I start Tomcat with -security and I use
>domain_name:8080/servlet/ListRoomsServlet, again I have no problem
>(ListRoomsServlet is the servlet I am trying).
>
>When I start Tomcat with -security and use
>domain_name/servlet/ListRoomsServlet, I have the next error message:
>
>exception
>
>javax.servlet.ServletException: org/apache/tomcat/util/http/HttpMessages
>	org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:324)
>	
>org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:200)
>
>
>root cause
>
>java.lang.NoClassDefFoundError: org/apache/tomcat/util/http/HttpMessages
>	
>org.apache.jk.server.JkCoyoteHandler.appendHead(JkCoyoteHandler.java:350)
>	org.apache.jk.server.JkCoyoteHandler.action(JkCoyoteHandler.java:402)
>	org.apache.coyote.Response.action(Response.java:226)
>	org.apache.coyote.Response.sendHeaders(Response.java:418)
>	org.apache.jk.server.JkCoyoteHandler.doWrite(JkCoyoteHandler.java:240)
>	org.apache.coyote.Response.doWrite(Response.java:586)
>	
>org.apache.coyote.tomcat5.OutputBuffer.realWriteBytes(OutputBuffer.java:405)
>	org.apache.tomcat.util.buf.ByteChunk.flushBuffer(ByteChunk.java:428)
>	org.apache.coyote.tomcat5.OutputBuffer.doFlush(OutputBuffer.java:361)
>	org.apache.coyote.tomcat5.OutputBuffer.close(OutputBuffer.java:325)
>	org.apache.coyote.tomcat5.CoyoteWriter.close(CoyoteWriter.java:130)
>	ListRoomsServlet.doGet(ListRoomsServlet.java:714)
>	javax.servlet.http.HttpServlet.service(HttpServlet.java:743)
>	javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
>	sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>	
>sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>	
>sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.jav
>a:25)
>	java.lang.reflect.Method.invoke(Method.java:324)
>	org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:284)
>	java.security.AccessController.doPrivileged(Native Method)
>	javax.security.auth.Subject.doAsPrivileged(Subject.java:500)
>	org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:306)
>	
>org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:200)
>
>Is there something I might forget to add to classpath or to add
>conf/catalina.policy?
>Thank you in advance.
>
>Sam
>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>
>
>
>  
>



---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


RE: JK2 and NoClassDefFoundError of HttpMessages

Posted by Yansheng Lin <ya...@isogis.com>.
Hi, 

You got it working yet?  It seems you are having trouble using apache as the
server.  You said when you use domainname:8080/something, you can see the pages,
but not domainname/something.  That's because  Tomcat is serving the pages
instead of Apache.

I need to go home to test this on Fedora, but in your conf/workers2.properties
file, you need to specify a connection between apache and tomcat, much like the
example from the other thread:

--------------------------------
[uri:/examples/*]
info=tomcat examples
context=/examples
worker=ajp13:localhost:8009
debug=0
--------------------------------

Hope this helps.

-----Original Message-----
From: bzbridge@dslextreme.com [mailto:bzbridge@dslextreme.com] 
Sent: Friday, December 12, 2003 11:47 AM
To: tomcat-user@jakarta.apache.org
Subject: JK2 and NoClassDefFoundError of HttpMessages


Hi,

I am trying Tomcat 5.0.16 with mod_jk2v2.0.2, Apache 2.0.47 on Fodora
Linux Core1.

When I start Tomcat without -security, I have no problem.
When I start Tomcat with -security and I use
domain_name:8080/servlet/ListRoomsServlet, again I have no problem
(ListRoomsServlet is the servlet I am trying).

When I start Tomcat with -security and use
domain_name/servlet/ListRoomsServlet, I have the next error message:

exception

javax.servlet.ServletException: org/apache/tomcat/util/http/HttpMessages
	org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:324)
	
org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:200)


root cause

java.lang.NoClassDefFoundError: org/apache/tomcat/util/http/HttpMessages
	
org.apache.jk.server.JkCoyoteHandler.appendHead(JkCoyoteHandler.java:350)
	org.apache.jk.server.JkCoyoteHandler.action(JkCoyoteHandler.java:402)
	org.apache.coyote.Response.action(Response.java:226)
	org.apache.coyote.Response.sendHeaders(Response.java:418)
	org.apache.jk.server.JkCoyoteHandler.doWrite(JkCoyoteHandler.java:240)
	org.apache.coyote.Response.doWrite(Response.java:586)
	
org.apache.coyote.tomcat5.OutputBuffer.realWriteBytes(OutputBuffer.java:405)
	org.apache.tomcat.util.buf.ByteChunk.flushBuffer(ByteChunk.java:428)
	org.apache.coyote.tomcat5.OutputBuffer.doFlush(OutputBuffer.java:361)
	org.apache.coyote.tomcat5.OutputBuffer.close(OutputBuffer.java:325)
	org.apache.coyote.tomcat5.CoyoteWriter.close(CoyoteWriter.java:130)
	ListRoomsServlet.doGet(ListRoomsServlet.java:714)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:743)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
	sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.jav
a:25)
	java.lang.reflect.Method.invoke(Method.java:324)
	org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:284)
	java.security.AccessController.doPrivileged(Native Method)
	javax.security.auth.Subject.doAsPrivileged(Subject.java:500)
	org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:306)
	
org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:200)

Is there something I might forget to add to classpath or to add
conf/catalina.policy?
Thank you in advance.

Sam



---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org