Re: java.lang.ClassCircularityError
Caldarale, Charles R wrote: According to the bug report, this is only fixed in Mustang (6.0), not 5.0 (aka 1.5). Ooh, my bad (misread of the fixed release..). Thanks.. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Re: java.lang.ClassCircularityError
> From: news [mailto:[EMAIL PROTECTED] On Behalf Of Shankar Unni > Subject: Re: java.lang.ClassCircularityError > > There seems to be a well-known Java bug (1.3.x and 1.4.x, > fixed in 1.5) that affects JBoss 3.x: > http://bugs.sun.com/bugdatabase/view_bug.do;:YfiG?bug_id=4699981 According to the bug report, this is only fixed in Mustang (6.0), not 5.0 (aka 1.5). - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: java.lang.ClassCircularityError
Jagadeesha T wrote: I am using Tomcat 5.0 with JBoss 3.2.6. In a very rare cases I got the error as java.lang.ClassCircularityError(myclass). Does anybody know wahy this error is coming. There seems to be a well-known Java bug (1.3.x and 1.4.x, fixed in 1.5) that affects JBoss 3.x: http://bugs.sun.com/bugdatabase/view_bug.do;:YfiG?bug_id=4699981 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: java.lang.ClassCircularityError
HI, Thanks for the reply, It is being working correctly all these days. Only once I got this error.After restarting the server worked fine. Only one time I got this error. But I have not done as you mentioned. I am very curious to know why is this suddenly came which was working all these days and gone after restarted the server. Thanks, Jagadish Leon Rosenberg <[EMAIL PROTECTED]> wrote: Just some thoughts... if you write two classes A and B B extends A then compile then put B into deployment change B to not extend A and A to extend B, compile A put A into deployment Then you'll probably have your runtime circularity. Try to delete all your class files and recompile your application from scratch. regards Leon On 10/5/05, Jagadeesha T wrote: > HI Andoni, > Thanks for the reply, It uses association that too unidirectional, I have > seen the option in sun forum as have you explained to me. I tried to compile > classes like this for just to get that error. This scenario won't compile, It > gave me a error saying "cycling inheritence". > Do you know any other scenarios which could cause this problem. > > Thanks, > Jagadish > > Andoni wrote: > Hi Jagadish, > > Do you have a drawing of all your inheritance relationships? This error seems > to be caused by a circular inheritance relationship i.e.: > > class ClassOne extends ClassTwo { > ... > } > > class ClassTwo extends ClassOne { > ... > } > > Obviously there could be many more than two classes involved so it may be > best to draw out the class tree. Specially if it is complicated. > > Hope that helps. > > Andoni. > > - Original Message - > From: Jagadeesha T > To: tomcat-user@jakarta.apache.org > Sent: Wednesday, October 05, 2005 9:01 AM > Subject: java.lang.ClassCircularityError > > > Hi all, > I am using Tomcat 5.0 with JBoss 3.2.6. In a very rare cases I got the error > as > java.lang.ClassCircularityError(myclass). Does anybody know wahy this error > is coming. > > Thanks, > Jagadish > > > - > Yahoo! for Good > Click here to donate to the Hurricane Katrina relief effort. > > > - > Yahoo! for Good > Click here to donate to the Hurricane Katrina relief effort. > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - Yahoo! for Good Click here to donate to the Hurricane Katrina relief effort.
Re: java.lang.ClassCircularityError
Just some thoughts... if you write two classes A and B B extends A then compile then put B into deployment change B to not extend A and A to extend B, compile A put A into deployment Then you'll probably have your runtime circularity. Try to delete all your class files and recompile your application from scratch. regards Leon On 10/5/05, Jagadeesha T <[EMAIL PROTECTED]> wrote: > HI Andoni, > Thanks for the reply, It uses association that too unidirectional, I > have seen the option in sun forum as have you explained to me. I tried to > compile classes like this for just to get that error. This scenario won't > compile, It gave me a error saying "cycling inheritence". > Do you know any other scenarios which could cause this problem. > > Thanks, > Jagadish > > Andoni <[EMAIL PROTECTED]> wrote: > Hi Jagadish, > > Do you have a drawing of all your inheritance relationships? This error seems > to be caused by a circular inheritance relationship i.e.: > > class ClassOne extends ClassTwo { > ... > } > > class ClassTwo extends ClassOne { > ... > } > > Obviously there could be many more than two classes involved so it may be > best to draw out the class tree. Specially if it is complicated. > > Hope that helps. > > Andoni. > > - Original Message - > From: Jagadeesha T > To: tomcat-user@jakarta.apache.org > Sent: Wednesday, October 05, 2005 9:01 AM > Subject: java.lang.ClassCircularityError > > > Hi all, > I am using Tomcat 5.0 with JBoss 3.2.6. In a very rare cases I got the error > as > java.lang.ClassCircularityError(myclass). Does anybody know wahy this error > is coming. > > Thanks, > Jagadish > > > - > Yahoo! for Good > Click here to donate to the Hurricane Katrina relief effort. > > > - > Yahoo! for Good > Click here to donate to the Hurricane Katrina relief effort. > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: java.lang.ClassCircularityError
Just thinking aloud here... is there anywhere in your program that you are using Java Reflection? Beyond this I am afraid I have no more ideas for now :-( Later, Andoni. - Original Message - From: Jagadeesha T To: Tomcat Users List Sent: Wednesday, October 05, 2005 9:48 AM Subject: Re: java.lang.ClassCircularityError HI Andoni, Thanks for the reply, It uses association that too unidirectional, I have seen the option in sun forum as have you explained to me. I tried to compile classes like this for just to get that error. This scenario won't compile, It gave me a error saying "cycling inheritence". Do you know any other scenarios which could cause this problem. Thanks, Jagadish Andoni <[EMAIL PROTECTED]> wrote: Hi Jagadish, Do you have a drawing of all your inheritance relationships? This error seems to be caused by a circular inheritance relationship i.e.: class ClassOne extends ClassTwo { ... } class ClassTwo extends ClassOne { ... } Obviously there could be many more than two classes involved so it may be best to draw out the class tree. Specially if it is complicated. Hope that helps. Andoni. - Original Message - From: Jagadeesha T To: tomcat-user@jakarta.apache.org Sent: Wednesday, October 05, 2005 9:01 AM Subject: java.lang.ClassCircularityError Hi all, I am using Tomcat 5.0 with JBoss 3.2.6. In a very rare cases I got the error as java.lang.ClassCircularityError(myclass). Does anybody know wahy this error is coming. Thanks, Jagadish - Yahoo! for Good Click here to donate to the Hurricane Katrina relief effort. - Yahoo! for Good Click here to donate to the Hurricane Katrina relief effort.
Re: java.lang.ClassCircularityError
HI Andoni, Thanks for the reply, It uses association that too unidirectional, I have seen the option in sun forum as have you explained to me. I tried to compile classes like this for just to get that error. This scenario won't compile, It gave me a error saying "cycling inheritence". Do you know any other scenarios which could cause this problem. Thanks, Jagadish Andoni <[EMAIL PROTECTED]> wrote: Hi Jagadish, Do you have a drawing of all your inheritance relationships? This error seems to be caused by a circular inheritance relationship i.e.: class ClassOne extends ClassTwo { ... } class ClassTwo extends ClassOne { ... } Obviously there could be many more than two classes involved so it may be best to draw out the class tree. Specially if it is complicated. Hope that helps. Andoni. - Original Message - From: Jagadeesha T To: tomcat-user@jakarta.apache.org Sent: Wednesday, October 05, 2005 9:01 AM Subject: java.lang.ClassCircularityError Hi all, I am using Tomcat 5.0 with JBoss 3.2.6. In a very rare cases I got the error as java.lang.ClassCircularityError(myclass). Does anybody know wahy this error is coming. Thanks, Jagadish - Yahoo! for Good Click here to donate to the Hurricane Katrina relief effort. - Yahoo! for Good Click here to donate to the Hurricane Katrina relief effort.
Re: java.lang.ClassCircularityError
Hi Jagadish, Do you have a drawing of all your inheritance relationships? This error seems to be caused by a circular inheritance relationship i.e.: class ClassOne extends ClassTwo { ... } class ClassTwo extends ClassOne { ... } Obviously there could be many more than two classes involved so it may be best to draw out the class tree. Specially if it is complicated. Hope that helps. Andoni. - Original Message - From: Jagadeesha T To: tomcat-user@jakarta.apache.org Sent: Wednesday, October 05, 2005 9:01 AM Subject: java.lang.ClassCircularityError Hi all, I am using Tomcat 5.0 with JBoss 3.2.6. In a very rare cases I got the error as java.lang.ClassCircularityError(myclass). Does anybody know wahy this error is coming. Thanks, Jagadish - Yahoo! for Good Click here to donate to the Hurricane Katrina relief effort.
Re: java.lang.ClassCircularityError
On Mon, 2004-05-24 at 20:58, Filip Hanik - Dev wrote: > glad you got it working!! > the class loaders were referencing each other in a cirular way. Does it means that I have done some thing wrong or it is bug which will be resolved? If it is a bug, do you know when it will be resolved (in which release)? This is important to us because we are planning to move from 4.1.30 to 5.x tomcat. Thanks Viktor - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: java.lang.ClassCircularityError
glad you got it working!! the class loaders were referencing each other in a cirular way. Filip - Original Message - From: "Viktor Matic" <[EMAIL PROTECTED]> To: "Tomcat Users List" <[EMAIL PROTECTED]> Sent: Monday, May 24, 2004 1:48 AM Subject: Re: java.lang.ClassCircularityError > This is probably related to the subject configuration. Can you create a > small test case that reproduce the problem? I will be able to better see > what's happening. I have tried to compose a simple test which simulates the real thing, but I did not succeed to reproduce the error. For simplicity reason of the test code all my classes, except the servlet class which was in the webapps, are placed in the {$CATALINA_HOME}/shared/classes. All code in the shared/classes has AllPermissions according to the catalina.policy. When I was sure that everything works fine with the tests I tried same approach on the original code (as Filip Hanik already suggested but not server/classes because ClassNotFound error). I have moved all code concerning security (implementations of Policy, Permissions, User groups, Log. Module, etc.) to the {$CATALINA_HOME}/shared/classes and gave AllPermissions to this code source through my security system. In webapps I have left only servlet class that use security. Now it works perfectly. Maybe problem is in the class loader (/shared/classes is served with different class loader than /webapps ?!) Best regards Viktor - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: java.lang.ClassCircularityError
> This is probably related to the subject configuration. Can you create a > small test case that reproduce the problem? I will be able to better see > what's happening. I have tried to compose a simple test which simulates the real thing, but I did not succeed to reproduce the error. For simplicity reason of the test code all my classes, except the servlet class which was in the webapps, are placed in the {$CATALINA_HOME}/shared/classes. All code in the shared/classes has AllPermissions according to the catalina.policy. When I was sure that everything works fine with the tests I tried same approach on the original code (as Filip Hanik already suggested but not server/classes because ClassNotFound error). I have moved all code concerning security (implementations of Policy, Permissions, User groups, Log. Module, etc.) to the {$CATALINA_HOME}/shared/classes and gave AllPermissions to this code source through my security system. In webapps I have left only servlet class that use security. Now it works perfectly. Maybe problem is in the class loader (/shared/classes is served with different class loader than /webapps ?!) Best regards Viktor - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: java.lang.ClassCircularityError
> This is probably related to the subject configuration. Can you create a > small test case that reproduce the problem? I will be able to better see > what's happening. I have tried to compose a simple test which simulates the real thing, but I did not succeed to reproduce the error. For simplicity reason of the test code all my classes, except the servlet class which was in the webapps, are placed in the {$CATALINA_HOME}/shared/classes. All code in the shared/classes has AllPermissions according to the catalina.policy. When I was sure that everything works fine with the tests I tried same approach on the original code (as Filip Hanik already suggested but not server/classes because ClassNotFound error). I have moved all code concerning security (implementations of Policy, Permissions, User groups, Log. Module, etc.) to the {$CATALINA_HOME}/shared/classes and gave AllPermissions to this code source through my security system. In webapps I have left only servlet class that use security. Now it works perfectly. Maybe problem is in the class loader (/shared/classes is served with different class loader than /webapps ?!) Best regards Viktor - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: java.lang.ClassCircularityError
Viktor Matic wrote: On Wed, 2004-05-19 at 18:49, Jeanfrancois Arcand wrote: /*This line is in servlet service method*/ Subject.doAsPrivileged(subject, new SecuredActions(), null ); Yes, that's probably the problem since SecurityUtil has already set that value. The AccesControlContext already has the Subject attached to it. You may want to try: Subject.getSubject(AccessController.getContext()); I have checked SecurityUtil class. If I understand it well it invokes servlet service method with the doAsPrivileged and the subject cached in the HttpSession. If I check current Subject with Subject.getSubject(AccessController.getContext()) inside service method before I call my doAsPrivleged it returns null. So I use my subject (which I get from login context with lc.getSubject()) to execute Subject.doAsPrivileged(subject, new SecuredActions(), null ) protected code which in turn check the subject permission. So I can try to describe whole situation as I see it: First, servlet service method is called as doAsPrivileged with null subject (which is cached in HttpSession) then I invoke doAsPrivileged within service method with subject generated in Login procedure on SecuredAction class. Here something goes wrong and I can't get what!? This is probably related to the subject configuration. Can you create a small test case that reproduce the problem? I will be able to better see what's happening. (P.S. This works fine on tomcat 4.1.30 maybe we should check SecurityUtil class implementation there?) There is no such class in 4.x. This was added in 5.x. That's why I suspect the problem is with that class. Thanks -- Jeanfrancois Viktor - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: java.lang.ClassCircularityError
On Wed, 2004-05-19 at 18:41, Filip Hanik - Dev wrote: > where are your classes? > if you put them in server/lib or server/classes and not in your webapp, > do you still get the error? > > Filip These classes are placed in the webapp directory together with application that use them. This approach seems logical to me. Hence, as you have suggested I have tried to put them in the server/classes directory, but this approach arised new problem, I receive ClassNotFound error for first class that should be used from our security system. I'am not sure why this happens (why class loader can not find these classes?). But, something tells me that this problem is not correlated with initial problem. Why did you suggest me to place classes in server/classes directory, what did you have on your mind? -- Viktor - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: java.lang.ClassCircularityError
On Wed, 2004-05-19 at 18:49, Jeanfrancois Arcand wrote: > > /*This line is in servlet service method*/ > > Subject.doAsPrivileged(subject, new SecuredActions(), null ); > > > > > Yes, that's probably the problem since SecurityUtil has already set that > value. The AccesControlContext already has the Subject attached to it. > You may want to try: > > Subject.getSubject(AccessController.getContext()); > I have checked SecurityUtil class. If I understand it well it invokes servlet service method with the doAsPrivileged and the subject cached in the HttpSession. If I check current Subject with Subject.getSubject(AccessController.getContext()) inside service method before I call my doAsPrivleged it returns null. So I use my subject (which I get from login context with lc.getSubject()) to execute Subject.doAsPrivileged(subject, new SecuredActions(), null ) protected code which in turn check the subject permission. So I can try to describe whole situation as I see it: First, servlet service method is called as doAsPrivileged with null subject (which is cached in HttpSession) then I invoke doAsPrivileged within service method with subject generated in Login procedure on SecuredAction class. Here something goes wrong and I can't get what!? (P.S. This works fine on tomcat 4.1.30 maybe we should check SecurityUtil class implementation there?) Viktor - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: java.lang.ClassCircularityError
Viktor Matic wrote: On Wed, 2004-05-19 at 17:23, Jeanfrancois Arcand wrote: Well, take a look at org.apache.catalina.security.SecurityUtil. I am setting the Subject/AccessControlContext there. I think that might cause your problem, but I need more info ;-). AnybodyPrincipal is trying to do what? -- Jeanfrancois Thanks for fast replay. I'll check org.apache.catalina.security.SecurityUtil. Problem is manifested in line 65 of class SimpeGroup and this line checks is group member instance of AnybodyPrincipal isMember = (member instanceof com.ingemark.security.AnybodyPrincipal) The AnybodyPrincipal is a simple class which returns true if it is compared to any real principal. But I think that real problem is not in implementation of this class than more likely in the class loader which tests permissions to read this particular class. For example if I comment out line 65 (which is not crucial for this test) and try it again ClassCircularityError arise on different place, as it can be seen in the following error stack dump: java.lang.ClassCircularityError: com/ingemark/experiments/PermissionName$NameLengthComparator com.ingemark.experiments.NamespacePermissionCollection.(NamespacePermissionCollection.java:22) com.ingemark.experiments.NamespacePermission.newPermissionCollection(NamespacePermission.java:66) java.security.Permissions.getPermissionCollection(Permissions.java:245) java.security.Permissions.add(Permissions.java:110) com.ingemark.security.PolicyEntry.getPermissions(PolicyEntry.java:50) com.ingemark.security.AuthorizationInfo.getPermissions(AuthorizationInfo.java:73) com.ingemark.security.SecurityPolicy.getPermissions(SecurityPolicy.java:95) java.security.Policy.implies(Policy.java:397) java.security.ProtectionDomain.implies(ProtectionDomain.java:189) java.security.AccessControlContext.checkPermission(AccessControlContext.java:254) java.security.AccessController.checkPermission(AccessController.java:401) java.lang.SecurityManager.checkPermission(SecurityManager.java:524) java.lang.SecurityManager.checkRead(SecurityManager.java:863) java.io.File.exists(File.java:678) org.apache.naming.resources.FileDirContext.file(FileDirContext.java:826) org.apache.naming.resources.FileDirContext.lookup(FileDirContext.java:208) org.apache.naming.resources.ProxyDirContext.lookup(ProxyDirContext.java:287) org.apache.catalina.loader.WebappClassLoader.findResourceInternal(WebappClassLoader.java:1707) org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:1575) org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:860) org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1307) org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1189) java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302) com.ingemark.experiments.NamespacePermissionCollection.(NamespacePermissionCollection.java:22) com.ingemark.experiments.NamespacePermission.newPermissionCollection(NamespacePermission.java:66) java.security.Permissions.getPermissionCollection(Permissions.java:245) java.security.Permissions.add(Permissions.java:110) com.ingemark.security.PolicyEntry.getPermissions(PolicyEntry.java:50) com.ingemark.security.AuthorizationInfo.getPermissions(AuthorizationInfo.java:73) com.ingemark.security.SecurityPolicy.getPermissions(SecurityPolicy.java:95) java.security.Policy.implies(Policy.java:397) java.security.ProtectionDomain.implies(ProtectionDomain.java:189) java.security.AccessControlContext.checkPermission(AccessControlContext.java:254) java.security.AccessController.checkPermission(AccessController.java:401) com.ingemark.experiments.ServletSec$SecuredActions.run(ServletSec.java:207) java.security.AccessController.doPrivileged(Native Method) javax.security.auth.Subject.doAsPrivileged(Subject.java:437) com.ingemark.experiments.ServletSec.service(ServletSec.java:181) javax.servlet.http.HttpServlet.service(HttpServlet.java:810) 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:241) java.security.AccessController.doPrivileged(Native Method) javax.security.auth.Subject.doAsPrivileged(Subject.java:500) org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:263) org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:157) This time execution breaks on different place but in a same conditions catalina class loader tries to load the class (com/ingemark/experiments/PermissionName$NameLengthComparator) and loops there checking read permission. Here is peace of servlet code which triggers this behavior .. /*This line is in servlet service method*/ Subject.doAsPrivil
Re: java.lang.ClassCircularityError
where are your classes? if you put them in server/lib or server/classes and not in your webapp, do you still get the error? Filip - Original Message - From: "Viktor Matic" <[EMAIL PROTECTED]> To: "Tomcat Users List" <[EMAIL PROTECTED]> Sent: Wednesday, May 19, 2004 11:04 AM Subject: Re: java.lang.ClassCircularityError On Wed, 2004-05-19 at 17:23, Jeanfrancois Arcand wrote: > > > Well, take a look at org.apache.catalina.security.SecurityUtil. I am > setting the Subject/AccessControlContext there. I think that might cause > your problem, but I need more info ;-). AnybodyPrincipal is trying to do > what? > > -- Jeanfrancois Thanks for fast replay. I'll check org.apache.catalina.security.SecurityUtil. Problem is manifested in line 65 of class SimpeGroup and this line checks is group member instance of AnybodyPrincipal isMember = (member instanceof com.ingemark.security.AnybodyPrincipal) The AnybodyPrincipal is a simple class which returns true if it is compared to any real principal. But I think that real problem is not in implementation of this class than more likely in the class loader which tests permissions to read this particular class. For example if I comment out line 65 (which is not crucial for this test) and try it again ClassCircularityError arise on different place, as it can be seen in the following error stack dump: java.lang.ClassCircularityError: com/ingemark/experiments/PermissionName$NameLengthComparator com.ingemark.experiments.NamespacePermissionCollection.(NamespacePermissionCollection.java:22) com.ingemark.experiments.NamespacePermission.newPermissionCollection(NamespacePermission.java:66) java.security.Permissions.getPermissionCollection(Permissions.java:245) java.security.Permissions.add(Permissions.java:110) com.ingemark.security.PolicyEntry.getPermissions(PolicyEntry.java:50) com.ingemark.security.AuthorizationInfo.getPermissions(AuthorizationInfo.java:73) com.ingemark.security.SecurityPolicy.getPermissions(SecurityPolicy.java:95) java.security.Policy.implies(Policy.java:397) java.security.ProtectionDomain.implies(ProtectionDomain.java:189) java.security.AccessControlContext.checkPermission(AccessControlContext.java:254) java.security.AccessController.checkPermission(AccessController.java:401) java.lang.SecurityManager.checkPermission(SecurityManager.java:524) java.lang.SecurityManager.checkRead(SecurityManager.java:863) java.io.File.exists(File.java:678) org.apache.naming.resources.FileDirContext.file(FileDirContext.java:826) org.apache.naming.resources.FileDirContext.lookup(FileDirContext.java:208) org.apache.naming.resources.ProxyDirContext.lookup(ProxyDirContext.java:287) org.apache.catalina.loader.WebappClassLoader.findResourceInternal(WebappClassLoader.java:1707) org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:1575) org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:860) org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1307) org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1189) java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302) com.ingemark.experiments.NamespacePermissionCollection.(NamespacePermissionCollection.java:22) com.ingemark.experiments.NamespacePermission.newPermissionCollection(NamespacePermission.java:66) java.security.Permissions.getPermissionCollection(Permissions.java:245) java.security.Permissions.add(Permissions.java:110) com.ingemark.security.PolicyEntry.getPermissions(PolicyEntry.java:50) com.ingemark.security.AuthorizationInfo.getPermissions(AuthorizationInfo.java:73) com.ingemark.security.SecurityPolicy.getPermissions(SecurityPolicy.java:95) java.security.Policy.implies(Policy.java:397) java.security.ProtectionDomain.implies(ProtectionDomain.java:189) java.security.AccessControlContext.checkPermission(AccessControlContext.java:254) java.security.AccessController.checkPermission(AccessController.java:401) com.ingemark.experiments.ServletSec$SecuredActions.run(ServletSec.java:207) java.security.AccessController.doPrivileged(Native Method) javax.security.auth.Subject.doAsPrivileged(Subject.java:437) com.ingemark.experiments.ServletSec.service(ServletSec.java:181) javax.servlet.http.HttpServlet.service(HttpServlet.java:810) 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:241) java.security.AccessController.doPrivileged(Native Method) javax.security.auth.Subject.doAsPrivileged(Subject.java:500) org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:263) org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:157) This time
Re: java.lang.ClassCircularityError
On Wed, 2004-05-19 at 17:23, Jeanfrancois Arcand wrote: > > > Well, take a look at org.apache.catalina.security.SecurityUtil. I am > setting the Subject/AccessControlContext there. I think that might cause > your problem, but I need more info ;-). AnybodyPrincipal is trying to do > what? > > -- Jeanfrancois Thanks for fast replay. I'll check org.apache.catalina.security.SecurityUtil. Problem is manifested in line 65 of class SimpeGroup and this line checks is group member instance of AnybodyPrincipal isMember = (member instanceof com.ingemark.security.AnybodyPrincipal) The AnybodyPrincipal is a simple class which returns true if it is compared to any real principal. But I think that real problem is not in implementation of this class than more likely in the class loader which tests permissions to read this particular class. For example if I comment out line 65 (which is not crucial for this test) and try it again ClassCircularityError arise on different place, as it can be seen in the following error stack dump: java.lang.ClassCircularityError: com/ingemark/experiments/PermissionName$NameLengthComparator com.ingemark.experiments.NamespacePermissionCollection.(NamespacePermissionCollection.java:22) com.ingemark.experiments.NamespacePermission.newPermissionCollection(NamespacePermission.java:66) java.security.Permissions.getPermissionCollection(Permissions.java:245) java.security.Permissions.add(Permissions.java:110) com.ingemark.security.PolicyEntry.getPermissions(PolicyEntry.java:50) com.ingemark.security.AuthorizationInfo.getPermissions(AuthorizationInfo.java:73) com.ingemark.security.SecurityPolicy.getPermissions(SecurityPolicy.java:95) java.security.Policy.implies(Policy.java:397) java.security.ProtectionDomain.implies(ProtectionDomain.java:189) java.security.AccessControlContext.checkPermission(AccessControlContext.java:254) java.security.AccessController.checkPermission(AccessController.java:401) java.lang.SecurityManager.checkPermission(SecurityManager.java:524) java.lang.SecurityManager.checkRead(SecurityManager.java:863) java.io.File.exists(File.java:678) org.apache.naming.resources.FileDirContext.file(FileDirContext.java:826) org.apache.naming.resources.FileDirContext.lookup(FileDirContext.java:208) org.apache.naming.resources.ProxyDirContext.lookup(ProxyDirContext.java:287) org.apache.catalina.loader.WebappClassLoader.findResourceInternal(WebappClassLoader.java:1707) org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:1575) org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:860) org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1307) org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1189) java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302) com.ingemark.experiments.NamespacePermissionCollection.(NamespacePermissionCollection.java:22) com.ingemark.experiments.NamespacePermission.newPermissionCollection(NamespacePermission.java:66) java.security.Permissions.getPermissionCollection(Permissions.java:245) java.security.Permissions.add(Permissions.java:110) com.ingemark.security.PolicyEntry.getPermissions(PolicyEntry.java:50) com.ingemark.security.AuthorizationInfo.getPermissions(AuthorizationInfo.java:73) com.ingemark.security.SecurityPolicy.getPermissions(SecurityPolicy.java:95) java.security.Policy.implies(Policy.java:397) java.security.ProtectionDomain.implies(ProtectionDomain.java:189) java.security.AccessControlContext.checkPermission(AccessControlContext.java:254) java.security.AccessController.checkPermission(AccessController.java:401) com.ingemark.experiments.ServletSec$SecuredActions.run(ServletSec.java:207) java.security.AccessController.doPrivileged(Native Method) javax.security.auth.Subject.doAsPrivileged(Subject.java:437) com.ingemark.experiments.ServletSec.service(ServletSec.java:181) javax.servlet.http.HttpServlet.service(HttpServlet.java:810) 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:241) java.security.AccessController.doPrivileged(Native Method) javax.security.auth.Subject.doAsPrivileged(Subject.java:500) org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:263) org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:157) This time ex
RE: java.lang.ClassCircularityError
Hi, The error is 6 levels deep in your own class hierarchy. Maybe if you could share some of the relevant code we could help more. I haven't seen this error before (on any tomcat version). I haven't seen it reported here, or anything like it reported for tomcat 5. Hmm ;( Yoav Shapira Millennium Research Informatics >-Original Message- >From: Viktor Matic [mailto:[EMAIL PROTECTED] >Sent: Wednesday, May 19, 2004 11:16 AM >To: [EMAIL PROTECTED] >Subject: java.lang.ClassCircularityError > >We are getting java.lang.ClassCircularityError on the Tomcat 5.0.x (we >have tested the same code on a following releases 5.0.18, 5.0.19 and >5.0.24). The java source code, which we have used for the testing >purposes, consists of the servlet which use our custom implementation of >the java.security.Policy to test user rights to execute action. >This code pass JUnit tests and works fine if it is called isolated out >of the Tomcat (called through class with the main method). It also works >fine on Tomcat 4.1.30. >Since improvement list for Tomcat 5.0.x states that Security Manager >support is enhanced from 4.1.x release maybe there is something we are >missing to implement or maybe there is a new bug in the catalina class >loader when it is used with java.security.manager. It is important to >state that out application sets our policy (Policy.setPolicy(new >OurPolicy())). We are pretty sure that we have configured Tomcat >properly because everything works fine on older Tomcat. > >Here is error stack trace: > >root cause: >java.lang.ClassCircularityError: com/ingemark/security/AnybodyPrincipal > com.ingemark.security.SimpleGroup.isMember(SimpleGroup.java:65) > com.ingemark.security.NestableGroup.isMember(NestableGroup.java:89) > com.ingemark.security.PolicyEntry.contains(PolicyEntry.java:67) > com.ingemark.security.PolicyEntry.implies(PolicyEntry.java:105) > com.ingemark.security.AuthorizationInfo.getPermissions(AuthorizationI >nfo.java:72) > com.ingemark.security.SecurityPolicy.getPermissions(SecurityPolicy.ja >va:95) > java.security.Policy.implies(Policy.java:397) > java.security.ProtectionDomain.implies(ProtectionDomain.java:189) > java.security.AccessControlContext.checkPermission(AccessControlConte >xt.java:254) > java.security.AccessController.checkPermission(AccessController.java: >401) > java.lang.SecurityManager.checkPermission(SecurityManager.java:524) > java.lang.SecurityManager.checkRead(SecurityManager.java:863) > java.io.File.exists(File.java:678) > org.apache.naming.resources.FileDirContext.file(FileDirContext.java:8 >26) > org.apache.naming.resources.FileDirContext.lookup(FileDirContext.java >:208) > org.apache.naming.resources.ProxyDirContext.lookup(ProxyDirContext.ja >va:287) > org.apache.catalina.loader.WebappClassLoader.findResourceInternal(Web >appClassLoader.java:1707) > org.apache.catalina.loader.WebappClassLoader.findClassInternal(Webapp >ClassLoader.java:1575) > org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoa >der.java:860) > org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoa >der.java:1307) > org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoa >der.java:1189) > java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302) > com.ingemark.security.SimpleGroup.isMember(SimpleGroup.java:65) > com.ingemark.security.NestableGroup.isMember(NestableGroup.java:89) > com.ingemark.security.PolicyEntry.contains(PolicyEntry.java:67) > com.ingemark.security.PolicyEntry.implies(PolicyEntry.java:105) > com.ingemark.security.AuthorizationInfo.getPermissions(AuthorizationI >nfo.java:72) > com.ingemark.security.SecurityPolicy.getPermissions(SecurityPolicy.ja >va:95) > java.security.Policy.implies(Policy.java:397) > java.security.ProtectionDomain.implies(ProtectionDomain.java:189) > java.security.AccessControlContext.checkPermission(AccessControlConte >xt.java:254) > java.security.AccessController.checkPermission(AccessController.java: >401) > com.ingemark.experiments.ServletSec$SecuredActions.run(ServletSec.jav >a:207) > java.security.AccessController.doPrivileged(Native Method) > javax.security.auth.Subject.doAsPrivileged(Subject.java:437) > com.ingemark.experiments.ServletSec.service(ServletSec.java:181) > javax.servlet.http.HttpServlet.service(HttpServlet.java:810) > sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl. >java:39) > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces >sorImpl.java:25) > java.lang.reflect.Method.invoke(Method.java:324) > org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:241 >) > java.security.AccessController.doPrivileged(Native Method) > javax.security.auth.Subject.doAsPrivileged(Subject.java:500) > org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:2 >63) > org.apache.c
Re: java.lang.ClassCircularityError
Viktor Matic wrote: We are getting java.lang.ClassCircularityError on the Tomcat 5.0.x (we have tested the same code on a following releases 5.0.18, 5.0.19 and 5.0.24). The java source code, which we have used for the testing purposes, consists of the servlet which use our custom implementation of the java.security.Policy to test user rights to execute action. This code pass JUnit tests and works fine if it is called isolated out of the Tomcat (called through class with the main method). It also works fine on Tomcat 4.1.30. Since improvement list for Tomcat 5.0.x states that Security Manager support is enhanced from 4.1.x release maybe there is something we are missing to implement or maybe there is a new bug in the catalina class loader when it is used with java.security.manager. It is important to state that out application sets our policy (Policy.setPolicy(new OurPolicy())). We are pretty sure that we have configured Tomcat properly because everything works fine on older Tomcat. Well, take a look at org.apache.catalina.security.SecurityUtil. I am setting the Subject/AccessControlContext there. I think that might cause your problem, but I need more info ;-). AnybodyPrincipal is trying to do what? -- Jeanfrancois Here is error stack trace: root cause: java.lang.ClassCircularityError: com/ingemark/security/AnybodyPrincipal com.ingemark.security.SimpleGroup.isMember(SimpleGroup.java:65) com.ingemark.security.NestableGroup.isMember(NestableGroup.java:89) com.ingemark.security.PolicyEntry.contains(PolicyEntry.java:67) com.ingemark.security.PolicyEntry.implies(PolicyEntry.java:105) com.ingemark.security.AuthorizationInfo.getPermissions(AuthorizationInfo.java:72) com.ingemark.security.SecurityPolicy.getPermissions(SecurityPolicy.java:95) java.security.Policy.implies(Policy.java:397) java.security.ProtectionDomain.implies(ProtectionDomain.java:189) java.security.AccessControlContext.checkPermission(AccessControlContext.java:254) java.security.AccessController.checkPermission(AccessController.java:401) java.lang.SecurityManager.checkPermission(SecurityManager.java:524) java.lang.SecurityManager.checkRead(SecurityManager.java:863) java.io.File.exists(File.java:678) org.apache.naming.resources.FileDirContext.file(FileDirContext.java:826) org.apache.naming.resources.FileDirContext.lookup(FileDirContext.java:208) org.apache.naming.resources.ProxyDirContext.lookup(ProxyDirContext.java:287) org.apache.catalina.loader.WebappClassLoader.findResourceInternal(WebappClassLoader.java:1707) org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:1575) org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:860) org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1307) org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1189) java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302) com.ingemark.security.SimpleGroup.isMember(SimpleGroup.java:65) com.ingemark.security.NestableGroup.isMember(NestableGroup.java:89) com.ingemark.security.PolicyEntry.contains(PolicyEntry.java:67) com.ingemark.security.PolicyEntry.implies(PolicyEntry.java:105) com.ingemark.security.AuthorizationInfo.getPermissions(AuthorizationInfo.java:72) com.ingemark.security.SecurityPolicy.getPermissions(SecurityPolicy.java:95) java.security.Policy.implies(Policy.java:397) java.security.ProtectionDomain.implies(ProtectionDomain.java:189) java.security.AccessControlContext.checkPermission(AccessControlContext.java:254) java.security.AccessController.checkPermission(AccessController.java:401) com.ingemark.experiments.ServletSec$SecuredActions.run(ServletSec.java:207) java.security.AccessController.doPrivileged(Native Method) javax.security.auth.Subject.doAsPrivileged(Subject.java:437) com.ingemark.experiments.ServletSec.service(ServletSec.java:181) javax.servlet.http.HttpServlet.service(HttpServlet.java:810) 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:241) java.security.AccessController.doPrivileged(Native Method) javax.security.auth.Subject.doAsPrivileged(Subject.java:500) org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:263) org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:157) I will be happy to present this problem in more details if some