Results 1 to 1 of 1
Thread: not able to call the ejb
- 08-07-2009, 10:12 AM #1
Member
- Join Date
- Aug 2009
- Posts
- 1
- Rep Power
- 0
not able to call the ejb
Hi !! I am fairly new to EJB and I am getting a problem in calling the ejb through dependency injection
The code is ( in pollclient class)
try
{
// Get the context
context = new InitialContext();
// Lookup the bean using its JNDI name
remoteBean = (VotingRemote) context.lookup("Voting");
String vote = (String) candidateList.getSelectedValue();
}
catch (Exception e)
{
System.out.println("Could not locate remote object. Client will exit.");
System.exit(1);
}
.
.
.
( in voting bean class )
@Stateless(mappedName="Voting")
public class VotingBean implements VotingRemote
{
Poll poll;
/** Creates a new instance of VotingBean */
public VotingBean()
{
try
{
System.out.println("reaching to voting bean");
// Get a reference to the object bound by the remote server
.
.
.
The remote interface is all set up correctly
import javax.ejb.Remote;
/**
* This is the business interface for Voting enterprise bean.
*/
@Remote
public interface VotingRemote
{
void castVote(String candidate);
}
Any help will be much appreciated.
Similar Threads
-
how to call method?
By leapinlizard in forum New To JavaReplies: 9Last Post: 04-29-2009, 11:55 PM -
how to call dll from java ??
By Omarero in forum New To JavaReplies: 3Last Post: 11-13-2008, 05:14 AM -
how to call a dll from java
By katie in forum Advanced JavaReplies: 3Last Post: 12-10-2007, 10:34 AM -
I need to call and run another program
By coco in forum Advanced JavaReplies: 1Last Post: 07-31-2007, 05:47 AM -
How To Call EJB From Eclipse IDE
By JavaForums in forum EclipseReplies: 0Last Post: 04-26-2007, 10:15 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks