The entire JMS specification consists of interfaces. Therefore, to write and compile a an application that makes use of the JMS api, you only need to add a JAR containing the interfaces to your classpath. The jboss-j2ee.jar contains all the JMS interfaces.
The actual JBoss implementations of those interfaces are located in jbossmq.jar (for example org.jboss.mq.SpyQueueSession is an implementation of javax.jms.QueueSession). This Jar is required at runtime, not compile time.
Thank you Tim, it seems you are write.
Still, when I added jboss-j2ee.jar in IntelliJ IDEA's project configuration, it complains about having not found some methods, for example: ConnectionFactory.createConnection().
What can I do?
Thanks a lot
That method is only available in JMS 1.1 which is only included with J2EE 1.4.
JBoss 3.x supports J2EE 1.3, which includes the JMS 1.0.2 APIs. ConnectionFactory has no methods in that version.
I'd suggest reviewing the J2EE 1.3 javax.jms API docs and make sure if you're following any tutorials that they are for the JMS 1.0.2 spec. The concepts are the same but the actual classes and methods you'll use are different.
Alternatively, use something like Spring Framework's API helpers to insulate your code from many of the API details.
Tim, I am now using JBoss4.0 and the included jboss-j2ee.jar file and everything goes well.
Thank you very much