Debuging Java service in Eclipse

Hi,

I need to debug the java service using Eclipse, I have added the nesscary jar files.

I have saved the values in pipeline and use restore pipeline to retrieve the values , in java service. The problem i face is that its throwing an exception of UnknownServiceException.

The sample code is as follows

[SIZE=2][COLOR=#3f7f5f]

IData input = IDataFactory.create();
IDataCursor inputCursor = input.getCursor();
IDataUtil.put( inputCursor, “fileName”, “number.xml” );

inputCursor.destroy();
[SIZE=2][SIZE=2][COLOR=#3f7f5f]output = Service.doInvoke( “pub.flow”, “restorePipelineFromFile”, input );

Here the output IData i get null object… and its throwing me UnknownServiceException.

Kindly help me resolve this issue.

Thanks in advance
[/color][/size][/SIZE][/COLOR][/SIZE]

You can’t call Service.doInvoke unless your Java is running within IS.
You can use the methods in com.wm.app.b2b.client.Context

Or you could store the XML locally, and use com.wm.util.coder.IDataXMLCoder to turn it into IData.

Hiubert,

There’s actually a way that you can hook Eclipse up to the Integration Server, which allows you to debug Java services without having to use pipeline files and etc.

It’s been a while since I set this up, but I’ll try to remember the details. The basic idea is to create an Eclipse project in the same folder as your IS package folder and with the same name as the package that you’re trying to debug. Set the project’s source folder to the packages code/source folder and set the project’s output folder to the packages code/classes folder. Then, you need to add some parameters to your IS JVM that give Eclipse a hook to connect into. I believe the parameters I used were:

-Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,server=y,address=4444,suspend=n

Once you start your IS and you’re ready to debug your Java service, you’d open Eclipse’s Debug Dialog box and you’d configure a Remote Java Application and point to the port specified in your JVM parameters (ex.: 4444). Click Debug. Now, when you run, step into, or step over a Java service in the Developer, you should see control being transferred to Eclipse and you can step through your code there.

I first learned about this by looking at an environment that was already setup this way, but I’m sure there’s good documentation out there from Sun and Eclipse that will give you a better understanding of how it all works and how to set it all up. The information I gave you here should be good enough to get you started though.

  • Percio

did anyone tried this on IS 7.1.2 and eClipse 3.5?
I tried all the discussed ways above, still got "eclipse.buildId=I20090611-1540
java.version=1.6.0_02
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=en_CA
Framework arguments: -product org.eclipse.epp.package.jee.product
Command-line arguments: -os win32 -ws win32 -arch x86 -product org.eclipse.epp.package.jee.product

Error
Tue Aug 24 15:30:16 EDT 2010
Failed to connect to remote VM. Connection refused.

java.net.ConnectException: Connection refused: connect
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
at java.net.Socket.connect(Socket.java:518)
at java.net.Socket.connect(Socket.java:468)
at java.net.Socket.(Socket.java:365)
at java.net.Socket.(Socket.java:179)
at org.eclipse.jdi.internal.connect.SocketTransportService$2.run(SocketTransportService.java:136)
at java.lang.Thread.run(Thread.java:619)
"

thanks for your response

richard

Since Designer came out, I just use Designer so I don’t need an extra Eclipse installation. I have different workspaces setup. For example, one where I use Designer for BPM, CAF projects, etc, and one where I use Designer just like I used Eclipse before for Java projects.

I can tell you for sure that it works fine with Designer 7.1.2, 7.2, and 8.0, which are basically Eclipse 3.4 I believe. Can you try it with your Designer installation? If you run into issues there, then we’ll know it’s not an issue with Eclipse 3.5, but maybe and issue in the configuration.

  • Percio