I don't think it is a good idea to have multiple applications in one
war. Wicket stores static state in ThreadLocals (Application, Session,
etc.). All apps in the same war share the same ClassLoader and thus the
same static ThreadLocal instances. There might be circumstances when the
state somehow gets messed up. I'm sure this is the source of your
problems. So, either go for one app for all users or create two separate
war files.
Reinhard
Am 10.12.2010 07:07, schrieb fstof:
Oh and I excluded the session code for the simple reason, that I dont think
it is relevant, as it is the applications that get mixed up
fstof wrote:
Igor Vaynberg-2 wrote:
a reproducible test case :)
-igor
If I could reproduce it I'm pretty sure I would have been able to solve it
:) The thing is It happens like once a week, and we have not seen it
happen in any of our DEV/PRE environments
Zilvinas Vilutis wrote:
1. No one will steal your non-working code - that's for sure :)
2. Try to explain the scenario in more details. Are you using Spring
Security or just wicket? What brings you to the app after login -
component.continueToOriginalDestination() ?
1. Steeling my code is the least of my problems :)
2. We are not using spring at all, Only wicket-auth-roles.
(AuthenticatedWebApplication / AuthenticatedWebSession)
When loading the app in the browser it loads the HomePage /
ThirdPartyHomePage. Both of these have the annotation
@AuthorizeInstantiation("user") which causes the redirecting the the
SignInPage / SignInThirdPartyPage
And that is exactly where it goes pear shaped.
When calling the mapping for the one Application
(MMSAHealthWebApplication) it would load the page SignInThirdPartyPage
which belongs to the other app
So I'll add some more code...
1. We have a base Application class:
public abstract class MMSAAbstractWebApplication extends
AuthenticatedWebApplication {
private static Logger log =
LoggerFactory.getLogger(MMSAAbstractWebApplication.class);
protected void init() {
log.info("initialising application");
super.init();
// Get the logger
IRequestLoggerSettings reqLogger =
Application.get().getRequestLoggerSettings();
// Enable the logger
reqLogger.setRequestLoggerEnabled(true);
getRequestCycleSettings().setRenderStrategy(Settings.ONE_PASS_RENDER);
mountPages();
}
private void mountPages() {
mountBookmarkablePage("/registration", RegistrationPage.class);
...
}
}
2. Then we have 2 subclasses (these are the ones mapped in web.xml)
public class MMSAHealthWebApplication extends MMSAAbstractWebApplication {
private static Logger log =
LoggerFactory.getLogger(MMSAHealthWebApplication.class);
@Override
protected Class<? extends AuthenticatedWebSession>
getWebSessionClass() {
return MMSAHealthWebSession.class;
}
protected Class<? extends WebPage> getSignInPageClass() {
return SignInPage.class;
}
public Class<? extends WebPage> getHomePage() {
return HomePage.class;
}
protected void init() {
log.info("initialising application");
super.init();
}
}
And
public class MMSAThirdPartyWebApplication extends
MMSAAbstractWebApplication {
private static Logger log =
LoggerFactory.getLogger(MMSAThirdPartyWebApplication.class);
@Override
protected Class<? extends AuthenticatedWebSession>
getWebSessionClass() {
return MMSAThirdPartyWebSession.class;
}
protected Class<? extends WebPage> getSignInPageClass() {
return SignInThirdPartyPage.class;
}
public Class<? extends WebPage> getHomePage() {
return ThirdPartyHomePage.class;
}
protected void init() {
log.info("initialising application");
super.init();
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org