• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

global - name not bound exception

 
Sagar Shroff
Ranch Hand
Posts: 209
Java Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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]]

Why ClassNotFoundException ? confused

Regards,
Shroff

 
gurpeet singh
Ranch Hand
Posts: 924
1
Fedora Java Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Frits Walraven
Creator of Enthuware JWS+ V6
Saloon Keeper
Pie
Posts: 2345
90
Android Chrome Eclipse IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

I agree with Gurpeet Singh.

@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.

Regards,
Frits
 
Sagar Shroff
Ranch Hand
Posts: 209
Java Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.

Regards,
Shroff.
 
Sagar Shroff
Ranch Hand
Posts: 209
Java Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ?

Regards,
Shroff.
 
Frits Walraven
Creator of Enthuware JWS+ V6
Saloon Keeper
Pie
Posts: 2345
90
Android Chrome Eclipse IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes you can really struggle to get this thing working (which is mostly caused by incorrect project setup) You might want to check the Jboss or Glassfish manuals to get the right project configuration.

You can also have a look at Ivan notes in chapter 5.2. Remote Session Bean Clients

Regards,
Frits
 
Don't get me started about those stupid light bulbs.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic