RavenclawDev: java galaxy server
Thomas K Harris
tkharris at cs.cmu.edu
Tue Sep 26 18:32:46 EDT 2006
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
> </stream:stream> to close start tag <stream:stream> from line 1, parser
> stop
> ped on END_TAG seen ...</mechanisms></stream:features>... @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<name of operation>(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 <event_query
> > > 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 {
> > > <file c:\documents and settings\sveta\my
> > > 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
> > > ---------------------------------------------------------
> > >
> >
> >
> >
More information about the Ravenclaw-developers
mailing list