2

As can be seen below, system time and SoapUI's time value is different.

system and soapui time

SoapUI using JRE time and that's why it should be a bug of Java's itself because; also below code gives: Venezuela Time

String tzn = TimeZone.getDefault().getDisplayName();
System.out.println(tzn);

What I've tried and failed:

  • Playing with regedit and changing time zone then get it back to correct.
  • Giving -Duser.timezone="Europe/Istanbul" at Control Panel/Java/JRE Settings/Runtime Parameters or giving same parameter inside the JAVA_OPTS variable.
  • Changing time or time zone and get it back.

I checked this question surely, correcting the timezone programmatically is doable but I need to correct SoapUI's timezone which affects automated test results. Because tests are time dependent.

Community
  • 1
  • 1
Ömer Faruk Almalı
  • 3,792
  • 6
  • 37
  • 63
  • 3
    So you see the problem when you're just running a test Java program completely independently of SoapUI? If that's the case, I don't see how SoapUI is relevant to the question. – Jon Skeet Feb 15 '13 at 14:34
  • Nope not only Java, I am running Soap requests, Http requests, Groovy codes as well. Also some situations requires to trace SoapUI logs. – Ömer Faruk Almalı Feb 15 '13 at 14:40
  • Are you sure that Europe/Turkey is a defined timezone? Could you try setting it with Europe/Istanbul? According to this article http://tutorials.jenkov.com/java-date-time/java-util-timezone.html Europe/Turkey is not defined. – bhdrkn Feb 15 '13 at 15:24
  • @ÖmerFarukAlmalı Could you please clarify your answer to the above question? Let me re-state it: On this same system, if you put your 2 lines of java code above (the ones that print the default timezone) into a stand-alone program, does the program output Venezuelan Time or Turkish time? – EJK Feb 15 '13 at 15:28
  • @bhdrkn I tried Europe/Istanbul. I typed it wrong in the question it's not working. – Ömer Faruk Almalı Feb 15 '13 at 15:32
  • I am not sure that changing the value of "Control Panel/Java/JRE Settings/Runtime Parameters" will have any affect here. I think that setting is only for the Java browser plug-in. What you are really interested in is the java.exe instance that is used to launch SOAP-UI. I believe all SOAP-UI scripting runs within that same VM instance. – EJK Feb 15 '13 at 15:33
  • @EJK I agree with you. SoapUI has it's own JRE folder there must be a file that should be edited. But also Groovy scripts are doing some db checks and these values are returning wrong as well. I also checked db sysdate and it's correct so hard to figure out why. – Ömer Faruk Almalı Feb 15 '13 at 15:39
  • @ÖmerFarukAlmalı I will ask again. Could you please respond to the question that has been asked by me and Jon Skeet? See the 1st and 4th comments. Without this information, it will be very hard to know the root cause. – EJK Feb 15 '13 at 15:42
  • Could you try to set JAVA_OPTS environment var which includes -Duser.timezone="Europe/Istanbul"? – bhdrkn Feb 15 '13 at 15:42
  • Ok when i'll be home i'm going to try. – Ömer Faruk Almalı Feb 15 '13 at 15:48
  • @EJK I think i answered Jon Skeet's and your question. I am not using only a test Java program or code that I have typed in question not only those giving me the unexpected results. I am running Groovy codes Web Service requests too and if SoapUI's own logs are giving wrong times how can people think SoapUI is relevant from this question? – Ömer Faruk Almalı Feb 15 '13 at 15:58
  • 2 lines of code and SoapUI logs are giving same result Venezuelan time – Ömer Faruk Almalı Feb 15 '13 at 16:04
  • Edit on comment *irrelevant from this question – Ömer Faruk Almalı Feb 15 '13 at 16:06
  • @bhdrkn setting JAVA_OPTS not working pal.. – Ömer Faruk Almalı Feb 15 '13 at 19:00

1 Answers1

2

I really tried hard to solve this issue, for days. I really don't know why the most plausible two methods are not working properly which:

  • Creating JAVA_OPTS system variable which has the value of: -Duser.timezone="Turkey"
  • Passing vm parameter from command line.

At last I gave up and set this parameter for each specific program, to be able to do this for SoapUI, go to SoapUI Home Path/bin folder and right click to soapui-pro.bat and choose to edit. (If you are using the community version, the name of the bat file will be different)

Then go to line 29 which starts with set JAVA_OPTS=-Xms128m... and insert time-zone parameter: -Duser.timezone="Turkey". Now execute the bat file, it's going to start to work properly!

Ömer Faruk Almalı
  • 3,792
  • 6
  • 37
  • 63
  • This isn't a problem just with SoapUI but with JRE/JVM (6 in my case). Our app was having the same issue with Turkey's timezone. Your solution worked for me! – Molten Ice Nov 26 '15 at 13:26