Garbage Statement

R

Ravi Shankar Nair

Dear all,

I have a J2EE application called THUB. Other applications will invoke my
THUB using a servlet URL call, writing the parameters in the stream. In
THUB, within the receiving servlet, I get the parameters from stream and
invoke an EJB which does translation of the message from EDI to XML. The
application is working for very high load for about 10 months. The
application is deplyed in BEA Weblogic 8.1.

Today the one, exactly one and the first one in 10 months reported a problem
saying that the traslated output XML contains some characters which are not
part of the message. When I looked, I have seen that, the Garbage
Collector's message is printed as the first line as:-

[GC 240575K->130513K(511232K), 0.1076972 secs] <trade version="1.0"
date="20060111" time="123806"><std_dec
version="1.0"><std_dec_header><int_no>

<!--- valid XML tags here -->

</trade>



There is no clue at all. I am using a FileWriter to write the output. Can
any experts out there kindly help me on how this line crept in ? Please note
that the start up script contains option "verbosegc", which should and must
write to the console output rather than to a file, provided the fact that I
am not at all setting any output stream. After my translation, I just open
the file and write the translated XML output to a file using FileWriter and
I close it after I write. Any clues, thanks

Regards,

Ravi
 
J

John C. Bollinger

Ravi said:
Today the one, exactly one and the first one in 10 months reported a problem
saying that the traslated output XML contains some characters which are not
part of the message. When I looked, I have seen that, the Garbage
Collector's message is printed as the first line as:-

[GC 240575K->130513K(511232K), 0.1076972 secs] <trade version="1.0"
date="20060111" time="123806"><std_dec
version="1.0"><std_dec_header><int_no>

<!--- valid XML tags here -->

</trade>



There is no clue at all. I am using a FileWriter to write the output. Can
any experts out there kindly help me on how this line crept in ? Please note
that the start up script contains option "verbosegc", which should and must
write to the console output rather than to a file, provided the fact that I
am not at all setting any output stream. After my translation, I just open
the file and write the translated XML output to a file using FileWriter and
I close it after I write. Any clues, thanks

Supposing that the problem was not a transient VM blooper, I'd look for
invocations of System.setOut() and System.setErr(). These might cause
the verbose GC output to be directed to some other stream than whichever
of the VM's standard streams it normally goes to. I speculate that some
code in your application, possibly in a third-party library, is using
one of these to temporarily change the System's output or error stream.
One might do that, for instance, to glue in code that was originally
(and unwisely) written to use the standard streams explicitly.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,431
Messages
2,571,677
Members
48,796
Latest member
Greg L.

Latest Threads

Top