Gerhard Schuster is working on some How-to’s about how to use Eclipse 3.3 to develop and connect EJB 3.0 Beans running on JBoss 4.2.
He’s using a lot of screenshots to make it easy to follow his instructions.
I think it is a worthwhile read for anybody interested in this topic who wants some more detail than my article can offer.
You can find Gerhards articles here:
To get something working we need to insert some code in our RCP. We will insert it directly in the Application.java. All output will be echo to the console so that there is no need for a GUI:
Application.java
Now click on "Lauch an Eclipse application" in the "Overview"-tab to lauch the RCP. If anything is OK you should see a RCP window and an output similar to this one:

Hopefully this small tutorial is a little helpful.
Start Slide Show with CoolirisFirst we need to declare the RCP dependend on the JBoss-plugin.

Now we define the Buddy-Policy in the JBoss plugin ( insert "Eclipse-BuddyPolicy: registered" in the Manifest.MF) and let the RCP-Plugin register as a buddy (insert "Eclipse-RegisterBuddy: org.jboss.client" in the Manifest.MF). Please ensure that there is always a blank line at the end of the Manifest.MF and there is no whitespace in front of the "Eclipse-..."!


We need to let our plugin know the EJBs it should work with. Inside the project we create a new folder called "libs" and copy the file MyTestStatelessSession.jar into it. Now we will refresh the project and add the JAR to the build path by right-clicking on the file and choose Build Path > Add to Build Path. The result should look like this:

As a last step we need to add the EJB-Jar to the classpath under Runtime. Without this step our JBoss-Plugin is not able to find the classes at runtime.

In the last part I will show you how to create some test code to ensure anything is working.
Start Slide Show with CoolirisUsing the menus File > New > Project we will create our RCP. All details you can find in the following 4 screenshots:




Our plugin with the JBoss-Classes will be created similar to the RCP-plugin. But in this case we are using "Plug-in from existing JAR archives".

In the next dialog we are choosing Add external and select all JARs in the %JBOSSHOME%/client folder. The auth.conf file should not be selected!


Now we need to define the dependency between the two plugins and create a Buddy-Policy. I'll show that to you in part 4.
Start Slide Show with CoolirisAs 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
MyTestStatelessSessionBean.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:
In the next part I'll show you how to create our simple RCP application.



