• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Tim Cooke
  • Devaka Cooray
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
Bartenders:
  • Carey Brown
  • Roland Mueller

EJB 3 Newbie

 
Ranch Hand
Posts: 759
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi friends, my name is Jeffry. I'm a newbie in EJB 3 technology.

I have few questions regarding invoking EJB session bean:

  • Can I invoke session bean through an independent Java swing application without running it inside the application client container ? If I can, how can I do that ?


  • Can I invoke session bean across the Internet ?


  • Your help will become a great contribution in my learning experience.

    Thanks before


    Jeffry Kristianto Yanuar (Java Instructor)
    SCJP 5.0 SCJA SCJD
     
    author & internet detective
    Posts: 41967
    911
    Eclipse IDE VI Editor Java
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    Jeffry,
    You can definitely call it from the Swing client. I'm not sure about over the internet. I know you can call it from a different machine. I don't know if it has to be on the same network. I think you can do it, but I'm not positive.

    The code varies a bit based on your server, but it basically looks like this example.
     
    author
    Posts: 580
    5
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    Jeffry,

    Take a look here: https://glassfish.dev.java.net/javaee5/ejb/EJB_FAQ.html. You may use either DI or look-ups in a Swing based standalone Java SE client.

    Remote EJB calls via RMI/JRMP (the default for most application servers and the most performance friendly choice) can be made across the Internet in theory. In practice, you will need to configure RMI HTTP/S tunneling since most routers block RMI ports: http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3954059#3954059. Note, I've never seen anyone trying to invoke EJB across a firewall via HTTP/RMI, so am not sure how it will work in practice. Remoting inside a firewall works very well.

    Hope it helps,
    Reza
     
    Jeffry Kristianto Yanuar
    Ranch Hand
    Posts: 759
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    Thanks Reza, actually I am learning EJB using your book titled "EJB 3 in Action". The book is very good. I think you should provide the sample code in Netbenas project. Using Netbeans to build a project is easier than invoking Ant method.



    Jeffry Kristianto Yanuar (Java Instructor) SCJP 5.0 SCJA SCJD
     
    Reza Rahman
    author
    Posts: 580
    5
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    Jeffry,

    Thanks for the kind words. If you get a chance, please do consider posting a review on Amazon.com or elsewhere. It really helps us out.

    I am going to write on setting up EJB 3/Java EE 5 projects using Eclipse, NetBeans or Maven very soon. I am just very busy, so it is difficult to make time. I wish someone else would do some of it (hint, hint ;-)).

    Cheers,
    Reza
     
    Jeffry Kristianto Yanuar
    Ranch Hand
    Posts: 759
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    I'll post a review on Amazon when I have a time, I also very busy cause I need to teach EJB 3 soon. I am a Java Instructor in Java SE, ME, and EE (currently teaching Servlet and JSP).

    Thanks for replying and providing very good links. The "EJB 3 in Action" book become a primary contribution in my learning experience


    Thanks

    Jeffry Kristianto Yanuar (Java Instructor) SCJP 5.0 SCJA SCJD
     
    Reza Rahman
    author
    Posts: 580
    5
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    Jeffry,

    Great! Many thanks...

    Reza
     
    This guy is skipping without a rope. At least, that's what this tiny ad said:
    We need your help - Coderanch server fundraiser
    https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
    reply
      Bookmark Topic Watch Topic
    • New Topic