This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes EJB and other Java EE Technologies and the fly likes always showing null, not calling the bean class methods. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "always showing null, not calling the bean class methods." Watch "always showing null, not calling the bean class methods." New topic
Author

always showing null, not calling the bean class methods.

Punit Jain
Ranch Hand

Joined: Aug 20, 2011
Posts: 980
    
    2
i m getting a problem in stateless bean..
here is my interface:
calc.java

calcImpl.java


Index.jsp


calServlet.java


the problem is my servlet is not calling the methods of calcImpl class.
i mean when i clicking on button, it showing me null always..
James Boswell
Bartender

Joined: Nov 09, 2011
Posts: 1012
    
    5

What properties are set for your context? See here for more info: http://docs.oracle.com/javase/6/docs/api/javax/naming/InitialContext.html
Punit Jain
Ranch Hand

Joined: Aug 20, 2011
Posts: 980
    
    2

What properties are set for your context?

Where to check this??
i don't know about them, i just got the code from internet.
James Boswell
Bartender

Joined: Nov 09, 2011
Posts: 1012
    
    5

Did you read anything from the link I sent you? Do this first. I prefer the jndi.properties file option myself.
Punit Jain
Ranch Hand

Joined: Aug 20, 2011
Posts: 980
    
    2
yes, i read that, but didn't got anything.
how that is related to this problem?
i mean what is the use of this:

What properties are set for your context? See here for more info: http://docs.oracle.com/javase/6/docs/api/javax/naming/InitialContext.html

here?
James Boswell
Bartender

Joined: Nov 09, 2011
Posts: 1012
    
    5

Punit

If you had bothered to read the link more carefully, you will have discovered that it is totally relevant to what you are trying to achieve. When you use an InitialContext, a particular set of system properties need to be set so that this class knows where to look for the resources you are attempting to look up.

The values of these system properties vary, depending on the application server you are using. But recently, when looking up an EJB remotely, running on JBoss AS6, I used the following values defined in a jndi.properties file:

java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
java.naming.provider.url=localhost:1099
java.naming.factory.url.pkgs=org.jboss.naming: org.jnp.interfaces

You may need to look up the documentation of the application server you are using to find out what values are required.
mihran eprem
Greenhorn

Joined: Apr 26, 2012
Posts: 4
on witch j2ee container did you deploy your application ??
if weblogic you cant look up in this way ....
Punit Jain
Ranch Hand

Joined: Aug 20, 2011
Posts: 980
    
    2
no i used jboss..
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: always showing null, not calling the bean class methods.
 
Similar Threads
ClassCastException while reading ics file with ical4j in JackRabit
how to know which servlet/jsp calling a particular servlet
@EJB
Forwarding users from one JSP to another using a form.
@EJB