ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » General IBM MQ Support » Client triggering Java program in HP-UX

Post new topic  Reply to topic
 Client triggering Java program in HP-UX « View previous topic :: View next topic » 
Author Message
mqmhr
PostPosted: Tue Jan 09, 2007 1:28 pm    Post subject: Client triggering Java program in HP-UX Reply with quote

Centurion

Joined: 28 Dec 2004
Posts: 105

We have configured a process definition to trigger a java program on the MQ client machine (runmqtmc). Both the MQ server and client are in HP-UX Itanium boxes. When we put a message, the java app is not getting triggered and we are getting the error "Unable to find library 'libjvm.so'.
".

I am able to locate the .so in the client and tried specifying the directory name in classpath as well as path, still the triggering wont work. When invoked from the command prompt in the client machine, the java program gets invoked successfully.

Could you please tell me if I am missing something here ? Do we need to set any environment variables specifically for triggering a java program in a client machine in Hp-UX Itanium ?
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Tue Jan 09, 2007 1:39 pm    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

It's always better to trigger a shell script when launching java, rather than directly launching java, for just these kinds of reasons.

http://www.mqseries.net/phpBB2/viewtopic.php?t=12988
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
mqmhr
PostPosted: Tue Jan 09, 2007 3:39 pm    Post subject: Reply with quote

Centurion

Joined: 28 Dec 2004
Posts: 105

Hello Jeff

Triggering a .sh and invoking java from within it, doesnt seem to work either. The shell script gets triggered but the java app is not getting invoked, with the same error.

When I placed the java app in the server machine and used server trigger monitor runmqtrm, it was triggered successfully. But the issue with runmqtmc still persists. Any pointers ???

Thanks
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Tue Jan 09, 2007 3:56 pm    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

The advantage of the shell script is that you can customize it to match the required environment - for example to match the one that is in effect when you successfully run the program from the command prompt - rather than being stuck with the environment that is in effect for runmqtmc.

It sounds like you have replicated your non-working environment into your shell script. This is a good first step - now you can work on fixing the shell script so it sets the environment correctly.

Secondly, when using a client triggered application, you need to configure all the trigger information for the CLIENT MACHINE, and not for the server machine. That means all paths, all libraries, etc must be valid on the CLIENT side.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
ashly
PostPosted: Tue Jan 09, 2007 5:12 pm    Post subject: Reply with quote

Newbie

Joined: 10 Oct 2006
Posts: 8

seems like the JRE is having an issue in loading the jvm dll.
check path/ld_library_path is set correctly.
Back to top
View user's profile Send private message
mqmhr
PostPosted: Tue Jan 09, 2007 6:46 pm    Post subject: Reply with quote

Centurion

Joined: 28 Dec 2004
Posts: 105

The path and the library path (tried giving both LD_LIBRARY_PATH and SHLIB_PATH) is set correctly to point to the directory containing jvmlib.so file in the client machine.

Jeff, I mentioned the server triggering to bring out the fact that the problem is occuring only when runmqtmc is trying to invoke the java program.

So now I have a situation where the shell script has all the required environment variables set to the correct values and still, runmqtmc throws the error "Unable to find library jvmlib.so". The java app runs fine when executed from the command prompt of the client machine.
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Tue Jan 09, 2007 7:40 pm    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20756
Location: LI,NY

mqmhr wrote:
The path and the library path (tried giving both LD_LIBRARY_PATH and SHLIB_PATH) is set correctly to point to the directory containing jvmlib.so file in the client machine.

Jeff, I mentioned the server triggering to bring out the fact that the problem is occuring only when runmqtmc is trying to invoke the java program.

So now I have a situation where the shell script has all the required environment variables set to the correct values and still, runmqtmc throws the error "Unable to find library jvmlib.so". The java app runs fine when executed from the command prompt of the client machine.

Read this post about java triggering in a unix environment. Maybe it will clarify a thing or 2.

Enjoy
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
ashly
PostPosted: Tue Jan 09, 2007 7:45 pm    Post subject: Reply with quote

Newbie

Joined: 10 Oct 2006
Posts: 8

check the user who fires the trigger has it set . that should seal it.
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Wed Jan 10, 2007 2:28 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

So the shell script runs just fine from the command prompt, when logged in as the same user that starts runmqtmc?

And you still have the same problem when you start runmqtmc manually, from an interactive login prompt while logged in as the same user that starts runmqtmc?

How are you starting runmqtmc?
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
Nigelg
PostPosted: Wed Jan 10, 2007 3:33 am    Post subject: Reply with quote

Grand Master

Joined: 02 Aug 2004
Posts: 1046

Quote:
The path and the library path (tried giving both LD_LIBRARY_PATH and SHLIB_PATH) is set correctly to point to the directory containing jvmlib.so file in the client machine.


These env vars are set to their default values when a process is exec'ed from a setuid/setgid app like runmqtmc. Either install the required lib on the default path, or set the env vars in the triggered shell script before running the java app.
_________________
MQSeries.net helps those who help themselves..
Back to top
View user's profile Send private message
mqmhr
PostPosted: Wed Jan 10, 2007 8:32 am    Post subject: Reply with quote

Centurion

Joined: 28 Dec 2004
Posts: 105

jefflowrey wrote:

And you still have the same problem when you start runmqtmc manually, from an interactive login prompt while logged in as the same user that starts runmqtmc?

How are you starting runmqtmc?


I am starting runmqtmc from the command prompt in an interactive manner. I am using only one user id in the entire sequence of operations. Still the problem persists.

Quote:
or set the env vars in the triggered shell script before running the java app.


I have explicitly the environment variables in the shell script, before I call the java program. Still the same error is obtained.
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Wed Jan 10, 2007 5:58 pm    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20756
Location: LI,NY

mqmhr wrote:

I have explicitly the environment variables in the shell script, before I call the java program. Still the same error is obtained.


Sure you've Set the variable value in the script. But did you EXPORT the variable in the script before calling the process that needs it?

Enjoy
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
mqmhr
PostPosted: Thu Jan 25, 2007 5:37 pm    Post subject: Reply with quote

Centurion

Joined: 28 Dec 2004
Posts: 105

We have resolved this issue now.

From the HP site for JRE 1.4.2.07,

Quote:
Java requires dynamic loading (SHLIB_PATH, LD_LIBRARY_PATH) which are disabled in setuid or setgid executables. Therefore Java cannot run with setuid or setgid.


runmqtmc being a setuid program, was unable to launch JRE 1.4.2.07

We upgraded JRE version to 1.4.2.10 and runmqtmc was able to launch the JVM without any issues.

It was a good lesson to learn and hope this thread benefits others with a similar problem.
Back to top
View user's profile Send private message
Nigelg
PostPosted: Mon Jan 29, 2007 1:53 am    Post subject: Reply with quote

Grand Master

Joined: 02 Aug 2004
Posts: 1046

Quote:
It was a good lesson to learn and hope this thread benefits others with a similar problem.


I gave that answer on Jan 10th. Shame you did not read the replies to your question back then, then this thread might have helped you with your problem...
_________________
MQSeries.net helps those who help themselves..
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » General IBM MQ Support » Client triggering Java program in HP-UX
Jump to:  



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.