You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@avalon.apache.org by Emperor <Da...@gmx.net> on 2002/02/25 11:33:29 UTC

strange missing classes behavior

I just encountered a strange bug. I tested the following method

public Acceptor createAcceptor()
{
  Acceptor acceptor = new NBIOAcceptor();
  m_acceptors.add(acceptor);
  return acceptor;
}

And my call did hang (on the nbio acceptor construction). After more
that one hour of debug I discovered a bug in my build.xml file: the NBIO
lib wasn't included in the generated sar file. My NBIOAcceptor class has
a nbio class member (which had a static part - perhaps it's important ;)
) and of course it could not be found. The strange thing is that I
didn't get any exception, the thread was just killed without any
exception throwed. Is that a avalon bug?

Nils



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


AW: strange missing classes behavior

Posted by Emperor <Da...@gmx.net>.
Ok, the thread wasn't dying... simply blocked. I was not able to
reproduce the error. Now I get a class not found exception. In my
further tests the thread seemed to block on calling the constructor
which is logical because a class used in a member wasn't found.

> 
> 
> Threads don't just go away without a trace. :-)  Its low 
> tech, but try 
> going through the code and adding
> debug output every couple lines to track down exactly where 
> the thread 
> is dying.  More than likely it
> is blocking someplace rather than dying???  Not sure what 
> your class is 
> doing exactly that would cause
> this because of a missing jar.  It is possible that someone has a 
> try{}catch without a propper logging
> someplace, but I doubt it.  (If so, someone needs to be thwapped :-)
> 
> Do try to find out where the thread was going though.  If it is an 
> avalon problem, it needs to be fixed.
> 
> In addition to placing debug output in the NBIOAcceptor construction, 
> try modifying your method like
> this to make sure that nothing is being thrown and being 
> ignored higher 
> up.   Just remember to take it out.
> 
> public Acceptor createAcceptor()
> {
>     try
>         Acceptor acceptor =  new NBIOAcceptor();
>         m_acceptors.add(acceptor);
>         return acceptor;
>     }
>     catch (Throwable t)
>     {
>        t.printStackTrace();
>     }
> }
> 
> More info?
> 
> Cheers,
> Leif
> 
> 


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


Re: strange missing classes behavior

Posted by Leif Mortenson <le...@silveregg.co.jp>.

Emperor wrote:

>I just encountered a strange bug. I tested the following method
>
>public Acceptor createAcceptor()
>{
>  Acceptor acceptor = new NBIOAcceptor();
>  m_acceptors.add(acceptor);
>  return acceptor;
>}
>
>And my call did hang (on the nbio acceptor construction). After more
>that one hour of debug I discovered a bug in my build.xml file: the NBIO
>lib wasn't included in the generated sar file. My NBIOAcceptor class has
>a nbio class member (which had a static part - perhaps it's important ;)
>) and of course it could not be found. The strange thing is that I
>didn't get any exception, the thread was just killed without any
>exception throwed. Is that a avalon bug?
>
Threads don't just go away without a trace. :-)  Its low tech, but try 
going through the code and adding
debug output every couple lines to track down exactly where the thread 
is dying.  More than likely it
is blocking someplace rather than dying???  Not sure what your class is 
doing exactly that would cause
this because of a missing jar.  It is possible that someone has a 
try{}catch without a propper logging
someplace, but I doubt it.  (If so, someone needs to be thwapped :-)

Do try to find out where the thread was going though.  If it is an 
avalon problem, it needs to be fixed.

In addition to placing debug output in the NBIOAcceptor construction, 
try modifying your method like
this to make sure that nothing is being thrown and being ignored higher 
up.   Just remember to take it out.

public Acceptor createAcceptor()
{
    try
        Acceptor acceptor =  new NBIOAcceptor();
        m_acceptors.add(acceptor);
        return acceptor;
    }
    catch (Throwable t)
    {
       t.printStackTrace();
    }
}

More info?

Cheers,
Leif


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