Win a copy of TDD for a Shopping Website LiveProject this week in the Testing forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

problem with stateless session bean

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
here is the code
-------------------------bean class
package pkg;

import javax.ejb.Stateless;

@Stateless
public class HelloBean implements HelloRemote {
public void sayHello(String name) {
System.out.println("Hello " + name + " welcome to SCBCD");
}

}
------------------------remote interface
package pkg;

import javax.ejb.Remote;

@Remote
public interface HelloRemote {
public void sayHello(String name);

}
-------------------------client code
package ejb;
import pkg.HelloBean;
import pkg.HelloRemote;
import javax.ejb.EJB;
public class Client{
@EJB
private static Client c;
public static void main(String[] args){
c.sayHello("aishwarya rai");
}
}
----------------------------
can any body say how to run this program
problem is error at method invocation in client side
please help me
 
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by venkateswar gayam:

can any body say how to run this program
problem is error at method invocation in client side
please help me





Use Dependency Injection on Business interface reference.

@EJB
HelloRemote c;
 
That feels good. Thanks. Here's a tiny ad:
free, earth-friendly heat - a kickstarter for putting coin in your pocket while saving the earth
https://coderanch.com/t/751654/free-earth-friendly-heat-kickstarter
reply
    Bookmark Topic Watch Topic
  • New Topic