Hi,

of course. The point is if I delete this:

InjectorHolder.getInjector().inject(this);

from my session class everything works fine :(

On 7 February 2011 15:27, Martijn Dashorst <martijn.dasho...@gmail.com>wrote:

> Did you provide the application to the wicket tester?
>
> WicketTester tester = new WicketTester(myapp);
>
> Martijn
>
> On Mon, Feb 7, 2011 at 2:10 PM, Dmitriy Neretin
> <dmitriy.nere...@googlemail.com> wrote:
> > Hello everybody,
> >
> > After integration with spring I have following problem:
> >
> > if I add following to my CustomSession:
> >
> > InjectorHolder.getInjector().inject(this); (because I store some spring
> > beans in the custom session)
> >
> > My WicketTester doesn't work anymore. I get this exception:
> > "BeanFactory not initialized or already closed - call 'refresh' before
> > accessing beans via the ApplicationContext"
> >
> > What I have done in my Unit Tests:
> >
> > @Before
> >    public void setUp() {
> >        MworldWicketApplication wicketWebApp = new
> MworldWicketApplication()
> > {
> >
> >            ApplicationContext ctx = new XmlWebApplicationContext();
> >
> >            @Override
> >            public void init() {
> >                addComponentInstantiationListener(new
> > SpringComponentInjector(this, ctx, true));
> >            }
> >        };
> >
> > And I don't really understand what to do now :)
> >
> > Can somebody help me?
> >
> > P. S. The Application works. Affected are only unit tests
> >
>
>
>
> --
> Become a Wicket expert, learn from the best: http://wicketinaction.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>

Reply via email to