• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

always showing null, not calling the bean class methods.

 
Punit Jain
Ranch Hand
Posts: 1012
2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1051
5
Chrome Eclipse IDE Hibernate
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1012
2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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
Posts: 1051
5
Chrome Eclipse IDE Hibernate
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1012
2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1051
5
Chrome Eclipse IDE Hibernate
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
on witch j2ee container did you deploy your application ??
if weblogic you cant look up in this way ....
 
Punit Jain
Ranch Hand
Posts: 1012
2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
no i used jboss..
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic