Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

EJB help

Posted on 2005-03-07
8
Medium Priority
?
243 Views
Last Modified: 2013-11-24
Hello,

My company has one server where all the EJB resides. Now, I want to my local PC connected to that EJB ( I mean I want to execute some of the methods provided in the EJB on that particular computer). If I develop web application (using Bea), what information do I need? Can I connect to that EJB using Java standalone (using Socket), not web application?

Thanks

Regards
Dave
0
Comment
Question by:suprapto45
  • 3
  • 2
  • 2
  • +1
8 Comments
 
LVL 86

Expert Comment

by:CEHJ
ID: 13475990
You can simply connect to it through anything that can access a JNDI provider and the client stubs
0
 
LVL 16

Author Comment

by:suprapto45
ID: 13476003
can you describe more CEHJ, btw thanks for your prompt reply.

Thanks

Regards
Dave
0
 
LVL 35

Expert Comment

by:TimYates
ID: 13476080
You just need to have a JAR file of the Remote and Home interfaces for your EJB app

Then set up the JNDI parameters as usual, and call the EJB app...

This can be from any java code* (both client app, or web app)

Tim

(* apart from J2ME) ;-)
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 6

Assisted Solution

by:durgaprasad_j
durgaprasad_j earned 200 total points
ID: 13476088
hi,

see this post http://www.experts-exchange.com/Programming/Programming_Languages/Java/Q_21340328.html

he is accessing ejbs from normal client [ that is not the web application].

Good Luck
0
 
LVL 86

Accepted Solution

by:
CEHJ earned 800 total points
ID: 13476094
Here's an overview of EJB from the client perspective:

http://www.javaskyline.com/learnejb.html#topiccli
0
 
LVL 35

Assisted Solution

by:TimYates
TimYates earned 400 total points
ID: 13476119
You just need to do something like:

      java.util.Properties JNDIParm = new java.util.Properties() ;
      JNDIParm.setProperty( InitialContext.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory" ) ;
      JNDIParm.setProperty( InitialContext.PROVIDER_URL, "jnp://yourEJBserver:1099" ) ;
      JNDIParm.setProperty( InitialContext.URL_PKG_PREFIXES, "org.jboss.naming:org.jnp.interfaces" ) ;
      ctx = new InitialContext( JNDIParm ) ;

(that's for JBoss)

Then use the InitialContext "ctx" to look up your EJBs...
0
 
LVL 16

Author Comment

by:suprapto45
ID: 13476153
Thanks, let try those solutions. Btw, you all are awesome. You all are robot's brain :)

Regards
Dave
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 13498235
:-)
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

For beginner Java programmers or at least those new to the Eclipse IDE, the following tutorial will show some (four) ways in which you can import your Java projects to your Eclipse workbench. Introduction While learning Java can be done with…
A solution for Fortify Path Manipulation.
Video by: Michael
Viewers learn about how to reduce the potential repetitiveness of coding in main by developing methods to perform specific tasks for their program. Additionally, objects are introduced for the purpose of learning how to call methods in Java. Define …
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.
Suggested Courses
Course of the Month15 days, 13 hours left to enroll

580 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question