Couldn't connect to the Box API due to a network error? - box

I am getting below mentioned error while accessing the box api using box java sdk in java application.Please suggest the cause for this problem.
Exception in thread "main" com.box.sdk.BoxAPIException: Couldn't connect to the Box API due to a network error.
at com.box.sdk.BoxAPIRequest.trySend(BoxAPIRequest.java:386)
at com.box.sdk.BoxAPIRequest.send(BoxAPIRequest.java:200)
at com.box.sdk.BoxAPIRequest.send(BoxAPIRequest.java:175)
at com.box.sdk.BoxUser.getCurrentUser(BoxUser.java:112)
at com.box.cdm.demo.Main.main(Main.java:24)
Caused by: java.net.ConnectException: Connection refused: connect
at java.net.DualStackPlainSocketImpl.connect0(Native Method)
at java.net.DualStackPlainSocketImpl.socketConnect(Unknown Source)
at java.net.AbstractPlainSocketImpl.doConnect(Unknown Source)
at java.net.AbstractPlainSocketImpl.connectToAddress(Unknown Source)
at java.net.AbstractPlainSocketImpl.connect(Unknown Source)
at java.net.PlainSocketImpl.connect(Unknown Source)
at java.net.SocksSocketImpl.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at sun.security.ssl.SSLSocketImpl.connect(Unknown Source)
at sun.net.NetworkClient.doConnect(Unknown Source)
at sun.net.www.http.HttpClient.openServer(Unknown Source)
at sun.net.www.http.HttpClient.openServer(Unknown Source)
at sun.net.www.protocol.https.HttpsClient.<init>(Unknown Source)
at sun.net.www.protocol.https.HttpsClient.New(Unknown Source)
at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.getNewHttpClient(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection.plainConnect(Unknown Source)
at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(Unknown Source)
at sun.net.www.protocol.https.HttpsURLConnectionImpl.connect(Unknown Source)
at com.box.sdk.BoxAPIRequest.trySend(BoxAPIRequest.java:384)
... 4 more

The main causes of this exception - and the things you need to check - are:-
There is no network between your application (the client) and the server (the Box API). Where is the Box instance running, on same machine as your application (locally)?
What port is Box listening on? You need to show your connection code code (endpoint / port etc).
If client and server on different hardware, and you know you have a network connection between them then is Box behind firewall?

Related

Blocked Thread Exception While Using BR-POP and Socket

We have running 1 vert.x Server connected with redis and DB for running Messenger App.
5~7 people(client) connected to redis simultaneously.
when we send a message to others or do some task processing via Web Socket.
WARNING: Thread Thread[vert.x-worker-thread-4,5,main] has been blocked for 74241 ms, time limit is 60000
io.vertx.core.VertxException: Thread blocked
at java.net.SocketInputStream.socketRead0(Native Method)
at java.net.SocketInputStream.socketRead(Unknown Source)
at java.net.SocketInputStream.read(Unknown Source)
at java.net.SocketInputStream.read(Unknown Source)
at java.net.SocketInputStream.read(Unknown Source)
at redis.clients.util.RedisInputStream.ensureFill(RedisInputStream.java:195)
at redis.clients.util.RedisInputStream.readByte(RedisInputStream.java:40)
at redis.clients.jedis.Protocol.process(Protocol.java:141)
at redis.clients.jedis.Protocol.read(Protocol.java:205)
at redis.clients.jedis.Connection.readProtocolWithCheckingBroken(Connection.java:297)
at redis.clients.jedis.Connection.getBinaryMultiBulkReply(Connection.java:233)
at redis.clients.jedis.Connection.getMultiBulkReply(Connection.java:226)
at redis.clients.jedis.Jedis.brpop(Jedis.java:1716)
at redis.clients.jedis.Jedis.brpop(Jedis.java:3400)
at com.ontheit.redis.clients.AbstractRedisClient.BRPOP(AbstractRedisClient.java:59)
at com.ontheit.redis.clients.AbstractRedisClient.BRPOP(AbstractRedisClient.java:50)
at com.ontheit.redis.clients.RedisRequestDaemonClient.getNotify(RedisRequestDaemonClient.java:147)
at com.ontheit.vertx.cache.CacheWorkVerticle.lambda$0(CacheWorkVerticle.java:27)
at com.ontheit.vertx.cache.CacheWorkVerticle$$Lambda$80/1754003563.handle(Unknown Source)
at io.vertx.core.impl.ContextImpl.lambda$executeBlocking$1(ContextImpl.java:273)
at io.vertx.core.impl.ContextImpl$$Lambda$85/1241209246.run(Unknown Source)
at io.vertx.core.impl.TaskQueue.run(TaskQueue.java:76)
at io.vertx.core.impl.TaskQueue$$Lambda$9/1676010932.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
at java.lang.Thread.run(Unknown Source)
we got this warning
we cant understand that warning came out with current circumstance.
we also can't understand why clients number is too high compare to real user who is using redis server.
how can we solved this?

Unable to find NodeJSInstalls for Parsing TypeScript file using Eclipse plugin

i'm facing below issue while parsing TypeScript files in the Eclipse plugin project. Following are log details:
INFO [main] (GeneratorMain.java:178) - Start generate model STST0101_swap_js.xbl
java.lang.NullPointerException
at ts.eclipse.ide.internal.core.Trace.trace(Trace.java:89)
at ts.eclipse.ide.internal.core.Trace.trace(Trace.java:61)
at ts.eclipse.ide.internal.core.nodejs.NodejsInstallManager.loadNodejsInstalls(NodejsInstallManager.java:109)
at ts.eclipse.ide.internal.core.nodejs.NodejsInstallManager.getNodejsInstalls(NodejsInstallManager.java:68)
at com.sample.ts.nodejs.NodeJSProcess.getNodeJsPath(NodeJSProcess.java:125)
at com.sample.ts.nodejs.NodeJSProcess.startServer(NodeJSProcess.java:198)
at com.sample.ts.nodejs.NodeJSProcess.ensureRunning(NodeJSProcess.java:85)
at com.sample.ts.tsparser.ScriptParserClient.executeRequest(ScriptParserClient.java:43)
at com.sample.ts.tsparser.ScriptParserClient.parseString(ScriptParserClient.java:100)
at com.sample.ts.tsparser.ScriptParser.parse(ScriptParser.java:73)
at com.sample.ts.ast.AST.parseString(AST.java:163)
at com.sample.nmc.ts.generator.GeneratorBase.findClass(GeneratorBase.java:302)
at com.sample.nmc.ts.generator.GeneratorBase.ensureClass(GeneratorBase.java:115)
at com.sample.nmc.ts.generator.EventActionGenerator.doGenerate(EventActionGenerator.java:37)
at com.sample.nmc.ts.generator.GeneratorBase.generate(GeneratorBase.java:58)
at com.sample.nmc.ts.GeneratorMain.generateXbl(GeneratorMain.java:198)
at com.sample.nmc.ts.GeneratorMain.generateFunctionUnit(GeneratorMain.java:168)
at com.sample.nmc.ts.GeneratorMain.execute(GeneratorMain.java:66)
at com.sample.nmc.ts.GeneratorMain.main(GeneratorMain.java:43)
java.net.ConnectException: Connection refused: connect
at java.net.DualStackPlainSocketImpl.connect0(Native Method)
at java.net.DualStackPlainSocketImpl.socketConnect(Unknown Source)
at java.net.AbstractPlainSocketImpl.doConnect(Unknown Source)
at java.net.AbstractPlainSocketImpl.connectToAddress(Unknown Source)
at java.net.AbstractPlainSocketImpl.connect(Unknown Source)
at java.net.PlainSocketImpl.connect(Unknown Source)
at java.net.SocksSocketImpl.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at java.net.Socket.<init>(Unknown Source)
at java.net.Socket.<init>(Unknown Source)
at com.sample.ts.tsparser.ScriptParserClient.executeRequest(ScriptParserClient.java:52)
at com.sample.ts.tsparser.ScriptParserClient.parseString(ScriptParserClient.java:100)
at com.sample.ts.tsparser.ScriptParser.parse(ScriptParser.java:73)
at com.sample.ts.ast.AST.parseString(AST.java:163)
at com.sample.nmc.ts.generator.GeneratorBase.findClass(GeneratorBase.java:302)
at com.sample.nmc.ts.generator.GeneratorBase.ensureClass(GeneratorBase.java:115)
at com.sample.nmc.ts.generator.EventActionGenerator.doGenerate(EventActionGenerator.java:37)
at com.sample.nmc.ts.generator.GeneratorBase.generate(GeneratorBase.java:58)
at com.sample.nmc.ts.GeneratorMain.generateXbl(GeneratorMain.java:198)
at com.sample.nmc.ts.GeneratorMain.generateFunctionUnit(GeneratorMain.java:168)
at com.sample.nmc.ts.GeneratorMain.execute(GeneratorMain.java:66)
at com.sample.nmc.ts.GeneratorMain.main(GeneratorMain.java:43)
The plugin project runs perfectly fine if executed as Eclipse plugin. I face above error if i try executing it as Runnable JAR file.
Kindly provide necessary help

DocuSign : Getting connection timedout while using the Java program in the Demo site.

I am new to DocuSign.
Started trying with the basic Login authentication in Java. Used the code snippet in the below link.
http://iodocs.docusign.com/APIWalkthrough/getEnvelopeRecipientStatus#java
Getting the below exception.
Exception in thread "main" java.net.ConnectException: Connection timed out: conn
ect
at java.net.DualStackPlainSocketImpl.connect0(Native Method)
at java.net.DualStackPlainSocketImpl.socketConnect(Unknown Source)
at java.net.AbstractPlainSocketImpl.doConnect(Unknown Source)
at java.net.AbstractPlainSocketImpl.connectToAddress(Unknown Source)
at java.net.AbstractPlainSocketImpl.connect(Unknown Source)
at java.net.PlainSocketImpl.connect(Unknown Source)
at java.net.SocksSocketImpl.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at sun.security.ssl.SSLSocketImpl.connect(Unknown Source)
at sun.security.ssl.BaseSSLSocketImpl.connect(Unknown Source)
at sun.net.NetworkClient.doConnect(Unknown Source)
at sun.net.www.http.HttpClient.openServer(Unknown Source)
at sun.net.www.http.HttpClient.openServer(Unknown Source)
at sun.net.www.protocol.https.HttpsClient.(Unknown Source)
at sun.net.www.protocol.https.HttpsClient.New(Unknown Source)
at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.getNewH
ttpClient(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection.plainConnect(Unknown Sour
ce)
at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect
(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown So
urce)
at java.net.HttpURLConnection.getResponseCode(Unknown Source)
at sun.net.www.protocol.https.HttpsURLConnectionImpl.getResponseCode(Unk
nown Source)
at GetEnvelopeInfo.main(GetEnvelopeInfo.java:56)
Tried to Ping the server address. got the same Request timed out error.
ping demo.docusign.net
Pinging demo.docusign.net.akadns.net [209.46.117.172] with 32 bytes of data:
Request timed out.
Request timed out.
Request timed out.
Request timed out.
Please help me out on this.
You might need to set the proxy information for your environment. The jvm parameters are http.proxyHost and http.proxyPort. It can be set by using
System.setProperty("http.proxyHost", "yourProxyHostname");

javax.naming.CommunicationException

I get the below error while trying to shutdown my jboss server
Exception in thread "main" javax.naming.CommunicationException
[Root exception is java.rmi.ConnectIOException: Exception creating connection to: 10.10.100.49;
nested exception is:
java.net.NoRouteToHostException: No route to host]
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:649)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:509)
at javax.naming.InitialContext.lookup(Unknown Source)
at org.jboss.Shutdown.main(Shutdown.java:188)
Caused by: java.rmi.ConnectIOException: Exception creating connection to: 10.10.100.49; nested exception is:
java.net.NoRouteToHostException: No route to host
at sun.rmi.transport.tcp.TCPEndpoint.newSocket(Unknown Source)
at sun.rmi.transport.tcp.TCPChannel.createConnection(Unknown Source)
at sun.rmi.transport.tcp.TCPChannel.newConnection(Unknown Source)
at sun.rmi.server.UnicastRef.invoke(Unknown Source)
at org.jnp.server.NamingServer_Stub.lookup(Unknown Source)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:530)
... 3 more
Caused by: java.net.NoRouteToHostException: No route to host
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(Unknown Source)
at java.net.PlainSocketImpl.connectToAddress(Unknown Source)
at java.net.PlainSocketImpl.connect(Unknown Source)
at java.net.SocksSocketImpl.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at java.net.Socket.<init>(Unknown Source)
at java.net.Socket.<init>(Unknown Source)
at sun.rmi.transport.proxy.RMIDirectSocketFactory.createSocket(Unknown Source)
at sun.rmi.transport.proxy.RMIMasterSocketFactory.createSocket(Unknown Source)
... 9 more
The virtual machine on which the JBoss server is installed was recently copied to a new virtual machine with a different IP address. Not sure where the old IP is still referenced.
Do a search for 10.10.100.49 in your JBoss root folder.
If you're on Unix-like OS, try:
find /path/to/jboss/home -type f -exec grep -l '10.10.100.49' {} \;

SoapUI: ConnectException: Connection timed out:

i try to send request via REST.
I get success response when using firefox rest-client,
but in SoapUI i get exception attached below.
How to resolve this issue?
Thanks.
java.net.ConnectException: Connection
timed out: connect at
java.net.PlainSocketImpl.socketConnect(Native
Method) at
java.net.PlainSocketImpl.doConnect(Unknown
Source) at
java.net.PlainSocketImpl.connectToAddress(Unknown
Source) at
java.net.PlainSocketImpl.connect(Unknown
Source) at
java.net.SocksSocketImpl.connect(Unknown
Source) at
java.net.Socket.connect(Unknown
Source) at
java.net.Socket.connect(Unknown
Source) at
java.net.Socket.(Unknown Source)
at java.net.Socket.(Unknown
Source) at
org.apache.commons.httpclient.protocol.DefaultProtocolSocketFactory.createSocket(DefaultProtocolSocketFactory.java:80)
at
org.apache.commons.httpclient.protocol.DefaultProtocolSocketFactory.createSocket(DefaultProtocolSocketFactory.java:122)
at
org.apache.commons.httpclient.HttpConnection.open(HttpConnection.java:707)
at
com.eviware.soapui.impl.wsdl.support.http.SoapUIMultiThreadedHttpConnectionManager$HttpConnectionAdapter.open(SoapUIMultiThreadedHttpConnectionManager.java:1637)
at
org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:387)
at
org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:171)
at
org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:397)
at
com.eviware.soapui.impl.wsdl.submit.transports.http.HttpClientRequestTransport.sendRequest(HttpClientRequestTransport.java:202)
at
com.eviware.soapui.impl.wsdl.WsdlSubmit.run(WsdlSubmit.java:123)
at
java.util.concurrent.Executors$RunnableAdapter.call(Unknown
Source) at
java.util.concurrent.FutureTask$Sync.innerRun(Unknown
Source) at
java.util.concurrent.FutureTask.run(Unknown
Source) at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown
Source) at
java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown
Source) at
java.lang.Thread.run(Unknown Source)
Default socket timeout is set to 60000 milliseconds.
You can change it:
File -> Preferences -> HTTP Settings -> Socket Timeout
You can also set the value to 0 and then it doesn't time out.
Tested it with SoapUI 4.5.0
You can also set timeout for your request, it's on left bottom Request properties, that helped me (SoapUI 5.4.0)
I would try adjusting the socket timeout in SoapUI preferences. SoapUI has a standard timeout of 60000 milliseconds. I would try making that much larger to see if you have the same issue. This has fixed a timeout issue for myself before.
You can also edit this setting directly in the soapui-settings.xml
<con:setting id="HttpSettings#socket_timeout">120000</con:setting>
If this doesn't help, try asking on the eviware forum.
Apart from adjusting timeouts, if this issue still persists then it could be because few of the plugins needed by SoapUI are not loaded. Because these plugins are present in some other place that require permission to access.
If u check your logs u can find this trace :
java.lang.ClassNotFoundException: com.eviware.soapui.plugins.auto.factories.AutoImportMethodFactory
at java.net.URLClassLoader$1.run(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
The problem does not occur when starting the SoapUI directly from bin
Also you can run with Administrative privileges.