Threads in Java VUser(Vugen Script) (1458 Views)
Reply
Regular Advisor
Mayank D
Posts: 114
Registered: ‎11-06-2008
Message 1 of 11 (1,458 Views)
Accepted Solution

Threads in Java VUser(Vugen Script)

Hi,

I need to run java threads in my Java VUuser, program.
I had made a java program through Netbeans, it has two threads :-
1. Receiver
2. Sender
Receiver listens for a message from sender, once it receive the messsage, it terminates.
This is working fine in Netbeans but when i tried to run in VuGen, it is showing nothing.
Please tell me what configuration i need to do in VuGEN to make it run.
I need it ASAP as this is a production issue.

Best Regards,
Mayank
Honored Contributor
Mario Morelli
Posts: 1,258
Registered: ‎01-12-2009
Message 2 of 11 (1,458 Views)

Re: Threads in Java VUser(Vugen Script)

Hi Mayan

With what protocol are you trying to record this app?

--Regards
--Mario
Regular Advisor
Mayank D
Posts: 114
Registered: ‎11-06-2008
Message 3 of 11 (1,458 Views)

Re: Threads in Java VUser(Vugen Script)

Hi Mario,

I am using simple java with threads, the code is working fine in Netbeans IDE. But when i m trying to run in VuGEN using Java VUSer, it is not behaving properly.
In logs it sbows
***************************
Error: Thread Context: Call to service of the driver failed, reason - thread context wasn't initialized on this thread.
Error (-17998): Failed to get [param not passed in call] thread TLS entry.
Error (-17998): Failed to get [param not passed in call] thread TLS entry.
Error: Thread Context: Call to service of the driver failed, reason - thread context wasn't initialized on this thread.
*************************
Please tell me is there some configuration to be done to run a threaded program in VuGEN.

Also please let me know, can i run a batch file from VuGEN and in which protocol.

Best Regards,
Mayank


Mayank
Honored Contributor
Mario Morelli
Posts: 1,258
Registered: ‎01-12-2009
Message 4 of 11 (1,458 Views)

Re: Threads in Java VUser(Vugen Script)

Hi Mayan

There is a setting in vugen under run time settings which lets you choose to run as process or thread.


Try that and let me know.
Honored Contributor
Mario Morelli
Posts: 1,258
Registered: ‎01-12-2009
Message 5 of 11 (1,458 Views)

Re: Threads in Java VUser(Vugen Script)

Hi

Also if you can put the C code in vugen to run the batch file I think it would be possible.

--Regards
--Mario
Regular Advisor
Mayank D
Posts: 114
Registered: ‎11-06-2008
Message 6 of 11 (1,458 Views)

Re: Threads in Java VUser(Vugen Script)

Thanks Mario for quick response.
I tried in VuGEN run time settings. There in miscellaneous menu, we have multithreading radio buttons. i selected "Run Vuser as threads" but still it is in the same state.
Please tell me apart from this if another setting required or correct me the way to do those setting.

Best Regards,
Mayank
Regular Advisor
Mayank D
Posts: 114
Registered: ‎11-06-2008
Message 7 of 11 (1,458 Views)

Re: Threads in Java VUser(Vugen Script)

Hi Experts..

Any suggestion for my problem. I need to solve it ASAP.

Thanks & Best Regards,
Mayank
Honored Contributor
Mario Morelli
Posts: 1,258
Registered: ‎01-12-2009
Message 8 of 11 (1,458 Views)

Re: Threads in Java VUser(Vugen Script)

Hi Mayan

Could you please upload the code so that I can see if i can help.

--Regards
--Mario
Occasional Visitor
Jessreq
Posts: 1
Registered: ‎07-15-2010
Message 9 of 11 (1,458 Views)

Re: Threads in Java VUser(Vugen Script)

Can I know how this problem was solved? I also run a Java program with SmartSockets. I have a sender and a receiver. It is ok in Eclipse and when ran by itself. But when it is ran by Vugen, the receiver does not get the data. I believe this is just a configuration issue.
Frequent Advisor
pgopalak
Posts: 35
Registered: ‎04-28-2008
Message 10 of 11 (1,434 Views)

Re: Threads in Java VUser(Vugen Script)

Was this ever fixed ? We are also being hit by this issue

 

Thanks

Prabhu

Occasional Collector
JHF Remmelzwaal
Posts: 2
Registered: ‎04-17-2009
Message 11 of 11 (691 Views)

Re: Threads in Java VUser(Vugen Script)

Recently I had the same type of issues. Note that when you run a java thread in VuGen it will use for all LR-based classes/functions the C-libraries via JNI. Also stdout and stderr are redirected. It looks like LR is using TLS for this. Your own created thread does not have access to LR's internal TLS which is also in native code.

 

So creating your own threads work fine as long as you do not use stderr/stdout (use your own logging or use a queue to hand it over to an LR-thread started by LR itself) and do not use any LR functions like lr.* and web.* etc from your own thread.

 

The opinions expressed above are the personal opinions of the authors, not of HP. By using this site, you accept the Terms of Use and Rules of Participation.