|Home > Guides > Core Developers Guide > Application Servers > WebSphere|
See forum thread: http://forums.opensymphony.com/message.jspa?messageID=119574#119574
It looks like there is a bug in WebSphere App Server related to which classloader is used at the time that Struts2 is loading the properties files, (all properties files, not just struts.properties and default.properties). The bug may have been fixed in WAS 126.96.36.199, (check out this link for details http://www-1.ibm.com/support/docview.wss?uid=swg27006876).
If you just want to confirm the issue, or you need just a temporary fix, try this:
1) jar up all properties files for your project, (including default.properties in its full path), and put these into the WS common applications lib directory at the same level as the "profiles" directory.
2) Run the application - everything should work
This solution is strictly temporary, as all struts2 apps in this instance of WAS would have to use the same properties files. A better solution:
1) add a servlet that initializes the Struts Dispatcher with the servlet context:
2) launch it at start-up (web.xml):
3) Run application and everything should work.
To make struts2 work in Websphere, one has to set Websphere specific properties, you may want to add that to the wiki:
The properties are:
At least that is necessary when using StrutsPrepareAndExecuteFilter.
In Websphre admin console one has to add those properties here:
A wsadmin jython script to set those properties could look like this:
Thanks to Christoph Nenning (christoph dot nenning at lex-com at net)
IBM WebSphere Application Server uses the JSESSIONID information to keep track of the client session. If you have an application where the application client must navigate across multiple WebSphere Application Server nodes residing in same domain, then the JSESSIONID information may be over-written on the client because multiple JSESSIONID cookies received with the same name and path.
When persistence is disabled and if the JSESSIONID in the incoming request is not found in the current session manager, then the session manager will generate a new sessionId and create a session object, instead of using the sessionId in the incoming request.
To resolve this issue, configure WebSphere Application Server to reuse the sessionId present in the incoming request.
For All versions:
If the application client does not navigate across multiple WebSphere Application Server nodes residing in the same domain but there are multiple WARs with different context roots, following is the step that needs to be followed for session to be maintained in one web application:
Thanks to Vineet Kanwal from IBM!