You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jetspeed-dev@portals.apache.org by Barnhill William <ba...@bah.com> on 2003/12/02 18:04:16 UTC
Re: [J2] Cornerstone stack overflow
The readme file in the cornerstone sample zip says that the
StackOverflowError happens sometimes. For me it's happening everytime.
After doing some hunting and fiddling with logging I think I've tracked
it down to the following msg/location:
2003-12-02 12:01:25,702 671
[main@(org.apache.cornerstone.framework.persistence.factory.BasePersistentObjectCollectionFactory.createCollection(BasePersistentObjectCollectionFactory.java:325))]
ERROR
org.apache.cornerstone.framework.persistence.factory.BasePersistentObjectCollectionFactory
- collection type definition missing; use
'collection.instance.className' or 'collection.factory.className' or
'collection.parent.name'
Has anyone fixed this already?
Does anyone have an idea how to fix this?
Also, will it make a difference right now if I use the version in CVS,
or the one in the zip archive?
---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jetspeed-dev-help@jakarta.apache.org
Re: [J2] Cornerstone stack overflow
Posted by Jun Yang <ju...@cisco.com>.
Yes, Bill, that is the fix. Thank you so much!
Jun
Barnhill William wrote:
> Hi Jun,
>
> Your welcome, just happy I can start contributing a little instead of
> spouting opinions.
> FYI, this problem occurred with the zip file version of the sources
> and a little further tracking tracked it to
> org.apache.cornerstone.framework.api.core.BaseException::getCause
>
> Looking at that method it looked like you could have an infinite loop
> if the cause of the original exception was null, so I ...
> 1) commented out extra code in that method
> 2) changed it to return super.getCause()
> 3) re-tested
> And no stack overflow
>
> Granted it's a jury rig fix, as I don't know the impact of commenting
> out the other code in getCause().
> If the impact is a non-issue then do I need to submit a patch for the
> <10 line fix to get committed, or is this enough info for a committer
> to do a fix?
>
> Btw, first and last names can be confusing in emails, and my actual
> first name is Bill, not Barnhill.
> This may be an issue with my client or email server.
>
> Thanks,
> Bill Barnhill
>
>
> Jun Yang wrote:
>
>> Hi Barnhill,
>>
>> Thanks for your diligent work! My comments are below. I will also
>> respond to your next message.
>>
>> Barnhill William wrote:
>>
>>> The readme file in the cornerstone sample zip says that the
>>> StackOverflowError happens sometimes. For me it's happening everytime.
>>>
>>> After doing some hunting and fiddling with logging I think I've
>>> tracked it down to the following msg/location:
>>>
>>> 2003-12-02 12:01:25,702 671
>>> [main@(org.apache.cornerstone.framework.persistence.factory.BasePersistentObjectCollectionFactory.createCollection(BasePersistentObjectCollectionFactory.java:325))]
>>>
>>> ERROR
>>> org.apache.cornerstone.framework.persistence.factory.BasePersistentObjectCollectionFactory
>>> - collection type definition missing; use
>>> 'collection.instance.className' or 'collection.factory.className' or
>>> 'collection.parent.name'
>>>
>>> Has anyone fixed this already?
>>>
>>> Does anyone have an idea how to fix this?
>>>
>>> Also, will it make a difference right now if I use the version in
>>> CVS, or the one in the zip archive?
>>
>>
>>
>> Until further notice, please use the zip file which is the latest and
>> greatest. I have seen many CVS messages showing Scott is committing
>> the content of the zip into CVS. The difference between the zip
>> version and the CVS version will be small (such as the CVS version
>> uses Maven to build vs. just Ant). After I get a Jarkata account
>> this will be easier and the CVS version will be the only version we
>> use going forward.
>>
>> Jun
>
---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jetspeed-dev-help@jakarta.apache.org
Re: [J2] Cornerstone stack overflow
Posted by Barnhill William <ba...@bah.com>.
Hi Jun,
Your welcome, just happy I can start contributing a little instead of
spouting opinions.
FYI, this problem occurred with the zip file version of the sources and
a little further tracking tracked it to
org.apache.cornerstone.framework.api.core.BaseException::getCause
Looking at that method it looked like you could have an infinite loop if
the cause of the original exception was null, so I ...
1) commented out extra code in that method
2) changed it to return super.getCause()
3) re-tested
And no stack overflow
Granted it's a jury rig fix, as I don't know the impact of commenting
out the other code in getCause().
If the impact is a non-issue then do I need to submit a patch for the
<10 line fix to get committed, or is this enough info for a committer to
do a fix?
Btw, first and last names can be confusing in emails, and my actual
first name is Bill, not Barnhill.
This may be an issue with my client or email server.
Thanks,
Bill Barnhill
Jun Yang wrote:
> Hi Barnhill,
>
> Thanks for your diligent work! My comments are below. I will also
> respond to your next message.
>
> Barnhill William wrote:
>
>> The readme file in the cornerstone sample zip says that the
>> StackOverflowError happens sometimes. For me it's happening everytime.
>>
>> After doing some hunting and fiddling with logging I think I've
>> tracked it down to the following msg/location:
>>
>> 2003-12-02 12:01:25,702 671
>> [main@(org.apache.cornerstone.framework.persistence.factory.BasePersistentObjectCollectionFactory.createCollection(BasePersistentObjectCollectionFactory.java:325))]
>>
>> ERROR
>> org.apache.cornerstone.framework.persistence.factory.BasePersistentObjectCollectionFactory
>> - collection type definition missing; use
>> 'collection.instance.className' or 'collection.factory.className' or
>> 'collection.parent.name'
>>
>> Has anyone fixed this already?
>>
>> Does anyone have an idea how to fix this?
>>
>> Also, will it make a difference right now if I use the version in
>> CVS, or the one in the zip archive?
>
>
> Until further notice, please use the zip file which is the latest and
> greatest. I have seen many CVS messages showing Scott is committing
> the content of the zip into CVS. The difference between the zip
> version and the CVS version will be small (such as the CVS version
> uses Maven to build vs. just Ant). After I get a Jarkata account this
> will be easier and the CVS version will be the only version we use
> going forward.
>
> Jun
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jetspeed-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: jetspeed-dev-help@jakarta.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jetspeed-dev-help@jakarta.apache.org
Re: [J2] Cornerstone stack overflow
Posted by Jun Yang <ju...@cisco.com>.
Hi Barnhill,
Thanks for your diligent work! My comments are below. I will also
respond to your next message.
Barnhill William wrote:
> The readme file in the cornerstone sample zip says that the
> StackOverflowError happens sometimes. For me it's happening everytime.
>
> After doing some hunting and fiddling with logging I think I've
> tracked it down to the following msg/location:
>
> 2003-12-02 12:01:25,702 671
> [main@(org.apache.cornerstone.framework.persistence.factory.BasePersistentObjectCollectionFactory.createCollection(BasePersistentObjectCollectionFactory.java:325))]
>
> ERROR
> org.apache.cornerstone.framework.persistence.factory.BasePersistentObjectCollectionFactory
> - collection type definition missing; use
> 'collection.instance.className' or 'collection.factory.className' or
> 'collection.parent.name'
>
> Has anyone fixed this already?
>
> Does anyone have an idea how to fix this?
>
> Also, will it make a difference right now if I use the version in CVS,
> or the one in the zip archive?
Until further notice, please use the zip file which is the latest and
greatest. I have seen many CVS messages showing Scott is committing the
content of the zip into CVS. The difference between the zip version and
the CVS version will be small (such as the CVS version uses Maven to
build vs. just Ant). After I get a Jarkata account this will be easier
and the CVS version will be the only version we use going forward.
Jun
---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jetspeed-dev-help@jakarta.apache.org
Re: [J2] Cornerstone stack overflow
Posted by Barnhill William <ba...@bah.com>.
Jun and all,
My sincere apologies, this came in as I was writing a response to the
earlier msg.
Bill
Jun Yang wrote:
> Hi Barnhill,
>
> I am very sorry for this glitch. I am sure it's a small thing. I
> just didn't have time to get around to it. Thanks for your excellent
> detective work. PersistenceException is where I guessed where the
> problem may be (actually it may turn out to be its super class
> BaseException). My guess is the getCause() method has infinite
> recursion on itself. So a condition should be added to detect if
> cause == this then we just return this or something like that. I will
> try to see if I have time to fix it today. Thanks again!
>
> Jun
>
> Barnhill William wrote:
>
>> ok, based on some behavior I was seeing in the debugger I think I've
>> tracked down the real culprit : PersistenceException.
>>
>> I can reproduce the bug every time if I reduce the demoPersistence
>> program down to just the following:
>>
>> package org.apache.cornerstone.framework.demo.main;
>>
>> import java.util.List;
>>
>> import org.apache.cornerstone.framework.api.factory.CreationException;
>> import org.apache.cornerstone.framework.api.factory.IFactory;
>> import
>> org.apache.cornerstone.framework.api.implementation.ImplementationException;
>>
>> import org.apache.cornerstone.framework.bean.visitor.BeanPrinter;
>> import org.apache.cornerstone.framework.demo.bo.api.IGroup;
>> import org.apache.cornerstone.framework.demo.bo.api.IUser;
>> import org.apache.cornerstone.framework.init.Cornerstone;
>> import org.apache.cornerstone.framework.init.InitException;
>> import org.apache.log4j.PropertyConfigurator;
>> import org.apache.log4j.Logger;
>> import
>> org.apache.cornerstone.framework.api.persistence.factory.PersistenceException;
>>
>>
>> public class DemoPersistence {
>> public static final String REVISION = "$Revision: 1.6 $";
>> public static void main(String[] args) throws InitException,
>> ImplementationException, CreationException {
>> // init log4j
>> String log4jConfigFilePath =
>> System.getProperty("log4j.configuration", "log4j.properties");
>> PropertyConfigurator.configure(log4jConfigFilePath);
>> Logger log = Logger.getLogger(DemoPersistence.class);
>> //try {
>> Cornerstone.init("../../runtime");
>> try {
>> try {
>> throw new PersistenceException("dummy");
>> }
>> catch (PersistenceException ex) {
>> log.error(ex);
>> ex.printStackTrace();
>> } }
>> catch (Throwable th) {
>> java.io.StringWriter sw = new java.io.StringWriter();
>> java.io.PrintWriter pw = new java.io.PrintWriter(sw);
>> if (th.getCause() == null) {
>> pw.println("Cause is null");
>> }
>> else {
>> th.getCause().printStackTrace(pw);
>> }
>> th.printStackTrace(pw);
>> log.error("Error message is "+th.getMessage());
>> log.error("Stack trace from previous error was:
>> \n"+sw.getBuffer().toString()); }
>> }
>> }
>>
>> The output I get is :
>> org.apache.cornerstone.framework.api.persistence.factory.PersistenceException:
>> dummy
>> at
>> org.apache.cornerstone.framework.demo.main.DemoPersistence.main(DemoPersistence.java:31)
>>
>> Caused by:
>> org.apache.cornerstone.framework.api.persistence.factory.PersistenceException:
>> dummy
>> ... 1 more
>>
>> with
>> Caused by:
>> org.apache.cornerstone.framework.api.persistence.factory.PersistenceException:
>> dummy
>> ... 1 more
>> repeated MANY more times.
>>
>>
>> Barnhill William wrote:
>>
>>> The readme file in the cornerstone sample zip says that the
>>> StackOverflowError happens sometimes. For me it's happening everytime.
>>>
>>> After doing some hunting and fiddling with logging I think I've
>>> tracked it down to the following msg/location:
>>>
>>> 2003-12-02 12:01:25,702 671
>>> [main@(org.apache.cornerstone.framework.persistence.factory.BasePersistentObjectCollectionFactory.createCollection(BasePersistentObjectCollectionFactory.java:325))]
>>>
>>> ERROR
>>> org.apache.cornerstone.framework.persistence.factory.BasePersistentObjectCollectionFactory
>>> - collection type definition missing; use
>>> 'collection.instance.className' or 'collection.factory.className' or
>>> 'collection.parent.name'
>>>
>>> Has anyone fixed this already?
>>>
>>> Does anyone have an idea how to fix this?
>>>
>>> Also, will it make a difference right now if I use the version in
>>> CVS, or the one in the zip archive?
>>
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jetspeed-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: jetspeed-dev-help@jakarta.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jetspeed-dev-help@jakarta.apache.org
Re: [J2] Cornerstone stack overflow
Posted by Jun Yang <ju...@cisco.com>.
Hi Barnhill,
I am very sorry for this glitch. I am sure it's a small thing. I just
didn't have time to get around to it. Thanks for your excellent
detective work. PersistenceException is where I guessed where the
problem may be (actually it may turn out to be its super class
BaseException). My guess is the getCause() method has infinite
recursion on itself. So a condition should be added to detect if cause
== this then we just return this or something like that. I will try to
see if I have time to fix it today. Thanks again!
Jun
Barnhill William wrote:
> ok, based on some behavior I was seeing in the debugger I think I've
> tracked down the real culprit : PersistenceException.
>
> I can reproduce the bug every time if I reduce the demoPersistence
> program down to just the following:
>
> package org.apache.cornerstone.framework.demo.main;
>
> import java.util.List;
>
> import org.apache.cornerstone.framework.api.factory.CreationException;
> import org.apache.cornerstone.framework.api.factory.IFactory;
> import
> org.apache.cornerstone.framework.api.implementation.ImplementationException;
>
> import org.apache.cornerstone.framework.bean.visitor.BeanPrinter;
> import org.apache.cornerstone.framework.demo.bo.api.IGroup;
> import org.apache.cornerstone.framework.demo.bo.api.IUser;
> import org.apache.cornerstone.framework.init.Cornerstone;
> import org.apache.cornerstone.framework.init.InitException;
> import org.apache.log4j.PropertyConfigurator;
> import org.apache.log4j.Logger;
> import
> org.apache.cornerstone.framework.api.persistence.factory.PersistenceException;
>
>
> public class DemoPersistence {
> public static final String REVISION = "$Revision: 1.6 $";
> public static void main(String[] args) throws InitException,
> ImplementationException, CreationException {
> // init log4j
> String log4jConfigFilePath =
> System.getProperty("log4j.configuration", "log4j.properties");
> PropertyConfigurator.configure(log4jConfigFilePath);
> Logger log = Logger.getLogger(DemoPersistence.class);
> //try {
> Cornerstone.init("../../runtime");
> try {
> try {
> throw new PersistenceException("dummy");
> }
> catch (PersistenceException ex) {
> log.error(ex);
> ex.printStackTrace();
> } }
> catch (Throwable th) {
> java.io.StringWriter sw = new java.io.StringWriter();
> java.io.PrintWriter pw = new java.io.PrintWriter(sw);
> if (th.getCause() == null) {
> pw.println("Cause is null");
> }
> else {
> th.getCause().printStackTrace(pw);
> }
> th.printStackTrace(pw);
> log.error("Error message is "+th.getMessage());
> log.error("Stack trace from previous error was:
> \n"+sw.getBuffer().toString()); }
> }
> }
>
> The output I get is :
> org.apache.cornerstone.framework.api.persistence.factory.PersistenceException:
> dummy
> at
> org.apache.cornerstone.framework.demo.main.DemoPersistence.main(DemoPersistence.java:31)
>
> Caused by:
> org.apache.cornerstone.framework.api.persistence.factory.PersistenceException:
> dummy
> ... 1 more
>
> with
> Caused by:
> org.apache.cornerstone.framework.api.persistence.factory.PersistenceException:
> dummy
> ... 1 more
> repeated MANY more times.
>
>
> Barnhill William wrote:
>
>> The readme file in the cornerstone sample zip says that the
>> StackOverflowError happens sometimes. For me it's happening everytime.
>>
>> After doing some hunting and fiddling with logging I think I've
>> tracked it down to the following msg/location:
>>
>> 2003-12-02 12:01:25,702 671
>> [main@(org.apache.cornerstone.framework.persistence.factory.BasePersistentObjectCollectionFactory.createCollection(BasePersistentObjectCollectionFactory.java:325))]
>>
>> ERROR
>> org.apache.cornerstone.framework.persistence.factory.BasePersistentObjectCollectionFactory
>> - collection type definition missing; use
>> 'collection.instance.className' or 'collection.factory.className' or
>> 'collection.parent.name'
>>
>> Has anyone fixed this already?
>>
>> Does anyone have an idea how to fix this?
>>
>> Also, will it make a difference right now if I use the version in
>> CVS, or the one in the zip archive?
>
---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jetspeed-dev-help@jakarta.apache.org
Re: [J2] Cornerstone stack overflow
Posted by Barnhill William <ba...@bah.com>.
ok, based on some behavior I was seeing in the debugger I think I've
tracked down the real culprit : PersistenceException.
I can reproduce the bug every time if I reduce the demoPersistence
program down to just the following:
package org.apache.cornerstone.framework.demo.main;
import java.util.List;
import org.apache.cornerstone.framework.api.factory.CreationException;
import org.apache.cornerstone.framework.api.factory.IFactory;
import
org.apache.cornerstone.framework.api.implementation.ImplementationException;
import org.apache.cornerstone.framework.bean.visitor.BeanPrinter;
import org.apache.cornerstone.framework.demo.bo.api.IGroup;
import org.apache.cornerstone.framework.demo.bo.api.IUser;
import org.apache.cornerstone.framework.init.Cornerstone;
import org.apache.cornerstone.framework.init.InitException;
import org.apache.log4j.PropertyConfigurator;
import org.apache.log4j.Logger;
import
org.apache.cornerstone.framework.api.persistence.factory.PersistenceException;
public class DemoPersistence {
public static final String REVISION = "$Revision: 1.6 $";
public static void main(String[] args) throws InitException,
ImplementationException, CreationException {
// init log4j
String log4jConfigFilePath =
System.getProperty("log4j.configuration", "log4j.properties");
PropertyConfigurator.configure(log4jConfigFilePath);
Logger log = Logger.getLogger(DemoPersistence.class);
//try {
Cornerstone.init("../../runtime");
try {
try {
throw new PersistenceException("dummy");
}
catch (PersistenceException ex) {
log.error(ex);
ex.printStackTrace();
}
}
catch (Throwable th) {
java.io.StringWriter sw = new java.io.StringWriter();
java.io.PrintWriter pw = new java.io.PrintWriter(sw);
if (th.getCause() == null) {
pw.println("Cause is null");
}
else {
th.getCause().printStackTrace(pw);
}
th.printStackTrace(pw);
log.error("Error message is "+th.getMessage());
log.error("Stack trace from previous error was:
\n"+sw.getBuffer().toString());
}
}
}
The output I get is :
org.apache.cornerstone.framework.api.persistence.factory.PersistenceException:
dummy
at
org.apache.cornerstone.framework.demo.main.DemoPersistence.main(DemoPersistence.java:31)
Caused by:
org.apache.cornerstone.framework.api.persistence.factory.PersistenceException:
dummy
... 1 more
with
Caused by:
org.apache.cornerstone.framework.api.persistence.factory.PersistenceException:
dummy
... 1 more
repeated MANY more times.
Barnhill William wrote:
> The readme file in the cornerstone sample zip says that the
> StackOverflowError happens sometimes. For me it's happening everytime.
>
> After doing some hunting and fiddling with logging I think I've
> tracked it down to the following msg/location:
>
> 2003-12-02 12:01:25,702 671
> [main@(org.apache.cornerstone.framework.persistence.factory.BasePersistentObjectCollectionFactory.createCollection(BasePersistentObjectCollectionFactory.java:325))]
>
> ERROR
> org.apache.cornerstone.framework.persistence.factory.BasePersistentObjectCollectionFactory
> - collection type definition missing; use
> 'collection.instance.className' or 'collection.factory.className' or
> 'collection.parent.name'
>
> Has anyone fixed this already?
>
> Does anyone have an idea how to fix this?
>
> Also, will it make a difference right now if I use the version in CVS,
> or the one in the zip archive?
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jetspeed-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: jetspeed-dev-help@jakarta.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jetspeed-dev-help@jakarta.apache.org