Java RMI – How to setup java.rmi.server.codebase in Eclipse

 Eclipse, IT, Java  Kommentare deaktiviert für Java RMI – How to setup java.rmi.server.codebase in Eclipse
Aug 302012
 

A typical problem when running and building java RMI Applications is the following Exception:

Registering server with rmiregistry
Error happened: RemoteException occurred in server thread; nested exception is: 
    java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is: 
    java.lang.ClassNotFoundException: com.ibm.pbo.rmi.HelloInterface

To handle that problem, you have to set the following JVM Argument when running the ServerApplication:

-Djava.rmi.server.codebase=file:/abc/def

When using Eclipse, you can set this Argument in the Run Configuration:

Right Click on the ServerApplication java file -> Run As -> Run Configuration

Go to the Arguments Tab and insert the codebase argument in the VM Arguments Section:

 

Be careful with the trailing slash at the end. This slash is NECESSARY.

When I tried to point to the src directory of my Project it did not work, but if it points to the bin directory it worked fine.

-Djava.rmi.server.codebase=file:/home/philboss/Projekte/Eclipse_workspace/JavaRMI/bin/

Have fun with Java RMI 🙂

Eclipse User Libraries – How to manage build path libraries for several projects easily

 Eclipse, IT, Java  Kommentare deaktiviert für Eclipse User Libraries – How to manage build path libraries for several projects easily
Aug 272012
 

After switching my Workspace from Windows to Linux, I had to reconfigure the build-Path for each Eclipse project separately. This was a lot of work, so I took a look on how to manage build path libraries easily.

Eclipse ships a great solution for that, called „User Libraries“.

I will show you the advantages of user libraries and how to use them:

The Problem:

After switching my workspace to Linux, I had several Build Path errors like this:

 

The Solution:

To solve that, I had to reconfigure the build Path for all of my Projects in order to make them working.

This is a lot of work and if you want to upgrade your required Libraries (in this case you want to upgrade from ActiveMQ 5.4.3 to ActiveMQ 5.6.1) you have again to reconfigure all Build Paths that require that jar-File.

The Solution: User libraries

To avoid that, I decided to use User Libraries. How is it working? You can create your own libraries in which you can put several jar files (or classes). Then you have to reconfigure your build path in the projects to use the user libraries instead of the single jar files. If you now upgrade your Jar file (for Example ActiveMQ) you only have to modify your user library instead of all your project build paths.

 

Example in Pictures:

3 Projects that are using the same libraries:

Now we will create a User Library that contains the activemq-all.jar and log4j.jar file (Window -> Preferences:)

Add the needed jar-files to that library:

Then you see something like this:

Then you can reconfigure your projects to use this user library instead of the single jar-files (right click on project -> Build Path -> configure Build Path), remove the single jar files, and Add your user library (Add Library -> User Library -> „Your own Lib“):

Old build path:

New Path (with user library):

 

Projects View old:

 

Project View with user library:

 

Now you can apply that for all your Projects that are using ActiveMQ and/or log4j:

 

In the future you only have to maintain your user library and it will effect all the projects that are using that library:

Have fun with your own user libraries 😉

 

 

 

How to install SVN & Eclipse on RedHat 6.3 RHEL 6

 Eclipse, IT, Java, Linux  Kommentare deaktiviert für How to install SVN & Eclipse on RedHat 6.3 RHEL 6
Aug 212012
 

Hi,

to install Eclipse do the following steps (based on this tutorial: http://www.if-not-true-then-false.com/2010/linux-install-eclipse-on-fedora-centos-red-hat-rhel/ ):

Download eclipse and extract it to /opt/:

tar -xvzf eclipse-SDK-4.2-linux-gtk-x86_64.tar.gz -C /opt

Make all files readable:

chmod -R +r /opt/eclipse

Create executable in /usr/bin/

touch /usr/bin/eclipse
chmod 755 /usr/bin/eclipse

Notice / Update: I had some issues with Plugins when I not changed the owner of the eclipse folder. You should change the owner to avoid that: (see this link: https://philipp-boss.de/it/linux/eclipse-updates-or-plugins-are-not-working-linx )

sudo chown -R <user> eclipe

Open that file with your favourite editor and insert that content

#!/bin/sh
export ECLIPSE_HOME="/opt/eclipse"

$ECLIPSE_HOME/eclipse $*

Create a Desktop Launcher:

(right click on Desktop ->Create Launcher)

Now you can start eclipse.

How to Install SVN and SubClipse Plugin:

Install Subversion via Package manager or via yum (needs root):

(use the same command, in this case this package was already installed)

[root@oc3458605084 philboss]# <strong>yum install subversion</strong>
Loaded plugins: repository,
              : refresh-packagekit, security
Setting up Install Process
Package subversion-1.6.11-7.el6.x86_64 already installed and latest version
Nothing to do
[root@oc3458605084 philboss]#

 

Subclipse

Start Eclipse, click on Help -> Install New Software

and enter this Update Site URL: http://subclipse.tigris.org/update_1.8.x

Select the features you would like to have and install them.

 

If you get that error when using Subclipse the first time:

 

 

After that I installed the SVNKit also and set the preference to SVNKit:

(Window -> Preferences:)

 

 

After restart it worked fine 🙂