Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » Test and Performance Tools Platform (TPTP) » [new AC] Data exchange fail between Java client and Java Agent !
[new AC] Data exchange fail between Java client and Java Agent ! [message #116178] Tue, 23 October 2007 10:31 Go to next message
Eclipse UserFriend
Originally posted by: mlafon.arcadsoftware.removethis.com

I just try to use the TPTPJavaAgent with an modified version of the
SampleClientAC (I just change the name of the agent used to
JavatimeCollector), with TPTP 4.4.0.3.

After some work to config the agent... If the agent is not launched with
the good parameter this causes JVM crash, this can bereally confusing in
a deployment stage. Any way, I get the agent working and this is what I
get on the Client conseole :

Testing Agent Controler Server...
Connecting to Host localhost
Connecting to AC..
Connected to localhost at port number 10006
Connected to org.eclipse.tptp.JavaTimeCollector
The Data received from TimeCollector - JTC HELLO
The Data received from TimeCollector - JTC HELLO
The Data received from TimeCollector - JTC HELLO
The Data received from TimeCollector - JTC HELLO
The Data received from TimeCollector - JTC HELLO
The Data received from TimeCollector - JTC HELLO
The Data received from TimeCollector - JTC HELLO
The Data received from TimeCollector - JTC HELLO
The Data received from TimeCollector - JTC HELLO
The Data received from TimeCollector - JTC HELLO
Data Processor Waiting for Data Called

"JTC HELLO" is the data send by the agent, except that the agent send
"JTC HELLO FROM JTC ".

In fact, there is an conversion problem in the sendData :

super.sendData(destID,"JTC HELLO FROM JTC ".toCharArray());

the data are sent to the Native in the form of array of char (char in
java are 2 byte data, I gess ?).

The client get an incomingData with an array of byte and the lenght is
the lenght of the array of char, the HALF of the real byte array size.


To get all the data I need to double the string, something like this :

public int sendData(int targetInstanceId, String buffer)
throws AgentControllerUnavailableException {
// double string length
buffer = buffer + buffer;
return super.sendData(targetInstanceId, buffer.toCharArray());
}

And the client need to remove the last character of the received string :

public void incomingData(byte[] buffer, int length, InetAddress peer) {
String data = new String(buffer,0,length-1); // Remove last char !!!
...
}

This is working but this is ugly !

Finally, I get the answer of my previous question, the new Java API has
not been tested.


Marc.
Re: [new AC] Data exchange fail between Java client and Java Agent ! [message #116191 is a reply to message #116178] Tue, 23 October 2007 12:34 Go to previous messageGo to next message
Igor Alelekov is currently offline Igor AlelekovFriend
Messages: 139
Registered: July 2009
Senior Member
Hi Marc
This defect has two bugzillas opened -
https://bugs.eclipse.org/bugs/show_bug.cgi?id=150216 and
https://bugs.eclipse.org/bugs/show_bug.cgi?id=150217
Regards,
Igor
Re: [new AC] Data exchange fail between Java client and Java Agent ! [message #116229 is a reply to message #116191] Tue, 23 October 2007 14:49 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: mlafon.arcadsoftware.removethis.com

Hi Igor,

thank for your answer and your efforts in the TPTP Agent Controller
project.

I saw the bug report, I just forgot it :), by the way, except silly
remarks about testing, my post give a workaround if someone need it...

It looks like this bug is corrected in a patch and that patch is not
check-in because it contains a modification of the API ! an API that
does not work anyway... :p


Do you took a look at the bug report #207126 :

https://bugs.eclipse.org/bugs/show_bug.cgi?id=207126

This is the reason why we are using data channel, my Java Agent can't
access to command bodies.

Marc.
Re: [new AC] Data exchange fail between Java client and Java Agent ! [message #116242 is a reply to message #116229] Tue, 23 October 2007 14:59 Go to previous messageGo to next message
Igor Alelekov is currently offline Igor AlelekovFriend
Messages: 139
Registered: July 2009
Senior Member
Hi Marc,
I don't remeber exactly, but there should be another way to get command
data.
I'll check it tomorrow.
Regards,
Igor
Re: [new AC] Data exchange fail between Java client and Java Agent ! [message #116252 is a reply to message #116229] Tue, 23 October 2007 15:00 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: mlafon.arcadsoftware.removethis.com

It's me again...

There is any chances to retarget the pacthes in the next version ?

I just take a look into, it does not make any change to the API. it just
add a new (really usefull) function without modifying the existing one !
Re: [new AC] Data exchange fail between Java client and Java Agent ! [message #116277 is a reply to message #116252] Tue, 23 October 2007 15:08 Go to previous messageGo to next message
Igor Alelekov is currently offline Igor AlelekovFriend
Messages: 139
Registered: July 2009
Senior Member
The patches could be committed shortly if pmc approves the bug for TPTP 4.5
Re: [new AC] Data exchange fail between Java client and Java Agent ! [message #116289 is a reply to message #116242] Tue, 23 October 2007 15:23 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: mlafon.arcadsoftware.removethis.com

That would be great !
(The check-in 4.5 is a good news, too)

Thanks a lot, Igor.


Marc.
Re: [new AC] Data exchange fail between Java client and Java Agent ! [message #116328 is a reply to message #116289] Wed, 24 October 2007 10:24 Go to previous messageGo to next message
Igor Alelekov is currently offline Igor AlelekovFriend
Messages: 139
Registered: July 2009
Senior Member
Hi Marc,

to get a command data you can use ICommandFragment.getElemList() instead.
Please see comments in the
https://bugs.eclipse.org/bugs/show_bug.cgi?id=207126

Regards,
Igor
Re: [new AC] Data exchange fail between Java client and Java Agent ! [message #116333 is a reply to message #116252] Wed, 24 October 2007 14:44 Go to previous message
Igor Alelekov is currently offline Igor AlelekovFriend
Messages: 139
Registered: July 2009
Senior Member
Marc,
Could ypu please submit your comments/requests to bugzilla?
Regards,
Igor
Previous Topic:Agent Controller is unavailable under port 10002
Next Topic:[AGR] - invoke external process from AGR macro
Goto Forum:
  


Current Time: Tue Apr 23 07:03:40 GMT 2024

Powered by FUDForum. Page generated in 0.04244 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top