Results 1 to 5 of 5
  1. #1
    sehudson's Avatar
    sehudson is offline Senior Member
    Join Date
    Mar 2010
    Posts
    384
    Rep Power
    10

    Default Java Messaging Service Standalone Application

    First, I am unsure if this is posted in the correct forum. I searched the J2EE sub-forums, but couldn't find one related to JMS, so I am posting here, please let me know if this is not the correct area of the forum.

    I have a standalone JAVA Application (JAR) that consumes messages posted to a JMS Queue that I have setup within my Glassfish installation. I know that normally the JMS API is used within the context of an application deployed on an application server, but I also understand that with Glassfish (more than likely other application servers as well) there is a way to have a standalone application use JMS resources by essentially 'wrapping' the JAR file using a utility called appclient. This allows the JAR to have access to server resources, in my case, the queue that I have setup. I invoked the following command:

    Java Code:
    appclient -client subscriberApp.jar
    When, I do that, I receive the following error:

    org.glassfish.appclient.client.acc.UserError: The location file:/C:/Users/seh/Desktop/TempEventReceiver/dist/subscriberApp.jar could not be opened as an archive; an app client or an enterprise app was expected

    Has anyone encountered this? I cannot find much information online. Any help would be appreciated.

  2. #2
    gimbal2 is offline Just a guy
    Join Date
    Jun 2013
    Location
    Netherlands
    Posts
    5,114
    Rep Power
    12

    Default Re: Java Messaging Service Standalone Application

    Seems like the jar is broken? Can you open it in a zip tool?
    "Syntactic sugar causes cancer of the semicolon." -- Alan Perlis

  3. #3
    sehudson's Avatar
    sehudson is offline Senior Member
    Join Date
    Mar 2010
    Posts
    384
    Rep Power
    10

    Default Re: Java Messaging Service Standalone Application

    I'll give it a try. I'm using Maven as the build system, so your question has me wondering if there is something about the way Maven is building the JAR. I haven't declared anything in the build section of the pom file, so it's being built the 'default' way, but I'm wondering if I may need to do something special.

    I know when I open it in the IDE (NetBeans) it runs up until the point where the JMS API is used, but I can't recall at the moment what the error is, but I wouldn't expect it to work within the IDE since there is no 'hook' to the server, but the program at least started running. I'll take a look at the JAR later today.

    Thanks.
    Last edited by sehudson; 06-01-2015 at 06:00 PM.

  4. #4
    sehudson's Avatar
    sehudson is offline Senior Member
    Join Date
    Mar 2010
    Posts
    384
    Rep Power
    10

    Default Re: Java Messaging Service Standalone Application

    I'll give it a try. I'm using Maven as the build system, so your question has me wondering if there is something about the way Maven is building the JAR. I haven't declared anything in the build section of the pom file, so it's being built the 'default' way, but I'm wondering if I may need to do something special. Thanks.

  5. #5
    gimbal2 is offline Just a guy
    Join Date
    Jun 2013
    Location
    Netherlands
    Posts
    5,114
    Rep Power
    12

    Default Re: Java Messaging Service Standalone Application

    I haven't ever seen Maven produce a broken jar so that's likely not it.

    The error you get when running from the IDE is probably a better clue.
    "Syntactic sugar causes cancer of the semicolon." -- Alan Perlis

Similar Threads

  1. Replies: 0
    Last Post: 01-01-2015, 11:51 AM
  2. Replies: 14
    Last Post: 08-04-2012, 01:08 AM
  3. How to develop a standalone application using java
    By santhoshkeleti in forum New To Java
    Replies: 2
    Last Post: 11-15-2011, 07:21 PM
  4. developing a standalone application using java
    By santhoshkeleti in forum New To Java
    Replies: 1
    Last Post: 11-15-2011, 07:18 PM
  5. Replies: 0
    Last Post: 02-03-2011, 05:36 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •