Technical info and insight on using Oracle Documaker for customer communication and document automation

Remixing the JSESSION ID with Documaker

Andy Little
Technical Director

If you have deployed Oracle Documaker Enterprise Edition (ODEE) into an existing environment with other WebLogic applications, it's possible that you have run into a problem. That problem usually exhibits as an inability to access Documaker applications (such as Interactive, Dashboard, or Administrator) or an inability to access another WebLogic-hosted J2EE application. Typically you might be able to access one and not the other depending on your users' particular work process. What I have found in such situations is that the conflict occurs specifically when both applications are using authentication (which is pretty typical in all applications).

WebLogic uses a default cookie name (JSESSIONID) for all web applications, and when authentication is in use, the same cookie name is used -- this enables single-sign on (SSO) applications to work. Once a user has been authenticated, the applications can all use the same cookie for user authentication. This is documented in WebLogic 11g and 12c. So what happens when you have two applications that use the same cookie for authentication but have different authentication mechanisms and users? Well, one or both of those applications aren't going to work. In this case, the fix is simple: all you need to do is configure one of the applications to use a different cookie name.

If you want to do this for a Documaker application, here's how. First, you need to make a choice: you can change the cookie name or the cookie path. Either should work, but I've tested specifically with changing the cookie name. What you'll be doing is changing a parameter in the WebLogic-specific deployment descriptor weblogic.xml, which is a file contained in the application deployment. Inside weblogic.xml is an XML element called <session-descriptor>. Inside this element you can set the <cookie-name> element, which should be something other than the default JSESSIONID (if it is not specified, the default is used). Alternatively, you can set the <cookie-path> instead, which defaults to "/". My recommendation is to set the <cookie-name>. To modify the deployment descriptor, here's what you need to do:

  1. Get the EAR file for the web app you want to modify (e.g. Documaker Admin, Dashboard, or Interactive). When you installed ODEE, these were written to the filesystem inside the <ODEE_HOME> so you should find them under <ODEE_HOME>/documaker/j2ee/weblogic/<dbtype>.
  2. Make a backup copy of the EAR file.
  3. Open the EAR file with your favorite ZIP file manager. Locate the WAR file inside this file (it should be at the root of the EAR).
  4. Open the WAR file and locate the WEB-INF/weblogic.xml file.
  5. Modify the weblog.xml and change the cookie-name or cookie-path as mentioned above. 
  6. Save the weblogic.xml file inside the WAR file. Replace the WAR inside the EAR file. Note: some ZIP file managers will allow you to navigate and edit files directly rather than having to unpack, edit, and rebuild your WAR/EAR files. Repeat for all web apps you want to modify. Make sure your final EAR file has the same name and path as the original. You can have a backup file sitting next to it with a different name, or make the backup somewhere else.
  7. Use the WebLogic console and navigate to Deployments, then select the application you updated and click Update. This should allow you to specify the deployment file (EAR) that you want to update -- it should default to the same EAR file you just built/edited. In the following screen click Finish. It should redeploy the EAR file you modified. Repeat for each application you modified.

Important Note: If are you using a proxy such as IIS, Apache, or Oracle HTTP Server to proxy requests you must change the WebLogic Plugin configuration to rename the WLCookieName parameter to match what you did above for <cookie-name>. For reference you can see the Oracle docs.

As always, if you don't have an ODEE playground you can set one up by following my blog posts. If you have questions, feel free to post a comment, or head on over to the Oracle Documaker community pages.

Be the first to comment

Comments ( 0 )
Please enter your name.Please provide a valid email address.Please enter a comment.CAPTCHA challenge response provided was incorrect. Please try again.