Adam Bien's Weblog   

Tuesday Jun 10, 2008

How To Get Rid Of: com.sun.messaging.jmq.io.Packet cannot be cast to com.sun.messaging.jms.ra.DirectPacket in Glassfish V2.X

If you are running Glassfish and using JMS (e.g. a Message Driven Bean), you probably saw already the following error in the log files: DirectConsumer:Caught Exception delivering messagecom.sun.messaging.jmq.io.Packet cannot be cast to com.sun.messaging.jms.ra.DirectPacket.

The error is caused by directly embedding the JMS-Host into Glassfish v2 - it can be easily fixed in the admin console:

 

  1. Open the admin console: http://localhost:4848
  2. Select: Configuration -> Java Message Service node in the tree on the left side.
  3. Change the type from "Embedded" into "Local". The doc says:
    "Choose LOCAL (the default for the server-config configuration) to access the JMS service on the local host. The JMS service is started and managed by the Application Server."
  4. Restart Glassfish
This will cause the openmq.dev.java.net runtime to run out-of-process locally, and not in embedded mode. This fixes the classpath problem.


[This entry is based on / extends my books: Enterprise Architekturen, Leitfaden fuer effiziente Software-Entwicklung and: Java EE 5 Architekturen, Patterns und Idiome]

 Subscribe in a reader

About,RSS / Atom

About me: www.adam-bien.com
JavaONE 2008 Interview
My Recent Books
Adverts
Search
Links
greenfire.dev.java.net
...the last 150 posts
my.netbeans.org
Visitors
License