Author |
Message
|
kirankinnu |
Posted: Fri Jan 16, 2009 12:12 pm Post subject: Invoking a jar file from Flow |
|
|
 Centurion
Joined: 12 Jun 2004 Posts: 128 Location: Chicago, IL
|
Hello Folks,
I am having an interesting issue over here. Here is the scenario.
We have a MB flow MB1.flow which calls a java method JM1. This class is under jar file JAR1. JM1 uses other jar JAR2 for parsing the data. If I run the JM1 outside the broker by feeding in the input, it runs fine. I deployed the flow into execution group along with JAR1 and JAR2. At run time, we are able to call the JM1, but once it reaches the parsing stage, its not recognising the class in JAR2. We are getting an error as Class not found error. I hope I did make sense. I did try putting the JAR2 under /shared-classes, but of no use. how does the broker load the classes of JAR2.
Would appreciate any inputs to this.
Thank You,
Kiran |
|
Back to top |
|
 |
jr_martin |
Posted: Fri Jan 16, 2009 6:25 pm Post subject: |
|
|
 Apprentice
Joined: 24 Aug 2005 Posts: 36 Location: NY
|
I had the same issue...
I placed the jar file in some other directory and referenced it in mqsiprofile's CLASSPATH variable, bounced broker, then it was working ok. |
|
Back to top |
|
 |
kirankinnu |
Posted: Sun Jan 18, 2009 4:26 pm Post subject: |
|
|
 Centurion
Joined: 12 Jun 2004 Posts: 128 Location: Chicago, IL
|
How are you setting the mqsiprofile's CLASSPATH variable. I did try setting the class path variable under environment variables and bounced the broker, but did not take it.
Thank You,
Kiran |
|
Back to top |
|
 |
joebuckeye |
Posted: Tue Jan 20, 2009 7:41 am Post subject: |
|
|
 Partisan
Joined: 24 Aug 2007 Posts: 365 Location: Columbus, OH
|
Be aware that placing jar files in the shared-classes directory requires a broker restart to pick up any new jars in the directory or even changes to existing jar files.
We only place very stable, 3rd party jars in that directory (ie log4j and ojdbc).
For any other jars we use we deploy them via bar files. This way any new jars or changes to existing jar files are picked up at deployment time. The only downside to this is that each jar file would then need to be deployed to each execution group. It can become an issue if the jars are large and/or you have many execution groups. |
|
Back to top |
|
 |
radha* |
Posted: Wed Jan 21, 2009 9:52 pm Post subject: |
|
|
Newbie
Joined: 21 Jan 2009 Posts: 5
|
hi, I have some problem with jar file..I am trying to read a property file from a java class, via esql. I am getting a missing resource bundle exception, when I place the property file outside jar file. But, if I bundle the property file along with the jar file, my flow is successfully processed.
Ideally the propery file should have been detected even if it is placed outside the jar file..cant broker detect propery files placed in the sharedclasses folder? |
|
Back to top |
|
 |
fjb_saper |
Posted: Thu Jan 22, 2009 3:41 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
radha* wrote: |
hi, I have some problem with jar file..I am trying to read a property file from a java class, via esql. I am getting a missing resource bundle exception, when I place the property file outside jar file. But, if I bundle the property file along with the jar file, my flow is successfully processed.
Ideally the propery file should have been detected even if it is placed outside the jar file..cant broker detect propery files placed in the sharedclasses folder? |
Did you restart the broker after putting the properties file into the folder?  _________________ MQ & Broker admin |
|
Back to top |
|
 |
radha* |
Posted: Thu Jan 22, 2009 4:05 am Post subject: |
|
|
Newbie
Joined: 21 Jan 2009 Posts: 5
|
ya, I did. (quite a lot of times) , it didnt work in Windows...strangely..I found same jar, with property file out of jar..worked in unix...
why so?? |
|
Back to top |
|
 |
fjb_saper |
Posted: Thu Jan 22, 2009 4:10 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
radha* wrote: |
ya, I did. (quite a lot of times) , it didnt work in Windows...strangely..I found same jar, with property file out of jar..worked in unix...
why so?? |
Possibly because the relative or absolute path to the file contained a space?
 _________________ MQ & Broker admin |
|
Back to top |
|
 |
radha* |
Posted: Thu Jan 22, 2009 6:13 am Post subject: |
|
|
Newbie
Joined: 21 Jan 2009 Posts: 5
|
I used ResourceBundle class, so no need to provide any path to the file..i |
|
Back to top |
|
 |
|