by Jeremy Whitlock
When I first started working on BEA WebLogic Server applications, there wasn't much support for actively debugging applications deployed to WebLogic Server while developing in Eclipse—such functionality existed only in WebLogic Workshop 8.1. For this reason, I wrote the WebLogic-Plugin for Eclipse, an extension to the basic Eclipse IDE to provide WebLogic Server integration features. After nearly two years since its inception, the plug-in has changed dramatically to provide many more features than simply debugging your deployed application. This article gives you a good overview of the WebLogic-Plugin and its features, and a handle on how to install and use the WebLogic-Plugin to deploy and debug applications.
Unless you've been under a rock the last year you have probably heard of the Eclipse IDE. Eclipse has become one of the most popular IDEs, and the goal of the WebLogic-Plugin project on CodeShare was to create an extension to the Eclipse IDE for managing and debugging deployed applications on WebLogic Server. While the final version of the plug-in is not finished yet, here is the planned feature list for 2.0.0 final:
As you can see, we have ambitious plans to create an Eclipse plug-in that provides full lifecycle management of applications deployed to an out-of-the-box Eclipse IDE.
This article helps you install the WebLogic-Plugin and then utilize it to manage a WebLogic Server, manage its deployments, and debug a simple EJB deployed to the WebLogic Server.
To get any use out of this article you will have to make sure that your environment is ready. Here are the tools that you need to have installed:
The installation of Eclipse and WebLogic Server is outside the scope of this article, but the WebLogic-Plugin installation instructions can be found here. Just make sure you choose the 2.0 version when installing. Before we configure a server, let's make the WebLogic Servers view visible:
Window > Show View > Other... > WebLogic > WebLogic Servers
Now that everything is installed, we're ready to look at how to use the WebLogic-Plugin.
The concept behind the WebLogic-Plugin is simple. You create configurations that correspond to an existing WebLogic domain. Once your domain is ready, you need to let the WebLogic-Plugin know where this domain is, what the domain's resource requirements are, and finally how to properly start up the domain. To do this in the WebLogic-Plugin, you need to configure a server, and the WebLogic-Plugin provides you with the means to do it.
To use the WebLogic-Plugin you need to have a WebLogic domain already created. Based on the version of WebLogic Server that you will be running, the following documents will help get your respective WebLogic domain created:
In the WebLogic Servers view, click the to spawn a dialog allowing you to configure the WebLogic Server that you want to deploy this sample application to debug. Here is a description of all parts of the Add WebLogic Server Instance dialog:
General tab is used to give information about your WebLogic Server installation and domain configuration. A lot of this information may seem unnecessary, but the WebLogic-Plugin uses this information extensively beyond starting/stopping the server. Values input on this form will override any of the same references in the
config.xml (such as the port and SSL port):
Classpath tab is useful for updating your configuration so that it either properly runs or properly debugs. The
webservices.jar are already included. (This will be visualized before 2.0 final.) You can use the
Classpath tab when your project requires JARs to be on the classpath or you need to prepend a .jar, like Xerces, to override the ones delivered with WebLogic. Another use of the
Classpath tab is for debugging. When you debug your application, you need to have the Eclipse project you are debugging to be on the classpath. For the example, we do not need to modify this for now, but we will later when we want to debug.
The Runtime tab is where we configure the runtime portions of your WebLogic Server configuration including VM and program arguments. We will get into this more when we begin debugging, but in the mean time, here is a description of the inputs:
For this article, I have gone through the domain configuration wizard, mentioned above. In doing so, I changed only the domain's server name and the domain's name.
Figure 1 shows what the resulting configuration should look like.
Figure 1. The Add Server Dialog properly configured
Now that we have a server configured, let's start it up to make sure we don't have any problems. To start your configured WebLogic instance, right-click on the new server in your WebLogic Servers view. This will pop up a context menu. Click the Start menu item to start the server.
Figure 2 shows the result of starting your WebLogic Server successfully.
Assuming all is well, let's stop the server by right-clicking on your running WebLogic instance and clicking the Stop menu option and get on with debugging an application.
Note that we performed no configuration in the Classpath or Runtime tabs! You only need to do this when you are ready to debug the application. We will be doing this closer to the end of the article.
Pages: 1, 2