Arch2Arch Tab BEA.com
Syndicate this blog (XML)

Configuring Eclipse to launch WebLogic Event Server

Bookmark Blog Post

del.icio.us del.icio.us
Digg Digg
DZone DZone
Furl Furl
Reddit Reddit

Seth White's Blog | February 15, 2008   8:06 PM | Comments (0)


It's been a while since my last post.  For the last few months I have been busy writing code for the next release of the WebLogic Event Server.  Now, the development team has reached our internal "feature complete" milestone for the 3.0 release, so I have time to blog again.

One thing that's nice about the fact that the Event Server is based on an OSGi kernel is that it makes it easy to configure Eclipse to launch the Event Server as a normal Java application.  You essentially just need to specify the Java class for the server, add three jars to the classpath, configure the usual command line options, and away you go. OSGi will take care of loading any additional jars that the server needs.

Before I go into detail concerning the setup, I should mention that BEA does provide some nice Eclipse tooling for the Event Server that can also be used to launch the server.  You may want to set things up yourself, however, if you are using a different version of Eclipse than the one the Event Server plug-in supports.  I have been using Eclipse 3.3 for almost a year, for example, and the plug-in requires Eclipse 3.2.

From within Eclipse, start by by selecting Run > Open Run Dialogue.  When the Run dialogue box opens click on "Java Application" and then click on the leftmost menu item above (the one that looks like a blank sheet of paper) to create a new run configuration for the Java application.
Next, we need to fill in some information.  The screenshot below shows the main screen of the run configuration with the values that I used.  In this example, I am going to configure the server to use the domain for the helloworld sample application that comes with the 2.0 release.

You can see that I have named the run configuration "helloworld server".  I have also associated this run configuration with my helloworld_domain project.  This is an eclipse project that I created and that is rooted at the domain directory of the helloworld sample application that can be found in the Event Server 2.0 release.  I believe you can actually specify whatever you want for the Name and Project, the important thing on this screen is the Main class: com.bea.wlevs.Server.  This is the primordial class whose main method will launch the Event Server.

image


Next, let's look at the arguments that are passed to the server.  I have disabled security since I am just doing development.  I have also specified the BEA and WLEVS home directories.  These are the typical arguments that are specified when running the Event Server from the command line.  I have also specified a value for the Working directory.  This is the directory where the event server will be "run".  In this case, I have specified the root directory of my helloworld_domain project.  I did this by clicking on the "Workspace..." button and then selecting the helloworld_domain project.

image

The next step is to specify the JRE  for the server to use.  The server should use the version of JRockIt that is installed with the Event Server.  You may need to click on "Installed JREs…” and tell Eclipse where to find JRockIt before you can specify it as the Alternate JRE  to use.

image

Next, let's configure the classpath for our server instance.  Initially, the Classpath window will look something like this:

image

 

We need to configure the "User Entries" portion of the classpath.  First, delete whatever is there for "UserEntries" by default.  Then, you will need to add three jars from the bin directory of your Event Server installation.  In the example below,I have done this by selecting"Add External JARs..." , and selecting each jar from my Event Server installation's bin directory.

 

 image

That's it!  Now, if you click on Run the server should boot and deploy the helloworld sample application.

 

image

To recap, we specified the following:

  1. The Main class for the server.
  2. The commandline arguments to the server.
  3. The server's working directory.
  4. The JRE for the server to use.
  5. The classpath for the server.

At this point, you can repeatedly run the server by clicking on the green Run button near the top of the Eclipse window. Eclipse will remember the last application that was run, so a single click is all it takes. You can also run the server in debug mode in order to debug applications using the Eclipse debugger. 

If you want to run the server using a different domain, you can copy your existing run configuration for the server and then just change the working directory so that it is the same as the domain directory for the new

domain you want to use. In other words, you don't need to go through all the steps of creating a new run configuration again.

Technorati Tags: ,

Comments

Comments are listed in date ascending order (oldest first) | Post Comment



Only logged in users may post comments. Login Here.

Powered by
Movable Type 3.31