| Author |
always showing null, not calling the bean class methods.
|
Punit Jain
Ranch Hand
Joined: Aug 20, 2011
Posts: 908
|
|
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
Ranch Hand
Joined: Nov 09, 2011
Posts: 657
|
|
|
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: 908
|
|
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
Ranch Hand
Joined: Nov 09, 2011
Posts: 657
|
|
|
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: 908
|
|
yes, i read that, but didn't got anything.
how that is related to this problem?
i mean what is the use of this:
here?
|
 |
James Boswell
Ranch Hand
Joined: Nov 09, 2011
Posts: 657
|
|
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: 908
|
|
|
no i used jboss..
|
 |
 |
|
|
subject: always showing null, not calling the bean class methods.
|
|
|