PDA

View Full Version : Question about connecting a java client to the HTTP socket


jsharpe
01-10-2007, 05:03 PM
All

We have a ls feed that is pumping data out to a webpage(s) and this works fine.

What we need to do is create a java client that can listen to the same connection and get the same data out:

The URL is http://<machine.domain>:8087/OurStuff/ (tomcat is sat on 8085)

Tweaking the Test example (from sdk_for_j2se-clients\examples\ls_client) to point to the above, I get the following:
using "<machine.domain>", port "8087" and the adaptor "OurStuff"

Exception in thread "main" com.lightstreamer.ls_client.PushConnException: java.io.FileNotFoundException: http://<machine.domain>:8087/lightstreamer/create_session.txt
at com.lightstreamer.ls_client.PushServerProxy.startSession(PushServerProxy.java:101)
at com.lightstreamer.ls_client.ServerManager.<init>(ServerManager.java:62)
etc..

and nothing appears in the LisghtStreamer window

if I use port 8085 (Tomcat) i get:
Exception in thread "main" com.lightstreamer.ls_client.PushConnException: java.io.IOException: Server returned HTTP response code: 500 for URL: http://<machine.domain>:8085/lightstreamer/create_session.txt
at com.lightstreamer.ls_client.PushServerProxy.startSession(PushServerProxy.java:101)
at com.lightstreamer.ls_client.ServerManager.<init>(ServerManager.java:62)

and the lightstreamer reports:
com.lightstreamer.i.j: com.lightstreamer.g.a: Requested Adapter, OurStuff, not found
at com.lightstreamer.i.bb.a(bb.java)
at com.lightstreamer.f.g.a(g.java)
at com.lightstreamer.f.g.a(g.java)
at com.lightstreamer.f.n.b(n.java)
at com.lightstreamer.f.n.a(n.java)
at com.lightstreamer.a.g.b(g.java)
at com.lightstreamer.a.g.a(g.java)
at com.lightstreamer.a.w.a(w.java)
at com.lightstreamer.j.wb.run(wb.java)
at com.lightstreamer.j.qb.a(qb.java)
at com.lightstreamer.j.rb.run(rb.java)
(I am about 99% certain the jars are the same).

Using the StockDemo I get the same type of responces.

Is there anything obvious I am missing (e.g. "you cannot use that Test to connect") and/or is there a tutorial I can read.

Thanks

JoN

jsharpe
01-11-2007, 12:02 PM
All

After a bit of trial and error it looks as if we had a version clash of the jar files.

A "revert to green field" and start again fixed the issue.

If possible, it would be nice if there was a better error message.

Thanks

JoN

DarioCrivelli
01-11-2007, 03:52 PM
Hi JoN,

some more error messages can be enabled by configuring the logging categories.
The logging is performed through the "java.util.logging" package supplied by the java API.
You can find at "DOCS-SDKs\sdk_client_java_se\conf\logCfg.properties" a sample logging configuration file. As far as I know, this file has to be merged with the corresponding "jre/lib/logging.properties" file in your JRE installation.

Dario

jsharpe
01-12-2007, 11:08 AM
Dario

Hi JoN,

some more error messages can be enabled by configuring the logging categories.
The logging is performed through the "java.util.logging" package supplied by the java API.

Dario

That's a fair point - it was/is a bit annoying when I was doing a dev test (not wanting to configure the logging) it appeared to be somewhat unhelpful.

Thanks for the feedback.

JoN

ctranfd
02-05-2009, 12:45 AM
Hello,

Just wondering if you implemented the java solution using an external server (external to the lightstreamer server) - similar to the .NET sockets example described in http://cometdaily.com/2008/04/14/hello-world-for-net-with-lightstreamer/ ?

I want to implement something similar and any help would be much appreciated :)

Thanks,

C