Re: SV: Multiple wicket applications in a single WAR

2010-12-10 Thread fstof


Reinhard Nägele wrote:
 
 I don't think it is a good idea to have multiple applications in one 
 war.
 
Well according to Igor It's not an issue, as wicket-examples makes use of
it. Although it does not use the Servlet but rather the Filter, (don't know
if that could make a difference)


Reinhard Nägele wrote:
 
 All apps in the same war share the same ClassLoader and thus the 
 same static ThreadLocal instances.
 
The point of ThreadLocal is that whatever object is stored in it is only
static within that thread


Reinhard Nägele wrote:
 
 There might be circumstances when the state somehow gets messed up.
 
This I know happens (in our case) but what are the circumstances? thats
what I want to get to


-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Multiple-wicket-applications-in-a-single-WAR-tp3066793p3081608.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: SV: SV: Multiple wicket applications in a single WAR

2010-12-10 Thread fstof


Wilhelmsen Tor Iver wrote:
 
 The ThreadLocal objects are static, yes, but the actual objects stored
 there are per thread and thus not static. 
 
My thoughts exactly


Wilhelmsen Tor Iver wrote:
 
 The Application instance is shared between all users, but in this case
 there is no user state in it, the difference is which Session class is
 used for factorizing the user Session, and which Pages are mounted (again,
 for factory purposes).
 
I'm not sure what exactly it is you are asking...?

I have a bunch of pages mounted(loging pages for both applications) in my
base abstract Application class's init() so both my sub Applications mount
the same pages... (could this be it?)

Also both my Application implementations specify their own home pages and
sign in pages

Could there be something wrong in my sessions?

I thought it might be some static/synchronisation issue

-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Multiple-wicket-applications-in-a-single-WAR-tp3066793p3081633.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: SV: Multiple wicket applications in a single WAR

2010-12-09 Thread 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();
   }
 }
 

-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Multiple-wicket-applications-in-a-single-WAR-tp3066793p3081431.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: SV: Multiple wicket applications in a single WAR

2010-12-09 Thread Reinhard Nägele
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



SV: SV: Multiple wicket applications in a single WAR

2010-12-09 Thread Wilhelmsen Tor Iver
 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.).

The ThreadLocal objects are static, yes, but the actual objects stored there 
are per thread and thus not static. 

 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.

If one thread can get at objects belonging to a different thread that would not 
be a circumstance but a serious bug.

 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.

The Application instance is shared between all users, but in this case there is 
no user state in it, the difference is which Session class is used for 
factorizing the user Session, and which Pages are mounted (again, for factory 
purposes).

- Tor Iver

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



SV: Multiple wicket applications in a single WAR

2010-12-08 Thread Wilhelmsen Tor Iver
 BUMP...
 
 
 Anyone?  we run wicket 1.4.9

Any reason you use WicketServlet instead of WicketFilter? We use multiple apps 
in a war and that works fine in the filter case. In fact it seems that 
WicketServlet delegates to an internal WicketFilter anyway...

- Tor Iver

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



Re: SV: Multiple wicket applications in a single WAR

2010-12-08 Thread fstof

That is what I noticed when I looked at the code, so I cant really tell why
that could be an issue

We are using WicketServlet because WebSphere 6.1 has issues with the filter
(not 100% sure what the issue is, but it does not work with the filter)


Wilhelmsen Tor Iver wrote:
 
 Any reason you use WicketServlet instead of WicketFilter? We use multiple
 apps in a war and that works fine in the filter case. In fact it seems
 that WicketServlet delegates to an internal WicketFilter anyway...
 
 - Tor Iver
 

-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Multiple-wicket-applications-in-a-single-WAR-tp3066793p3078248.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: SV: Multiple wicket applications in a single WAR

2010-12-08 Thread Zilvinas Vilutis
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() ?

Žilvinas Vilutis

Mobile:   (+370) 652 38353
E-mail:   cika...@gmail.com



On Wed, Dec 8, 2010 at 6:57 AM, fstof frans.stofb...@gmail.com wrote:

 That is what I noticed when I looked at the code, so I cant really tell why
 that could be an issue

 We are using WicketServlet because WebSphere 6.1 has issues with the filter
 (not 100% sure what the issue is, but it does not work with the filter)


 Wilhelmsen Tor Iver wrote:

 Any reason you use WicketServlet instead of WicketFilter? We use multiple
 apps in a war and that works fine in the filter case. In fact it seems
 that WicketServlet delegates to an internal WicketFilter anyway...

 - Tor Iver


 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/Multiple-wicket-applications-in-a-single-WAR-tp3066793p3078248.html
 Sent from the Users forum mailing list archive at Nabble.com.

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



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



Re: SV: Multiple wicket applications in a single WAR

2010-12-08 Thread fstof


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();
}
}
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Multiple-wicket-applications-in-a-single-WAR-tp3066793p3078310.html
Sent from the Users forum mailing list archive at Nabble.com.

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