From sveta at cs.sunysb.edu Tue Sep 26 17:17:01 2006 From: sveta at cs.sunysb.edu (Svetlana Stenchikova) Date: Tue, 26 Sep 2006 17:17:01 -0400 (EDT) Subject: RavenclawDev: java galaxy server In-Reply-To: <04a901c6d165$71028350$6401a8c0@athlon> References: <04a901c6d165$71028350$6401a8c0@athlon> Message-ID: Hi, I am writing a java backend server (using Jason as a sample java server) So, as I understand, to write a java server I just need to 1. extend galaxy.server.Server 2. start the MainServer from main() of my program 3. set the class name mainServer.setServerClassName("java_be"); 4. declare public GFrame serverOp(GFrame f) for all commands that my server accepts. Thomas, in Jason there is also a functions: requestInitSession() which is called from startConversation() This is necessary for Jason because it is an initiator of a message, right? The backend server will be a receiver of the messages. So, now I have a question of how to send a message from the dialog manager to the backend server. In RoomLine it is done from an execute agent using a launch_query: DEFINE_EXECUTE_AGENT( CDBGetEvents, CALL("gal_be.launch_query query=get_events eventlistresult error>backend_error") ) If my server name is java_be (specified in mainServer.setServerClassName) And I have defined a method public GFrame serverOpTest(GFrame f) { System.err.println("Java backend was called!!!"); return (GFrame) null; } Now, if I call from the Dialog manager Execute agent: DEFINE_EXECUTE_AGENT( CDBGetEvents, CALL("java_be.Test ") ) The ServerOpTest() should get executed, is this correct? I want to make sure that my java backend server receives a call. The ServerOpTest() method prints to standard error. I got nothing in the window where the server was started. Does the stderr output go somewhere else from the backend server? My DM output has: [COR at 16:51:16.934] Executing dialog agent /RavenCalendar/TestCallBackend ... [TMS at 16:51:16.935] Preparing external server call... [TMS at 16:51:16.935] Calling galaxy server java_be.Test. [TMD at 16:51:16.936] Calling galaxy server java_be.Test. Call frame dumped below. { query test_query } [TMS at 16:51:16.939] Galaxy server call complete. [TMD at 16:51:16.939] Galaxy server call results dumped below. [ERR at 16:51:16.939] Cannot parse result from java_be.Test. Does not start with { . Since I got no output in the java_be server window, I am not sure if my server was actually accessed. Could you please make any suggestions on how to proceed? Thank you ************************************************** my main() is: public static void main(String[] args) throws java.io.FileNotFoundException, java.io.IOException, java.lang.Exception { MainServer mainServer = new MainServer("java_be", args); mainServer.setServerClassName("GoogleConnect"); try { mainServer.start(); } catch(Exception e) { System.err.println(e.toString()); } } --------------------------------------------------------- Svetlana Stenchikova, Ph.D. Candidate Computer Science Department, Stony Brook University http://cs.sunysb.edu/~sveta sveta at cs.sunysb.edu --------------------------------------------------------- From tkharris at cs.cmu.edu Tue Sep 26 17:33:35 2006 From: tkharris at cs.cmu.edu (Thomas K Harris) Date: Tue, 26 Sep 2006 17:33:35 -0400 Subject: RavenclawDev: java galaxy server In-Reply-To: Message-ID: <006601c6e1b3$6c639920$e6cb0280@speech.cs.cmu.edu> > The ServerOpTest() should get executed, is this correct? That all sounds right to me. > Does the stderr output go somewhere > else from the backend server? Standard error should be reported to the console window that the process manager starts just like with a C app. Did you add "test" to the hub program file? If not, then that's probably it. Basically you'll want to put it wherever launch_query was. If you already took care of that, let me know and I'll take a closer look. -Thomas > -----Original Message----- > From: Svetlana Stenchikova [mailto:sveta at cs.sunysb.edu] > Sent: Tuesday, September 26, 2006 5:17 PM > To: Thomas K Harris > Cc: 'Dialog Group CMU' > Subject: RE: RavenclawDev: java galaxy server > > > Hi, I am writing a java backend server (using Jason as a sample java > server) > > So, as I understand, to write a java server I just need to > 1. extend galaxy.server.Server > 2. start the MainServer from main() of my program > 3. set the class name mainServer.setServerClassName("java_be"); > 4. declare public GFrame serverOp(GFrame f) for > all commands that my server accepts. > > > Thomas, in Jason there is also a functions: requestInitSession() which > is called from startConversation() > This is necessary for Jason because it is an initiator of a message, > right? The backend server will be a receiver of the messages. > > > So, now I have a question of how to send a message from the dialog manager > to the backend server. > > In RoomLine it is done from an execute agent using a launch_query: > DEFINE_EXECUTE_AGENT( CDBGetEvents, > CALL("gal_be.launch_query query=get_events results>eventlistresult error>backend_error") > ) > > If my server name is java_be (specified in mainServer.setServerClassName) > And I have defined a method > public GFrame serverOpTest(GFrame f) { > System.err.println("Java backend was called!!!"); > return (GFrame) null; > } > > Now, if I call from the Dialog manager Execute agent: > > DEFINE_EXECUTE_AGENT( CDBGetEvents, > CALL("java_be.Test ") > ) > > The ServerOpTest() should get executed, is this correct? > > > I want to make sure that my java backend server receives a call. > The ServerOpTest() method prints to standard error. I got nothing in the > window where the server was started. Does the stderr output go somewhere > else from the backend server? My DM output has: > > [COR at 16:51:16.934] Executing dialog agent /RavenCalendar/TestCallBackend > ... > [TMS at 16:51:16.935] Preparing external server call... > [TMS at 16:51:16.935] Calling galaxy server java_be.Test. > [TMD at 16:51:16.936] Calling galaxy server java_be.Test. Call frame dumped > below. > { > query test_query > } > > [TMS at 16:51:16.939] Galaxy server call complete. > [TMD at 16:51:16.939] Galaxy server call results dumped below. > > [ERR at 16:51:16.939] Cannot parse result from java_be.Test. Does not start > with { > documents\work\calendar\ravencalendar\l > ibraries\ravenclaw\dmcore\agents\coreagents\trafficmanageragent.cpp, line > 171>. > > > > Since I got no output in the java_be server window, I am not sure if my > server was actually accessed. > > Could you please make any suggestions on how to proceed? > > > Thank you > > ************************************************** > my main() is: > > public static void main(String[] args) throws > java.io.FileNotFoundException, java.io.IOException, java.lang.Exception { > MainServer mainServer = new MainServer("java_be", args); > mainServer.setServerClassName("GoogleConnect"); > try { > mainServer.start(); > } catch(Exception e) { > System.err.println(e.toString()); > } > } > > --------------------------------------------------------- > Svetlana Stenchikova, Ph.D. Candidate > Computer Science Department, Stony Brook University > http://cs.sunysb.edu/~sveta > sveta at cs.sunysb.edu > --------------------------------------------------------- > From sveta at cs.sunysb.edu Tue Sep 26 18:20:41 2006 From: sveta at cs.sunysb.edu (Svetlana Stenchikova) Date: Tue, 26 Sep 2006 18:20:41 -0400 (EDT) Subject: RavenclawDev: java galaxy server In-Reply-To: <006601c6e1b3$6c639920$e6cb0280@speech.cs.cmu.edu> References: <006601c6e1b3$6c639920$e6cb0280@speech.cs.cmu.edu> Message-ID: Thanks Thomas, So I added to the .pgm file ;; ------------------------------------------------- ;; Backend - Server (java_be) ;; ------------------------------------------------- SERVER: java_be at localhost:11003 OPERATIONS: Test INIT: :greeting "RavenCalendar Java Backend!" And also "Test" on the line TIMESTAMP: And now I got exception on the start of java_be: Listener received handshake frame: {c handshake :protocol_version 1 :conn_type 1 } ERROR: Caught exception while creating instance of server class "GoogleConnect": java.lang.reflect.InvocationTargetException ERROR: Unknown error in listener while creating a new server. Listener waiting for connection request... java.net.SocketException: Connection closed by remote host at com.sun.net.ssl.internal.ssl.SSLSocketImpl.checkWrite(Unknown Source) at com.sun.net.ssl.internal.ssl.AppOutputStream.write(Unknown Source) at sun.nio.cs.StreamEncoder$CharsetSE.writeBytes(Unknown Source) at sun.nio.cs.StreamEncoder$CharsetSE.implFlushBuffer(Unknown Source) at sun.nio.cs.StreamEncoder$CharsetSE.implFlush(Unknown Source) at sun.nio.cs.StreamEncoder.flush(Unknown Source) at java.io.OutputStreamWriter.flush(Unknown Source) at java.io.BufferedWriter.flush(Unknown Source) at org.jivesoftware.smack.PacketWriter.writePackets(PacketWriter.java:242) at org.jivesoftware.smack.PacketWriter.access$000(PacketWriter.java:36) at org.jivesoftware.smack.PacketWriter$1.run(PacketWriter.java:70) java.io.EOFException: no more data available - expected end tag to close start tag from line 1, parser stop ped on END_TAG seen ...... @1:343 at org.xmlpull.mxp1.MXParser.fillBuf(MXParser.java:3014) at org.xmlpull.mxp1.MXParser.more(MXParser.java:3025) at org.xmlpull.mxp1.MXParser.nextImpl(MXParser.java:1144) at org.xmlpull.mxp1.MXParser.next(MXParser.java:1093) at org.jivesoftware.smack.PacketReader.parsePackets(PacketReader.java:377) at org.jivesoftware.smack.PacketReader.access$000(PacketReader.java:43) at org.jivesoftware.smack.PacketReader$1.run(PacketReader.java:63) Do you have suggestions on this? I am starting the server separately (not using the pmonitor), it shouldn't matter though, should it? Thanks! Svetlana --------------------------------------------------------- Svetlana Stenchikova, Ph.D. Candidate Computer Science Department, Stony Brook University http://cs.sunysb.edu/~sveta sveta at cs.sunysb.edu --------------------------------------------------------- On Tue, 26 Sep 2006, Thomas K Harris wrote: > > The ServerOpTest() should get executed, is this correct? > > That all sounds right to me. > > > Does the stderr output go somewhere > > else from the backend server? > > Standard error should be reported to the console window that the process > manager starts just like with a C app. > > Did you add "test" to the hub program file? If not, then that's probably it. > Basically you'll want to put it wherever launch_query was. If you already > took care of that, let me know and I'll take a closer look. > > -Thomas > > > -----Original Message----- > > From: Svetlana Stenchikova [mailto:sveta at cs.sunysb.edu] > > Sent: Tuesday, September 26, 2006 5:17 PM > > To: Thomas K Harris > > Cc: 'Dialog Group CMU' > > Subject: RE: RavenclawDev: java galaxy server > > > > > > Hi, I am writing a java backend server (using Jason as a sample java > > server) > > > > So, as I understand, to write a java server I just need to > > 1. extend galaxy.server.Server > > 2. start the MainServer from main() of my program > > 3. set the class name mainServer.setServerClassName("java_be"); > > 4. declare public GFrame serverOp(GFrame f) for > > all commands that my server accepts. > > > > > > Thomas, in Jason there is also a functions: requestInitSession() which > > is called from startConversation() > > This is necessary for Jason because it is an initiator of a message, > > right? The backend server will be a receiver of the messages. > > > > > > So, now I have a question of how to send a message from the dialog manager > > to the backend server. > > > > In RoomLine it is done from an execute agent using a launch_query: > > DEFINE_EXECUTE_AGENT( CDBGetEvents, > > CALL("gal_be.launch_query query=get_events > results>eventlistresult error>backend_error") > > ) > > > > If my server name is java_be (specified in mainServer.setServerClassName) > > And I have defined a method > > public GFrame serverOpTest(GFrame f) { > > System.err.println("Java backend was called!!!"); > > return (GFrame) null; > > } > > > > Now, if I call from the Dialog manager Execute agent: > > > > DEFINE_EXECUTE_AGENT( CDBGetEvents, > > CALL("java_be.Test ") > > ) > > > > The ServerOpTest() should get executed, is this correct? > > > > > > I want to make sure that my java backend server receives a call. > > The ServerOpTest() method prints to standard error. I got nothing in the > > window where the server was started. Does the stderr output go somewhere > > else from the backend server? My DM output has: > > > > [COR at 16:51:16.934] Executing dialog agent /RavenCalendar/TestCallBackend > > ... > > [TMS at 16:51:16.935] Preparing external server call... > > [TMS at 16:51:16.935] Calling galaxy server java_be.Test. > > [TMD at 16:51:16.936] Calling galaxy server java_be.Test. Call frame dumped > > below. > > { > > query test_query > > } > > > > [TMS at 16:51:16.939] Galaxy server call complete. > > [TMD at 16:51:16.939] Galaxy server call results dumped below. > > > > [ERR at 16:51:16.939] Cannot parse result from java_be.Test. Does not start > > with { > > > documents\work\calendar\ravencalendar\l > > ibraries\ravenclaw\dmcore\agents\coreagents\trafficmanageragent.cpp, line > > 171>. > > > > > > > > Since I got no output in the java_be server window, I am not sure if my > > server was actually accessed. > > > > Could you please make any suggestions on how to proceed? > > > > > > Thank you > > > > ************************************************** > > my main() is: > > > > public static void main(String[] args) throws > > java.io.FileNotFoundException, java.io.IOException, java.lang.Exception { > > MainServer mainServer = new MainServer("java_be", args); > > mainServer.setServerClassName("GoogleConnect"); > > try { > > mainServer.start(); > > } catch(Exception e) { > > System.err.println(e.toString()); > > } > > } > > > > --------------------------------------------------------- > > Svetlana Stenchikova, Ph.D. Candidate > > Computer Science Department, Stony Brook University > > http://cs.sunysb.edu/~sveta > > sveta at cs.sunysb.edu > > --------------------------------------------------------- > > > > > From sveta at cs.sunysb.edu Tue Sep 26 18:21:49 2006 From: sveta at cs.sunysb.edu (Svetlana Stenchikova) Date: Tue, 26 Sep 2006 18:21:49 -0400 (EDT) Subject: RavenclawDev: BackendServer2 In-Reply-To: References: <1546B8BE23C96940B5B4929DB7CC2343792235@e2k3.srv.cs.cmu.edu> Message-ID: There is a BackendServer2 and RoomLineBackend. The dialog manager first calls BackendServer2 (where gal_be is defined) which then calls RoomLineBackend using a socket (not using hub, right?) What's the reason for such hierarchy? (Similarly with NLGServer2) If I just want to have a single java backend server instead RoomlineBackend and BackendServer2, it should work, right? thanks Svetlana --------------------------------------------------------- Svetlana Stenchikova, Ph.D. Candidate Computer Science Department, Stony Brook University http://cs.sunysb.edu/~sveta sveta at cs.sunysb.edu --------------------------------------------------------- From tkharris at cs.cmu.edu Tue Sep 26 18:32:46 2006 From: tkharris at cs.cmu.edu (Thomas K Harris) Date: Tue, 26 Sep 2006 18:32:46 -0400 Subject: RavenclawDev: java galaxy server In-Reply-To: Message-ID: <007a01c6e1bb$b07e29b0$e6cb0280@speech.cs.cmu.edu> Right, it doesn't matter where it's started. This looks like some leftover code from Jason that you don't need. Somewhere there's an instance of GoogleConnect. You should remove this. -Thomas > -----Original Message----- > From: Svetlana Stenchikova [mailto:sveta at cs.sunysb.edu] > Sent: Tuesday, September 26, 2006 6:21 PM > To: Thomas K Harris > Cc: 'Dialog Group CMU' > Subject: RE: RavenclawDev: java galaxy server > > Thanks Thomas, > > So I added to the .pgm file > ;; ------------------------------------------------- > ;; Backend - Server (java_be) > ;; ------------------------------------------------- > > SERVER: java_be at localhost:11003 > OPERATIONS: Test > INIT: :greeting "RavenCalendar Java Backend!" > > And also "Test" on the line TIMESTAMP: > > And now I got exception on the start of java_be: > > > > Listener received handshake frame: > {c handshake > :protocol_version 1 > :conn_type 1 } > > ERROR: Caught exception while creating instance of server class > "GoogleConnect": java.lang.reflect.InvocationTargetException > ERROR: Unknown error in listener while creating a new server. > Listener waiting for connection request... > java.net.SocketException: Connection closed by remote host > at com.sun.net.ssl.internal.ssl.SSLSocketImpl.checkWrite(Unknown > Source) > at com.sun.net.ssl.internal.ssl.AppOutputStream.write(Unknown > Source) > at sun.nio.cs.StreamEncoder$CharsetSE.writeBytes(Unknown Source) > at sun.nio.cs.StreamEncoder$CharsetSE.implFlushBuffer(Unknown > Source) > at sun.nio.cs.StreamEncoder$CharsetSE.implFlush(Unknown Source) > at sun.nio.cs.StreamEncoder.flush(Unknown Source) > at java.io.OutputStreamWriter.flush(Unknown Source) > at java.io.BufferedWriter.flush(Unknown Source) > at > org.jivesoftware.smack.PacketWriter.writePackets(PacketWriter.java:242) > at > org.jivesoftware.smack.PacketWriter.access$000(PacketWriter.java:36) > at org.jivesoftware.smack.PacketWriter$1.run(PacketWriter.java:70) > java.io.EOFException: no more data available - expected end tag > to close start tag from line 1, parser > stop > ped on END_TAG seen ...... @1:343 > at org.xmlpull.mxp1.MXParser.fillBuf(MXParser.java:3014) > at org.xmlpull.mxp1.MXParser.more(MXParser.java:3025) > at org.xmlpull.mxp1.MXParser.nextImpl(MXParser.java:1144) > at org.xmlpull.mxp1.MXParser.next(MXParser.java:1093) > at > org.jivesoftware.smack.PacketReader.parsePackets(PacketReader.java:377) > at > org.jivesoftware.smack.PacketReader.access$000(PacketReader.java:43) > at org.jivesoftware.smack.PacketReader$1.run(PacketReader.java:63) > > > Do you have suggestions on this? > > I am starting the server separately (not using the pmonitor), it shouldn't > matter though, should it? > > Thanks! > Svetlana > > > --------------------------------------------------------- > Svetlana Stenchikova, Ph.D. Candidate > Computer Science Department, Stony Brook University > http://cs.sunysb.edu/~sveta > sveta at cs.sunysb.edu > --------------------------------------------------------- > > On Tue, 26 Sep 2006, Thomas K Harris wrote: > > > > The ServerOpTest() should get executed, is this correct? > > > > That all sounds right to me. > > > > > Does the stderr output go somewhere > > > else from the backend server? > > > > Standard error should be reported to the console window that the process > > manager starts just like with a C app. > > > > Did you add "test" to the hub program file? If not, then that's probably > it. > > Basically you'll want to put it wherever launch_query was. If you > already > > took care of that, let me know and I'll take a closer look. > > > > -Thomas > > > > > -----Original Message----- > > > From: Svetlana Stenchikova [mailto:sveta at cs.sunysb.edu] > > > Sent: Tuesday, September 26, 2006 5:17 PM > > > To: Thomas K Harris > > > Cc: 'Dialog Group CMU' > > > Subject: RE: RavenclawDev: java galaxy server > > > > > > > > > Hi, I am writing a java backend server (using Jason as a sample java > > > server) > > > > > > So, as I understand, to write a java server I just need to > > > 1. extend galaxy.server.Server > > > 2. start the MainServer from main() of my program > > > 3. set the class name mainServer.setServerClassName("java_be"); > > > 4. declare public GFrame serverOp(GFrame f) > for > > > all commands that my server accepts. > > > > > > > > > Thomas, in Jason there is also a functions: requestInitSession() > which > > > is called from startConversation() > > > This is necessary for Jason because it is an initiator of a message, > > > right? The backend server will be a receiver of the messages. > > > > > > > > > So, now I have a question of how to send a message from the dialog > manager > > > to the backend server. > > > > > > In RoomLine it is done from an execute agent using a launch_query: > > > DEFINE_EXECUTE_AGENT( CDBGetEvents, > > > CALL("gal_be.launch_query query=get_events > > results>eventlistresult error>backend_error") > > > ) > > > > > > If my server name is java_be (specified in > mainServer.setServerClassName) > > > And I have defined a method > > > public GFrame serverOpTest(GFrame f) { > > > System.err.println("Java backend was called!!!"); > > > return (GFrame) null; > > > } > > > > > > Now, if I call from the Dialog manager Execute agent: > > > > > > DEFINE_EXECUTE_AGENT( CDBGetEvents, > > > CALL("java_be.Test ") > > > ) > > > > > > The ServerOpTest() should get executed, is this correct? > > > > > > > > > I want to make sure that my java backend server receives a call. > > > The ServerOpTest() method prints to standard error. I got nothing in > the > > > window where the server was started. Does the stderr output go > somewhere > > > else from the backend server? My DM output has: > > > > > > [COR at 16:51:16.934] Executing dialog agent > /RavenCalendar/TestCallBackend > > > ... > > > [TMS at 16:51:16.935] Preparing external server call... > > > [TMS at 16:51:16.935] Calling galaxy server java_be.Test. > > > [TMD at 16:51:16.936] Calling galaxy server java_be.Test. Call frame > dumped > > > below. > > > { > > > query test_query > > > } > > > > > > [TMS at 16:51:16.939] Galaxy server call complete. > > > [TMD at 16:51:16.939] Galaxy server call results dumped below. > > > > > > [ERR at 16:51:16.939] Cannot parse result from java_be.Test. Does not > start > > > with { > > > > > documents\work\calendar\ravencalendar\l > > > ibraries\ravenclaw\dmcore\agents\coreagents\trafficmanageragent.cpp, > line > > > 171>. > > > > > > > > > > > > Since I got no output in the java_be server window, I am not sure if > my > > > server was actually accessed. > > > > > > Could you please make any suggestions on how to proceed? > > > > > > > > > Thank you > > > > > > ************************************************** > > > my main() is: > > > > > > public static void main(String[] args) throws > > > java.io.FileNotFoundException, java.io.IOException, > java.lang.Exception { > > > MainServer mainServer = new MainServer("java_be", args); > > > mainServer.setServerClassName("GoogleConnect"); > > > try { > > > mainServer.start(); > > > } catch(Exception e) { > > > System.err.println(e.toString()); > > > } > > > } > > > > > > --------------------------------------------------------- > > > Svetlana Stenchikova, Ph.D. Candidate > > > Computer Science Department, Stony Brook University > > > http://cs.sunysb.edu/~sveta > > > sveta at cs.sunysb.edu > > > --------------------------------------------------------- > > > > > > > > > From tkharris at cs.cmu.edu Tue Sep 26 18:39:02 2006 From: tkharris at cs.cmu.edu (Thomas K Harris) Date: Tue, 26 Sep 2006 18:39:02 -0400 Subject: RavenclawDev: BackendServer2 In-Reply-To: Message-ID: <008401c6e1bc$90b9ba30$e6cb0280@speech.cs.cmu.edu> > There is a BackendServer2 and RoomLineBackend. The dialog manager first > calls BackendServer2 (where gal_be is defined) which then calls > RoomLineBackend using a socket (not using hub, right?) What's the reason > for such hierarchy? (Similarly with NLGServer2) We (before my time here) had perl backends and either didn't have or couldn't find perl bindings for Galaxy (although they're there now at least). So they wrote a C Galaxy wrapper for them (BackendServer2). Same deal with the nlg. Rosetta is a perl process. > If I just want to have a single java backend server instead > RoomlineBackend and BackendServer2, it should work, right? Yea, it should work fine. -Thomas > thanks > Svetlana > > --------------------------------------------------------- > Svetlana Stenchikova, Ph.D. Candidate > Computer Science Department, Stony Brook University > http://cs.sunysb.edu/~sveta > sveta at cs.sunysb.edu > --------------------------------------------------------- > From sveta at cs.sunysb.edu Tue Sep 26 22:09:14 2006 From: sveta at cs.sunysb.edu (Svetlana Stenchikova) Date: Tue, 26 Sep 2006 22:09:14 -0400 (EDT) Subject: RavenclawDev: java galaxy server In-Reply-To: <007a01c6e1bb$b07e29b0$e6cb0280@speech.cs.cmu.edu> References: <007a01c6e1bb$b07e29b0$e6cb0280@speech.cs.cmu.edu> Message-ID: Thanks Thomas, you are right, the constructor was making calls that caused exception. Svetlana On Tue, 26 Sep 2006, Thomas K Harris wrote: > Right, it doesn't matter where it's started. > > This looks like some leftover code from Jason that you don't need. Somewhere > there's an instance of GoogleConnect. You should remove this. > > -Thomas > > > -----Original Message----- > > From: Svetlana Stenchikova [mailto:sveta at cs.sunysb.edu] > > Sent: Tuesday, September 26, 2006 6:21 PM > > To: Thomas K Harris > > Cc: 'Dialog Group CMU' > > Subject: RE: RavenclawDev: java galaxy server > > > > Thanks Thomas, > > > > So I added to the .pgm file > > ;; ------------------------------------------------- > > ;; Backend - Server (java_be) > > ;; ------------------------------------------------- > > > > SERVER: java_be at localhost:11003 > > OPERATIONS: Test > > INIT: :greeting "RavenCalendar Java Backend!" > > > > And also "Test" on the line TIMESTAMP: > > > > And now I got exception on the start of java_be: > > > > > > > > Listener received handshake frame: > > {c handshake > > :protocol_version 1 > > :conn_type 1 } > > > > ERROR: Caught exception while creating instance of server class > > "GoogleConnect": java.lang.reflect.InvocationTargetException > > ERROR: Unknown error in listener while creating a new server. > > Listener waiting for connection request... > > java.net.SocketException: Connection closed by remote host > > at com.sun.net.ssl.internal.ssl.SSLSocketImpl.checkWrite(Unknown > > Source) > > at com.sun.net.ssl.internal.ssl.AppOutputStream.write(Unknown > > Source) > > at sun.nio.cs.StreamEncoder$CharsetSE.writeBytes(Unknown Source) > > at sun.nio.cs.StreamEncoder$CharsetSE.implFlushBuffer(Unknown > > Source) > > at sun.nio.cs.StreamEncoder$CharsetSE.implFlush(Unknown Source) > > at sun.nio.cs.StreamEncoder.flush(Unknown Source) > > at java.io.OutputStreamWriter.flush(Unknown Source) > > at java.io.BufferedWriter.flush(Unknown Source) > > at > > org.jivesoftware.smack.PacketWriter.writePackets(PacketWriter.java:242) > > at > > org.jivesoftware.smack.PacketWriter.access$000(PacketWriter.java:36) > > at org.jivesoftware.smack.PacketWriter$1.run(PacketWriter.java:70) > > java.io.EOFException: no more data available - expected end tag > > to close start tag from line 1, parser > > stop > > ped on END_TAG seen ...... @1:343 > > at org.xmlpull.mxp1.MXParser.fillBuf(MXParser.java:3014) > > at org.xmlpull.mxp1.MXParser.more(MXParser.java:3025) > > at org.xmlpull.mxp1.MXParser.nextImpl(MXParser.java:1144) > > at org.xmlpull.mxp1.MXParser.next(MXParser.java:1093) > > at > > org.jivesoftware.smack.PacketReader.parsePackets(PacketReader.java:377) > > at > > org.jivesoftware.smack.PacketReader.access$000(PacketReader.java:43) > > at org.jivesoftware.smack.PacketReader$1.run(PacketReader.java:63) > > > > > > Do you have suggestions on this? > > > > I am starting the server separately (not using the pmonitor), it shouldn't > > matter though, should it? > > > > Thanks! > > Svetlana > > > > > > --------------------------------------------------------- > > Svetlana Stenchikova, Ph.D. Candidate > > Computer Science Department, Stony Brook University > > http://cs.sunysb.edu/~sveta > > sveta at cs.sunysb.edu > > --------------------------------------------------------- > > > > On Tue, 26 Sep 2006, Thomas K Harris wrote: > > > > > > The ServerOpTest() should get executed, is this correct? > > > > > > That all sounds right to me. > > > > > > > Does the stderr output go somewhere > > > > else from the backend server? > > > > > > Standard error should be reported to the console window that the process > > > manager starts just like with a C app. > > > > > > Did you add "test" to the hub program file? If not, then that's probably > > it. > > > Basically you'll want to put it wherever launch_query was. If you > > already > > > took care of that, let me know and I'll take a closer look. > > > > > > -Thomas > > > > > > > -----Original Message----- > > > > From: Svetlana Stenchikova [mailto:sveta at cs.sunysb.edu] > > > > Sent: Tuesday, September 26, 2006 5:17 PM > > > > To: Thomas K Harris > > > > Cc: 'Dialog Group CMU' > > > > Subject: RE: RavenclawDev: java galaxy server > > > > > > > > > > > > Hi, I am writing a java backend server (using Jason as a sample java > > > > server) > > > > > > > > So, as I understand, to write a java server I just need to > > > > 1. extend galaxy.server.Server > > > > 2. start the MainServer from main() of my program > > > > 3. set the class name mainServer.setServerClassName("java_be"); > > > > 4. declare public GFrame serverOp(GFrame f) > > for > > > > all commands that my server accepts. > > > > > > > > > > > > Thomas, in Jason there is also a functions: requestInitSession() > > which > > > > is called from startConversation() > > > > This is necessary for Jason because it is an initiator of a message, > > > > right? The backend server will be a receiver of the messages. > > > > > > > > > > > > So, now I have a question of how to send a message from the dialog > > manager > > > > to the backend server. > > > > > > > > In RoomLine it is done from an execute agent using a launch_query: > > > > DEFINE_EXECUTE_AGENT( CDBGetEvents, > > > > CALL("gal_be.launch_query query=get_events > > > results>eventlistresult error>backend_error") > > > > ) > > > > > > > > If my server name is java_be (specified in > > mainServer.setServerClassName) > > > > And I have defined a method > > > > public GFrame serverOpTest(GFrame f) { > > > > System.err.println("Java backend was called!!!"); > > > > return (GFrame) null; > > > > } > > > > > > > > Now, if I call from the Dialog manager Execute agent: > > > > > > > > DEFINE_EXECUTE_AGENT( CDBGetEvents, > > > > CALL("java_be.Test ") > > > > ) > > > > > > > > The ServerOpTest() should get executed, is this correct? > > > > > > > > > > > > I want to make sure that my java backend server receives a call. > > > > The ServerOpTest() method prints to standard error. I got nothing in > > the > > > > window where the server was started. Does the stderr output go > > somewhere > > > > else from the backend server? My DM output has: > > > > > > > > [COR at 16:51:16.934] Executing dialog agent > > /RavenCalendar/TestCallBackend > > > > ... > > > > [TMS at 16:51:16.935] Preparing external server call... > > > > [TMS at 16:51:16.935] Calling galaxy server java_be.Test. > > > > [TMD at 16:51:16.936] Calling galaxy server java_be.Test. Call frame > > dumped > > > > below. > > > > { > > > > query test_query > > > > } > > > > > > > > [TMS at 16:51:16.939] Galaxy server call complete. > > > > [TMD at 16:51:16.939] Galaxy server call results dumped below. > > > > > > > > [ERR at 16:51:16.939] Cannot parse result from java_be.Test. Does not > > start > > > > with { > > > > > > > documents\work\calendar\ravencalendar\l > > > > ibraries\ravenclaw\dmcore\agents\coreagents\trafficmanageragent.cpp, > > line > > > > 171>. > > > > > > > > > > > > > > > > Since I got no output in the java_be server window, I am not sure if > > my > > > > server was actually accessed. > > > > > > > > Could you please make any suggestions on how to proceed? > > > > > > > > > > > > Thank you > > > > > > > > ************************************************** > > > > my main() is: > > > > > > > > public static void main(String[] args) throws > > > > java.io.FileNotFoundException, java.io.IOException, > > java.lang.Exception { > > > > MainServer mainServer = new MainServer("java_be", args); > > > > mainServer.setServerClassName("GoogleConnect"); > > > > try { > > > > mainServer.start(); > > > > } catch(Exception e) { > > > > System.err.println(e.toString()); > > > > } > > > > } > > > > > > > > --------------------------------------------------------- > > > > Svetlana Stenchikova, Ph.D. Candidate > > > > Computer Science Department, Stony Brook University > > > > http://cs.sunysb.edu/~sveta > > > > sveta at cs.sunysb.edu > > > > --------------------------------------------------------- > > > > > > > > > > > > > > > > From sveta at cs.sunysb.edu Wed Sep 27 14:59:51 2006 From: sveta at cs.sunysb.edu (Svetlana Stenchikova) Date: Wed, 27 Sep 2006 14:59:51 -0400 (EDT) Subject: RavenclawDev: java galaxy server In-Reply-To: <007a01c6e1bb$b07e29b0$e6cb0280@speech.cs.cmu.edu> References: <007a01c6e1bb$b07e29b0$e6cb0280@speech.cs.cmu.edu> Message-ID: Which documentation did you use when you were writing your java servers? The only page that I found so far is http://communicator.sourceforge.net/sites/MITRE/distributions/GalaxyCommunicator/contrib/MITRE/bindings/java/index.html thank you --------------------------------------------------------- Svetlana Stenchikova, Ph.D. Candidate Computer Science Department, Stony Brook University http://cs.sunysb.edu/~sveta sveta at cs.sunysb.edu --------------------------------------------------------- From tkharris+ at cs.cmu.edu Wed Sep 27 15:36:13 2006 From: tkharris+ at cs.cmu.edu (Thomas K Harris) Date: Wed, 27 Sep 2006 15:36:13 -0400 Subject: RavenclawDev: java galaxy server In-Reply-To: Message-ID: <000901c6e26c$31801220$00fced80@speech.cs.cmu.edu> Yes, that's what I used. -Thomas > -----Original Message----- > From: Svetlana Stenchikova [mailto:sveta at cs.sunysb.edu] > Sent: Wednesday, September 27, 2006 3:00 PM > To: Thomas K Harris > Cc: 'Dialog Group CMU' > Subject: RE: RavenclawDev: java galaxy server > > > Which documentation did you use when you were writing your java servers? > The only page that I found so far is > http://communicator.sourceforge.net/sites/MITRE/distributions/GalaxyCommun > icator/contrib/MITRE/bindings/java/index.html > > > thank you > > --------------------------------------------------------- > Svetlana Stenchikova, Ph.D. Candidate > Computer Science Department, Stony Brook University > http://cs.sunysb.edu/~sveta > sveta at cs.sunysb.edu > --------------------------------------------------------- >