Jlinker port conflict?

Michael Kandefer <[email protected]> Fri, 15 Jun 2007 14:58:17 +0000 (UTC)
Newsgroups gmane.lisp.allegro
Message-ID <[email protected]>
I want jlinker to connect to a Java application that is advertising on a port on
"localhost". The Lisp process is also on "localhost". Printing debug messages
produces the following:


Java side code
--------------

com.franz.jlinker.JavaLinkDist.advertise(5654, -1);

Java side tracing
-----------------

JavaLinkRoot: Allocating server port
JavaLinkRoot: Allocating server port 5654
JavaLinkRoot: making JavaLinkDist
JavaLinkDist.advertise: waiting for Lisp
JavaLinkRoot: listening at server port
JavaLinkDist.advertise: waiting for Lisp
...

Lisp code
---------


(require :jlinker)
(use-package :javatools.jlinker)


;;; also tried - :java-host "localhost" and :java-host "127.0.0.1"
(jlinker-init :mode :java-advertises
		:verbose t
		:java-file nil
		:java-port 5654)

Lisp trace
----------

;;ji[4]: Started Lisp server at localhost:2803.
;;ji[4]: Advertising Lisp server at localhost:2803.
;;ji[4]: Starting Java VM at 127.0.0.1:5654 ...
;;ji[4]: Expecting announceServer message from Java.
;;ji[4]: Java server is ready at NIL:NIL
;;ji[4]: Connect to Java server NIL:NIL failed.
Error: #<JLINKER-ERROR
         :JLINKER-INIT - :CLIENT(:JHOST NIL :JPORT NIL (:ERROR #<TYPE-ERROR @
#x20f60a92>) . "(ERROR NIL cannot be converted to a pathname.)") @
         #x20f611c2>


-------------

It looks as if jlinker is starting a JVM at the specified port, so it can
connect to it. However, I want it to connect to the currently running Java VM,
which is already using that port. Is this possible? Is this just a
misunderstanding on my part on how :java-advertise works?

My goal is to write a Java executable jar that runs the Java code, uses Java
Runtime to start a Lisp image executable that connects to the Java process
through jlinker.