| Author |
Facing problem in dependecy injection of EJB 3.0 session bean
|
ramakrishna kulkarni
Greenhorn
Joined: Feb 06, 2009
Posts: 14
|
|
Hi All
I am trying to run this simple ejb example using eclipse
This the client code and client is also part of EAR
package example.ejb.client;
import javax.ejb.EJB;
public class HelloUserClient {
@EJB
private static HelloUserBeanRemote helloUser;
public static void main(String[] args) {
helloUser.sayHello();
}
}
When I tried to do this class is not compiling properly
getting error at this line
private static HelloUserBeanRemote helloUser;
Error :HelloUserBeanRemote cannot be resolved to a type
HelloUserBeanRemote is Remote interface and I am implementing this interface properly
I am not able to figure out what is going wrong
|
 |
Marco Ehrentreich
best scout
Bartender
Joined: Mar 07, 2007
Posts: 1221
|
|
Hi Ramakrishna,
this doesn't seem to be an EJB problem. The error message "HelloUserBeanRemote cannot be resolved to a type" says that the compiler can't resolve the type of your interface which in turn means this class is missing a proper import statement or the JAR/package which provides the interface declaration isn't included in the classpath of your client application.
Depending on your development environment or IDE you probably just have to add the JAR in question to your client project and add the necessary import statement to the client class and at least this problem should (hopefully) disappear
Marco
|
 |
 |
|
|
subject: Facing problem in dependecy injection of EJB 3.0 session bean
|
|
|