Eclipse and WM IS46

Has anyone successfully configured Eclipse as an external IDE for WM 4.6 and been able to run java services through the Eclipse Debugger?

–steve

Yes. That is my normal development mode for Java services.

You just need to make sure you change the command-line options when launching the IS to enable the debugger.

Make sure you update your project settings to include the package’s code/classes directory where your Java service is located.

Are there any specific problems that you are having?

well, I am still learning Eclipse and have only used it for JSP/servlet development with the Tomcat and the Eclipse Tomcat plug-in. So I am figure out how to create my Eclipse project and what folders I need and which jar I will need in my project build path, so my java files will compile. Also how did you incorporate Jcode into Eclipse?

You can add jcode as an external build tool to your project for the package. That way when ever you build your project, it’ll automatically include the jcode command.

One other alternative is to use an ant build file, which already has integration into Eclipse. You can use this to compile your Java services and perform the jcode tasks.

Here is what I have. I have created an Eclipse Project(default location is under my Eclipse Workspace directory)). I then created a source/om/db directory and classes/om/db directory. I have my source file “jdbc.java” in source/om/db.

I have created an external build tool using jcode, which only works if I run Eclipse on the same machine as the IS4.6 server.

My question is how is the newly complied class file and the source file getting updated in the packages/<mypackagename>/code/source and packages/<mypackagename>/code/classes?

I have IS running in debug, I have modified my watt.server.compile to compile in debug. How do I execute the server so Eclipse will catch the break point?

perhaps, we could take this offline to discuss in details the configuration of Eclipse?

ok, with some help from Eduardo, here are the steps to configure Eclipse and webMethods 4.6

  1. Modify server.bat, modify the following line “set JAVA_RUN=%JAVA_EXE% %JAVA_MEMSET%” to “set JAVA_RUN=%JAVA_EXE% -Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,server=y,address=8125,suspend=n %JAVA_MEMSET%”
    Note the adderss is the debug port, make sure you don’t have any conflict on this port, this not the admin port, so don’t use 5555 if you are still using the default admin port.

  2. Modify watt.server.compile to watt.server.compile=javac -g -classpath {0} -d {1} {2} This added debug to you classes

3.Create an Eclipse Project, create an empty java project

4.Create a new folder, select advanced and link to the WM package where you will be doing java service development.

5.Select project properties | Java Build Path | source tab
add folder, select advanced, and link to the “WM package | code | source” folder that contains your java source. Then expand the new folder in the source tab window and select output folder and edit the output folder. Select the “wm package | code | classes” folder.

  1. Select the Libraries tab. Then add External JARS. Select all jar files in <is> | lib and any other jar files you need from <is> | lib | jars.

  2. Select run | “debug …” Select Remote java application, create new. Set a name, the project is you Eclipse project, Connection type is Standard (Socket Attach), host is the host of the IS servers machine, port is the port number specified in step 1 “address”

  3. Now when you compile source you are compiling the Java code from code / source and generating class files in code/classes. There is no need to use jcode. Just run the service from the developer and Eclipse will catch the break point.

Steven,

Thanks for taking the time to document these steps. I hear that WM is working on integrating Developer and Eclipse to increase the productivity of developers who need to create EJB’s to be used by the WmJBoss package. Not sure when or if this will be available as a FCS or preview version.

The Developer editor so excruciatingly basic that it does a very good job of discouraging new users from putting too much integration logic into java services. However, there are times when you need to build more robust java services and having Eclipse pre-configured to work with Developer would be a great value-add.

Regards,

Mark

Mark,

Thanks for the feedback, but you really need to thank Eduardo, with out his assistance, I would not have been able to document the configuration

Steve / Eduardo:

What version of Eclipse were you working with? I’m having a little trouble matching your instructions to Eclipse 3.0.

Thx,

Mark

Mark,
I am using WM 4.6 and Eclipse 2.1.1. What problems are you experiencing?

Well, the step-by-step instructions didn’t map to what I was seing in Eclipse 3.0 M4. I think was able to perform the equivalent steps in 3.0 until I got to step 7 “run | debug”.

I’m also getting an “Editor could not be initialized” error message when I try to open the source file in Eclipse. The java editor works fine with other standalone java source files. It can open the source using the text editor, but that defeats the purpose.

I’m going to switch back to Eclipse 2.1.x and give that a try.

Eduardo, have you guys had success using a Eclipse 3.0 version as the Java IDE for Developer?

-M

Mark,

I did a quick test on Eclipse 3.0M2, steps are pretty much the same as described by Steve. I don’t get the initialization error when opening a Java source file either.

What aspects of the Run | Debug steps are different from what is described?

-ed

Mark,

I tested w/ 3.0M4 just a few minutes ago. It looks like some changes were made that affected the link capability for folders in a project.

Instead of creating a project and linking to the package’s directory, try creating your project outside of the workspace. Opening the Java source file should work properly (i.e. using the Java editor).

hth

-ed

I was able to use the Eclipse 2.1.1 debugger for IS java service development by following the steps that Steve summarized above. I’ll try to get Eclipse 3.0M4 to work sometime soon.

Are you thinking that some M4 changes are responsible for the editor initialization issues I’m seeing or were the M4 changes related to an issue with linking to folders in an IS server’s packages directory?

On a slightly different topic, what do you see as being a reasonably productive way to use Eclipse to do java development using a shared server?

Mark

VERY GOOD THREAD!

My eclipse gave me “Failed to connect to remote VM” error following the above steps.
I overcome the problem by changing JAVA_RUN as shown below:

set JAVA_RUN=%JAVA_EXE% -Xrs -Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,server=y,address=8888,suspend=n %JAVA_MEMSET%

Ravi,

Running “java -X” at the command line says that the -Xrs option is intended to “reduce use of OS signals by Java/VM”. Do you know why this fixes the issue? Also, how did you identify the fix?

Mark

Great posts! Thanks to all contributors!

Wayne

Mark,

The -Xrs flag prevents the JVM from receiving logoff events, which is important when running as a Windows service. Details here:

[url=“JDK 19 Documentation - Home”]JDK 19 Documentation - Home

Very helpful thread, because wM Support cannot tell me how to do it.

I’m running IS6.0.1 with SP2 and JVM 1.4.1. There is no problem to connect remotely to the IS, but when I debug my code, I cannot see any local variables. What do I wrong?

My former post is outdated. There was no debugging information in the class file. Now it really works fine. Thanks!