Running JMS tutorial examples in Eclipse without deploytool
I’ve currently been reading up on JMS via the J2EE 1.4 tutorial. (Chapters 33 and 34). I use Eclipse J2EE.
The deploytool way of doing things annoyed me quite a bit. When I had to edit the /jms/simple/src/* code for the first example (remove the jupiter prefix used for the next example in the Connection Factories) I really wanted to use eclipse. But in Eclipse I needed to emulate all the magic that asant.bat and appclient.bat made to build the class-files and run the code. After lots and lots of browsing I found the jars I needed in my build (and run) path. I created an Application Client project for each of SimpleProducer, SimpleSyncConsumer and SimpleAsyncConsumer.
Each of these in the buildpath.
- C:\Sun\AppServer\lib\install\applications\jmsra\imqjmsra.jar
- C:\Sun\AppServer\lib\appserv-admin.jar
- C:\Sun\AppServer\lib\appserv-rt.jar
- C:\Sun\AppServer\imq\lib\imq.jar
besides from being created with the Sun Application Server 8.2 Default Configuration in the eclipse wizard. Here’s a .classpath
I also tried to emulate the deploytools .jars. To be able to create jars usable by appclient (and everything else) you need to manually fix the MANIFEST.MF. Set the Main-Class: to the right class. For examples like this for SimpleProducer:
Manifest-Version: 1.0
Main-Class: SimpleProducer