java:comp is only available inside the bean that defines it.
It is not available from a client, nor is the java:/ namespace.
You should use the global jndi name,
your <ejb-name> by default unless you change it with a jndi-name in jboss.xml
Here's the part of the deployment descriptor:
<entreprise-beans> <session> <description> My first stateless session bean </description> <ejb-name>MySessionBean</ejb-name> <home>EJB.MySessionBeanHome</home> <remote>EJB.MySessionBean</remote> <ejb-class>MySessionBeanBean</ejb-class> <session-type>Stateless</session-type> <transaction-type>Container</transaction-type> <jndi-name>MyBean</jndi-name> </session> </entreprise-beans>
Should I see "MyBean" in the Global JNDI in the console?
In the client, I have:
Object ref = (MySessionBeanHome)jndiContext.lookup("MyBean");
and I have an error message back saying that the component is unknown..
Do you know what my problem is?
I don't see MySessionBean in the Global JNDI context.
I also tried MySessionBean for the lookup without success...
What did you mean by MySessionBean ?
Do you get errors during deployment?
You question has been posted many times before. Use search
or download the getting started guide.
Your response time to my answers suggests to me that you are not trying to
understand what is going on and you are just proxying your errors for me to solve.
That is not acceptable.
I said MySessionBean, because that is your ejb-name, see my first post.
1) You have a jboss.xml
2) Your bean is not getting deployed
3) You are connecting to the wrong server.
Show me you understand what is supposed to happen by posting relevent
configuration/logging or listing the bindings of your context - the latter
will show me you used search.
To understand why I am angry see the FAQ section about forums usage.
I though my question was well related to "Installation and configuration".
I'll try to make it working by myself. Thank you.