Re: problem with ojb when overwriting the toString() method

2005-04-04 Thread Armin Waibel
Hi Günther,
Günther Wieser wrote:
hi,
this weekend ojb brought me a lot of fun. i'd been searching for a problem
for over half a day until i found out that ojb didn't like the way i
overwrote the toString() method ob the objects that i wanted to be
persisted.
finally i found some debug output like BAD toString() implementation of
class x, but couldn't find any further details.
anyone an idea how i can implement an ojb compatible toString() method
output, and what ojb does with the result of the toString() method?
The BAD toString()... comment was cause by an exception thrown by the 
#toString() method of your persistent objet.
When OJB is logging some times the persistent object itself was logged 
too. In this case OJB checks if the #toString method of the object is 
valid to use. If not (#toString throws an exception) the BAD 
toString... entry is shown.

Could it be the case that the #toString method of your persistent object 
is cause an exception?

regards,
Armin

kr,
guenther

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


RE: problem with ojb when overwriting the toString() method

2005-04-04 Thread Günther Wieser
hi,

hmm, haven't seen any error so far when using the toString() method of
objects of this class so far.
what the toString() method does is to get all private fields of the object
by introspection and fill a string buffer with the name of the field and the
value.

i will look deeper into this later today, but, as mentioned, haven't seen
any problems so far with this method outside ojb. so if you have any other
idea what could cause this problem, i would very much appreciate that.

kr,
guenther

--
Günther Wieser

creative-it
Guglgasse 6/1/11/1
A-1110 Wien
Austria
http://www.creative-it.com


-Original Message-
From: Armin Waibel [mailto:[EMAIL PROTECTED] 
Sent: Monday, April 04, 2005 2:27 PM
To: OJB Users List
Subject: Re: problem with ojb when overwriting the toString() method

Hi Günther,

Günther Wieser wrote:
 hi,
 
 this weekend ojb brought me a lot of fun. i'd been searching for a 
 problem for over half a day until i found out that ojb didn't like the 
 way i overwrote the toString() method ob the objects that i wanted to 
 be persisted.
 
 finally i found some debug output like BAD toString() implementation 
 of class x, but couldn't find any further details.
 
 anyone an idea how i can implement an ojb compatible toString() method 
 output, and what ojb does with the result of the toString() method?
 

The BAD toString()... comment was cause by an exception thrown by the
#toString() method of your persistent objet.
When OJB is logging some times the persistent object itself was logged too.
In this case OJB checks if the #toString method of the object is valid to
use. If not (#toString throws an exception) the BAD toString... entry is
shown.

Could it be the case that the #toString method of your persistent object is
cause an exception?

regards,
Armin


 kr,
 guenther
 
 

-
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: problem with ojb when overwriting the toString() method

2005-04-04 Thread Armin Waibel
Günther Wieser wrote:
hi,
hmm, haven't seen any error so far when using the toString() method of
objects of this class so far.
what the toString() method does is to get all private fields of the object
by introspection and fill a string buffer with the name of the field and the
value.
i will look deeper into this later today, but, as mentioned, haven't seen
any problems so far with this method outside ojb. so if you have any other
idea what could cause this problem, i would very much appreciate that.
Sorry, this is the only idea I have. Have a look in one of the Logger 
implementations classes, e.g. PoorMansLoggerImpl. Here you can see how 
it works.

regards,
Armin

kr,
guenther
--
Günther Wieser
creative-it
Guglgasse 6/1/11/1
A-1110 Wien
Austria
http://www.creative-it.com
-Original Message-
From: Armin Waibel [mailto:[EMAIL PROTECTED] 
Sent: Monday, April 04, 2005 2:27 PM
To: OJB Users List
Subject: Re: problem with ojb when overwriting the toString() method

Hi Günther,
Günther Wieser wrote:
hi,
this weekend ojb brought me a lot of fun. i'd been searching for a 
problem for over half a day until i found out that ojb didn't like the 
way i overwrote the toString() method ob the objects that i wanted to 
be persisted.

finally i found some debug output like BAD toString() implementation 
of class x, but couldn't find any further details.

anyone an idea how i can implement an ojb compatible toString() method 
output, and what ojb does with the result of the toString() method?


The BAD toString()... comment was cause by an exception thrown by the
#toString() method of your persistent objet.
When OJB is logging some times the persistent object itself was logged too.
In this case OJB checks if the #toString method of the object is valid to
use. If not (#toString throws an exception) the BAD toString... entry is
shown.
Could it be the case that the #toString method of your persistent object is
cause an exception?
regards,
Armin

kr,
guenther


-
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]

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: problem with ojb when overwriting the toString() method

2005-04-04 Thread Thomas Franke
Günther Wieser wrote:
hmm, haven't seen any error so far when using the toString() method of
objects of this class so far.
what the toString() method does is to get all private fields of the object
by introspection and fill a string buffer with the name of the field and the
value.
Could I take a look on your source code?
regards
Thomas
--
Mit freundlichen Grüßen
Thomas Franke
Geschäftsführer
Leiter Entwicklung
--
the energy for a better world
--
softEnergy GmbH
Platz der Freundschaft 1
18059 Rostock
--
fon: +49 381 40 587 535
fax: +49 381 40 587 555
mobil: +49 1715222015
http://www.softenergy.de
mail: [EMAIL PROTECTED]
--
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


RE: problem with ojb when overwriting the toString() method

2005-04-04 Thread Günther Wieser
hi,

finally i found the problem. i started to make my tests more complex, and
then i found the big error (and the reason why i get a stack overflow): i
have objects that are liked bidirectionally with each other. i call
toString() on one of these objects, it dumps all private fields INCLUDING
the referenced object. as the referenced object's toString() method is
called, and as it references itself the first object again, a circular
reference is being established, a lot of toString() methods on the same
objects are being called again and again, and the stack overflow happens.
didn't see that happening in my code before as i called toString() on my
objects BEFORE i linked them bidirectionally.

kr,
guenther

-Original Message-
From: Thomas Franke [mailto:[EMAIL PROTECTED] 
Sent: Monday, April 04, 2005 3:12 PM
To: OJB Users List
Subject: Re: problem with ojb when overwriting the toString() method

Günther Wieser wrote:

 hmm, haven't seen any error so far when using the toString() method of 
 objects of this class so far.
 what the toString() method does is to get all private fields of the 
 object by introspection and fill a string buffer with the name of the 
 field and the value.
Could I take a look on your source code?

regards

Thomas
--
Mit freundlichen Grüßen

Thomas Franke

Geschäftsführer
Leiter Entwicklung
--
the energy for a better world
--
softEnergy GmbH
Platz der Freundschaft 1
18059 Rostock
--
fon: +49 381 40 587 535
fax: +49 381 40 587 555
mobil: +49 1715222015

http://www.softenergy.de
mail: [EMAIL PROTECTED]
--

-
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: problem with ojb when overwriting the toString() method

2005-04-04 Thread Armin Waibel
... so OJB found a bug in your code ;-)
Armin
Günther Wieser wrote:
hi,
finally i found the problem. i started to make my tests more complex, and
then i found the big error (and the reason why i get a stack overflow): i
have objects that are liked bidirectionally with each other. i call
toString() on one of these objects, it dumps all private fields INCLUDING
the referenced object. as the referenced object's toString() method is
called, and as it references itself the first object again, a circular
reference is being established, a lot of toString() methods on the same
objects are being called again and again, and the stack overflow happens.
didn't see that happening in my code before as i called toString() on my
objects BEFORE i linked them bidirectionally.
kr,
guenther
-Original Message-
From: Thomas Franke [mailto:[EMAIL PROTECTED] 
Sent: Monday, April 04, 2005 3:12 PM
To: OJB Users List
Subject: Re: problem with ojb when overwriting the toString() method

Günther Wieser wrote:

hmm, haven't seen any error so far when using the toString() method of 
objects of this class so far.
what the toString() method does is to get all private fields of the 
object by introspection and fill a string buffer with the name of the 
field and the value.
Could I take a look on your source code?
regards
Thomas
--
Mit freundlichen Grüßen
Thomas Franke
Geschäftsführer
Leiter Entwicklung
--
the energy for a better world
--
softEnergy GmbH
Platz der Freundschaft 1
18059 Rostock
--
fon: +49 381 40 587 535
fax: +49 381 40 587 555
mobil: +49 1715222015
http://www.softenergy.de
mail: [EMAIL PROTECTED]
--
-
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]

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]