This week's book giveaway is in the Other Languages forum.
We're giving away four copies of Functional Reactive Programming and have Stephen Blackheath and Anthony Jones on-line!
See this thread for details.
Win a copy of Functional Reactive Programming this week in the Other Languages forum!
    Bookmark Topic Watch Topic
  • New Topic

Session bean not bound

 
Rachil Chandran
Ranch Hand
Posts: 67
  • Mark post as helpful
  • send pies
  • Report post to moderator
I am new to both EJBs and JBoss.

I have a simple stateless bean that I want to test.
The code is:


and


There is no problem with deployment, the message in JBoss console is: (SessionListener.ejb3 contains SessionListener.class and SessionListenerBean.class)

INFO [Ejb3Deployment] EJB3 deployment time took: 156
INFO [JmxKernelAbstraction] installing MBean: jboss.j2ee:jar=Sessi
onListener.ejb3,name=SessionListenerBean,service=EJB3 with dependencies:
INFO [EJBContainer] STARTED EJB: jee.jboss.session.SessionListenerBean ejbName: SessionListenerBean
INFO [EJB3Deployer] Deployed: file:/C:/Program Files/jboss-4.0.5.G
A/server/default/deploy/SessionListener.ejb3

But when I try to run a remote client,

NameNotFoundException: jee.jboss.session.SessionListener not bound

message is thrown.

Client code is:


I googled this, searched on forums and tried all the remedies given (including adding all the jar files in %JBOSS_HOME/client to classpath). No luck. Appreciate any pointers. Sorry for the lengthy post
 
Jaikiran Pai
Marshal
Pie
Posts: 10447
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Report post to moderator
Whats the name of the ear that you have package the bean in? Assuming it's MyApp.ear, your lookup for the remote bean would look like:



[ February 07, 2007: Message edited by: Jaikiran Pai ]
 
Rachil Chandran
Ranch Hand
Posts: 67
  • Mark post as helpful
  • send pies
  • Report post to moderator
Hi Jaikiran,

Thanks for your quick response.

I have packages the interface and bean classes in SessionListener.ejb3 archive file. Someone told me the latest JBoss (4.0.5) requires .ejb3 files instaed of JAR/EAR.

I tried the approach outlined by you, infact my original code had the following



I did check the JNDIview in the JMX-Console and it does not show the SessionListener to be bound in the gloabl JNDI.

I have no clue as to what is happening. I have spent a day and half trying to troubleshoot. Its is very discouraging to someone trying to use JBoss for the very first time.
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Report post to moderator
try just looking up

"SessionListenerBean/remote"

Mark
 
Rachil Chandran
Ranch Hand
Posts: 67
  • Mark post as helpful
  • send pies
  • Report post to moderator
It worked without a flaw.

Thanks a ton Mark and Jaikiran.

Mark, I know this may be asking for too much, but could you explain what's happening.

I ve read a few tutorials and all they do is just give you the plain syntax without explaining what's going on. Sorry if there is material out there regarding this that I simply missed.

Thanks,
Rachil
 
Jaikiran Pai
Marshal
Pie
Posts: 10447
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Report post to moderator
I ve read a few tutorials and all they do is just give you the plain syntax without explaining what's going on


You mean, you want to know about which jndi name to use while looking up your bean? EJBs are nothing but resources that get bound to the JNDI tree. These can then be looked up by the clients by doing operations on the JNDI tree. To put it in simple terms, its nothing more than specifying a name for your bean so that if you want to access it, you just refer it using that name.

Technically, by default (in EJB3), the jndi name that is given to the bean is of the following syntax:
For remote -
<ApplicationName>/<BeanClassName>/<remote>

For local-
<ApplicationName>/<BeanClassName>/<local>

I see that in your case where you deployed your archive as .ejb3, it was not required to specify the application name.

Also, you can always override these default jndi names by specifying your own jndi names for the beans.
[ February 07, 2007: Message edited by: Jaikiran Pai ]
 
Hernán Quevedo
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
  • Report post to moderator
Hey, all.

I am sorry, but I have to ask this one more thing: using JEE EJB3 annotations, I have this ManagedBean, made in the faces-config.xml editor in ganymede:



The session-bean:



The local interface:



This session-bean comes inside an EJB 3.0 project packed in a jar inside this war and both inside an EAR and deployed on JBoss 5.0, and then it goes:



Any help really appreciated.
 
Peter Johnson
author
Bartender
Posts: 5852
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Report post to moderator
Hernan, you should have started a new post, and not asked a different question on a 2-year old post.
 
    Bookmark Topic Watch Topic
  • New Topic