• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Unable to start the JMS port in Unix.

 
Greenhorn
Posts: 25
Hibernate Eclipse IDE
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Hi All,

I have script where i will startmy java application through jar file. when i run the script from the console manually the application is starting properly with out any issues. Upto here every thing is fine , then problem is coming when i am running the script from the cronjob. see the error log below.



And my script contents go like this

#!/bin/bash
#set -x

umask 002

BASE_DIR=/site/dev-dms1
LIB=/site/dev-dms1/lib
DIST=/site/dev-dms1/dist
INSTANCE=Dev
WEBHOST=dev-dms1.enterprisenet.org

unset CLASSPATH
CLASSPATH="/site/dev-dms1/dist/rtv.jar"

unset JAVA_HOME
JAVA_HOME=/iapp/jdk/jre

for x in `find $LIB -maxdepth 1 -name "*.jar" | sort`
do
CLASSPATH=$CLASSPATH:$x
done

JAVA_OPTS="-Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=1212 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false"

/iapp/jdk/jre/bin/java -server -Xms512m -Xmx512m -XX:NewRatio=2 -XX:+UseConcMarkSweepGC -XX:+UseParNewGC -classpath ${CLASSPATH} $JAVA_OPTS -Dapp.instance=$INSTANCE -Dapp.host=$WEBHOST -Djava.rmi.server.codebase=file://site/dev-dms1/dist/rtv.jar -Djava.rmi.server.hostname=dev-dms1.enterprisenet.org com.powerdigm.server.ServerApplication > $BASE_DIR/logs/dev_dms.out 2> $BASE_DIR/logs/dev_dms.err &

echo $! > $BASE_DIR/process.pid



umask 022
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


at com.iag.util.IAGApplicationContext.<init>(IAGApplicationContext.java:28)
at com.powerdigm.server.ServerApplication.main(ServerApplication.java:72)


What is line 72 of ServerApplication doing?
 
silamala ramesh babu
Greenhorn
Posts: 25
Hibernate Eclipse IDE
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Ulf Dittmer,

ServerApplication is my main class , at line 72 i am loading the beans using spring DI .Please see the piece of code below.



And the bean entry for which i am getting error is below.



 
Ulf Dittmer
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What's the value of "${jmsPort}"?
 
silamala ramesh babu
Greenhorn
Posts: 25
Hibernate Eclipse IDE
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Ulf Dittmer,

I guess the port which I gave in the shell script that is -Dcom.sun.management.jmxremote.port=1212
 
Ulf Dittmer
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Guessing is not good - it looks like that value is not set anywhere, so its value is -1 (which is what the error message is saying). It certainly has nothing to do with any JMX port: JMS != JMX.

Search the source code and config files for "jmsPort".
 
silamala ramesh babu
Greenhorn
Posts: 25
Hibernate Eclipse IDE
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Ulf Dittmer,

Thanks for your quick reply.

I will search my source code for the exact replacement for jmsport.

But if you read my initial question , the same script is starting my application when I run the script form consle(i mean manually) , only the problem is when i am crate a cronjob to run the script i am getting that error in the log file.

 
Ulf Dittmer
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If you don't know how "jmsPort" is configured, I think you aren't in a position to state that it couldn't work differently between a manual start and a cron-driven start.
 
silamala ramesh babu
Greenhorn
Posts: 25
Hibernate Eclipse IDE
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Ulf Dittmer,

The JMS port is configured in Ldap server , the jms port configured is 7001.
 
Ulf Dittmer
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
How does the value get to the code? Does that work correctly? Can you add code that checks whether it works correctly, and which performs some logging so that you can see whether or not it's working?
 
reply
    Bookmark Topic Watch Topic
  • New Topic