Hello ranchers i am trying a small example of jndi global namespace . I have deployed my service bean in jboss , packaged in TestLocationIndependence.jar , my client is web application (servlet) packaged in RemClientJboss.war . Inside my servlet i have written the following jndi code
and when i try to request this servlet i get javax.naming.NameNotFoundException: global not bound . I dont understand where i am getting wrong.
Does this exception have any relation because i am using jboss 5.1 (I dont know whether it supports ejb 3.1)
But to add on i tries the same example in glassfishv3 which i think support JEE 6 so it should have worked there atleast ?
Rancher just to add on in Glassfish i am getting a little different error
SEVERE: javax.naming.NamingException: Lookup failed for 'java:global/TestLocationIndependece/MyBean!mypack.MyBeanRemote' in SerialContext [Root exception is javax.naming.NamingException: ejb ref resolution error for remote business interfacemypack.MyBeanRemote [Root exception is java.lang.ClassNotFoundException: mypack.MyBeanRemote]]
do your .war file and .jar file packaged in EAR file ? if not then you need to package them in ear file and then run the code. according to ejb 3. 1 specifications inter-application component access is possible in ejb but how this will be achieved is largely vendor specific.
@Shroff: You might want to look at the packaging example in my notes (chapter 10, ScbcdLinks). That example uses the glassfish server (v3) and the option of an ejb-client.jar (chapter 20, EJB-specs). In this example you can see an inter-application (inter-ear) communication.
But one thing i dont get is why this exception , cant we make a simple remote invocation ? that's what i did ? i just looked up in the container's directory service and internally it should have got one stub and do all the RMI thing .(as my service had exposed Remote view)
So as you mentioned it is vendor specific ? so i just want to confirm that my above code which dint worked in my app-server(Glassfish) , will it work in other app server ? (just because you mentioned that inter application communication is vendor specific).
Also lets say i want somehow achieve the above scenario , lets say my service is running in some server , now you the client who is also deployed in the same app server but not packaged in the same EAR , now there must be some way you should be able to invoke this , as i have studied that Remote client view is suitable for such scenario.
Frits I tried your examples they were quite helpful . But now i feel my basics are still weak, please help to clear it out.
In eclipse whenever my project is depended on external class files , i do RClick on project properties and go to java build path and from there i click on Add External Jars .
So in my previous example what i did in my ServiceEJB was , i first exported remote interface of my service bean as an archive in a certain location and then in my client i added that zip as Add External Jars method which i described above.So at compile time it was not giving me any problem but at runtime it blowed off . So my main question to you is that i am not understanding how ClassNotFoundException blowing here because i follow the same methodology of Add External Jar in my standalone java app and it works fine, why is it not able to pick up at runtime ?