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

Reply via email to