The messagin examples require that JMS connection factories and destination resources be created before deploying and running the samples. More specifically, you must create a javax.jms.TopicConnectionFactory resource with an JNDI name jms/TopicConnectionFactory, and a javax.jms.Topic destination resource with JNDI name jms/Topic. In Sun RI/Glassfish, the destination resource must have an additional property that links it with a physical destination. To provide that, add the property "name" with value "Topic" to that resource in the admin GUI.