Hermes JMS – Revisited for WebLogic Server JMS 10gR3

Hermes JMS is an open source JMS Browser created by Colin Crist and hosted on Sourgeforge that works with numerous JMS implementations including WebLogic JMS and Oracle Application Server JMS.  I have written about using Hermes and WebLogic together before so see that entry for an overview.  I have found that this tool works great for me to quickly view/move/delete JMS messages in queues and topics.  This entry is simply an update for the recent version of Hermes 1.13 and WebLogic Server 10gR3.  Here’s a screenshot that highlights just some of the capabilities, click to enlarge.

hermesFeatures 

  • I like using the off-line installation from Sourceforge for reasons that will probably become apparent below, but there is also a Web Start version on the project home page.
  • I found an old comment that I had written that claimed using the same JVM as the WLS server with Hermes helps, so I modify the %HERMES_INSTALL%\bin\hermes.bat file to use JRockit from WLS 10gR3:
SET JAVA_HOME=C:\Oracle\wls10gR3\jrockit_160_05
set PATH=C:\Oracle\wls10gR3\jrockit_160_05\bin


  • Launch Hermes and go to Options->Preferences to add the weblogic.jar to the providers tab, this is nice because presumably I could use multiple WLS versions (I haven’t tried that)

ClasspathGroup


  • Configure a new Session in the GUI.

session 


  • Then right click on the session and select “Discover” and you should have all the destinations available to browse.
  • The Session gets saved in hermes-config.xml (C:\.hermes\hermes-config.xml on my machine) and the relevant snippet looks like this:
        <factory classpathId="weblogic10.3">
            <provider className="hermes.JNDIConnectionFactory">
                <properties>
                    <property name="initialContextFactory" value="weblogic.jndi.WLInitialContextFactory"/>
                    <property name="providerURL" value="t3://localhost:7001"/>
                    <property name="securityCredentials" value="weblogic"/>
                    <property name="binding" value="javax/jms/QueueConnectionFactory"/>
                    <property name="securityPrincipal" value="weblogic"/>
                </properties>
            </provider>
            <connection clientID="" connectionPerThread="false">
                <session audit="false" id="examplesQCF" reconnects="0" transacted="true" useConsumerForQueueBrowse="false"/>
            </connection>
            <destination domain="1" name="weblogic/wsee/DefaultQueue"/>
            <destination domain="1" name="weblogic/examples/ejb30/ExampleQueue"/>
            <destination domain="2" name="weblogic/examples/jms/exampleTopic"/>
            <destination domain="1" name="weblogic/examples/jms/exampleQueue"/>
            <destination domain="1" name="jms/MULTIDATASOURCE_MDB_QUEUE"/>
            <destination domain="2" name="quotes"/>
            <destination domain="2" name="stockTopic"/>
            <extension className="hermes.ext.weblogic.WebLogicJMSAdminFactory">
                <properties/>
            </extension>
        </factory>


    Now you should be ready to browse.  You could also take the alternative route of binding to the Initial Context of the server, which then makes it easy to create multiple Sessions from the Connection Factory objects.  However, I had trouble doing this without editing the hermes-config.xml due to what might be a fluke in the GUI for changing the class-loader provider from System to the WebLogic10.3 one that has the weblogic.jar.  If you have trouble with this you can either edit the hermes-config.xml file to have the correct provider or just add the weblogic.jar to the classpath (so System inherits it).  Good luck with Hermes.

    Comments:

    From where i can download Hermes JMS and also can we view or delete Jms messages if the user is monitor other than Admin.

    Posted by ANAND on December 21, 2009 at 03:39 AM PST #

    You can get Hermes JMS here: http://hermesjms.org I have never tried manipulating messages as anything other than an Admin role, you might ask in the WLS JMS OTN forum what user permissions are required.

    Posted by james.bayer on December 25, 2009 at 05:25 AM PST #

    Hi, Nice post, thanks! Can i see content of 'consumed' messages with Hermes?Because i am hitting some problems in weblogic jms and i can not be sure that if a message arrived my queue or not.Ofcourse checking message count is a way but is not enough for me. I need to see content of the message consumed. thanks

    Posted by aylin on January 22, 2010 at 04:22 AM PST #

    No, once a message is consumed from a queue, Hermes has no knowledge of it because WebLogic does not keep any data about consumed message contents.

    Posted by james.bayer on January 22, 2010 at 11:22 AM PST #

    Have you tried connecting to Oracle Application Server 10.1.3.4 and the Topics used by ESB in HA?

    Posted by Seth on January 26, 2010 at 06:13 AM PST #

    No, I have not, but hermesjms.org has some config info for Oracle Application Server: http://hermesjms.org/confluence/display/HJMS/Oracle Good luck, James

    Posted by james.bayer on January 26, 2010 at 10:53 AM PST #

    Hi, Nice post, can I use Hermes to connect a weblogic 10.2 on server from my laptop? It always gives me exception.

    Posted by Tejo Pendyal on August 03, 2010 at 06:20 AM PDT #

    Just last week a customer told me that they were able to use the wlfullclient.jar to use Hermes with a remote WLS server. As of WLS 10.x, weblogic.jar should not be copied around because it has relative references. Either use reference the weblogic.jar at the location where it is installed or try to build a wlfullclient.jar and see if that works. Good luck, James

    Posted by james.bayer on August 03, 2010 at 01:59 PM PDT #

    I have configured as described and switch the Java_home, Path to JRocket. But Hermes still complains it can not find the class in weblogic.jar 10.3, see below va.lang.NoClassDefFoundError: weblogic/security/subject/AbstractSubject How to do now? Thank you Leonard

    Posted by Leonard on November 02, 2010 at 07:35 AM PDT #

    Leonard, Did you add either weblogic.jar (in the location where WLS is installed, not copied) OR wlfullclient.jar to your provider tab? That is required. There is an old recording for 9.2 here: http://hermesjms.org/confluence/display/HJMS/WebLogicMQ+9.X+Tutorial Good luck, James

    Posted by james.bayer on November 02, 2010 at 08:24 AM PDT #

    Hi James, Thanks for the article. We have successfully set up Hermes on weblogic 10.3. Just wondering if you've seen this strange behaviour. We've noticed that some messages do not appear using Hermes, but they are visible via the weblogic console. So far all messages we have found like this have a "state string" value of Ordered, while all other messages have a "state string" value of Visible. Any idea what the state string value corresponds to? Keith

    Posted by keith on January 11, 2011 at 09:19 PM PST #

    Keith, Are you using WebLogic Server JMS features like Unit or Order or Unit of Work? That would probably effect the visibility of messages to a standard client like Hermes. Thanks, James

    Posted by james.bayer on January 12, 2011 at 12:27 PM PST #

    James I have followed your steps and seem to get the following problem. Could not create InitialContext: failed to unmarshal class weblogic.security.acl.internal.AuthenticatedUser:nested exception is java.io.StreamCorruptedException invalid type Code : 31 I am targeting weblogic 9.2 My Hermes is 1.4 Hermes is using JDK 1.6.11 Any assistance towards this would help.

    Posted by John on March 27, 2011 at 06:02 PM PDT #

    John, I recommend trying the same JVM that you're using on WLS to start Hermes. So in this case, that means going back to a 1.5 based JVM for the Hermes client. There may be a JVM option that helps with this, -Dsun.lang.ClassLoader.allowArraySyntax=true that could be used on the Hermes client with JVM 1.6. See the last comment on http://www.thatsjava.com/java-core-apis/39552/ for more details. Thanks, James

    Posted by james.bayer on March 28, 2011 at 01:50 AM PDT #

    Hi James, Yes the class path property did do the trick. However I did not switch JVM's as I was trying to run Hermes from SOAP UI and that definitely wanted JDK 1.6.14 other wise the Swing UI does not start up for older versions of the JDK,I tried it with JDK 1.5.11. Thanks for the help and assistance.

    Posted by John on March 28, 2011 at 06:58 PM PDT #

    the info you provide here effectively means that hermes cannot be used with jdks older than 1.6 that is a serious limmitation i figure? (due to serialization issues)

    Posted by guest on May 16, 2011 at 12:05 AM PDT #

    Guest, I think the easiest path is to use Hermes with the same JDK that you are using with WebLogic Server (unless you're using WLS 8.1 since I don't think Hermes supports 1.4.2 JVMs). You may be able to get it to work with a 1.5 WLS JVM (such as WLS 9.2 and 10.0) and a 1.6 Hermes JVM, but I have not used it in that way. Good luck, James

    Posted by james.bayer on May 16, 2011 at 05:01 AM PDT #

    Post a Comment:
    Comments are closed for this entry.
    About

    James Bayer Image
    I was formerly a Product Manager on the WebLogic Server team based out of Oracle HQ. You can find my new blog at http://iamjambay.com.
    Follow Me on Twitter
    Oracle WebLogic

    Search

    Archives
    « April 2014
    SunMonTueWedThuFriSat
      
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
       
           
    Today