Corporate Info | News | Solutions | Products | Partners | Services | Events | Download | How To Buy
Frequently Asked Questions: Previous topic | Next topic | Contents

WebLogic Frequently Asked Questions: Java

- I'm having trouble with Java - What do I do?

- Help, I'm getting Java error messages

- StackOverflowException

- How can I make my Java application run faster?

- Problems reading jar files with ZipFile

I'm having trouble with Java - What do I do?

This is really a whole set of questions that our support engineers are sometimes asked. We are very happy to help you with problems you are having with our software, but we can only offer you directions to some other resources for problems like these:

My program will not work. Can you help me debug it?

If the problem you are having is not directly related to our software, we suggest that you use a Java development tool that helps you with debugging, and that you invest in some books/training to help you learn Java. There are many ways to build debugging into your program, and getting good training in Java programming is a good start to understanding how to do this.

I'm taking a class and I need help learning Java.

There are a lot of books and online references to Java. A good starting place is at the JavaSoft website documentation index, which has links to whitepapers and the Java Tutorial. You can find books on Java at any of the major online book shopping sites.

Where do I get the JDK?

See our Platform support page for information about specific JDKs that we have tested and certified for use with WebLogic software.

Once you determine which version of the JDK you will be using, go to the JavaSoft website. Many platform vendors provide an optimized version of the JDK for their computers.

How do I set up my CLASSPATH?

Setting up your CLASSPATH is straightforward, once you understand the concept. See Setting the classpath in the Installation Guide. When working with our examples, see Setting your development environment.

When I try to run an example, it doesn't work.

Usually problems with examples are related to your environment. Here are some troubleshooting hints:

1. If you are using a database, make sure you have run the utility utils.dbping to verify that your JDBC driver is correctly installed and configured.

2. Run the setEnv script to make sure your CLASSPATH is correctly set in the shell or DOS window in which you are running the examples. For more information, see Setting your development environment.

3. Check the instructions for the examples to make sure you have changed any user-specific variables in the code before compiling.

4. Verify that you are compiling with the -d option to direct the class files into the proper directory, as defined in the example instructions.

If the example is an applet, check the CODE and CODEBASE, and make sure WebLogic Server is running.

Help, I'm getting Java error messages

Where can I get help on Java error messages?

Many of the questions we receive at BEA are related to generic Java error messages and are not specific to WebLogic Server. Here are some links that contain information on Java error messages that may help you.

####

Source | Description
--- | ---
Sun's Java Developer Connection | This forum includes Questions and Answers on a wide variety of Java topics, including error messages. Use the Search box for fast results. For example, type "classpath error" in the Search box.
Compiler Error Messages | An extensive list of compiler error messages, including the infamous NoClassDefFoundError.
Sun's Java APIs | Check the Java API to see if there is an exception description for the class you are using.

StackOverflowException

I received a StackOverflowException when I sent a message between client and server. What's going on?

If you are sending a particularly large data structure using java.io.Serialization, you may exceed the per-thread size limit for either the Java or native stack. You can increase the stack size by using the following command line options:

  -ss Stacksize to increase the native stack size or
  -oss Stacksize to increase the Java stack size,

where Stacksize is expressed as an integer followed by "k" or "m" for kbytes or mbytes. For example,

$java -ss156k (native)

$java -oss600k (Java)

The default native stack size is 128k, with a minimum value of 1000 bytes. The default java stack size is 400k, with a minimum value of 1000 bytes.

How can I make my Java application run faster?

Will using a JIT make my Java application run faster?

A Just-In-Time compiler will make some Java applications run faster. A JIT works by storing generated machine code in memory and reusing it when possible. For instance, if you execute the same operation 1000 times in a loop, a JIT will improve performance of this operation since the code will only be generated once. Applications with a lot of native methods will not see as much performance improvement as pure-Java applications.

If you use a JIT, you may want to turn off the JIT during debugging to facilitate stacktracing. If you are doing performance testing with a JIT, make sure that you execute the same test several times in the same invocation and then throw away the first result to get an idea of how long the transaction will take when your application is running in a steady state. The first time the code is executed, your test will take longer (the "code generation hit").

Problems reading jar files with ZipFile

I am trying to read some jar files but the following exception is thrown: java.io.EOFException:Unexpected end of ZLIB input stream.

I used JDK 1.1.x to jar the files.

There is a bug in JDK 1.1.x which causes the ZipFile class to read beyond the end-of-file. JavaSoft recommends the following workaround: Do not attempt to read more bytes than the entry contains. Call ZipEntry.getSize() to get the actual size of the entry and use that value to keep track of the remaining number of bytes while reading the entry. There is additional information available from the JavaSoft Bug Parade.

Copyright © 2000 BEA Systems, Inc. All rights reserved. Required browser: Netscape 4.0 or higher, or Microsoft Internet Explorer 4.0 or higher.