Running OpenCms on JRun 4.0

From OpenCms Wiki
Jump to: navigation, search

Because JRun 4.0 does not support Java Servlet 2.4 specifications OpenCms 7.x will not run on JRun.

You must use OpenCms 6.2.3 with a series of modifications. The steps I successfully used are below:

1) Deploy OpenCms 6.2.3 binary distribution.

2) Deploy OpenCms 6.2.3 Java 1.4 compatibility module.

3) Replace commons-digester-1.7.x.jar with common-digester-1.8.jar

4) Update org.opencms.workplace.commons.CmsDisplayResource. Replace line "getJsp().getResponse().sendRedirect(url);" with "CmsFlexController.getController(getJsp().getRequest()).getTopResponse().sendRedirect(url);" within the actionShow() method. JRun cannot perform a redirect with the wrapped HttpServletResponse object. Use the OpenCms 6.2.3 source code distribution to rebuild the opencms.jar. **You will notice this when attempting to perform a redirect in any OpenCms JSP templates as well. Use the getController() method of CmsFlexController to get to the top response as shown in the code snippet and you should be fine. If you fail to make this revision, when you view any resources such as an HTML page from the workplace you will be shown a blank screen. Although opencms.jar is replaced as part of the Java 1.4 compatibility I experienced no problems rebuilding the entire OpenCms 6.2.3 project with Java 1.4 using the distributed OpenCms 6.2.3 source code. There is no indication of whether this is Java 1.4 or 1.5 compliant and there is no separate source code package for the 1.4 compatibility module. So why is there a need for an opencms.jar in the compatibility module???

5) Update the your JRun jvm configs (e.g. jvm.config) such that the OpenCms' /WEB-INF/lib directory is included and ensure that it is loaded before the default libs. If this is not done an older version of Perl5Util or Perl5Pattern packaged with jrun.jar will be loaded and upon creating any new content in OpenCms you will encounter an error in the Workplace GUI)

The previous modifications were successfully deployed using JRun 4 with Updater 5 and both MSDE 2000 and Oracle 9i. For MSDE 2000, the mssql-jtds-1.2.jar from OpenCms 7.x was also deployed. For Oracle 9i, ojdbc14.jar was deployed.

Personal tools