JMCblog

Nothing in particular…

Sonntag
Mai 20,2007

Creating the RCP-Plugins

Using the menus File > New > Project we will create our RCP. All details you can find in the following 4 screenshots:

RCP Plugin Projekt anlegen
RCP Plugin Projekt anlegen
RCP Plugin Projekt anlegen
RCP Plugin Projekt anlegen

Creating the JBoss-Client-Plugin

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”.

Create JBoss-Client-Plugin

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!

Create JBoss-Client-Plugin
Create JBoss-Client-Plugin

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 Cooliris
Sonntag
Mai 20,2007

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:
  1. package bz.jmc.blog.tutorial.rcp_with_jboss.ejb;
  2.  
  3. import javax.ejb.Remote;
  4.  
  5. public interface MyTestStatelessSessionRemote {
  6.  
  7. public String sayHello();
  8.  
  9. }

MyTestStatelessSessionBean.java

JAVA:
  1. package bz.jmc.blog.tutorial.rcp_with_jboss.ejb;
  2.  
  3. import javax.ejb.Stateless;
  4.  
  5. @Stateless
  6. public class MyTestStatelessSessionBean implements MyTestStatelessSessionRemote {
  7.  
  8. public String sayHello() {
  9. return "Hello World! I'm an Stateless-Session-Bean";
  10. }
  11.  
  12. }

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:
  1. 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
  2. 11:39:01,958 INFO  [Ejb3Deployment] EJB3 deployment time took: 88
  3. 11:39:02,027 INFO  [JmxKernelAbstraction] installing MBean: jboss.j2ee:jar=MyTestStatelessSession.jar, name=MyTestStatelessSessionBean, service=EJB3 with dependencies:
  4. 11:39:03,276 INFO  [EJBContainer] STARTED EJB: bz.jmc.blog.tutorial.rcp_with_jboss.ejb.MyTestStatelessSessionBean ejbName: MyTestStatelessSessionBean
  5. 11:39:03,697 INFO  [EJB3Deployer] Deployed: file:/Users/jmc/Applications/jboss-4.0.4.GA/server/default/deploy/MyTestStatelessSession.jar

In the next part I'll show you how to create our simple RCP application.

Samstag
Mai 19,2007

I got a lot of hits to my article about how to connect an Eclipse Rich Client Project to JBoss and EJB 3. Most of these hits came from people outside of germany and they left right after entering the page. So I think that there is some interest in an english version of this article.

Our goal

We want to create an Eclipse Rich Client Project (RCP for now on) consisting of the RCP-plugin and a second plugin containing the JBoss client JARs. To keep things simple, the EJB-Classes will be hold directly in the RCP-Plugin. In a later article I will show how to extract the business-classes in an extra plugin to ensure better maintainablity.

The problem

The OSGI-Classloader from Eclipse creates an extra Classpath for any plugin it loads. Classes from other plugins are therefore invisible. This behavior is pretty good in generel because it allows Eclipse e.g. to enable or disable plugins at runtime. But sometimes it is necessary to give plugin A access to classes in plugin B. This can be archived by declaring a dependency between A and B.

But for our problem we need access in both directions. Our RCP needs "to see" the JBoss classes and JBoss needs access to our EJBs. And because this is not possible you will get a lot of

Javax.naming.CommunicationException [Root exception is java.lang.ClassNotFoundException: bz.jmc.blog.tutorial.rcp_with_jboss.ejb.MyTestStatelessSessionRemote (no security manager: RMI class loader disabled)]

and other errors.

The solution

As mentioned above, you can't set a dependency in both directions. We need another solution for this particular problem and this solution is called "Buddy Classloading". So it is possible to "open" one plugin for others. Other Plugins can register as a buddy and give access to their classes.

In some upcoming articles I will create a small tutorial project with screenshots, illustrating the buddy classloading solution.

Freitag
Mai 11,2007

Nachdem ich nun eine digitale Spiegelreflex (Nikon D70S) besitze (naja, zumindest fast, da sie schon / noch in Reparatur ist) und ich ein wenig bei Flickr aktiv geworden bin, kam der Wunsch auf, die Bilder auch geographisch zu kennzeichnen. Dies wird allgemein als Geotagging bezeichnet.

Das nötige Equipment ist vorhanden, die Suche nach der Software war allerdings ein wenig aufwändiger. Folgende Ausstattung ist für meinen Ansatz nötig:

  • ein Pocket PC (am besten mit Windows Mobile 5)
  • ein kompatibler GPS-Empfänger (entweder eingebaut, Bluetooth oder mit Anbindung per Kabel)
  • die kostenlose Software Odgps

Es wird einiges an kostenpflichtiger Software für diesen Zweck angeboten. Diese war mir aber für den geplanten Einsatzzweck zu teuer und / oder hat zu viele Ressourcen verbraucht (z.B. GPSTuner). Ich wollte ja nur eine Software, die eine bestimmte Wegstrecke als GPX-Datei speichern kann... Mit einer ganzen Menge "googlen" fand ich dann Odgps.

ODGPS Konfiguration Screenshot ODGPS Dashboard Screenshot
Odpgs wird als Donationware angeboten. Es glänzt zwar nicht mit einer verspielten Oberfläche, aber das ist ja auch nicht erforderlich. Unter Tracker -> NewTrack kann man die Aufzeichnung eines neues Tracks starten. Abgefragt wird noch der Name, den die Datei haben soll.

In weiteren Beiträgen werde ich dann beschreiben, wie man die mit Odgps gewonnen Daten mit seinen Photos verbinden kann und wie es sogar möglich ist, Odgps und sein Navigationsprogramm (z.B. TomTom) parallel auf dem Pocket PC zu betreiben.

Die Screenshots wurden übrigens mit PocketSnap aufgenommen, welches von Boris Nienke geschrieben wurde. Boris ist einer der Macher vom HappyShooting-Podcast.

Start Slide Show with Cooliris

Hafencity Hamburg HDR

Montag
Apr 30,2007


Weitere Fotos der Hafencity in HDR findet Ihr auf meiner Flickr-Seite oder in der Gallerie vom JMCblog.

Die Bilder sind am 17.04.07 mit meiner Nikon D70S entstanden. Als Software kam Photomatix Pro 2.4 zum Einsatz.

Start Slide Show with Cooliris


JMC on flickr

RiesenradDoppelter RolandMaple leaf1914-1918

Letzte Kommentare


Schlagwörter

Apple assignments aufgaben aufgaben assignments b&w black classic d300 day88 dia dockland fehmarn film Flickr Hörertreffen hamburg HappyShooting Holga hund iPhone ipod itunes Kopenhagen live microsoft mittelformat musik Nikon p6000 photo assignment aufgabe Photographie Project365 project365 photofriday raw review schwarz shuffle Strobist VFXY view weiß white wic Wordpress Workshop

VFXY Photos 2008 Photoblog Awards