Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Starting WebLogic 9.2 Managed Server in debug mode in Eclipse

We are trying to switch from MyEclipse 10 to Eclipse Indigo. We are currently using WebLogic 9.2, and typically debug directly in Eclipse.

Using MyEclipse, we were able to get the Server defined within the IDE to start/stop the Managed Server directly, having already started the Node Manager and Admin server manually prior. However, with Eclipse and WTP, we have not been able to determine how to do the same.

When defining a server in Eclipse Indigo, it allows us to specify the domain, but when we start it we only get the Admin server started. For writing and debugging applications this is useless. What I am looking for is a means to allow me to start/stop the Managed Server and not the Admin server. I have Google'd repeatedly to no avail as everything I have found walks me through the same process I have already performed. Remote debugging doesn't seem like a good option.

Yes I know we are on an ancient version of WL. Yes I know we really should update for numerous reasons. Those decisions are well above my pay grade, and we have already raised our concerns with the people who have that authority. I just need to get what I have working like I want.

Update I have been searching and playing and searching some more. Tried to simply change the "Start script" in the Debug Configuration to be that of the Managed Server instead of the LocalAdmin. However, if I have the LocalAdmin started via Service or Command line, Eclipse sees this and makes the server in the Server tab as "Running". Trying to start it causes the running LocalAdmin to stop and the Managed Server to start... not what I need.

My next thought was to do what I did in MyEclipse, which was to duplicate the Debug Config and add the appropriate VM args to start the Managed Server, but there is no place to do that as there are no config options to control the VM args.

Finally, I tried to add a "Generic Server", point it to the WebLogic JARs, but I never get an option to "Debug" the Generic Server.

I am not sure what else to try. SOMEONE has to be other there that has debugged a Managed Server within Eclipse! My only other thought is to turn on remote debugging. This seems like a painful option.

It just seems odd that there is no option to attach to a Managed Server. I'd have to think SOMEONE out there has done this, or needed this. Otherwise, what's the point of offering it?

like image 301
CodeChimp Avatar asked Oct 10 '13 13:10

CodeChimp


People also ask

How do I start WebLogic admin server in debug mode?

Select "Run/Debug" from "Project Properties" and select "Edit" for the "Default Run Configurations". Within the "Edit Run Configuration", select the "Remote Debugging and Profiling" checkbox for "Launch Settings".


1 Answers

I have always found that the interfaces provided by various versions of Eclipse for starting and stopping the Weblogic server were painful to use. It is much better to create a modified and renamed startWeblogic.cmd script that includes debug parameters to open a port when starting the server, and then remotely attaching to the machine. This assumes that your code is compiled with debugging enabled.

For example the modified script might include some of the following arguments. %JAVA_HOME%\bin\java %JAVA_VM% %MEM_ARGS% -Xdebug -Xrunjdwp:transport=dt_socket,address=8000,suspend=n,server=y

You then create a new remote application in eclipse with Debug As... and attach to the port. In this case 8000.

like image 72
Sammy Avatar answered Oct 29 '22 05:10

Sammy