|
Q: When I run swlist -f sdk14_14207_1100.depot I get the following error message: ERROR: Could not read input file "sdk14_14207_1100.depot" ERROR: Command line parsing failed
A: Try your swlist command with an absolute path to the downloaded .depot file and using the -s flag, as follows:
swlist -s /tmp/sdk14_14207_1100.depot
Q: I would like to find out more about the garbage collection mechanism and need further information to understand the result of the log file generated with the "-Xverbosegc" option.
A: The -Xverbosegc option is explained in detail in the Java™ for HP-UX Programmer's Guide, in the HotSpot chapter at
HP-UX Java™ Programmer's Guide. In addition, you could use HPjtune, HP's garbage collection analysis tool, that can be downloaded free from
HP-UX Java™ downloads.
Another tool available to you is an awk script that formats the verbosegc output files that you can obtain from
HP-UX Java™ downloads, on the Information Library page at:
Information Library Core Documents.
To format your gc.out file, just type:
cat gc.out|awk -f vgc > gc.formatted
Q: My application runs a monthly batch job. The job completes successfully for smaller numbers of records, but the process runs out of memory when it encounters records in excess of 100000. What probable location should I start looking at for debugging?
A: There are many things that could cause this. As a start you should use HP OpenView GlancePlus available from
http://www.managementsoftware.hp.com/products/a-z.html to find out what area the process runs out of space. If it is Java™ heap,
run the profiler and verbosegc to analyze the heap. For more information on verbosegc, refer to the
HP-UX Programmer's Guide
If the problem is in the C heap (DATA) you may have a memory leak. You can use gdb (available from www.hp.com/go/wdb) to locate the problem.
Q: Are gdb's capabilities for debugging Java™ documented anywhere?
A: You could start with "Debugging a native JNI library with Java™ 2 HotSpot VM under gdb" at Developer & Solution Partner Program (DSPP). Also, stack unwinding in the Java™ code is now available, so you can now do a backtrace through the native code stack frames, interpreter code stack frames, and runtime compiled code stack frames. To use this new feature, you will need the latest version of gdb available from
www.hp.com/go/wdb, plus the 1.3.1.02 or later JVM.
Q: I have set java -Djava.rmi.server.logCalls=true, and also the system property java.rmi.serever.logCalls to true, and I do not see the log files on the machine.
A: The logs are sent to standard error. If you have stderr redirected, you need to look there. Also, both options are equivalent, so you need to use either one of the options, but not both.
Q: I have been unsuccessful in getting my shared library to load. I discovered using "ldd" that there were numerous unsolved symbols in the Java™ library. Running ldd on libjawt.sl indicates unresolved symbols. The symbol entry points appear to be located in libmawt.sl but this library is not linked with libjawt.sl
A: The library libmawt.sl is loaded using java.lang.ClassLoader.loadLibrary() during runtime, which resolves the symbols.
Q: Our application is leaking threads. I notice that when I tune up maxdsize from the default 64MB to 1GB, the thread issue disappears. Is this possible?
A: If the maxdsize limit is being reached, then this can cause trouble creating new threads. If a thread creation fails it is reported back to the application as an OutOfMemoryError, usually as a result of a call to Thread.start().
Q: I can load a library from Java™ using LoadsLibrary, but when my Java™ class is initiated from a C++ main (nonjavacallingjava), I receive an error:
shl_load failed for: ./libftjss01.sl,
[errno 2: No such file or directory] /usr/lib/dld.sl:
Call to mmap() failed - TEXT ./libftjss01.sl
A: Ensure that the SHLIB_PATH of the main executable is enabled. Also ensure that the C++ main initializes some Java™ properties (like mx) as follows, for example:
//Get the default initialization args and set the class path
jint ret = JNI_GetDefaultJavaVM InitArgs(vm_args);
vm.args.version = 0x00010001:
vm_args.minHeapSize = 32000000;
vm_args.maxHeapSize = 96000000;
vm_args.nativeStatckSize = 1000000;
vm_args.javaStackSize = 1000000;
vm_args.disableJIT = JNI_TRUE;
if (ret !=0)
printf("failed to GetDefaultJavaVMInitArgs/n");
//Note: If you have not set and exported the environment variable
//CLASSPATH you may also need to add this:
vm_args.classpath =.:/opt/java/lib/classes.zip:./ssjcls01.zip";
//load and initialize a JVM, return a JNI interface pointer in env
ret = JNI_CreateJavaVM(jvm env vm_args);
For more information and code examples, refer to the JNI chapter of the
HP-UX Java™ Programmer's Guide
Q: I downloaded Java™ and got the error: "Unable to initialize threads -- cannot find class java/lang/thread". What should I do?
A: For most users, the Java™ wrapper script will take care of setting the JAVA_HOME environment variable and will add the appropriate entries to the CLASSPATH so that the JVM finds the standard API classes.
The PATH environment variable needs to include a path to the Java™ wrapper script. People writing applications with non-Java mains may need to worry about the setting of CLASSPATH and SHLIB_PATH.
For more information, refer to the
HP-UX Java™ Programmer's Guide
Q: I'm trying to establish a bare socket connection from a client machine to a server machine on another network through a firewall. How do I do this?
A: You have to use C or C++ routines and communicate with the JVM via JNI calls (Java™ calling C or C++). For more information and code examples, refer to the JNI chapter of our Java™ 2 Programmer's Guide at
HP-UX Java™ Programmer's Guide
Q: When I start swinstall and try to install the depot file, I get the message: "You do not have the required permissions to perform this SD operation." How can this be, if I am logged in as root?
A: You could try the following:
- Kill the swagentd process.
- Run the following command, and if the file swlock exists, rename the file.
ls /var/adm/sw/products/swlock
- Kill the swinstall process (if swinstall is running).
- Restart the swagentd process.
Q: I have a program with many threads, and I suspect there is some lock contention between the threads which is slowing down the performance. Can you recommend a tool which will help me identify potential lock contentions?
A: Please go to our Java™ performance tuning website, which contains much useful information on helping you improve the performance of your Java-based applications. In particular, look at the "Java™ specific profilers and tools" section of the
tools page, which offers a script that you can use in conjunction with the "kill -3 <pid> command. In addition, if you are using the SDK 1.3.1.02 or later, you can use the lock contention metric of
HPjmeter to analyze the problem.
Java™ and all Java-based trademarks and logos are trademarks or registered trademarks of Sun Microsystems, Inc. in the U.S. and other countries. Hewlett-Packard is independent of Sun Microsystems, Inc.
|