Discussion:
[REPOST]Tomcat with security manager + NoClassDefFoundError
Phillip Qin
2003-06-23 18:24:36 UTC
Permalink
Don't know if this mailing list filters my post, try it again.

I am frustrated. I have a webapp developed by struts. If I start Tomcat
without security manager, everything works fine. I can access
https://myhost.mydomain.com/myapp/mylink.do?myparam=myvalue.

After I start Tomcat -security and access the above link, I got the
following error. There is an index.jsp. When some one type
https://myhost.mydomain.com/myapp, this index.jsp will redirect him to the
home page. It is simply a META refresh. The frustration is, if I access
https://myhost.mydomain.com/myapp once, then I can always access
https://myhost.mydomain.com/myapp/mylink.do?myparam=myvalue. I suspect there
are permission that I need to grant in Catalina.policy.

Any input?

java.lang.NoClassDefFoundError:
org/apache/coyote/tomcat4/CoyoteRequest$PrivilegedGetSession
at
org.apache.coyote.tomcat4.CoyoteRequest.getSession(CoyoteRequest.java:1728)
at
org.apache.coyote.tomcat4.CoyoteRequestFacade.getSession(CoyoteRequestFacade
.java:365)
at
org.apache.coyote.tomcat4.CoyoteRequestFacade.getSession(CoyoteRequestFacade
.java:375)
at
org.apache.struts.action.RequestProcessor.processLocale(RequestProcessor.jav
a:631)
at
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:230)
at
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1480)
at
org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:506)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application
FilterChain.java:247)
at
org.apache.catalina.core.ApplicationFilterChain.access$000(ApplicationFilter
Chain.java:98)
at
org.apache.catalina.core.ApplicationFilterChain$1.run(ApplicationFilterChain
.java:176)
at java.security.AccessController.doPrivileged(Native Method)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh
ain.java:172)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.ja
va:256)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
eNext(StandardPipeline.java:643)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.ja
va:191)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
eNext(StandardPipeline.java:643)
at
org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.java:2
46)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
eNext(StandardPipeline.java:641)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at
org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2415)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180
)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
eNext(StandardPipeline.java:643)
at
org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.
java:171)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
eNext(StandardPipeline.java:641)
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172
)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
eNext(StandardPipeline.java:641)
at
org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:509)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
eNext(StandardPipeline.java:641)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java
:174)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
eNext(StandardPipeline.java:643)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at
org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:223)
at
org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:261)
at
org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:360)
at org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:604)
at
org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:562)
at
org.apache.jk.common.SocketConnection.runIt(ChannelSocket.java:679)
at
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.jav
a:619)
at java.lang.Thread.run(Thread.java:536)




-----Original Message-----
From: Phillip Qin [mailto:***@shareowner.com]
Sent: June 23, 2003 2:23 PM
To: 'tomcat-***@jakarta.apache.org'
Subject: tomcat-user filter

Does this mailing list filter words like NoClassDefFoundError or security?
The message that I was posting never gets to the list.



Regards,







PQ



"The difference between 'involvement' and 'commitment'

is like an eggs-and-ham breakfast: the chicken was

'involved' - the pig was 'committed'."
John Turner
2003-06-23 18:33:36 UTC
Permalink
Is there a part in your error message that says "Root Cause"? If so, what
is it?

John

On Mon, 23 Jun 2003 14:24:36 -0400, Phillip Qin
Post by Phillip Qin
Don't know if this mailing list filters my post, try it again.
I am frustrated. I have a webapp developed by struts. If I start Tomcat
without security manager, everything works fine. I can access
https://myhost.mydomain.com/myapp/mylink.do?myparam=myvalue.
After I start Tomcat -security and access the above link, I got the
following error. There is an index.jsp. When some one type
https://myhost.mydomain.com/myapp, this index.jsp will redirect him to the
home page. It is simply a META refresh. The frustration is, if I access
https://myhost.mydomain.com/myapp once, then I can always access
https://myhost.mydomain.com/myapp/mylink.do?myparam=myvalue. I suspect there
are permission that I need to grant in Catalina.policy.
Any input?
org/apache/coyote/tomcat4/CoyoteRequest$PrivilegedGetSession
at
org.apache.coyote.tomcat4.CoyoteRequest.getSession(CoyoteRequest.java:1728)
at
org.apache.coyote.tomcat4.CoyoteRequestFacade.getSession(CoyoteRequestFacade
.java:365)
at
org.apache.coyote.tomcat4.CoyoteRequestFacade.getSession(CoyoteRequestFacade
.java:375)
at
org.apache.struts.action.RequestProcessor.processLocale(RequestProcessor.jav
a:631)
at
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:230)
at
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1480)
at
org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:506)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application
FilterChain.java:247)
at
org.apache.catalina.core.ApplicationFilterChain.access$000(ApplicationFilter
Chain.java:98)
at
org.apache.catalina.core.ApplicationFilterChain$1.run(ApplicationFilterChain
.java:176)
at java.security.AccessController.doPrivileged(Native Method)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh
ain.java:172)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.ja
va:256)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
eNext(StandardPipeline.java:643)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.ja
va:191)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
eNext(StandardPipeline.java:643)
at
org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.java:2
46)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
eNext(StandardPipeline.java:641)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at
org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2415)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180
)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
eNext(StandardPipeline.java:643)
at
org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.
java:171)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
eNext(StandardPipeline.java:641)
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172
)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
eNext(StandardPipeline.java:641)
at
org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:509)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
eNext(StandardPipeline.java:641)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java
:174)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
eNext(StandardPipeline.java:643)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at
org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:223)
at
org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:261)
at
org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:360)
at org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:604)
at
org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:562)
at
org.apache.jk.common.SocketConnection.runIt(ChannelSocket.java:679)
at
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.jav
a:619)
at java.lang.Thread.run(Thread.java:536)
-----Original Message-----
2:23 PM
Subject: tomcat-user filter
Does this mailing list filter words like NoClassDefFoundError or security?
The message that I was posting never gets to the list.
Regards,
PQ
"The difference between 'involvement' and 'commitment'
is like an eggs-and-ham breakfast: the chicken was
'involved' - the pig was 'committed'."
--
Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/
Phillip Qin
2003-06-23 18:41:02 UTC
Permalink
The exception that I posted is root cause. The exception is

javax.servlet.ServletException: Servlet execution threw an exception
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application
FilterChain.java:269)
at
org.apache.catalina.core.ApplicationFilterChain.access$000(ApplicationFilter
Chain.java:98)
at
org.apache.catalina.core.ApplicationFilterChain$1.run(ApplicationFilterChain
.java:176)
......

I solved this problem by including a grant entry

grant codeBase "file:${catalina.home}/webapps/myapp/WEB-INF/struts.jar" {
permission java.security.AllPermission;
};

But I am wondering if this AllPermission is secure enough or I am opening
more holes.

-----Original Message-----
From: John Turner [mailto:tomcat-***@johnturner.com]
Sent: June 23, 2003 2:34 PM
To: Tomcat Users List
Subject: Re: [REPOST]Tomcat with security manager + NoClassDefFoundError


Is there a part in your error message that says "Root Cause"? If so, what
is it?

John

On Mon, 23 Jun 2003 14:24:36 -0400, Phillip Qin
Post by Phillip Qin
Don't know if this mailing list filters my post, try it again.
I am frustrated. I have a webapp developed by struts. If I start Tomcat
without security manager, everything works fine. I can access
https://myhost.mydomain.com/myapp/mylink.do?myparam=myvalue.
After I start Tomcat -security and access the above link, I got the
following error. There is an index.jsp. When some one type
https://myhost.mydomain.com/myapp, this index.jsp will redirect him to
the
home page. It is simply a META refresh. The frustration is, if I access
https://myhost.mydomain.com/myapp once, then I can always access
https://myhost.mydomain.com/myapp/mylink.do?myparam=myvalue. I suspect
there
are permission that I need to grant in Catalina.policy.
Any input?
org/apache/coyote/tomcat4/CoyoteRequest$PrivilegedGetSession
at
org.apache.coyote.tomcat4.CoyoteRequest.getSession(CoyoteRequest.java:1728)
Post by Phillip Qin
at
org.apache.coyote.tomcat4.CoyoteRequestFacade.getSession(CoyoteRequestFacade
Post by Phillip Qin
.java:365)
at
org.apache.coyote.tomcat4.CoyoteRequestFacade.getSession(CoyoteRequestFacade
Post by Phillip Qin
.java:375)
at
org.apache.struts.action.RequestProcessor.processLocale(RequestProcessor.jav
Post by Phillip Qin
a:631)
at
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:230)
Post by Phillip Qin
at
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1480)
at
org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:506)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application
Post by Phillip Qin
FilterChain.java:247)
at
org.apache.catalina.core.ApplicationFilterChain.access$000(ApplicationFilter
Post by Phillip Qin
Chain.java:98)
at
org.apache.catalina.core.ApplicationFilterChain$1.run(ApplicationFilterChain
Post by Phillip Qin
.java:176)
at java.security.AccessController.doPrivileged(Native Method)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh
Post by Phillip Qin
ain.java:172)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.ja
Post by Phillip Qin
va:256)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
Post by Phillip Qin
eNext(StandardPipeline.java:643)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
Post by Phillip Qin
at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.ja
Post by Phillip Qin
va:191)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
Post by Phillip Qin
eNext(StandardPipeline.java:643)
at
org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.java:2
Post by Phillip Qin
46)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
Post by Phillip Qin
eNext(StandardPipeline.java:641)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
Post by Phillip Qin
at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at
org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2415)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180
Post by Phillip Qin
)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
Post by Phillip Qin
eNext(StandardPipeline.java:643)
at
org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.
Post by Phillip Qin
java:171)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
Post by Phillip Qin
eNext(StandardPipeline.java:641)
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172
Post by Phillip Qin
)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
Post by Phillip Qin
eNext(StandardPipeline.java:641)
at
org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:509)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
Post by Phillip Qin
eNext(StandardPipeline.java:641)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
Post by Phillip Qin
at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java
Post by Phillip Qin
:174)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
Post by Phillip Qin
eNext(StandardPipeline.java:643)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
Post by Phillip Qin
at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at
org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:223)
at
org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:261)
at
org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:360)
at org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:604)
at
org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:562)
Post by Phillip Qin
at
org.apache.jk.common.SocketConnection.runIt(ChannelSocket.java:679)
at
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.jav
Post by Phillip Qin
a:619)
at java.lang.Thread.run(Thread.java:536)
-----Original Message-----
2:23 PM
Subject: tomcat-user filter
Does this mailing list filter words like NoClassDefFoundError or
security?
The message that I was posting never gets to the list.
Regards,
PQ
"The difference between 'involvement' and 'commitment'
is like an eggs-and-ham breakfast: the chicken was
'involved' - the pig was 'committed'."
--
Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-***@jakarta.apache.org
For additional commands, e-mail: tomcat-user-***@jakarta.apache.org
Jason Bainbridge
2003-06-23 18:43:59 UTC
Permalink
Post by Phillip Qin
I solved this problem by including a grant entry
grant codeBase "file:${catalina.home}/webapps/myapp/WEB-INF/struts.jar" {
  permission java.security.AllPermission;
};
Why isn't it in WEB-INF/lib ? That is probably why you had to add that grant
entry as it isn't the usual place to store jar files.

Regards,
--
Jason Bainbridge
http://jblinux.org
John Turner
2003-06-23 18:48:08 UTC
Permalink
Good eye, Jason.

John
Post by Jason Bainbridge
Post by Phillip Qin
I solved this problem by including a grant entry
grant codeBase "file:${catalina.home}/webapps/myapp/WEB-INF/struts.jar" {
  permission java.security.AllPermission;
};
Why isn't it in WEB-INF/lib ? That is probably why you had to add that
grant entry as it isn't the usual place to store jar files.
Regards,
--
Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/
Phillip Qin
2003-06-23 18:46:44 UTC
Permalink
Typo, it is WEB-INF/lib.

When there is no grant entry for this jar, tomcat throws
"NoClassDefFoundError".

-----Original Message-----
From: Jason Bainbridge [mailto:***@jblinux.org]
Sent: June 23, 2003 2:44 PM
To: Tomcat Users List
Subject: Re: [REPOST]Tomcat with security manager + NoClassDefFoundError
Post by Phillip Qin
I solved this problem by including a grant entry
grant codeBase "file:${catalina.home}/webapps/myapp/WEB-INF/struts.jar" {
  permission java.security.AllPermission;
};
Why isn't it in WEB-INF/lib ? That is probably why you had to add that grant

entry as it isn't the usual place to store jar files.

Regards,
--
Jason Bainbridge
http://jblinux.org

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-***@jakarta.apache.org
For additional commands, e-mail: tomcat-user-***@jakarta.apache.org
Jason Bainbridge
2003-06-23 18:53:06 UTC
Permalink
What other struts.jar files have you got laying around? Have you maybe got one
in common/lib? I'm not sure why setting a grant like that would make a
NoClassDefFoundError go away, maybe it tricks the classloader into looking at
a specific class somehow.

Either way I don't think you have fixed the problem it just appears you
have...

Regards,
--
Jason Bainbridge
http://jblinux.org
Post by Phillip Qin
Typo, it is WEB-INF/lib.
When there is no grant entry for this jar, tomcat throws
"NoClassDefFoundError".
-----Original Message-----
Sent: June 23, 2003 2:44 PM
To: Tomcat Users List
Subject: Re: [REPOST]Tomcat with security manager + NoClassDefFoundError
Post by Phillip Qin
I solved this problem by including a grant entry
grant codeBase "file:${catalina.home}/webapps/myapp/WEB-INF/struts.jar" {
  permission java.security.AllPermission;
};
Why isn't it in WEB-INF/lib ? That is probably why you had to add that grant
entry as it isn't the usual place to store jar files.
Regards,
John Turner
2003-06-23 19:00:35 UTC
Permalink
NoClassDefFound is not the same as ClassNotFound...NoClassDefFound
typically means Tomcat is confused about which class you want it to use. I
agree with Jason, I think you have a couple struts.jar files around, and
Tomcat isn't sure which one to use.

John

On Mon, 23 Jun 2003 14:46:44 -0400, Phillip Qin
Post by Phillip Qin
Typo, it is WEB-INF/lib.
When there is no grant entry for this jar, tomcat throws
"NoClassDefFoundError".
-----Original Message-----
2:44 PM
To: Tomcat Users List
Subject: Re: [REPOST]Tomcat with security manager + NoClassDefFoundError
Post by Phillip Qin
I solved this problem by including a grant entry
grant codeBase "file:${catalina.home}/webapps/myapp/WEB-INF/struts.jar" {
  permission java.security.AllPermission;
};
Why isn't it in WEB-INF/lib ? That is probably why you had to add that grant
entry as it isn't the usual place to store jar files.
Regards,
--
Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/
Shapira, Yoav
2003-06-23 18:56:55 UTC
Permalink
Howdy,
The curious part about the stack trace is the doPrivileged throwing the exception. Are you using JAAS or a custom realm to do your authentication? If so, are you sure this realm is properly configured?

Yoav Shapira
Millennium ChemInformatics
Post by Phillip Qin
-----Original Message-----
Sent: Monday, June 23, 2003 2:53 PM
To: Tomcat Users List
Subject: Re: [REPOST]Tomcat with security manager + NoClassDefFoundError
What other struts.jar files have you got laying around? Have you maybe got
one
in common/lib? I'm not sure why setting a grant like that would make a
NoClassDefFoundError go away, maybe it tricks the classloader into looking
at
a specific class somehow.
Either way I don't think you have fixed the problem it just appears you
have...
Regards,
--
Jason Bainbridge
http://jblinux.org
Post by Phillip Qin
Typo, it is WEB-INF/lib.
When there is no grant entry for this jar, tomcat throws
"NoClassDefFoundError".
-----Original Message-----
Sent: June 23, 2003 2:44 PM
To: Tomcat Users List
Subject: Re: [REPOST]Tomcat with security manager + NoClassDefFoundError
Post by Phillip Qin
I solved this problem by including a grant entry
grant codeBase "file:${catalina.home}/webapps/myapp/WEB-INF/struts.jar"
{
Post by Phillip Qin
Post by Phillip Qin
  permission java.security.AllPermission;
};
Why isn't it in WEB-INF/lib ? That is probably why you had to add that
grant
entry as it isn't the usual place to store jar files.
Regards,
---------------------------------------------------------------------
This e-mail, including any attachments, is a confidential business communication, and may contain information that is confidential, proprietary and/or privileged. This e-mail is intended only for the individual(s) to whom it is addressed, and may not be saved, copied, printed, disclosed or used by anyone else. If you are not the(an) intended recipient, please immediately delete this e-mail from your computer system and notify the sender. Thank you.
Phillip Qin
2003-06-23 19:09:39 UTC
Permalink
1. There is no struts installation at all outside Catalina directories on
this production box.
2. There are two webapps using struts, but struts.jars are located in
webapps/myapp1/WEB-INF/lib and webapps/myapp2/WEB-INF/lib respectively.
3. No environment variables set for struts.jars so I assume tomcat
classloader should take care of them.

To Yoav:

I start Tomcat with -security option. Tomcat will use Catalina.policy to
manage the permissions. I don't use JAAS or realm at all (realms were
cleaned up in server.xml).

-----Original Message-----
From: John Turner [mailto:tomcat-***@johnturner.com]
Sent: June 23, 2003 3:01 PM
To: Tomcat Users List
Subject: Re: [REPOST]Tomcat with security manager + NoClassDefFoundError


NoClassDefFound is not the same as ClassNotFound...NoClassDefFound
typically means Tomcat is confused about which class you want it to use. I
agree with Jason, I think you have a couple struts.jar files around, and
Tomcat isn't sure which one to use.

John

On Mon, 23 Jun 2003 14:46:44 -0400, Phillip Qin
Post by Phillip Qin
Typo, it is WEB-INF/lib.
When there is no grant entry for this jar, tomcat throws
"NoClassDefFoundError".
-----Original Message-----
2:44 PM
To: Tomcat Users List
Subject: Re: [REPOST]Tomcat with security manager + NoClassDefFoundError
Post by Phillip Qin
I solved this problem by including a grant entry
grant codeBase "file:${catalina.home}/webapps/myapp/WEB-INF/struts.jar"
{
  permission java.security.AllPermission;
};
Why isn't it in WEB-INF/lib ? That is probably why you had to add that
grant
entry as it isn't the usual place to store jar files.
Regards,
--
Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-***@jakarta.apache.org
For additional commands, e-mail: tomcat-user-***@jakarta.apache.org
Shapira, Yoav
2003-06-23 19:12:10 UTC
Permalink
Howdy,
Is your catalina.policy the default or modified?

Yoav Shapira
Millennium ChemInformatics
Post by Phillip Qin
-----Original Message-----
Sent: Monday, June 23, 2003 3:10 PM
To: 'Tomcat Users List'
Subject: RE: [REPOST]Tomcat with security manager + NoClassDefFoundError
1. There is no struts installation at all outside Catalina directories on
this production box.
2. There are two webapps using struts, but struts.jars are located in
webapps/myapp1/WEB-INF/lib and webapps/myapp2/WEB-INF/lib respectively.
3. No environment variables set for struts.jars so I assume tomcat
classloader should take care of them.
I start Tomcat with -security option. Tomcat will use Catalina.policy to
manage the permissions. I don't use JAAS or realm at all (realms were
cleaned up in server.xml).
-----Original Message-----
Sent: June 23, 2003 3:01 PM
To: Tomcat Users List
Subject: Re: [REPOST]Tomcat with security manager + NoClassDefFoundError
NoClassDefFound is not the same as ClassNotFound...NoClassDefFound
typically means Tomcat is confused about which class you want it to use. I
agree with Jason, I think you have a couple struts.jar files around, and
Tomcat isn't sure which one to use.
John
On Mon, 23 Jun 2003 14:46:44 -0400, Phillip Qin
Post by Phillip Qin
Typo, it is WEB-INF/lib.
When there is no grant entry for this jar, tomcat throws
"NoClassDefFoundError".
-----Original Message-----
2:44 PM
To: Tomcat Users List
Subject: Re: [REPOST]Tomcat with security manager + NoClassDefFoundError
Post by Phillip Qin
I solved this problem by including a grant entry
grant codeBase "file:${catalina.home}/webapps/myapp/WEB-INF/struts.jar"
{
  permission java.security.AllPermission;
};
Why isn't it in WEB-INF/lib ? That is probably why you had to add that
grant
entry as it isn't the usual place to store jar files.
Regards,
--
Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/
---------------------------------------------------------------------
This e-mail, including any attachments, is a confidential business communication, and may contain information that is confidential, proprietary and/or privileged. This e-mail is intended only for the individual(s) to whom it is addressed, and may not be saved, copied, printed, disclosed or used by anyone else. If you are not the(an) intended recipient, please immediately delete this e-mail from your computer system and notify the sender. Thank you.
Phillip Qin
2003-06-23 19:30:08 UTC
Permalink
I even deleted server/webapps which contains struts.jar for admin
application.

To Yoav:

I modified Catalina default policy file to allow log4j writing to files and
myapps sending out emails and connecting to credit card processing company.

-----Original Message-----
From: Jason Bainbridge [mailto:***@jblinux.org]
Sent: June 23, 2003 2:53 PM
To: Tomcat Users List
Subject: Re: [REPOST]Tomcat with security manager + NoClassDefFoundError

What other struts.jar files have you got laying around? Have you maybe got
one
in common/lib? I'm not sure why setting a grant like that would make a
NoClassDefFoundError go away, maybe it tricks the classloader into looking
at
a specific class somehow.

Either way I don't think you have fixed the problem it just appears you
have...

Regards,
--
Jason Bainbridge
http://jblinux.org
Post by Phillip Qin
Typo, it is WEB-INF/lib.
When there is no grant entry for this jar, tomcat throws
"NoClassDefFoundError".
-----Original Message-----
Sent: June 23, 2003 2:44 PM
To: Tomcat Users List
Subject: Re: [REPOST]Tomcat with security manager + NoClassDefFoundError
Post by Phillip Qin
I solved this problem by including a grant entry
grant codeBase "file:${catalina.home}/webapps/myapp/WEB-INF/struts.jar"
{
Post by Phillip Qin
Post by Phillip Qin
  permission java.security.AllPermission;
};
Why isn't it in WEB-INF/lib ? That is probably why you had to add that
grant
entry as it isn't the usual place to store jar files.
Regards,
---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-***@jakarta.apache.org
For additional commands, e-mail: tomcat-user-***@jakarta.apache.org
Jason Bainbridge
2003-06-23 19:47:35 UTC
Permalink
Was just doing a bit of reading:

http://jakarta.apache.org/struts/userGuide/installation.html

Running Struts Applications Under A Security Manager

Many application servers execute web applications under the control of a Java
security manager, with restricted permissions on what classes in the web
application can do. If you utilize form beans with mapped properties, you may
encounter security exceptions unless you add the following permission to the
set of permissions granted to your Struts application's codebase:

permission java.lang.RuntimePermission "accessDeclaredMembers";

It still seems strange though that it was throwing a NoClassDefFoundError, can
you maybe try the above as an alternative fix and see if that resolves the
problem?

Regards,
--
Jason Bainbridge
http://jblinux.org
Post by Phillip Qin
I even deleted server/webapps which contains struts.jar for admin
application.
I modified Catalina default policy file to allow log4j writing to files and
myapps sending out emails and connecting to credit card processing company.
-----Original Message-----
Sent: June 23, 2003 2:53 PM
To: Tomcat Users List
Subject: Re: [REPOST]Tomcat with security manager + NoClassDefFoundError
What other struts.jar files have you got laying around? Have you maybe got
one
in common/lib? I'm not sure why setting a grant like that would make a
NoClassDefFoundError go away, maybe it tricks the classloader into looking
at
a specific class somehow.
Either way I don't think you have fixed the problem it just appears you
have...
Regards,
Phillip Qin
2003-06-23 19:56:26 UTC
Permalink
I have already added that one, plus

- ReflectPermission "suppressAccessChecks" for a commons-beanutils bug
- FilePermission for log4j

-----Original Message-----
From: Jason Bainbridge [mailto:***@jblinux.org]
Sent: June 23, 2003 3:48 PM
To: Tomcat Users List
Subject: Re: [REPOST]Tomcat with security manager + NoClassDefFoundError

Was just doing a bit of reading:

http://jakarta.apache.org/struts/userGuide/installation.html

Running Struts Applications Under A Security Manager

Many application servers execute web applications under the control of a
Java
security manager, with restricted permissions on what classes in the web
application can do. If you utilize form beans with mapped properties, you
may
encounter security exceptions unless you add the following permission to the

set of permissions granted to your Struts application's codebase:

permission java.lang.RuntimePermission "accessDeclaredMembers";

It still seems strange though that it was throwing a NoClassDefFoundError,
can
you maybe try the above as an alternative fix and see if that resolves the
problem?

Regards,
--
Jason Bainbridge
http://jblinux.org
Post by Phillip Qin
I even deleted server/webapps which contains struts.jar for admin
application.
I modified Catalina default policy file to allow log4j writing to files
and
Post by Phillip Qin
myapps sending out emails and connecting to credit card processing
company.
Post by Phillip Qin
-----Original Message-----
Sent: June 23, 2003 2:53 PM
To: Tomcat Users List
Subject: Re: [REPOST]Tomcat with security manager + NoClassDefFoundError
What other struts.jar files have you got laying around? Have you maybe got
one
in common/lib? I'm not sure why setting a grant like that would make a
NoClassDefFoundError go away, maybe it tricks the classloader into looking
at
a specific class somehow.
Either way I don't think you have fixed the problem it just appears you
have...
Regards,
---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-***@jakarta.apache.org
For additional commands, e-mail: tomcat-user-***@jakarta.apache.org
Jean-Francois Arcand
2003-06-23 20:42:02 UTC
Permalink
Hi,

that's a bug in Tomcat. You should not received that exception, which
means that the classloader is unable to load some package protected
classes. The
org/apache/coyote/tomcat4/CoyoteRequest$PrivilegedGetSession needs to be
loaded when Tomcat starts, not when you do your first invokation (Tomcat
5 handles the current case).

Which Tomcat version are you using (4.1.?)?

-- Jeanfrancois
Post by Phillip Qin
I have already added that one, plus
- ReflectPermission "suppressAccessChecks" for a commons-beanutils bug
- FilePermission for log4j
-----Original Message-----
Sent: June 23, 2003 3:48 PM
To: Tomcat Users List
Subject: Re: [REPOST]Tomcat with security manager + NoClassDefFoundError
http://jakarta.apache.org/struts/userGuide/installation.html
Running Struts Applications Under A Security Manager
Many application servers execute web applications under the control of a
Java
security manager, with restricted permissions on what classes in the web
application can do. If you utilize form beans with mapped properties, you
may
encounter security exceptions unless you add the following permission to the
permission java.lang.RuntimePermission "accessDeclaredMembers";
It still seems strange though that it was throwing a NoClassDefFoundError,
can
you maybe try the above as an alternative fix and see if that resolves the
problem?
Regards,
Phillip Qin
2003-06-23 21:07:03 UTC
Permalink
Apache 2.0.46, tomcat 4.1.24 and jk2 connector, struts-1.1-rc2

In my original posting, I said I am frustrated because,

- if I start index.jsp first which is simply a meta refresh, I didn't
receive the exception, and then I can access .../mylink.do?... from browser.
- if I access .../mylink.do?... first, I got this error.

I looked into catalina.out, there was no permission exception.

-----Original Message-----
From: Jean-Francois Arcand [mailto:***@apache.org]
Sent: June 23, 2003 4:42 PM
To: Tomcat Users List
Subject: Re: [REPOST]Tomcat with security manager + NoClassDefFoundError

Hi,

that's a bug in Tomcat. You should not received that exception, which
means that the classloader is unable to load some package protected
classes. The
org/apache/coyote/tomcat4/CoyoteRequest$PrivilegedGetSession needs to be
loaded when Tomcat starts, not when you do your first invokation (Tomcat
5 handles the current case).

Which Tomcat version are you using (4.1.?)?

-- Jeanfrancois
Post by Phillip Qin
I have already added that one, plus
- ReflectPermission "suppressAccessChecks" for a commons-beanutils bug
- FilePermission for log4j
-----Original Message-----
Sent: June 23, 2003 3:48 PM
To: Tomcat Users List
Subject: Re: [REPOST]Tomcat with security manager + NoClassDefFoundError
http://jakarta.apache.org/struts/userGuide/installation.html
Running Struts Applications Under A Security Manager
Many application servers execute web applications under the control of a
Java
security manager, with restricted permissions on what classes in the web
application can do. If you utilize form beans with mapped properties, you
may
encounter security exceptions unless you add the following permission to
the
Post by Phillip Qin
permission java.lang.RuntimePermission "accessDeclaredMembers";
It still seems strange though that it was throwing a NoClassDefFoundError,
can
you maybe try the above as an alternative fix and see if that resolves the
problem?
Regards,
---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-***@jakarta.apache.org
For additional commands, e-mail: tomcat-user-***@jakarta.apache.org
Loading...