File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes EJB and other Java EE Technologies and the fly likes Lookup problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "Lookup problem" Watch "Lookup problem" New topic
Author

Lookup problem

Mohamed Mostafa
Greenhorn

Joined: Mar 15, 2012
Posts: 11
I am trying to make an ejb which connects to a database using JNDI lookup
i am using Netbeans on Glassfish server (only if this info would help)

i have created a datasource on glassfish server for a sybase databse and the connection test went successfully

i have JNDI name: jdbc/test i have made reference and tried to use the look up method but always giving me error this is my code and below will print you the error




ERROR



i am still new in this area i have searched alot for a solution with no help i guess if there any configuration need to be made or what please any one help
Ram Narayan.M
Ranch Hand

Joined: Jul 11, 2010
Posts: 247

bean.main.main(main.java:25)


"test" Stateless Session bean does not have Business Interface from which it implements.
Seeing the trace, you are calling the "test" class from main() method of main class...

Seems you have directly instantiated the "test" class and making a conventional method on object invocation...

Does not seem to be done in Application Server...


SCJP 6 [SCJP - Old is Gold]
Mohamed Mostafa
Greenhorn

Joined: Mar 15, 2012
Posts: 11
test is the JNDI name .. whatever i have a dataSource that i need to use i can't know how to call it or why is this error happening
Mujahed Syed
Ranch Hand

Joined: May 18, 2010
Posts: 32

Hi,

Execute asadmin list-jndi-entries command to see if your ejb entry is available.

List of available commands http://glassfish.java.net/nonav/v3/admin/planning/j109/list-of-commands.html


SCJP, OCWCD
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Lookup problem
 
Similar Threads
Resource injection for env entry in the field
Had an issue while accessing JMS remotely
failed jndi datasource lookup for jdbc/__default on Glassfish
Problems with a simple jms test application
Getting error while deploying EJB