Using JBoss EJB 3 with Eclipse RCP [Part 2]
- Am 20. Mai 2007
- Von jmc
- In Eclipse IDE, EJB 3.0, English, Java, JBoss
1
The Demo-EJB
As a simple example EJB, which will be used in our RCP, we will use a small EJB 3.0 stateless session bean. It’s a typical “Hello World” bean:
MyTestStatelessSessionRemote.java
[java]
package bz.jmc.blog.tutorial.rcp_with_jboss.ejb;
import javax.ejb.Remote;
@Remote
public interface MyTestStatelessSessionRemote {
public String sayHello();
}
[/java]
MyTestStatelessSessionBean.java
[java]
package bz.jmc.blog.tutorial.rcp_with_jboss.ejb;
import javax.ejb.Stateless;
@Stateless
public class MyTestStatelessSessionBean implements MyTestStatelessSessionRemote {
public String sayHello() {
return “Hello World! I’m an Stateless-Session-Bean”;
}
}
[/java]
This Bean will be packaged in a JAR-file called MyTestStatelessSession.jar and needs to be deployed to JBoss. After deployment JBoss should echo something like this:
[code]
11:31:25,651 INFO [Server] JBoss (MX MicroKernel) [4.0.4.GA (build: CVSTag=JBoss_4_0_4_GA date=200605151000)] Started in 1m:21s:287ms
11:39:01,958 INFO [Ejb3Deployment] EJB3 deployment time took: 88
11:39:02,027 INFO [JmxKernelAbstraction] installing MBean: jboss.j2ee:jar=MyTestStatelessSession.jar, name=MyTestStatelessSessionBean, service=EJB3 with dependencies:
11:39:03,276 INFO [EJBContainer] STARTED EJB: bz.jmc.blog.tutorial.rcp_with_jboss.ejb.MyTestStatelessSessionBean ejbName: MyTestStatelessSessionBean
11:39:03,697 INFO [EJB3Deployer] Deployed: file:/Users/jmc/Applications/jboss-4.0.4.GA/server/default/deploy/MyTestStatelessSession.jar
[/code]
In the next part I’ll show you how to create our simple RCP application.




tiffany
The demo was really good…