Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Help EJB3

 
Gunnar Maluf
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?

 
Jaikiran Pai
Marshal
Pie
Posts: 10447
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The output looks right to me. Were you expecting something else?
 
Gunnar Maluf
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic