|
|
![]() |
| Thread Tools | Search this Thread |
#1
| |||
| |||
Java EJB not Found in Netbeans 6.0.1 and GlassFish V2
Hi, I use Netbeans 6.0.1 and GlassFish V2 to make EJB3. So I created a Session Bean the following code: Code: @ Stateless public class MySessionBean implements MySessionBeanRemote, MySessionBeanLocal ( public String getMessage () ( return "Hello World!"; ) ) Code: Context ctx = null; ctx = new InitialContext (); MySessionBeanRemote tsr = (MySessionBeanRemote) ctx.lookup ( "mySessionBean"); System.out.println ( "message =" + tsr.getMessage ()); When I run my client application, I always except as follows: Quote:
|
#2
| |||
| |||
Re: Java EJB not Found in Netbeans 6.0.1 and GlassFish V2
Your exception is that it does not mySessionBean jndi in your tree. I worked on a little ss weblogic and conf jndi was provided in xml files included in the classpath. In the case of your client application, you should check whether you load well conf files (. xml or properties) that contain the information to access your ejb. |
#3
| |||
| |||
Re: Java EJB not Found in Netbeans 6.0.1 and GlassFish V2
Thank you for your reply , I just wanted to correct something, the bean that I seek is MySessionBean not mySessionBean (m first in capitals), it was a typo when posting my problem and it ' is not the source of the problem. For your proposed solution I look into it . Thank you. I reviewed what I like jndi property, and do not see the problem exactly, thank you for me clarify exactly what I have to check my configuration. I even avoid using the file. Properties, passing under an item InitialContext Properties containing the requirements, but in vain. I do not know if I am wrong if I think the object is not instantiated in the application server (it's still a hypothesis). |
#4
| |||
| |||
Re: Java EJB not Found in Netbeans 6.0.1 and GlassFish V2
Hello, Well, I thought I share a little I do not used the same configuration as you but I will try to show you As I understand: When deploying ejb weblogic on a server, you can also generate customers who can call in the ejb remote. It is also valid for other server applications. Here are the config files generated by weblogic for a call to a ejb given: ejb-jar.xml: Code: <session> <ejb-name> MyBeanSession </ ejb-name> <home> en.edf.erdsge.ejb.mybean.MyBeanSessionHome </ home> <remote> en.edf.erdsge.ejb.mybean.MyBeanSessionRemote </ remote> <local-home> en.edf.erdsge.ejb.mybean.MyBeanSessionLocalHome </ local-home> <local> en.edf.erdsge.ejb.mybean.MyBeanSessionLocal </ local> <ejb-class> en.edf.erdsge.ejb.mybean.MyBeanSession </ ejb-class> Stateless <session-type> </ session-type> <transaction-type> Container </ transaction-type> </ session> weblogic-ejb-jar.xml: Code: <weblogic-enterprise-bean> <ejb-name> MyBeanSession </ ejb-name> <stateless-session-descriptor> </ stateless-session-descriptor> <enable-call-by-reference> true </ enable-call-by-reference> <jndi-name> ejb.MyBeanSessionRemoteHome </ jndi-name> <local-jndi-name> ejb.MyBeanSessionLocalHome </ local-jndi-name> </ weblogic-enterprise-bean> Here the lookup jndi fetches the reference in jndi weblogic-ejb-jar.xml then goes to the mapping in ejb-jar.xml to retrieve the name of the ejb to load classes that go well. These classes * * local and remote are delivered to the customer. I hope it can help you Good luck, |
#5
| |||
| |||
Re: Java EJB not Found in Netbeans 6.0.1 and GlassFish V2
First of All I uses EJB3 with annotations and therefore I do not think I need all this setting.I found the problem, I had just specify the mappedName my EJB, So a line like: @ Stateless (mappedName = "mySessionBean") Should have been the case (Stateful and Stateless as you want) Thank you for your aid.Regards |
![]() |
|
Tags: 601, ejb, glassfish, java, netbeans |
Thread Tools | Search this Thread |
|
![]() | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Problem install Glassfish Server | Defender14 | Software Development | 7 | 26-10-2010 01:38 PM |
Java main class not found | Rily | Software Development | 6 | 13-08-2010 10:21 AM |
Java Card Manager NetBeans plug-in | Galimberti | Software Development | 5 | 24-07-2010 03:27 AM |
Java console application used in netbeans 5.5 ide | Erie | Software Development | 6 | 22-07-2010 09:46 AM |
How do i load and save picture in java ide netbeans 6.5 | nanakofiboafo | Software Development | 1 | 23-04-2009 08:22 AM |