I followed the instructions for running the java application with profiler, by setting the LD_LIBRARY_PATH and adding the option -Xrunyjpagent. I was able to run the application successfully in solaris. But in linux, I tried the same. I am able to run the application for a small application for example.. java -Xrunyjpgagent Foo. But when I tried to run a application which is launched by a shell script , the application never launches. I am using MontaVista Linux. First I was under the assumption that the dependent libraries are not of correct version. But since I am able to launch a small application, I doubt is there anything wrong with my script. I have made sure that are no unresolved dependencies for the library.
>
[email protected]:/usr/lib# ldd
> /export/home/tpadmin/yourkit/yjp-3.2/bin/linux/libyjpagent.so
> libltdl.so.3 => /usr/lib/libltdl.so.3 (0x40049000)
> libstdc++.so.5 => /usr/lib/libstdc++.so.5 (0x40051000)
> libc.so.6 => /lib/libc.so.6 (0x400ff000)
> libdl.so.2 => /lib/libdl.so.2 (0x4022a000)
> libm.so.6 => /lib/libm.so.6 (0x4022d000)
> /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x80000000)
>
Here is the script I am using. Any suggestions are greatly appreciated.
#!/bin/sh
cd ..
. ./setEnv.sh
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/app/AdventNet/WebNMS/apache/lib:/app/AdventNet/WebNMS/lib:/usr/j2se/jre/lib/sparc:/home/brajagopalan/yjp-3.2/bin/linux:/usr/lib:/lib
SSH_HOME=/app/AdventNet/WebNMS/sshtools
SSHLIB=$SSH_HOME/lib/jaxb-rt-1.0-ea.jar:$SSH_HOME/lib/sshtools-j2ssh-0.0.4-alpha.jar:$SSH_HOME/lib/log4j-1.2.6.jar
CLASS_PATH=$AN_CLASSES:$AN_TEST:$AN_JDBC:$SUM_CLIENT_CLASSPATH:$SUM_SERVER_CLASSPATH:$CUSTOMPATH:$SNMP_CLASSPATH:$SAS_CLASSPATH:$XML_CLASSPATH:$OTHER_CLASSPATH:$MS_CLASSPATH:$WEBSERVER_CLASSPATH:$DB_CLASSPATH:$JAVA_CLASSPATH:$BUILDER_CLASSPATH:$TFTP_CLASSPATH:$CLI_CLASSPATH:$TRANSACTION_CLASSPATH:$NMS_CLASSES/AdventNetSnmpDistributedAPI.jar:$JIMI_CLASSPATH:$MOPATH:$LICENSE_PATH:$FTP_CLASSPATH:$TP_CLASSPATH:$SSHLIB
# Uncomment the following lines for using TL1 Protocol.
CLASS_PATH=$CLASS_PATH:$TL1_CLASSPATH
# Uncomment the following lines for using JMX Agent.
CLASS_PATH=$CLASS_PATH:$JMX_AGENT_CLASSPATH
STACK_SIZE=-mx512m
REMOTE_DEBUG="-Xdebug -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8787"
Dargs=" -Drmi.debug=true
-Dsun.rmi.log.debug=true
-Dsun.rmi.transport.logLevel=VERBOSE
-Dsun.rmi.transport.tcp.logLevel=VERBOSE
-Dsun.rmi.server.logLevel=VERBOSE
-Dsun.rmi.loader.logLevel=VERBOSE
"
echo before the start $LD_LIBRARY_PATH
# -Xrunyjpagent:port=10002 \
$JAVA_HOME/bin/java \
$STACK_SIZE \
-Xrunyjpagent \
$REMOTE_DEBUG \
-cp $CLASS_PATH \
-Dsshtools.home=$SSH_HOME \
-Dcatalina.home=$TOMCAT_HOME \
-Dmysql.home=$MYSQL_HOME \
-Dwebserver.port=$WEBSERVER_PORT \
-Dresource_check="$WEBSERVER_PORT,$WEBCONTAINER_PORT" \
-Dwebserver.rootdir=$WEBSERVER_HOME \
-Djava.rmi.server.codebase="$CODEBASE_LIST" \
$Dargs \
com.trueposition.ems.server.app.main.NmsMainBE \
rediscoverNetwork NMS_BE_PORT 2000 ROOT_DIR /app/AdventNet/WebNMS \
SERVICE true
if[ $? -ne 0]
echo program failed to launch successfully
exit
else
echo program is running
exit
regards,
balaji