Results 1 to 4 of 4
  1. #1
    Ashok Dave is offline Member
    Join Date
    Feb 2009
    Posts
    4
    Rep Power
    0

    Default java.lang.StringBuffer.append(StringBuffer.java(Co mpiled Code))

    Hi Friends,

    This problem might not be a part of 'Advance Java' category, but I didn;t get reply in 'New To Java' category, please bail me out from this problem.

    I am Using - JDK 1.4;
    In code i used String to append string & not StringBuffer. It is working fine without any problem, but once in a while during deployment it is throwing below error; One analysis I received from my circle that I have attached below error.

    Error:
    --------------------------------------------------------------

    3XMTHREADINFO "WebContainer : 3" (TID:0x30159968, sys_thread_t:0x7DE6FDA8, state:MW, native ID:0x56CE) prio=5
    4XESTACKTRACE at java.lang.StringBuffer.append(StringBuffer.java(Co mpiled Code))
    4XESTACKTRACE at com.action.MyJavaFile.myJavaMethod(MyJavaFile.java (Compiled Code))
    4XESTACKTRACE at com.action.MyJavaFile.execute(MyJavaFile.java:120)
    4XESTACKTRACE at org.apache.struts.action.RequestProcessor.processA ctionPerform(RequestProcessor.java(Compiled Code))
    4XESTACKTRACE at com.dcx.tcc.gbom.util.LongWaitRequestProcessor.pro cessActionPerform(LongWaitRequestProcessor.java(Co mpiled Code))
    4XESTACKTRACE at org.apache.struts.action.RequestProcessor.process( RequestProcessor.java(Compiled Code))
    4XESTACKTRACE at org.apache.struts.action.ActionServlet.process(Act ionServlet.java(Compiled Code))
    4XESTACKTRACE at org.apache.struts.action.ActionServlet.doPost(Acti onServlet.java(Compiled Code))
    4XESTACKTRACE at javax.servlet.http.HttpServlet.service(HttpServlet .java(Compiled Code))
    4XESTACKTRACE at javax.servlet.http.HttpServlet.service(HttpServlet .java(Compiled Code))
    4XESTACKTRACE at com.ibm.ws.webcontainer.servlet.ServletWrapper.ser vice(ServletWrapper.java(Compiled Code))
    4XESTACKTRACE at com.ibm.ws.webcontainer.servlet.ServletWrapper.han dleRequest(ServletWrapper.java(Compiled Code))
    4XESTACKTRACE at com.ibm.ws.webcontainer.servlet.CacheServletWrappe r.handleRequest(CacheServletWrapper.java(Compiled Code))
    4XESTACKTRACE at com.ibm.ws.webcontainer.WebContainer.handleRequest (WebContainer.java(Compiled Code))
    4XESTACKTRACE at com.ibm.ws.webcontainer.channel.WCChannelLink.read y(WCChannelLink.java(Compiled Code))
    4XESTACKTRACE at com.ibm.ws.http.channel.inbound.impl.HttpInboundLi nk.handleDiscrimination(HttpInboundLink.java(Compi led Code))
    4XESTACKTRACE at com.ibm.ws.http.channel.inbound.impl.HttpInboundLi nk.handleNewInformation(HttpInboundLink.java(Compi led Code))
    4XESTACKTRACE at com.ibm.ws.http.channel.inbound.impl.HttpICLReadCa llback.complete(HttpICLReadCallback.java(Compiled Code))
    4XESTACKTRACE at com.ibm.ws.tcp.channel.impl.WorkQueueManager.reque stComplete(WorkQueueManager.java(Compiled Code))
    4XESTACKTRACE at com.ibm.ws.tcp.channel.impl.WorkQueueManager.attem ptIO(WorkQueueManager.java(Compiled Code))
    4XESTACKTRACE at com.ibm.ws.tcp.channel.impl.WorkQueueManager.worke rRun(WorkQueueManager.java(Compiled Code))
    4XESTACKTRACE at com.ibm.ws.tcp.channel.impl.WorkQueueManager$Worke r.run(WorkQueueManager.java(Compiled Code))
    4XESTACKTRACE at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.j ava(Compiled Code)) by Kiran P Nellutla

    --------------------------------------------------------------

    One analysis I received is in JDK1.4 for String Concatination, Compiler will internally implement StringBuffer for that concatenation.For that it will create pool of StringBuffer instance. In multi threaded environment , because of limitation of pool, it will either Hang JRE or crash JRE. To avoid this scenario use StringBuffer (for JDK 1.4).

    Can I have your opinion on this issue?


    Thanks,
    Ashok.

  2. #2
    toadaly is offline Senior Member
    Join Date
    Jan 2009
    Posts
    671
    Rep Power
    6

    Default

    heh, upgrade to java 6.

  3. #3
    Ashok Dave is offline Member
    Join Date
    Feb 2009
    Posts
    4
    Rep Power
    0

    Default

    Hi,

    Thanks for the suggestion, but this is maintenance application, and i need to find resolution for given problem. If you are able to provide me solution or the opinion on given analysis then it would be great for me.

    Thanks.
    Ashok.

  4. #4
    toadaly is offline Senior Member
    Join Date
    Jan 2009
    Posts
    671
    Rep Power
    6

    Default

    If it's intermittent and a suspected bug in an old JVM, I'd be tempted to patch around it with appropriate try/catch, and just retry when it happens.

Similar Threads

  1. Replies: 1
    Last Post: 03-03-2009, 06:27 AM
  2. Should I use StringBuffer?
    By GenkiSudo in forum New To Java
    Replies: 7
    Last Post: 09-21-2008, 01:39 PM
  3. StringBuilder v/s StringBuffer
    By Pooja Deshpande in forum New To Java
    Replies: 9
    Last Post: 04-11-2008, 10:38 AM
  4. StringBuffer
    By Java Tip in forum Java Tip
    Replies: 0
    Last Post: 11-08-2007, 09:33 AM
  5. Help with StringBuffer
    By Marcus in forum AWT / Swing
    Replies: 2
    Last Post: 07-04-2007, 06:50 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •