martinboksa / rest-client

Automatically exported from code.google.com/p/rest-client
Apache License 2.0
0 stars 0 forks source link

NumberFormatException Cannot load Proxy options from properties #201

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
I am using RESTClient 3.2.2 CLI in windows 7(64bit) machine. Every time I am 
running it, it is showing below info-

Dec 14, 2013 5:14:24 PM org.wiztools.restclient.ProxyConfig getInstance
INFO: Cannot load Proxy options from properties.
java.lang.NumberFormatException: null
    at java.lang.Integer.parseInt(Unknown Source)
    at java.lang.Integer.parseInt(Unknown Source)
    at org.wiztools.restclient.ProxyConfig.init(ProxyConfig.java:42)
    at org.wiztools.restclient.ProxyConfig.getInstance(ProxyConfig.java:29)
    at org.wiztools.restclient.HTTPClientRequestExecuter.execute(HTTPClientRequestExecuter.java:127)
    at services.rest.executor.TestCaseExecutor.execute(TestCaseExecutor.java:211)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
    at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
    at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
    at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
    at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)
    at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)
    at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
    at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
    at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
    at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
    at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
    at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
    at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
    at org.junit.runners.Suite.runChild(Suite.java:127)
    at org.junit.runners.Suite.runChild(Suite.java:26)
    at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
    at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
    at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
    at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
    at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
    at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
    at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
    at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
    at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
    at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)

I don't need any proxy to connect to server.

Original issue reported on code.google.com by ravi2008...@gmail.com on 14 Dec 2013 at 11:49

GoogleCodeExporter commented 8 years ago
Proxy configurations are written by GUI tool in this location: 
~/.rest-client/rest-client.properties

So your options are:

1. Open GUI tool and then disable proxy
2. Edit proxy.options.is_enabled=false in the file
3. Delete rest-client.properties to regenerate the properties afresh

Original comment by subwiz on 14 Dec 2013 at 2:53

GoogleCodeExporter commented 8 years ago
Hi subwiz,

thanks for the quick response. Actually I am using RESTClient 3.2.2 CLI in one 
of my automation project. At this time, I have to do everything using CLI 
version (with Java programing) ONLY. Also, this file is only created after the 
execution, so for the first time (in a fresh machine) my test cases may fail. 
Below I have two short questions-

(1) How to disable the proxy using CLI version?
(2) How to configure HTTP Request Timeout using CLI version?

Thank you for the support.

--
Regards
Ravi

Original comment by ravi2008...@gmail.com on 14 Dec 2013 at 5:36

GoogleCodeExporter commented 8 years ago
The configuration is shared between the CLI and GUI versions.

Original comment by subwiz on 14 Dec 2013 at 5:38

GoogleCodeExporter commented 8 years ago
Hi subwiz,

Finally I figured out the exact problem. The CLI version is creating 
rest-client.properties with request-timeout-in-millis=60000 ONLY. If the user 
hasn't used GUI version, before executing CLI version, it is showing the above 
exception. After checking with the source code, I realized that as per the 
exception, it is trying to get the integer value of proxy.options.port 
parameter, which is NOT present in the properties file.

Since I never used GUI before this, I noticed that proxy.options.is_enabled 
parameter was not present in rest-client.properties file.

--
Regards
Ravi

Original comment by ravi2008...@gmail.com on 14 Dec 2013 at 8:29