You are viewing a plain text version of this content. The canonical link for it is here.
Posted to apps-dev@avalon.apache.org by Ed Coughlin <ec...@gollaborate.com> on 2002/11/14 01:42:28 UTC

socket connection disappears

Hi,

I've just subscribed to this list and so apologize if this question has been answered already. 

Last week I ported an application 'jaba server'  from an earlier avalon implementation to avalon4.1.3/pheonix 4.0.1.  These symptons did not occur with the earlier implementation.  i recompiled the app using the new version's lib and jdk1.3 (I also tried with jdk 1.4 less the xerces stuff and experienced the same symptons). 

 What happens is

1.  a client makes a socket connection with the server (server socket manager is using the cornerstone lib)
2.  the client sends an xml message to the server.
3.  the server acts on the message and replies with an xml message
4.  the client receives the first message and continues to read the stream for more xml
5.  the server attempts to emit the subsequent xml messages but on the 2nd message attempt finds the socket closed
6.  the avalon-default log shows -->

DEBUG   2002-11-13 15:14:21.079 [thread-m] (): Retrieving a org.apache.avalon.excalibur.thread.impl.WorkerThread from the pool
DEBUG   2002-11-13 15:14:21.210 [thread-m] (): Retrieving a org.apache.avalon.excalibur.thread.impl.WorkerThread from the pool
DEBUG   2002-11-13 15:14:21.260 [jaba-lis] (): Will publish block: jaba-publisher
DEBUG   2002-11-13 15:14:21.270 [thread-m] (): Retrieving a org.apache.avalon.excalibur.thread.impl.WorkerThread from the pool
DEBUG   2002-11-13 15:14:21.300 [jaba-pub] (): Publishing object [as: jabaserver, impl: org.apache.avalon.cornerstone.blocks.transport.publishing.SocketStreamPublisher@170bea5, interf: class org.novadeck.jabaserver.core.Server]
DEBUG   2002-11-13 15:17:03.613 [thread-m] (): Retrieving a org.apache.avalon.excalibur.thread.impl.WorkerThread from the pool
DEBUG   2002-11-13 15:17:03.623 [connecti] (): Starting connection on 192.168.0.2
DEBUG   2002-11-13 15:17:09.542 [connecti] (): Ending connection on 192.168.0.2
DEBUG   2002-11-13 15:17:09.552 [thread-m] (): Returning a org.apache.avalon.excalibur.thread.impl.WorkerThread to the pool
DEBUG   2002-11-13 15:24:01.835 [thread-m] (): Retrieving a org.apache.avalon.excalibur.thread.impl.WorkerThread from the pool

I cannot find any deliberate code in the client or server app that deliberately closes the socket and all ioexceptions are caught and logged as far as i can tell. 

Can someone tell me whether i am bumping up against a cornerstone bug or some configuration issure...

Any help would be appreciated!

Thanks!
Ed

Re: socket connection disappears

Posted by Greg Steuck <gr...@nest.cx>.
>>>>> "Ed" == Ed Coughlin <ec...@gollaborate.com> writes:

    Ed> Well, glad you asked that question.  I went looking for a recent
    Ed> download of cornestone and couldn't locate anything at

I doubt there exists a recent release of cornerstone. I usually check
out the source tree (generic instructions should be on jakarta
site). Then I build it with ant.

    Ed> The AutoPublisher came into the picture when I studied the
    Ed> altrmidemo assembly.xml and noted that it was using the
    Ed> AutoPublisher as the class for the application listener.  I
    Ed> relied on the demo as the reference implementation of the new
    Ed> version of avalon/pheonix.  Perhaps that was not a good idea but
    Ed> I wasn't able to find a good example of a connection and thread
    Ed> manager implementation elsewhere.

Cursory look over jabaserver doesn't reveal why it needs AutoPublisher
at all. I would try to remove the listener completely. But it isn't
relevant to your problems AFACT.

    Ed> I'll let you know how that test works and again I appreciate
    Ed> your assistance.  If I can obtain a copy of the code I'll be
    Ed> better able to understand how things are working under the hood.

http://jakarta.apache.org/site/cvsindex.html should get you started.

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: manual jakarta-avalon-cornerstone build available (was: Re: socket connection disappears)

Posted by Leo Simons <le...@apache.org>.
following up on myself...silly me :)

The nightlies are being moved to a different machine. atm you can get
most stuff from

http://cvs.apache.org/builds/jakarta-avalon/nightly

cheers,

- Leo

On Fri, 2002-11-15 at 14:34, Leo Simons wrote:
> Hi Ed, others,
> 
> until we get our nightly build system working again, it is a bit
> cumbersome to get avalon binaries for some of our stuff. I've manually
> built a cornerstone distribution based on current (15/11) cvs code. It
> is available at 
> 
> http://cvs.apache.org/~leosimons/cornerstone/
> 
> note this is not an official or supported release.
> 
> hope this helps,
> 
> - Leo Simons
> 
> On Fri, 2002-11-15 at 01:38, Ed Coughlin wrote:
> <snip/>
> > Well, glad you asked that question.  I went looking for a recent download of
> > cornestone and couldn't locate anything at
> > http://jakarta.apache.org/avalon/cornerstone/  .  But I downloaded the demo
> > .07 version from the application area under avalon and noticed a
> > cornerstone.jar with class files date stamped 10/5/2002 which looked pretty
> > recent :).  Not the way i like to do things.  Do you have a cvs command
> > string for downloading a recent version?  I'd love to get it.
> <snip/>
> 
> 
> 
> --
> To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>
> 




--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


manual jakarta-avalon-cornerstone build available (was: Re: socket connection disappears)

Posted by Leo Simons <le...@apache.org>.
Hi Ed, others,

until we get our nightly build system working again, it is a bit
cumbersome to get avalon binaries for some of our stuff. I've manually
built a cornerstone distribution based on current (15/11) cvs code. It
is available at 

http://cvs.apache.org/~leosimons/cornerstone/

note this is not an official or supported release.

hope this helps,

- Leo Simons

On Fri, 2002-11-15 at 01:38, Ed Coughlin wrote:
<snip/>
> Well, glad you asked that question.  I went looking for a recent download of
> cornestone and couldn't locate anything at
> http://jakarta.apache.org/avalon/cornerstone/  .  But I downloaded the demo
> .07 version from the application area under avalon and noticed a
> cornerstone.jar with class files date stamped 10/5/2002 which looked pretty
> recent :).  Not the way i like to do things.  Do you have a cvs command
> string for downloading a recent version?  I'd love to get it.
<snip/>



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: socket connection disappears

Posted by Ed Coughlin <ec...@gollaborate.com>.
Hi,

> Is that the Jabaserver from http://sourceforge.net/projects/jabaserver/
> we are discussing here?
>

Yes, it is the jabaserver from sourceforge.


> Check out the cornerstone version your are using. I don't see how this
> can be possible with current code in CVS.
>

Well, glad you asked that question.  I went looking for a recent download of
cornestone and couldn't locate anything at
http://jakarta.apache.org/avalon/cornerstone/  .  But I downloaded the demo
.07 version from the application area under avalon and noticed a
cornerstone.jar with class files date stamped 10/5/2002 which looked pretty
recent :).  Not the way i like to do things.  Do you have a cvs command
string for downloading a recent version?  I'd love to get it.

>     Ed>  Does anyone have suggestions on how I need to regulate
>     Ed> the AutoPublisher so that it does not pre-maturely release the
>     Ed> connection handler?
>
> I must be missing something, could you explain how publishing is
> pertinent to the problem you are seeing? I don't see any connection
> between DefaultConnectionManager and AutoPublisher.
>

The AutoPublisher came into the picture when I studied the altrmidemo
assembly.xml and noted that it was using the AutoPublisher as the class for
the application listener.  I relied on the demo as the reference
implementation of the new version of avalon/pheonix.  Perhaps that was not a
good idea but I wasn't able to find a good example of a connection and
thread manager implementation elsewhere.  I believe I attempted to swap the
AutoPublisher class with the actual reference to the jabaserver application
listener class without obtaining different results.  But I will try again.
Also, I embedded the actual assembly.xml and config.xml in the last email if
you have a chance to review it.  It sounds like I might have made some
obvious mistakes that you would pick up on.

I'll let you know how that test works and again I appreciate your
assistance.  If I can obtain a copy of the code I'll be better able to
understand how things are working under the hood.

Thanks
Ed

> Thanks
> Greg
>
> --
> To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
> For additional commands, e-mail:
<ma...@jakarta.apache.org>
>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: socket connection disappears

Posted by Greg Steuck <gr...@nest.cx>.
Is that the Jabaserver from http://sourceforge.net/projects/jabaserver/
we are discussing here?

>>>>> "Ed" == Ed Coughlin <ec...@gollaborate.com> writes:

    Ed> Greg, Thanks for the suggestion.  My implementation of the
    Ed> ConnectionHandler does not perform a disconnect or socket
    Ed> close().  I understood you to be saying that it should not.

This is correct.
org.apache.avalon.cornerstone.blocks.connection.ConnectionRunner will
close the socket for you after your ConnectionHandler.handleConnection()
exited.

    Ed> Your suggestion did cause me to look into the application
    Ed> listener that i needed to implement as part of the port to the
    Ed> newer Avalon since it is being called by the FW to instantiate
    Ed> the ConnectionHandler.  I discovered that the FW is calling the
    Ed> ReleaseConnectionHandler method implemented by the application
    Ed> listener.

    Ed> What I don't understand is why it is doing so when the handler
    Ed> is in the middle of parsing and emitting xml messages over the
    Ed> socket.

Check out the cornerstone version your are using. I don't see how this
can be possible with current code in CVS.

    Ed>  Does anyone have suggestions on how I need to regulate
    Ed> the AutoPublisher so that it does not pre-maturely release the
    Ed> connection handler?

I must be missing something, could you explain how publishing is
pertinent to the problem you are seeing? I don't see any connection
between DefaultConnectionManager and AutoPublisher.

Thanks
Greg

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: socket connection disappears

Posted by Ed Coughlin <ec...@gollaborate.com>.
Greg,

Thanks for the suggestion.  My implementation of the ConnectionHandler does
not perform a disconnect or socket close().  I understood you to be saying
that it should not.

Your suggestion did cause me to look into the application listener that i
needed to implement as part of the port to the newer Avalon since it is
being called by the FW to instantiate the ConnectionHandler.  I discovered
that the FW is calling the ReleaseConnectionHandler method implemented by
the application listener.

What I don't understand is why it is doing so when the handler is in the
middle of parsing and emitting xml messages over the socket.  Does anyone
have suggestions on how I need to regulate the AutoPublisher so that it does
not pre-maturely release the connection handler?

I've included my assembly.xml and config.xml files in case there is a
glaring mistake in them.

Thanks Greg and if there are any more suggestions I will appreciate hearing
them.

Ed

Assembly.xml

<?xml version="1.0" ?>
- <assembly>
  <listener
class="org.apache.avalon.cornerstone.blocks.transport.autopublishing.AutoPub
lisher" name="jaba-listener" />
- <!--
 The Storage block
  -->
  <block
class="org.apache.avalon.cornerstone.blocks.masterstore.RepositoryManager"
name="objectstorage" />
- <!--
 The Packet Manager block
  -->
- <block
class="org.apache.avalon.cornerstone.blocks.packet.DefaultPacketManager"
name="packet-manager">
  <provide name="thread-manager"
role="org.apache.avalon.cornerstone.services.threads.ThreadManager" />
  </block>
- <!--
 The ThreadManager block
  -->
  <block
class="org.apache.avalon.cornerstone.blocks.threads.DefaultThreadManager"
name="thread-manager" />
- <!--
 The Connection Manager block
  -->
- <block
class="org.apache.avalon.cornerstone.blocks.connection.DefaultConnectionMana
ger" name="connections">
  <provide name="thread-manager"
role="org.apache.avalon.cornerstone.services.threads.ThreadManager" />
  </block>
- <!--
 The Socket Manager block
  -->
  <block
class="org.apache.avalon.cornerstone.blocks.sockets.DefaultSocketManager"
name="sockets" />
- <!--
 The TimeScheduler block
  -->
  <block
class="org.apache.avalon.cornerstone.blocks.transport.authentication.Default
Authenticator" name="altrmi-authenticator" />
- <block
class="org.apache.avalon.cornerstone.blocks.scheduler.DefaultTimeScheduler"
name="scheduler">
  <provide name="thread-manager"
role="org.apache.avalon.cornerstone.services.threads.ThreadManager" />
  </block>
- <block
class="org.apache.avalon.cornerstone.blocks.transport.publishing.SocketStrea
mPublisher" name="jaba-publisher">
  <provide name="sockets"
role="org.apache.avalon.cornerstone.services.sockets.SocketManager" />
  <provide name="connections"
role="org.apache.avalon.cornerstone.services.connection.ConnectionManager"
/>
  <provide name="altrmi-authenticator"
role="org.apache.excalibur.altrmi.server.AltrmiAuthenticator" />
  </block>
- <!--
 Below this section are the jabaserver
  -->
- <block class="org.novadeck.jabaserver.core.Server" name="jaba-server">
- <!--
 The names here must match the names specified for a Block in some conf.xml
file.
    The role should be the interface mentioned in the BlockInfo (.xinfo)
files
  -->
  <provide name="sockets"
role="org.apache.avalon.cornerstone.services.sockets.SocketManager" />
  <provide name="connections"
role="org.apache.avalon.cornerstone.services.connection.ConnectionManager"
/>
  </block>
  </assembly>


Config.xml


- <config>
- <thread-manager>
- <thread-group>
  <name>default</name>
- <!--
 normal priority == 5, max-priority = 10
  -->
  <priority>5</priority>
- <!--
 are threads deamon threads ?
  -->
  <is-daemon>false</is-daemon>
  <max-threads>40</max-threads>
- <!--
 these are ignored at the moment but will be fixed in later revisions
  -->
  <min-threads>20</min-threads>
  <min-spare-threads>20</min-spare-threads>
  </thread-group>
  </thread-manager>
- <!--
 The Storage block
  -->
- <objectstorage>
- <repositories>
- <repository
class="org.apache.avalon.cornerstone.blocks.masterstore.File_Persistent_Obje
ct_Repository">
- <protocols>
  <protocol>file</protocol>
  </protocols>
- <types>
  <type>OBJECT</type>
  </types>
- <models>
  <model>SYNCHRONOUS</model>
  <model>ASYNCHRONOUS</model>
  <model>CACHE</model>
  </models>
  </repository>
- <repository
class="org.apache.avalon.cornerstone.blocks.masterstore.File_Persistent_Stre
am_Repository">
- <protocols>
  <protocol>file</protocol>
  </protocols>
- <types>
  <type>STREAM</type>
  </types>
- <models>
  <model>SYNCHRONOUS</model>
  <model>ASYNCHRONOUS</model>
  <model>CACHE</model>
  </models>
  </repository>
  </repositories>
  </objectstorage>
- <sockets>
- <server-sockets>
  <factory name="plain"
class="org.apache.avalon.cornerstone.blocks.sockets.DefaultServerSocketFacto
ry" />
  </server-sockets>
- <client-sockets>
  <factory name="plain"
class="org.apache.avalon.cornerstone.blocks.sockets.DefaultSocketFactory" />
  </client-sockets>
  </sockets>
  <altrmi-authenticator />
- <jaba-server>
  <port>5222</port>
  <bind>192.168.0.2</bind>
- <Jabahandler>
  <connectiontimeout>360000</connectiontimeout>
  </Jabahandler>
- <user-home-factory>

<implementation-class>org.novadeck.jabaserver.users.UserHomeDB</implementati
on-class>
  </user-home-factory>



----- Original Message -----
From: "Greg Steuck" <gr...@nest.cx>
To: "Avalon Applications Developers List"
<av...@jakarta.apache.org>
Sent: Wednesday, November 13, 2002 6:36 PM
Subject: Re: socket connection disappears


> >>>>> "Ed" == Ed Coughlin <ec...@gollaborate.com> writes:
>
>     Ed> I cannot find any deliberate code in the client or server app
>     Ed> that deliberately closes the socket and all ioexceptions are
>     Ed> caught and logged as far as i can tell.
>
> org.apache.avalon.cornerstone.services.connection.ConnectionHandler
> as of revision 1.6 documents:
>
>     /**
>      * Processes connections as they occur. The handler should not
>      * close the <tt>connection</tt>, the caller will do that.
>      *
>      * @param connection the connection
>      * @exception IOException if an error reading from socket occurs
>      * @exception ProtocolException if an error handling connection occurs
>      */
>     void handleConnection( Socket connection )
>         throws IOException, ProtocolException;
>
> Could that be the reason your connections are getting closed?
>
> --
> To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
> For additional commands, e-mail:
<ma...@jakarta.apache.org>
>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: socket connection disappears

Posted by Greg Steuck <gr...@nest.cx>.
>>>>> "Ed" == Ed Coughlin <ec...@gollaborate.com> writes:

    Ed> I cannot find any deliberate code in the client or server app
    Ed> that deliberately closes the socket and all ioexceptions are
    Ed> caught and logged as far as i can tell.

org.apache.avalon.cornerstone.services.connection.ConnectionHandler
as of revision 1.6 documents:

    /**
     * Processes connections as they occur. The handler should not
     * close the <tt>connection</tt>, the caller will do that.
     *
     * @param connection the connection
     * @exception IOException if an error reading from socket occurs
     * @exception ProtocolException if an error handling connection occurs
     */
    void handleConnection( Socket connection )
        throws IOException, ProtocolException;

Could that be the reason your connections are getting closed?

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>