say you are using @springbean in a non component in a wicket thread
and you are using it in a non wicket thread too,
you can do something like below
if(Application.exists())
{
InjectorHolder.getInjector().inject(this);
}else{
//set service my way
service=ServicesFactory.getService();
}
On Thu, Apr 7, 2011 at 11:58 PM, jsinai <[email protected]> wrote:
> We are seeing an intermittent problem with our webapp, where we are seeing
> the exception below. We have servlets other than Wicket's in our webapp,
> which provide remote services. The problem seems to be that somehow the
> Wicket proxy for a given Spring bean is being requested, perhaps from a
> different thread than Wicket's. Is there a solution for this?
>
> Any advice is appreciated.
>
> Julian
>
> org.apache.wicket.WicketRuntimeException: There is no application attached
> to
> current thread http-8443-1
> at org.apache.wicket.Application.get(Application.java:179)
> at
> org.apache.wicket.spring.injection.annot.SpringComponentInjector$ContextLocator.getSpringContext(SpringComponentInjector.java:159)
> at
> org.apache.wicket.spring.SpringBeanLocator.getSpringContext(SpringBeanLocator.java:219)
> at
> org.apache.wicket.spring.SpringBeanLocator.locateProxyTarget(SpringBeanLocator.java:205)
> at
> org.apache.wicket.proxy.LazyInitProxyFactory$CGLibInterceptor.intercept(LazyInitProxyFactory.java:317)
> at
> WICKET_com.hytrust.arc.TrustedHostMgr$$EnhancerByCGLIB$$60187c65.refreshAllPolicy()
> at
> com.hytrust.policy.update.DynamicUpdater.dynamicRefreshHost(DynamicUpdater.java:868)
>
>
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/SpringComponentInjector-and-non-Wicket-servlets-tp3434182p3434182.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
>
--
thank you,
regards,
Vineet Semwal
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]