ThreadInfo.getStackTrace() (JDK 1.5)

The javadocs for ThreadInfo.getStackTrace() states the following:
If no stack trace was requested for this thread info, this method will return a zero-length array.
I'm using the ThreadMXBean to retrieve a list of all Thread ids, then the ThreadInfo by each Id. When I attempt to output the stack trace for each Thread, nothing is output. In short, my StackTraceElement array is zero length.
My current platform is Windows XP Pro SP2, and the JDK is 1.5.0_005. I'm guessing that my platform does support the stack trace frames. So the only other logical explanation I can imagine is that "no stack trace was requested," as stated in the above javadoc.
If I'm on the right trail, how does one request the most recent stack trace information to be populated on a ThreadInfo object? Does the default ThreadMXBean not do so?
Thanks for any insight.

If you already have a ThreadInfo, you can call getThreadInfo on its ID and specify a stack trace depth. For example:
ThreadMXBean tmbean; // initialized somewhere
ThreadInfo threadInfo; // initialized somewhere
// Update the thread info with the full stack trace
threadInfo = tmbean.getThreadInfo(threadInfo.getThreadId(), Integer.MAX_VALUE);
StackTraceElement[] stackTrace = threadInfo.getStackTrace();
By default, ThreadInfo has no stack trace elements.

Similar Messages

  • ThreadInfo's getThreadId() == java.lang.Thread's getId() ?

    Hi Folks
    I am trying to add MBean to show CPU consumption of various threads in my application.
    The threads created during the course of the application execution are maintained in a vector list.
    In my instrumentation code, I use this list of threads and
    a) iterate over each Thread instance and get its thread id ( thread.getId() )
    b) Using this long value, I determine the CPU consumption of this thread as :
    ThreadMXBeanInstance. getThreadCpuTime(threadId)
    However this does not seem to be giving me the correct value.
    On debugging using a generic program, where I print the thread ID , name, CPU consumption of all the threads in the JVM, as :
    ThreadMXBeanInstance.getAllThreadIds()
    for( each ThreadInfo...)
    //print attributes using ThreadInfo.getThreadName(..)..getThreadId(..)...etc..
    the thread ID printed by ThreadInfo.getThreadId() seems to be always +1 + the threadID got as in (a))+.
    Please let me know if you can throw some light on the above subject?
    ps : I am using Java 6, u10 on a WINXP, SP2 + 2CPU Intel Core processor with 2 GHz & 2GB memory.
    Great Thanks in advance.

    Hi,
    Are you sure you haven't made a mistake somewhere?
    Here is a small program that iterates over the threads and print their name and thread id has obtained from Thread and ThreadInfo. I've run it on JDK 6u10 and as you can see the information match. What do you get if you run it on your install? (hint: run it with -Dcom.sun.management.jmxremote to get the same results than I).
    Here the program:
    package threadid;
    import java.lang.management.ManagementFactory;
    import java.lang.management.ThreadInfo;
    import java.lang.management.ThreadMXBean;
    * @author dfuchs
    public class Main {
         * @param args the command line arguments
        public static void main(String[] args) {
            // TODO code application logic here
            final ThreadMXBean tmb = ManagementFactory.getThreadMXBean();
            final Thread[] ts = new Thread[tmb.getThreadCount()];
            ThreadGroup tg = Thread.currentThread().getThreadGroup();
            while (tg.getParent()!=null) {
                tg = tg.getParent();
            tg.enumerate(ts,true);
            for (Thread t : ts) {
                if (t==null) continue;
                final ThreadInfo ti = tmb.getThreadInfo(t.getId());
                System.out.println(t.getName()+"[id="+t.getId()+"]: name=" +
                        ti.getThreadName()+", id="+ti.getThreadId());
    }Here is the output:
    Reference Handler[id=2]: name=Reference Handler, id=2
    Finalizer[id=3]: name=Finalizer, id=3
    Signal Dispatcher[id=4]: name=Signal Dispatcher, id=4
    RMI TCP Accept-0[id=9]: name=RMI TCP Accept-0, id=9
    main[id=1]: name=main, id=1Hope this helps,
    -- daniel
    [http://blogs.sun.com/jmxetc|http://blogs.sun.com/jmxetc]

  • How to install and configure WebLogic 10.3 to use 64-bit JDK?

    Hi,
    Is there a preferred/supported way to configure WebLogic to use the 64-bit JRockit that comes with JRockit Mission Control?
    I can't find any official documentation about how to configure WebLogic to use a 64-bit JDK. From other forum posts I can tell we need to use the 64-bit JRockit that is bundled with JRockit Mission Control (available at [http://www.oracle.com/technology/software/products/jrockit/index.html]) but then we are kind of stuck - the configure script which let me select a JDK for a domain doesn't seem to let me re-configure an existing domain, and I can't find anything within the admin console that would let me set the JDK to use.
    I was able to rename the existing jrockit_160_05 directory to e.g. jrockit_160_05_original and then rename the jrmc directory to "jrockit_160_05", effectively taking the place of the JDK being used but this seemed like a bad way to do it. I also found via Google this page: [http://java.sodeso.nl/application-servers/bea-weblogic/how-can-i-change-the-jdk-installation-that-weblogic-uses] which basically says to modify the JAVA_HOME environment variable in the start scripts, but this seems like the same thing.
    With the plethora of products and the different ways they are bundled, combined with all the documentation about everything, I thought I would find something but I keep coming up blank. Does anyone have suggestions or pointers?
    Thanks,
    KaJun

    Make sure your environment configuration is supported here:
    http://www.oracle.com/technology/software/products/ias/files/fusion_certification.html
    Then, you need to have the correct 64bit JDK installed. Sounds like you have done that.
    Then download and run the generic platform installer as described here with your 64bit supported JDK:
    http://download.oracle.com/docs/cd/E12839_01/doc.1111/e14142/start.htm#i1077535
    Notice how the link you post has the generic installer for all the 64bit JVM rows, but the other installer for the 32bit JVMs on the 64bit OS?

  • Paint performance with JScrollPane very slow in jdk 1.4?

    I got a simple program that overrides paintComponent on a JPanel. Then draws lots of lines, rectangles and some strings. The panel is then added to a scrollpane.
    The scrolling is very smooth in java 1.3.1, but very slow in 1.4.2
    the paintComponent takes between 16ms and 30ms with java 1.3.1 but 70-200ms with java 1.4.2.
    I tried turning of antialising etc.. but no help. Whats the "improvement" they made in jdk 1.4?

    Ok I made a simple example, which draws around 5000 elements.
    Sourcecode is here: http://www.mcmadsen.dk/files/ScrollPaneTest.java
    I did several testruns on java 1.4.2 and java 1.3.1, heres the "avarage" result:
    Java 1.4.2:
         Current: 140ms High: 203ms Avg: 144ms Low: 125ms
    Java 1.3.1:
         Current: 62ms High: 219ms Avg: 68ms Low: 47ms
    The paintComponent() looks like this:
    public void paintComponent(Graphics g)
    super.paintComponent(g);
    long offset=System.currentTimeMillis();
    PaintElement paintElementTmp;
    for(int i=0;i<paintElements.size();i++)
    paintElementTmp=(PaintElement)paintElements.elementAt(i);
    g.setColor(paintElementTmp.getBackground());
    g.fillRect(paintElementTmp.getX(),paintElementTmp.getY(),paintElementTmp.getWidth(),paintElementTmp.getHeight());
    g.setColor(paintElementTmp.getForeground());
    g.drawString(paintElementTmp.getText(),paintElementTmp.getX(),paintElementTmp.getY());
    long done=System.currentTimeMillis();
    long current=done-offset;
    sum+=current;
    if(current>high)high=current;
    if(low>current)low=current;
    count++;
    System.out.println("Current: "+current+"ms High: "+high+"ms Avg: "+(sum/count)+"ms Low: "+low+"ms");
    I tried all the renderinghints, but no difference (from the default settings). Also the scrolling is very slow and stops all the time in java 1.4.
    Any ideas on how to get java 1.4 to perform as java 1.3.1?
    Thanks

  • JAXP 1.4 in JDK 1.5? javax.xml.stream.FactoryFinder$ConfigurationError

    hello,
    i'm forced to develop in jdk 1.5 and need to use package javax.xml.stream (StAX), which is not included in jaxp1.3 (in jdk 5), so there is a need to somehow integrate jaxp 1.4 to jdk5.
    first thing i've tried was getting jaxp 1.4 src and include a buildpath to my project to it. problem is, that javax.xml.stream.XMLOutputFactory.newInstance() throws exception javax.xml.stream.FactoryFinder$ConfigurationError: Provider com.sun.xml.internal.stream.XMLOutputFactoryImpl not found
    thanks in advance

    problem solved

  • BufferedImage creation slow in JDK 1.4.2

    Hi,
    The creation of BufferedImage of size 400x400 takes 156ms in JDK1.4.2. It used to take less than 10ms in JDK1.3.1.
    Image image = new BufferedImage(400, 400, BufferedImage.TYPE_INT_ARGB);
    In JDK1.4.2, for sizes 363x363 and above, it takes 156ms and
    for sizes under 363x363, it takes close to 0ms.
    Is this a bug in JDK 1.4.2? I noticed similar behavior in JDK1.5 also.
    My machine configuration:
    Windows XP, 512MB Ram, 1.7GHz
    Thanks,
    Bindu

    The arg type of the setter and the return type of the getter must match up or you'll get this exception.

  • Problems with Adler32 class in JDK 1.5 (not tried 1.6)

    When I use the java.util.zip.Adler32-class for generating Adler32-checksums, I found a couple of strange problems. When the total filesize (generating checksums of several files with the same checksum-object, using reset() in between) is 31999 bytes or greater, it gives pseudorandom output for the first file that exceeds the 31999 bytes. By running the test-program several times in a row, it seems like the output changes every second, as if random data was generated with the second counter as a seed. All the other checksums seem correct, and they do not change. A workaround that works for a series of only small files is to create a new Adler32-object for every file that needs its checksum generated, but that proves itself insufficient when a single file exceeds 31998 bytes of size (31999 or above).
    I've tried different inputstreams and various methods of using the update(xx)-functions of the Adler32, but I always get the same results. Is this a known bug (Note: JDK 1.5, not 1.6)? Or am I doing something obviously wrong? Example source code can be provided if necessary.

    R,
    I'm disappointed to see that you haven't received any replies to this. I am experiencing a very similar problem. What I have noticed is that the problem occurs when the combo-box is forced to be heavy-weight (meaning it has to draw itself outside the bounds of the window). In those cases, I can never pick a different value from the combo-box in the table. The exact same app run under 1.3.1 does not have any problems. Further, combo-boxes not in table views do not seem to have any problems even when they are heavy-weight.
    Paul

  • Reading private key: works in jdk 1.5, but throws exception in 1.4

    Hello,
    I am trying to read an RSA private key from a file. I am using the following code snippet:
    KeySpec spec = new RSAPrivateKeySpec(modulus, pExp);
    KeyFactory factory = KeyFactory.getInstance("RSA");
    PrivateKey key = factory.generatePrivate(spec);
    This runs perfectly fine under jdk 1.5 on keys I generate with OpenSSL. However, if I recompile and run under jdk 1.4, I get the following exception:
    java.security.spec.InvalidKeySpecException: Unknown key spec.
         at com.sun.net.ssl.internal.ssl.JS_KeyFactory.engineGeneratePrivate(DashoA6275)
         at com.sun.net.ssl.internal.ssl.JSA_RSAKeyFactory.engineGeneratePrivate(DashoA6275)
         at java.security.KeyFactory.generatePrivate(KeyFactory.java:237)
    I have also tried using RSAPrivateCrtKeySpec but I get the same error. Can anyone shed some light on what is going on?
    Thank you.

    'Unlimited Strength Jurisdiction Policy Files 1.4' Could be the solution.
    I had a similar problem with java 1.4 and those files do the work.
    ... finally the problem was that the password that protectd the keystore had 7 characters, using one of 5 characters works ok...

  • Running flash in JDK 1.7

    Hi,
    In my java application I use the jdic.jar, jdic.dll, files are used to load flash files in Browser through my java application.
    I include the flash in the application path use the following function with the URL pointing to the correct location
    webBrowser.setURL(url);
    This worked fine with JDK 1.6, after upgrading to JDK1.7 I am facing a strange problem. The browser is loading .swf file which has a tree structure. The left click button works only once, after which it doesn’t work. This is the same case with all the different .swf files we have.
    In other words I am able to navigate to the immediate next Flash slide, but no further.
    Can some one please help?
    Thanks
    Edited by: kabira on Aug 16, 2011 4:48 PM

    Sry for being this late but I thought I might add..
    I found AWTUtilities under com.sun.awt.AWTUtilities if anyone is still wondering. That means it's proprietary and might be removed in the future so using it is not recommended.
    Here's one such instance of how it might be used: [http://www.pushing-pixels.org/?p=260]

  • Works fine in JDK 6.0 but not in jdk 1.5.???????

    Hi all,
    This code converts english date to japanese date but it is working fine in english only. can any body answer why it is so.
    Note : No Comiplation problem in jdk 1.5
    This code works fine in JDK 6.0 but not in JDK 1.5, Why.....?
    SimpleDateFormat sdf = new SimpleDateFormat("yyyy/MM/dd");
            Locale locale = new Locale("ja", "JP", "JP");//locale for Japanese
            Calendar cal = Calendar.getInstance(locale);  //japanese calender object
            DateFormat df = DateFormat.getDateInstance(DateFormat.LONG,locale);
            try{
            Date date = sdf.parse("1930/09/27");
                System.out.println(df.format(date));
            }catch(Exception e){
                System.out.println(e.getMessage());
            }

    Hi,
    If I give the Input date 1930/10/27 (in english), then program must display the date as S5.10.27 (it's japanese date with 'S' indicating ERA)
    But this will happpen only when i run the program in JDK 6.0.
    In JDK 1.5, for the above input, the output is 1930/10/27 (which is wrong)
    Still I don't have compilation and running problems in both. Can anybody expalin why it is so?
    I think i tried my best to restate the question.
    Thanx
    Aris

  • Socket connect slow in JDK 1.5?

    We recently began testing our Java Swing application with JDK 1.5, and we noticed that socket.connect()
    calls are taking several seconds to return, when before in 1.4 the calls returned immediately.
    Here is some sample code:
    Socket sock = new Socket();
    InetSocketAddress sockAddr = new InetSocketAddress(inAddress, portNum);
    sock.connect(sockAddr, 2000);
    What could be wrong? I've debugged the code and verified inAddress is an IP address,
    not a hostname.
    -Eric

    Here is the list of enhancements in JDK1.5.
    http://java.sun.com/j2se/1.5.0/docs/guide/net/enhancements-1.5.0.html
    I wonder if any of them are having some effect in the slow connection.
    There are some network properties that you can tweak with. Did you try them?
    Here is the list
    http://java.sun.com/j2se/1.5.0/docs/guide/net/properties.html

  • Very Urgent Unable to Launch Application using Web Start using JDK 1.4.2

    Hi all
    I am very serious issue i have ejb client swing application that uses
    RMI to contact a session bean deployed in JBoss now i want the client app to be installed in the client machine using web start . Also i understand i require security permission to access network resources. so i have signed all the JAR files with same certificate created using self certificate avialiable in JDK by default also in the JNLP file in have included the following tag
    <security>
    <all-permissions/>
    </security>
    Now when I launch my application using Web start it gives an error that " Unsigned application is trying to access local resources"
    I unable to understand what could be the problem . Please help me with the steps to be followed where in client should be able to RMI call to the server
    Thanks in Advance
    Naveen

    You may have tried this already, but you might have to sign the jars via command line, outside any export process from your IDE.
    $ jarsigner {filename}.jar {key from keystore}
    I also had problems using webstart and RMI through an RCP
    Ben

  • Application crashes when using JNI with Jdk 1,2, 1.3 and 1.4

    Hi!
    I have this application that has a GUI written in Java and a file parser written in C. JNI is used to connect these parts together. The problem is that the application only works when I am using jdk 1.1.8 but not when using jdk1.2, jdk1.3 or jdk1.4. I am running the application on a Solaris 8 machine.
    I have not written the application myself but I am going to be working with it from now on. But I have today little knowledge with JNI and I have tried different approaches to solve the problem. For example I have tried to used DDD together with GDB to find out what the problem is but with no luck. When I run the application using jdk1.4 I get the following error when the JVM crashes:
    An unexpected exception has been detected in native code outside the VM.
    Unexpected Signal : 10 occurred at PC=0xFA023164
    Function=Java_Bitmap_setDebug+0x1C
    Library=/usr/u/lal/micview/micview2_1_0_beta1/libBitmapImpl.so
    Current Java thread:
    at Bitmap.setDebug(Native Method)
    at DisplayPanel.loadFile(DisplayPanel.java:396)
    at MicPlot.loadFile(MicPlot.java:1452)
    at MicPlot.loadFile(MicPlot.java:1441)
    at MicPlot.miOpen_Action(MicPlot.java:1267)
    at MicPlot$SymAction.actionPerformed(MicPlot.java:1184)
    at java.awt.MenuItem.processActionEvent(MenuItem.java:588)
    at java.awt.MenuItem.processEvent(MenuItem.java:548)
    at java.awt.MenuComponent.dispatchEventImpl(MenuComponent.java:285)
    at java.awt.MenuComponent.dispatchEvent(MenuComponent.java:273)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:452)
    at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:197)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:150)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:144)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:136)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:99)
    Dynamic libraries:
    0x10000 /opt/java/jdk1.4/bin/java
    0xff360000 /usr/lib/libthread.so.1
    0xff3a0000 /usr/lib/libdl.so.1
    0xff280000 /usr/lib/libc.so.1
    0xff270000 /usr/platform/SUNW,Ultra-4/lib/libc_psr.so.1
    0xfe000000 /opt/java/j2sdk1.4.1/jre/lib/sparc/client/libjvm.so
    0xff220000 /usr/lib/libCrun.so.1
    0xff200000 /usr/lib/libsocket.so.1
    0xff100000 /usr/lib/libnsl.so.1
    0xff1d0000 /usr/lib/libm.so.1
    0xff250000 /usr/lib/libw.so.1
    0xff0e0000 /usr/lib/libmp.so.2
    0xff0b0000 /opt/java/j2sdk1.4.1/jre/lib/sparc/native_threads/libhpi.so
    0xff080000 /opt/java/j2sdk1.4.1/jre/lib/sparc/libverify.so
    0xff030000 /opt/java/j2sdk1.4.1/jre/lib/sparc/libjava.so
    0xfe7e0000 /opt/java/j2sdk1.4.1/jre/lib/sparc/libzip.so
    0xfe4e0000 /usr/lib/locale/en_US.ISO8859-1/en_US.ISO8859-1.so.2
    0xedd00000 /opt/java/j2sdk1.4.1/jre/lib/sparc/libawt.so
    0xfc480000 /opt/java/j2sdk1.4.1/jre/lib/sparc/libmlib_image.so
    0xfc410000 /opt/java/j2sdk1.4.1/jre/lib/sparc/motif21/libmawt.so
    0xeda80000 /usr/dt/lib/libXm.so.4
    0xfa090000 /usr/openwin/lib/libXt.so.4
    0xfa3d0000 /usr/openwin/lib/libXext.so.0
    0xfc7e0000 /usr/openwin/lib/libXtst.so.1
    0xed980000 /usr/openwin/lib/libX11.so.4
    0xfa2a0000 /usr/openwin/lib/libdps.so.5
    0xfa3b0000 /usr/openwin/lib/libSM.so.6
    0xfa1d0000 /usr/openwin/lib/libICE.so.6
    0xed880000 /opt/java/j2sdk1.4.1/jre/lib/sparc/libfontmanager.so
    0xfa390000 /usr/openwin/lib/locale/common/xlibi18n.so.2
    0xfa1b0000 /usr/openwin/lib/locale/iso8859-1/xomEuro.so.2
    0xfa190000 /usr/lib//liblayout.so
    0xfa050000 /usr/openwin/lib/locale/common/ximlocal.so.2
    0xfa010000 /usr/u/lal/micview/micview2_1_0_beta1/libBitmapImpl.so
    Local Time = Thu Oct 3 13:32:47 2002
    Elapsed Time = 35
    # The exception above was detected in native code outside the VM
    # Java VM: Java HotSpot(TM) Client VM (1.4.1-beta-b14 mixed mode)
    # An error report file has been saved as hs_err_pid27692.log.
    # Please refer to the file for further information.
    Abort
    From this information I think that the problem should be in the native method setDebug. But I have tried to set a breakpoint at the beginning of that function in the C part but with no luck. The application crashes before it reaches that position in the C file.
    What could possibly go wrong between the setDebug function in the C part and the function call in the Java part?
    When using GDB, GDB cannot figure out what is wrong it just returns a hex address, no function name.
    I would really appreciate some help. I have tried everything that I can come up with!
    Best regards
    Lars

    I have figured out that the application fails on its first call to the native methods.
    So I have this Bitmap class that contains all the native calls and it is defined shortly as follow:
    public class Bitmap {
    static {
    System.loadLibrary("BitmapImpl");
    native void setDebug(int debuglevel, int statistics);
    There are many more native methods defined in Bitmap, but I only show the setDebug method because that is the first one that is executed and also the one that immediately fails.
    My setDebug C function is defined as follow in BitmapImpl.c
    #include <time.h>
    #include <stdio.h>
    #include <limits.h>
    #include <fcntl.h>
    #include <jni.h>
    #include <math.h>
    #include <errno.h>
    #include "Bitmap.h"
    #include "data.h"
    jint debug = 0;
    jint statistics = 1;
    JNIEXPORT void JNICALL Java_Bitmap_setDebug
    (JNIEnv *jenv, jobject jo, jint d, jint s)
    debug = d;
    statistics = s;
    My libBitmapImpl.so file is compiled using the following Makefile and using GNU gcc:
    JAVAPATH=$(JAVAINCLUDEPATH)
    LMACRO=-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DSOLARIS
    CSOURCE=BitmapImpl.c
    all:
    gcc -O3 -G $(LMACRO) -I$(JAVAPATH) -I$(JAVAPATH)/solaris \
    $(CSOURCE) -o libBitmapImpl.so
    It is still a total mystory why the application fails. I have tried it on a RedHat Linux machine and there it works fine. But not on Solaris. Only if I use the jdk1.1.8 but not a later one.
    Would really appreiciate some help!
    Best regards
    Lars

  • HTTPS from JDK1.2.1 to JDK 1.4.1

    We are trying to connect application running on JDK1.2.1 to application in JDK 1.4.1. Both applications are in Oracle 9ias application server but with different JDK and different physical machines.
    We are getting following error while trying to access to application on JDK 1.4.1
    java.lang.ArrayStoreException
    at java.lang.System.arraycopy(System.java)
    at java.util.Vector.copyInto(Vector.java)
    at com.sun.net.ssl.internal.www.protocol.https.ChunkedInputStream.c(DashoA6275)
    at
    com.sun.net.ssl.internal.www.protocol.https.ChunkedInputStream.<init>(DashoA6275
    at com.sun.net.ssl.internal.www.protocol.https.HttpClient.b(DashoA6275)
    at com.sun.net.ssl.internal.www.protocol.https.HttpClient.a(DashoA6275)
    at
    com.sun.net.ssl.internal.www.protocol.https.HttpsURLConnection.getInputStream(Da
    shoA6275)
    at Perc939CallServlet.callServlet(Perc939CallServlet.java:103)
    We are using Entrust certificate and we already put cacerts file from jdk1.4 to jdk1.2.1 in jdk/jre/lib/security.
    This application was working till we upgraded version from 1.3.1 to 1.4.1.
    Is this is problem of 1.4.1 and how do we resolve this?
    Small code that will help is as follows
    //Dynamic registration of SunJSSE provider
    System.setProperty("java.protocol.handler.pkgs","com.sun.net.ssl.internal.www.protocol");
    Security.addProvider(new com.sun.net.ssl.internal.ssl.Provider());
    System.setProperty("ssl.SocketFactory.provider", "com.sun.net.ssl.internal.ssl.Provider");
    //Create a URL object from the sURL String representation.
    uRemoteURL = new URL(sURL);
    //Get a connection to the remote object referred to by the URL
    ucConn = uRemoteURL.openConnection();
    //Set the DoOutput flag to true to use the URL connection for output
    ucConn.setDoOutput(true);
    ucConn.setRequestProperty("Pragma", "no-cache");
    oosToWrite = new ObjectOutputStream(ucConn.getOutputStream());
    //Write sInputString to the OutputStream which will be read from the remote servlet
    oosToWrite.writeObject(sInputString);
    oosToWrite.flush();
    oosToWrite.close();
    ucConn.connect();
    System.out.println("Connection " + ucConn.toString());
    if(ucConn==null)
         System.out.println("Connection is Null");
    System.out.println("getInputStream " + ucConn.getInputStream());
    if(ucConn.getInputStream()==null)
         System.out.println("ucConn.getInputStream() is Null");
    // Read the string object from the InputStream and return
    oisToRead = new ObjectInputStream(ucConn.getInputStream());
    Object oReadObject = oisToRead.readObject();
    sOutputString = oReadObject.toString();
    oisToRead.close();
    return (sOutputString);

    Basically ArrayStoreException comes :
    Indicate that an attempt has been made to store the wrong type of object into an array of objects.
    But in jdk1.4.1 it is said that
    No usage of java.lang.ArrayStoreException
    it may be problem of jdk1.4.1 and try to upgrade to 1.4.2
    Regards,
    Anand

  • How to set up older version of Java JDK?

    I am a Java Developer, and I recently bought a Mac.  I also just started working for a Client who is using JDK 1.6.0_23, and this is not going to change.  The code fails to compile when running through the latest Java 1.6 JDK, so I REALLY need to download and set up JDK 1.6.0_23.  Is this possible?  If I can't get this working, I will unfortunately have to use the Windows machine that the Client gave me.
    Thanks in advance.

    I removed the old program.
    I am using this line in my autoexec.bat
    path = c:\jdk1.3.1_01\bin
    I understand that I don't need to set any classpath. If I am wrong, would this line be correct ?
    classpath = %classpath%;c:\jdk1.3.1_0\bin;c:\jdk1.3.1_01\lib\tools.jar

Maybe you are looking for