#651 Connecting to API via HClient

Mitchell Fontaine Mon 12 Nov 2018

I'm trying to connect to my skyspark instance using the haystack-java API. I haven't had any problems using HClient.open() to connect to my skyspark instance before, but now it just sits there. Java doesn't generate any errors or print anything to the console, it just sits and nothing happens when I call HClient.open. I put a println after the call to see if it's getting past it, and it's not. Any idea why HClient.open() would be getting stuck.

For what it's worth, I'm now running my java app on an Apache Tomcat server, rather than just a standalone app as I was when it was working. Not sure if this would affect it at all.

Brian Frank Wed 14 Nov 2018

Most likely its hanging on the opening a socket to your server. A simple way to see that is to force your Java app to dump a stack trace when its "hung" and see if its blocked inside the Java HTTP/socket library.

Mitchell Fontaine Mon 19 Nov 2018

How could I fix that? Dumping the stack traces for all threads that are a part of my application gives 59 threads, many of which are blocked. I'm not really sure what I'm looking for, and even if I was, I'm not sure I know how to fix it.

Mitchell Fontaine Mon 19 Nov 2018

Solved this problem - it had to do with not being able to see the HClient class. The app compiled fine because the haystack-java .jar was added to the java build path, but failed at runtime because it needed to be added to the tomcat build path as well.

Login or Signup to reply.