Has anyone done server-client using lisp-java? 
Author Message
 Has anyone done server-client using lisp-java?

I've got a bunch of lisp code that I would like to call from java.  I've
set up a server in lisp using the wire package on a free port on the
server.  However, I have not been able to write a java client to send
and receive the commands and results.

My client correctly opens a socket to the port and transmit a string
containing the lisp command I want to run.  However, my lisp server does
not receive the command.  Instead i get the error:

(COMMON-LISP::DO-ERROR "~S cannot be coerced to a character." (40))

My knowledge of lisp is limited, but it looks like it received the
string, but was expecting a character.  I used wire:read-newline-string
server-wire to obtain data from the port.

Has anyone done something similar like this before or has any idea what
i am doing wrong?

Thanks
Vivek



Sun, 01 Jul 2001 03:00:00 GMT  
 Has anyone done server-client using lisp-java?
Hello Vivek,

re:

Quote:
> My client correctly opens a socket to the port and transmit a string
> containing the lisp command I want to run.  However, my lisp server does
> not receive the command.  Instead i get the error:

> (COMMON-LISP::DO-ERROR "~S cannot be coerced to a character." (40))

> My knowledge of lisp is limited, but it looks like it received the
> string, but was expecting a character.  I used wire:read-newline-string
> server-wire to obtain data from the port.

Make sure that the Java code is not sending 16 bit unicode characters.
Also, I find it useful to (sometimes) write server apps so that they
use HTTP, so you can test the server part using any-old-web-browser.

-Mark

-- Mark Watson, consultant and author of 11 books on AI, Java, C++.
-- http://www.markwatson.com for Open Source (Java, NLPserver, etc.)



Sun, 01 Jul 2001 03:00:00 GMT  
 Has anyone done server-client using lisp-java?

Quote:
> I've got a bunch of lisp code that I would like to call from java.  I've
> set up a server in lisp using the wire package on a free port on the
> server.  However, I have not been able to write a java client to send
> and receive the commands and results.

> My client correctly opens a socket to the port and transmit a string
> containing the lisp command I want to run.  However, my lisp server does
> not receive the command.  Instead i get the error:

> (COMMON-LISP::DO-ERROR "~S cannot be coerced to a character." (40))

> My knowledge of lisp is limited, but it looks like it received the
> string, but was expecting a character.  I used wire:read-newline-string
> server-wire to obtain data from the port.

> Has anyone done something similar like this before or has any idea what
> i am doing wrong?

You could use a higher level interface between the two languages. E.g. if you
used a Java ORB in the client and a Common Lisp ORB in the server then both
application components would be able to deal with objects and function calls
instead of low level socket details.

__Jason



Mon, 02 Jul 2001 03:00:00 GMT  
 Has anyone done server-client using lisp-java?

Quote:

> I've got a bunch of lisp code that I would like to call from java.  I've
> set up a server in lisp using the wire package on a free port on the
> server.  However, I have not been able to write a java client to send
> and receive the commands and results.

> My client correctly opens a socket to the port and transmit a string
> containing the lisp command I want to run.  However, my lisp server does
> not receive the command.  Instead i get the error:

> (COMMON-LISP::DO-ERROR "~S cannot be coerced to a character." (40))

> My knowledge of lisp is limited, but it looks like it received the
> string, but was expecting a character.  I used wire:read-newline-string
> server-wire to obtain data from the port.

> Has anyone done something similar like this before or has any idea what
> i am doing wrong?

Vivek,

The closest thing I did is C-Allegro socket-based communication (modifying
example code from Franz's website -- credits :-). And I too initially
encountered
some problems with the handling of strings/characters on both sides.
However, I
avoid these by using READ-LINE from the Lisp stream produced when accepting
connection to the socket.

Now, I'm not familiar with the wire package. Assuming it generates a Lisp
stream
from the socket connection, is this a text stream or a binary stream?

Hope this helps,

Marc
--
____________________________________________________________________
Prof. Marc Cavazza              http://www.eimc.brad.ac.uk/~mcavazza

EIMC Department                 Phone: +44 (0)1274 236 135
University of Bradford          Fax:   +44 (0)1274 383 727

BD7 1DP -- United Kingdom
____________________________________________________________________



Sat, 07 Jul 2001 03:00:00 GMT  
 Has anyone done server-client using lisp-java?
Quote:


> > I've got a bunch of lisp code that I would like to call from java.  I've
> > set up a server in lisp using the wire package on a free port on the
> > server.  However, I have not been able to write a java client to send
> > and receive the commands and results.

> > My client correctly opens a socket to the port and transmit a string
> > containing the lisp command I want to run.  However, my lisp server does
> > not receive the command.  Instead i get the error:

...

I do that.  I use plain sockets and send/receive strings terminated with
newlines.  I use read-line on the lisp side to read from the socket.



Sat, 14 Jul 2001 03:00:00 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. VO Succesfuly created a Client/Server app using VO and MS-SQL Server

2. Anyone else having trouble with the CVS server?

3. Java and Smalltalk in a Client/Server app

4. Tips on Client/Server anyone?

5. JAVA Client and Ruby Server Connect

6. Anyone doing hosting of lisp-based web apps?

7. Client/Server communication between Java and Tcl/Tk

8. Python Server Java Client problem with OmniOrb

9. Java Integration with Lisp using Corman Lisp

10. Guidance using VA Web Connect - taking fat client and making it a multi-user server app

11. Error using OLE in client/server apps

12. Information about experiences using the CLIENT/SERVER accesories

 

 
Powered by phpBB® Forum Software