Results 1 to 4 of 4
  1. #1
    Malkaviano is offline Member
    Join Date
    Apr 2014
    Posts
    2
    Rep Power
    0

    Default Problem with Standalone client JSE -> EJB in Glassfish

    Hi all,
    - Same jvm
    - EJB module deployed in Glassfish 4.0
    - The client is a JSE application
    - IDE: Netbeans 7.3.1

    I added the following jar into the classpath of my client: gf-client.jar with an absolute path ponting directly into Glassfish lib directory. Everything compliance with https://glassfish.java.net/javaee5/ejb/EJB_FAQ.html.
    When I launch my client from Netbeans with this code into the main method:

    LogicService ls = (LogicService) new InitialContext().lookup(JNDINAME);
    System.out.println(ls.printMsg());

    IT WORKS. But when I launch the JAR separately from the IDE... Hell Unleashed....
    "Need to specify class name in enviroment or system property..."

    Why?
    Any help?

  2. #2
    gimbal2 is offline Just a guy
    Join Date
    Jun 2013
    Location
    Netherlands
    Posts
    4,260
    Rep Power
    6

    Default Re: Problem with Standalone client JSE -> EJB in Glassfish

    Methinks the glassfish client jar is not on the classpath. Open up the META-INF/MANIFEST.MF file of your jar and see what's in there. Most notably a line 'class-path' is of interest here.
    "Syntactic sugar causes cancer of the semicolon." -- Alan Perlis

  3. #3
    Malkaviano is offline Member
    Join Date
    Apr 2014
    Posts
    2
    Rep Power
    0

    Default Re: Problem with Standalone client JSE -> EJB in Glassfish

    Quote Originally Posted by gimbal2 View Post
    Methinks the glassfish client jar is not on the classpath. Open up the META-INF/MANIFEST.MF file of your jar and see what's in there. Most notably a line 'class-path' is of interest here.
    Is there:
    Class-Path: lib/BusinessLogic.jar lib/gf-client.jar

    Exactly... what jars are needed for a standalone client?

  4. #4
    gimbal2 is offline Just a guy
    Join Date
    Jun 2013
    Location
    Netherlands
    Posts
    4,260
    Rep Power
    6

    Default Re: Problem with Standalone client JSE -> EJB in Glassfish

    You already know that because it works from your IDE remember. You are not going to spontaneously need different jars when running the application through different means, there is simply something different in the runtime environment that needs to be rooted out; 99/100 times its a classpath not being managed properly, that is one of those things an IDE does for you.

    Alright, so as you can see the classpath wants the dependent jar files to be in a subdirectory 'lib' relative to the directory where you invoke the java command, which is likely going to be the directory where your application jar is. Does that directory exist and are the mentioned jar files in there?
    "Syntactic sugar causes cancer of the semicolon." -- Alan Perlis

Similar Threads

  1. How to run java web client in standalone client
    By Xerces in forum New To Java
    Replies: 3
    Last Post: 07-27-2012, 04:07 AM
  2. Glassfish v3 Problem
    By jaikumar in forum Java Servlet
    Replies: 0
    Last Post: 02-19-2012, 03:01 PM
  3. Invoke an EJB on Glassfish 3.1 from client in Tomcat 6
    By VegetaSSJ5 in forum Enterprise JavaBeans (EJB)
    Replies: 0
    Last Post: 07-29-2011, 08:40 PM
  4. glassfish problem
    By ondra in forum JavaServer Pages (JSP) and JSTL
    Replies: 1
    Last Post: 02-21-2010, 02:20 AM
  5. File upload from standalone client
    By Astghik in forum Enterprise JavaBeans (EJB)
    Replies: 1
    Last Post: 01-12-2010, 03:07 PM

Posting Permissions

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