You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mina.apache.org by satish viswanatham <sa...@gmail.com> on 2007/05/14 21:33:21 UTC

How can I get spring bean from IoHandlerAdaptor

Hi All,

Having problems getting a spring bean from IoHandleAdaptor. I am using a
custom SpringBeanFactory which implements ApplicationContextAware, so that I
can save the ApplicationContext. Calling applicationContext.getBean(name)
fails and just hangs.

I followed the example to initialize the handler, acceptor etc using spring
http://mina.apache.org/report/1.1/apidocs/org/apache/mina/integration/spring/IoAcceptorFactoryBean.html

Any clue on why this is happening? Is it possible that the new threads do
not have "sping context"?

thanks
Satish

Re: How can I get spring bean from IoHandlerAdaptor

Posted by Trustin Lee <tr...@gmail.com>.
On 5/15/07, satish viswanatham <sa...@gmail.com> wrote:
> Hi Trustin,
>
> Good morning. Yes my application hangs, no exceptions. Here is the thread
> dump. I see that my main singleton object's init method acts like the
> server. May be it is possible that - that object initialization method is
> still holding the spring lock?

Search '<0x0309edc8>' then you will see what's going on. It seems like
NodeAliveMonitor.run() doesn't return immediately.  This means it's
not Spring nor MINA problem.



>
> thanks
> Satish
>
>
>
> On 5/14/07, Trustin Lee <tr...@gmail.com> wrote:
> > Hi Satish,
> >
> > On 5/15/07, satish viswanatham <satish.viswanatham@gmail.com > wrote:
> > > Hi All,
> > >
> > > Having problems getting a spring bean from IoHandleAdaptor. I am using a
> > > custom SpringBeanFactory which implements ApplicationContextAware, so
> that I
> > > can save the ApplicationContext. Calling
> applicationContext.getBean(name)
> > > fails and just hangs.
> > >
> > > I followed the example to initialize the handler, acceptor etc using
> spring
> > >
> http://mina.apache.org/report/1.1/apidocs/org/apache/mina/integration/spring/IoAcceptorFactoryBean.html
> > >
> > > Any clue on why this is happening? Is it possible that the new threads
> do
> > > not have "sping context"?
> >
> > What do you mean by 'fails and hangs'?  Does it mean that it  throws
> > an exception, or it just freezes?  If it hangs, you could provide a
> > full thread dump.
> >
> > HTH,
> > Trustin
> > --
> > what we call human nature is actually human habit
> > --
> > http://gleamynode.net/
> > --
> > PGP Key ID: 0x0255ECA6
> >
>
>
>


-- 
what we call human nature is actually human habit
--
http://gleamynode.net/
--
PGP Key ID: 0x0255ECA6

Re: How can I get spring bean from IoHandlerAdaptor

Posted by Trustin Lee <tr...@gmail.com>.
Hi Satish,

On 5/15/07, satish viswanatham <sa...@gmail.com> wrote:
> Hi All,
>
> Having problems getting a spring bean from IoHandleAdaptor. I am using a
> custom SpringBeanFactory which implements ApplicationContextAware, so that I
> can save the ApplicationContext. Calling applicationContext.getBean(name)
> fails and just hangs.
>
> I followed the example to initialize the handler, acceptor etc using spring
> http://mina.apache.org/report/1.1/apidocs/org/apache/mina/integration/spring/IoAcceptorFactoryBean.html
>
> Any clue on why this is happening? Is it possible that the new threads do
> not have "sping context"?

What do you mean by 'fails and hangs'?  Does it mean that it  throws
an exception, or it just freezes?  If it hangs, you could provide a
full thread dump.

HTH,
Trustin
-- 
what we call human nature is actually human habit
--
http://gleamynode.net/
--
PGP Key ID: 0x0255ECA6