You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Sam Grönblom <sa...@eficode.fi> on 2010/07/29 10:54:39 UTC

Error "no application attached to current thread main" with AnnotApplicationContextMock

Getting this error when trying to use AnnotApplicationContextMock. 
Judging by the example shown in the latest javadocs: 
http://wicketbyexample.com/api/wicket-spring/latest/org/apache/wicket/spring/injection/annot/test/AnnotApplicationContextMock.html 
you should create the application context mock before initializing 
WicketTester. However then you get the error mentioned in the subject, 
ie. "no application attached to current thread main".

However if I initialize the WicketTester before the 
AnnotApplicationContextMock I get null pointer errors which are caused 
when the Panel or Page to be tested tries to access a service, which 
seems to apply that they don't get injected correctly in this case either.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Error "no application attached to current thread main" with AnnotApplicationContextMock

Posted by david_ <me...@gmail.com>.
I receive this exception also on method Application.get();
It happens on Tomcat after a redeploy. When I remove the "work" directory of
Tomcat, and do a restart, the error is gone.


2010/8/2 Sam Grönblom [via Apache Wicket] <
ml-node+2309949-1951419770-232081@n4.nabble.com<ml...@n4.nabble.com>
>

> On 07/29/2010 06:21 PM, Igor Vaynberg wrote:
>
> > what version of wicket?
> >
> > -igor
> >
> > On Thu, Jul 29, 2010 at 1:54 AM, Sam Grönblom<[hidden email]<http://user/SendEmail.jtp?type=node&node=2309949&i=0>>
>  wrote:
> >
> >> Getting this error when trying to use AnnotApplicationContextMock.
> Judging
> >> by the example shown in the latest javadocs:
> >>
> http://wicketbyexample.com/api/wicket-spring/latest/org/apache/wicket/spring/injection/annot/test/AnnotApplicationContextMock.html
> >> you should create the application context mock before initializing
> >> WicketTester. However then you get the error mentioned in the subject,
> ie.
> >> "no application attached to current thread main".
> >>
> >> However if I initialize the WicketTester before the
> >> AnnotApplicationContextMock I get null pointer errors which are caused
> when
> >> the Panel or Page to be tested tries to access a service, which seems to
>
> >> apply that they don't get injected correctly in this case either.
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: [hidden email]<http://user/SendEmail.jtp?type=node&node=2309949&i=1>
> >> For additional commands, e-mail: [hidden email]<http://user/SendEmail.jtp?type=node&node=2309949&i=2>
> >>
> >>
> >>
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [hidden email]<http://user/SendEmail.jtp?type=node&node=2309949&i=3>
> > For additional commands, e-mail: [hidden email]<http://user/SendEmail.jtp?type=node&node=2309949&i=4>
> >
> >
> 1.4.9
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]<http://user/SendEmail.jtp?type=node&node=2309949&i=5>
> For additional commands, e-mail: [hidden email]<http://user/SendEmail.jtp?type=node&node=2309949&i=6>
>
>
>
> ------------------------------
>  View message @
> http://apache-wicket.1842946.n4.nabble.com/Error-no-application-attached-to-current-thread-main-with-AnnotApplicationContextMock-tp2306157p2309949.html
> To start a new topic under Wicket - User, email
> ml-node+1842947-1066186228-232081@n4.nabble.com<ml...@n4.nabble.com>
> To unsubscribe from Wicket - User, click here<http://apache-wicket.1842946.n4.nabble.com/subscriptions/Unsubscribe.jtp?code=bWV1bGVtYW5zLmRhdmlkQGdtYWlsLmNvbXwxODQyOTQ3fC0xOTcyOTcxMjQ2>.
>
>
>

-- 
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Error-no-application-attached-to-current-thread-main-with-AnnotApplicationContextMock-tp2306157p2309964.html
Sent from the Wicket - User mailing list archive at Nabble.com.

Re: Error "no application attached to current thread main" with AnnotApplicationContextMock

Posted by Sam Grönblom <sa...@eficode.fi>.
On 07/29/2010 06:21 PM, Igor Vaynberg wrote:
> what version of wicket?
>
> -igor
>
> On Thu, Jul 29, 2010 at 1:54 AM, Sam Grönblom<sa...@eficode.fi>  wrote:
>    
>> Getting this error when trying to use AnnotApplicationContextMock. Judging
>> by the example shown in the latest javadocs:
>> http://wicketbyexample.com/api/wicket-spring/latest/org/apache/wicket/spring/injection/annot/test/AnnotApplicationContextMock.html
>> you should create the application context mock before initializing
>> WicketTester. However then you get the error mentioned in the subject, ie.
>> "no application attached to current thread main".
>>
>> However if I initialize the WicketTester before the
>> AnnotApplicationContextMock I get null pointer errors which are caused when
>> the Panel or Page to be tested tries to access a service, which seems to
>> apply that they don't get injected correctly in this case either.
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>>
>>      
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>    
1.4.9

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Error "no application attached to current thread main" with AnnotApplicationContextMock

Posted by Igor Vaynberg <ig...@gmail.com>.
what version of wicket?

-igor

On Thu, Jul 29, 2010 at 1:54 AM, Sam Grönblom <sa...@eficode.fi> wrote:
> Getting this error when trying to use AnnotApplicationContextMock. Judging
> by the example shown in the latest javadocs:
> http://wicketbyexample.com/api/wicket-spring/latest/org/apache/wicket/spring/injection/annot/test/AnnotApplicationContextMock.html
> you should create the application context mock before initializing
> WicketTester. However then you get the error mentioned in the subject, ie.
> "no application attached to current thread main".
>
> However if I initialize the WicketTester before the
> AnnotApplicationContextMock I get null pointer errors which are caused when
> the Panel or Page to be tested tries to access a service, which seems to
> apply that they don't get injected correctly in this case either.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org