This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes EJB and other Java EE Technologies and the fly likes Help EJB3 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "Help EJB3" Watch "Help EJB3" New topic
Author

Help EJB3

Gunnar Maluf
Ranch Hand

Joined: Dec 29, 2007
Posts: 39
Hello all!

I need some help with the following:

Web Server - Jboss 5.1.0 GA
IDE - eclipse

I created a EJB project using eclipse and the following files:

ejb.server.HelloWorld.HelloWorldBeanRemote


ejb.server.HelloWorld.HelloWorldBeanLocal



ejb.server.HelloWorld.HelloWorldBean



and the client



I execute the project from Eclipse and my ejb is deployed as I get the message:
11:27:41,999 INFO [EJBContainer] STARTED EJB: ejb.server.HelloWorld.HelloWorldBean ejbName: HelloWorldBean
11:27:42,018 INFO [JndiSessionRegistrarBase] Binding the following Entries in Global JNDI:

HelloWorldBean/remote - EJB3.x Default Remote Business Interface
HelloWorldBean/remote-ejb.server.HelloWorld.HelloWorldBeanRemote - EJB3.x Remote Business Interface
HelloWorldBean/local - EJB3.x Default Local Business Interface
HelloWorldBean/local-ejb.server.HelloWorld.HelloWorldBeanLocal - EJB3.x Local Business Interface




When I run the client as a JAVA APPLICATION I get the output:
Proxy to jboss.j2ee:jar=EJB.jar,name=HelloWorldBean,service=EJB3 implementing [interface ejb.server.HelloWorld.HelloWorldBeanRemote]
Proxy to jboss.j2ee:jar=EJB.jar,name=HelloWorldBean,service=EJB3 implementing [interface ejb.server.HelloWorld.HelloWorldBeanRemote]
Proxy to jboss.j2ee:jar=EJB.jar,name=HelloWorldBean,service=EJB3 implementing [interface ejb.server.HelloWorld.HelloWorldBeanRemote]

What I am doing wrong that I dont get the object I want from the Container?


Sun Certified Associate for Java Platform
Sun Certified Java Programmer 5.0
Sun Certified Web Component Developer 5.0
Jaikiran Pai
Marshal

Joined: Jul 20, 2005
Posts: 9924
    
158

The output looks right to me. Were you expecting something else?

[My Blog] [JavaRanch Journal]
Gunnar Maluf
Ranch Hand

Joined: Dec 29, 2007
Posts: 39
Jaikiran Pai wrote:The output looks right to me. Were you expecting something else?


Since I am starting studying EJB3 now....so I didn't know what to expect.
Although I was expecting an Object of my bean type, someone in another forum explained to me that EJB returns a proxy for the object.

Now I would like to know how to use a local interface, could you please help me?
Is it possible (and a good practice) to use a local interface in the client?

best regards
 
 
subject: Help EJB3
 
Similar Threads
Can't run first Session Bean : NameNotFoundException
ejb create() Error java.lang. IllegalStateEx: Failed to find method for hash
Client Code to Look Up a Bean in EJB 3
Session bean , Local and Remote interface with answer.
Problem deploying a simple EJB3 application