S
sasuke
Hello all.
For the past few days I have been trying to understand the complicated
concept behind EJB 3 but to no avail. I even haven't been able to run
a sample 'Hello world' app using the Netbeans IDE. Here are a few
questions I have in mind:
â—„ Do I have to package the entire j2ee.jar file and give it to the
client(desktop application) if they want to avail the services of the
EJB components deployed on my server. I ask this because when
programming the client we use the @EJB annotation to dynamically
locate and inject the EJB inside the EJB reference.
â—„ I tried creating an 'Enterprise application' in Netbeans with the
EJB's in a package named "home.ejb" and the client program in the
package named "home.client" just so I can test and deploy my first ejb
but it gives me a NullPointerException when I do something like below.
Both the bean package and client package are in the same application.
public class Test {
@EJB
private static HelloRemote helloBean;
public static void main(String args[]) {
helloBean.sayHello(); //sayHello is the business method
}
}
I guess my understanding of EJB concepts is really flawed or something
in my configuration is missing. Any help would be greatly appreciated.
Thanks,
--sasuke
For the past few days I have been trying to understand the complicated
concept behind EJB 3 but to no avail. I even haven't been able to run
a sample 'Hello world' app using the Netbeans IDE. Here are a few
questions I have in mind:
â—„ Do I have to package the entire j2ee.jar file and give it to the
client(desktop application) if they want to avail the services of the
EJB components deployed on my server. I ask this because when
programming the client we use the @EJB annotation to dynamically
locate and inject the EJB inside the EJB reference.
â—„ I tried creating an 'Enterprise application' in Netbeans with the
EJB's in a package named "home.ejb" and the client program in the
package named "home.client" just so I can test and deploy my first ejb
but it gives me a NullPointerException when I do something like below.
Both the bean package and client package are in the same application.
public class Test {
@EJB
private static HelloRemote helloBean;
public static void main(String args[]) {
helloBean.sayHello(); //sayHello is the business method
}
}
I guess my understanding of EJB concepts is really flawed or something
in my configuration is missing. Any help would be greatly appreciated.
Thanks,
--sasuke