Author |
Message
|
bamboozled_by_MQ |
Posted: Tue Dec 14, 2004 11:31 am Post subject: is WSAD 5.1.2/WMQ5.3 JMS1.1 capable? getBodyLength() error |
|
|
Voyager
Joined: 07 Jan 2004 Posts: 75
|
I installed the CSD08 (mq5.3) using WSAD 5.1.2
I put the the jars in the buildpath(jms.jar etc) and now when I am coding I presume I am using JMS 1.1 now
i do not get errors when I am trying to use the getBodyLength() method on my bytesMessage and it compiles perfect too.
however when running the app it is throwing the "nosuchmethod" error in the JVM!!
I was reading the doc and found this info that seems like it is exaclty what I need but why won it work??
Quote: |
For JMS1.0.2 applications that use accessor methods on
ConnectionFactory objects and are compiled using a Java SDK1.3
compiler and are to be deployed on BOTH WebSphere MQ V5.3 CSD06 or
later and WebSphere MQ V5.3 CSD05 or earlier, special measures are
required to ensure correct execution in both environments. Failure
to do this might result in a NoSuchMethodError exception being thrown
by the JVM.
To avoid this either:
- compile the application using the CSD05, or earlier, version of the
WebSphere MQ classes for JMS.
- or compile the application using Java SDK1.4 or later on either
environment. |
what am I doing wrong??
anyone using this method with WSAD?
thanks
Last edited by bamboozled_by_MQ on Thu Dec 16, 2004 1:38 pm; edited 1 time in total |
|
Back to top |
|
 |
EddieA |
Posted: Tue Dec 14, 2004 11:48 am Post subject: |
|
|
 Jedi
Joined: 28 Jun 2001 Posts: 2453 Location: Los Angeles
|
Quote: |
In the 'installed java runtime environmnet' I even added a new one and point it to j2sdk1.4.2_05 instead of the others.. |
OK, so WASD is using the right JRE to build.
Quote: |
however when running the app it is throwing the "nosuchmethod" error in the JVM!! |
But is this using the same JRE. What does java -version show.
Cheers, _________________ Eddie Atherton
IBM Certified Solution Developer - WebSphere Message Broker V6.1
IBM Certified Solution Developer - WebSphere Message Broker V7.0 |
|
Back to top |
|
 |
bamboozled_by_MQ |
Posted: Tue Dec 14, 2004 12:19 pm Post subject: |
|
|
Voyager
Joined: 07 Jan 2004 Posts: 75
|
Just doesnt seem like many people use 1.1 or the getBodyLength() for that matter...
anyway,
this is was the server console says:
Quote: |
*** Starting the server ***
************ Start Display Current Environment ************
WebSphere Platform 5.1 [BASE 5.1.0.3 cf30412.02] [JDK 1.4.1 b0344.02] running with process name localhost\localhost\server1 and process id 2496
Host Operating System is Windows XP, version 5.1
Java version = J2RE 1.4.1 IBM Windows 32 build cn1411-20031011 (JIT enabled: jitc), Java Compiler = jitc, Java VM name = Classic VM
was.install.root = C:\Program Files\IBM\WebSphere Studio\Application Developer\v5.1.2\runtimes\base_v51
user.install.root = C:\Program Files\IBM\WebSphere Studio\Application Developer\v5.1.2\runtimes\base_v51
...
|
this is from the cmd line:
Quote: |
C:\WINXP\system32>java -version
java version "1.4.2_05"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_05-b04)
Java HotSpot(TM) Client VM (build 1.4.2_05-b04, mixed mode)
|
|
|
Back to top |
|
 |
slaupster |
Posted: Wed Dec 15, 2004 2:48 am Post subject: |
|
|
Apprentice
Joined: 17 Nov 2004 Posts: 41
|
its not the version of the JVM you need to worry about - that note was for connectionfactories, its the version of the jms.jar and com.ibm.mqjms.jar (and com.ibm.mq.jar) available to your runtime. Your build classpath is set correctly, but when you run it, the runtime classpath is not set correctly.
You get this error because the jms.jar (the interface and abstract class jms definitions) and probably the com.ibm.mqjms.jar (IBM's implementation of jms.jar interfaces etc) are not csd06 and above, i.e. JMS 1.1. You need to set the classpath appropriately in the "Run" configuration, as well as the build path. |
|
Back to top |
|
 |
bamboozled_by_MQ |
Posted: Wed Dec 15, 2004 1:24 pm Post subject: |
|
|
Voyager
Joined: 07 Jan 2004 Posts: 75
|
in run-run...
im using server1, how do I set that?? my adminconsole is set to :
Quote: |
MQJMS_LIB_ROOT ${MQ_INSTALL_ROOT}/java/lib
MQ_INSTALL_ROOT c:/progra~1/ibm/websph~1
|
Last edited by bamboozled_by_MQ on Thu Dec 16, 2004 1:42 pm; edited 2 times in total |
|
Back to top |
|
 |
fjb_saper |
Posted: Wed Dec 15, 2004 3:29 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
The question is what is in your WAS variables JMS_MQ_ROOT etc..
(from memory so the name is approximative)
Check out the setup in the admin console.
Remember to check as well in the makeup of the QCF.
Going further down the road make sure your deployment environment is the right version of MQ as well.
Enjoy  |
|
Back to top |
|
 |
bamboozled_by_MQ |
Posted: Wed Dec 15, 2004 5:19 pm Post subject: |
|
|
Voyager
Joined: 07 Jan 2004 Posts: 75
|
MQJMS_LIB_ROOT C:\Program FIles\IBM\Websphere MQ\Java\lib cells:localhost:nodes:localhost
MQ_INSTALL_ROOT C:\Program FIles\IBM\Websphere MQ cells:localhost:nodes:localhost
this is in the WAS console. |
|
Back to top |
|
 |
fjb_saper |
Posted: Wed Dec 15, 2004 7:16 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
wrong values for the JMS_MQ_Provider. Click on the right side in the JMS_MQ_Provider windows in the management console. You'll get some help about the expected value.
You should have the path to <MQ_INSTALL>\java\lib and the corresponding jars in that directory.
Enjoy  |
|
Back to top |
|
 |
slaupster |
Posted: Thu Dec 16, 2004 2:23 am Post subject: |
|
|
Apprentice
Joined: 17 Nov 2004 Posts: 41
|
those variables are for WAS to find the JMS jars.
I assume that when you say:
Quote: |
my error in the console by the way is: |
you mean in the WSAD console, and that you are running the application from inside WSAD. You need to set the run configuration:
Select :
this gives you a window with different "Configurations" - you may be running this as a plain "Java Application", but you should have an instance of one of the Configurations called something eg myJavaApplicationConfiguration. If you select this you can modify properties of this instance, such as JRE, JVM args, source for debugging purposes, and what you need which is the CLASSPATH.
Put the CSD08 jars in the CP and it should resolve your problem. |
|
Back to top |
|
 |
bamboozled_by_MQ |
Posted: Thu Dec 16, 2004 10:29 am Post subject: |
|
|
Voyager
Joined: 07 Jan 2004 Posts: 75
|
thanks for the reply Slaupster.
When I go to run-run..
I am running my app as server1 since it has EJB's etc. with an ear
I know I set my projects to TARGET server 5.1 also but that may not be relative here.
If i do click on 'new' Wespherer v5.1 application client it pickups up my EAR file but complains about it needing a client app somewhere.
I dont think that is what need because this app will eventually be deployed to an actual WAS 5.1 server(server1) so I need to keep my test env on WSAD with server1 right? but how to set the classpath like you said?
note**
When I originally set my server1, I used v5.1 test env server
I am using WMQ5.3 as the provider so I checked allow AdminConsole and do all my config there, BUT shoud I double click this server1 and set the classpath there?
Can anyone tell me what exactly is in those two variabes in thero admin console
I currently have
Quote: |
MQJMS_LIB_ROOT ${MQ_INSTALL_ROOT}/java/lib
MQ_INSTALL_ROOT c:/progra~1/ibm/websph~1
|
|
|
Back to top |
|
 |
fjb_saper |
Posted: Thu Dec 16, 2004 3:08 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
bamboozled_by_mq wrote: |
I currently have
Quote:
MQJMS_LIB_ROOT ${MQ_INSTALL_ROOT}/java/lib
MQ_INSTALL_ROOT c:/progra~1/ibm/websph~1 |
This is what I am talking about. But you only specify the path:
${MQ_INSTALL_ROOT}/java/lib
You need to add the different parts there:
java/lib (you did) java/lib/jdbc; java/lib/<all the jars>
Prefix all the above with ${MQ_INSTALL_ROOT} or create a variable
MQLIB with value c:/progra~1/ibm/websph~1/java/lib and prefix using it.
So your classpath is going to be quite long....
Enjoy  |
|
Back to top |
|
 |
bamboozled_by_MQ |
Posted: Thu Dec 16, 2004 3:52 pm Post subject: |
|
|
Voyager
Joined: 07 Jan 2004 Posts: 75
|
all separated by semi-colon,
I put:
Quote: |
MQJMS_LIB_ROOT ${MQ_INSTALL_ROOT}/java/lib/jms.jar;${MQ_INSTALL_ROOT}/java/lib/com.ibm.mqjms.jar;${MQ_INSTALL_ROOT}/java/lib/com.ibm.mq.jar;
${MQ_INSTALL_ROOT}/java/lib/com.ibm.mqbind.jar;${MQ_INSTALL_ROOT}/java/lib/connector.jar;
${MQ_INSTALL_ROOT}/java/lib/com.ibm.mq.pcf.jar;${MQ_INSTALL_ROOT}/java/lib/fscontext.jar;${MQ_INSTALL_ROOT}/java/lib/jndi.jar;
${MQ_INSTALL_ROOT}/java/lib/jta.jar;${MQ_INSTALL_ROOT}/java/lib/ldap.jar;${MQ_INSTALL_ROOT}/java/lib/providerutil.jar;${MQ_INSTALL_ROOT}/java/lib/rmm.jar;
|
man, I need all of them?
I dont need to worry about the
Quote: |
MQ_INSTALL_ROOT c:/progra~1/ibm/websph~1
|
tried it..
ARGHHHH!!!!
still same error after rebooting server.... |
|
Back to top |
|
 |
slaupster |
Posted: Fri Dec 17, 2004 7:35 am Post subject: |
|
|
Apprentice
Joined: 17 Nov 2004 Posts: 41
|
yeah - I reckon you need to change your server config by double clicking as you say. In the environment tab you can add and remove CP and ext.dirs. If you can't see where your current MQ JMS classes come from through this, try adding MQ_INSTALL_ROOT/java/lib as the first ext.dir as the first ext.dir, this means that this is the first place to look for classes in jars. I know WSAD puts stuff in the ext.dirs (including the MQJMS dir) and CP anyway so this may not help unless placing your CSD08 directory in here puts it above the where WSAD gets it normally.
I think WSAD gets its MQ JMS jars from WSAD_HOME\runtimes\base_v51\mqjms - something like that depending on the version. So if you overwrite those (as they will be the equivalent embedded CSD for your WSAD version) with the CSD08 jars then that should also resolve the problem. Thats for the WAS 5.1 server config - other runtime directories are there for the other configs.
If all this still fails, and it just feels a bit too painful, then a possible workaround is to look in the SystemOut of the server1 you have defined. At the start, the JVM args are dumped, including ext.dirs and CP. Classloaders should always look in the ext.dirs first, then CP, so if you place CSD08 com.ibm.mq.jar and com.ibm.mqjms.jar in the first directory listed as ext.dirs, then it should find it there.
hope that helps![/b] |
|
Back to top |
|
 |
fjb_saper |
Posted: Fri Dec 17, 2004 2:21 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
Quote: |
MQJMS_LIB_ROOT ${MQ_INSTALL_ROOT}/java/lib/jms.jar;${MQ_INSTALL_ROOT}/java/lib/com.ibm.mqjms.jar;${MQ_INSTALL_ROOT}/java/lib/com.ibm.mq.jar;
${MQ_INSTALL_ROOT}/java/lib/com.ibm.mqbind.jar;${MQ_INSTALL_ROOT}/java/lib/connector.jar;
${MQ_INSTALL_ROOT}/java/lib/com.ibm.mq.pcf.jar;${MQ_INSTALL_ROOT}/java/lib/fscontext.jar;${MQ_INSTALL_ROOT}/java/lib/jndi.jar;
${MQ_INSTALL_ROOT}/java/lib/jta.jar;${MQ_INSTALL_ROOT}/java/lib/ldap.jar;${MQ_INSTALL_ROOT}/java/lib/providerutil.jar;${MQ_INSTALL_ROOT}/java/lib/rmm.jar; |
Ok you can drop a few as they would be provided by the J2EE services on WAS:
jms.jar(javax.jms),
jta.jar(J2ee trans manager is better anyway this provides limitted transactional capability in a standalone environment (no 2 phase commit))
pcf.jar (You'll have to add it to the apps path that need it though, but it is not needed for connectivity or message beans),
fscontext.jar (you are using the management console right? not any filecontext)
ldap.jar (use only if you use ldap authentication)
All the other jars should be on the class path.
Check out the manual. I remember there are some special conditions about jndi.jar. I believe you need it with WAS.
Enjoy  |
|
Back to top |
|
 |
|