19.10.05

OpenCMS and OC4J 10.1.2

For those that want to get OpenCMS working with OC4J here is an important note. The OpenCMS installer uses Java threads when setting up the modules. If you don't have user threads enabled in OC4J, you will face errors like "Unable to read opencms xml configuration". To work around this, you have to enable background threads for the container and this you do by adding following parameter to the OC4J container startup:
-Doc4j.userThreads=true

So if you start the OC4J from command line: java -jar oc4j.jar, you need to start with java -Doc4j.userThreads=true -jar oc4j.jar.
After this you will be able to run the setup successfully and continue using OpenCMS.

Re-packagaging EAR



For those that need helping hand on the re-wrapping the OpenCMS war file to be deployed as EAR in OC4J here are the steps:
1. Create a new subdirectory
2. Copy the opencms.war file to that directory
3. Create META-INF -directory and new file application.xml

<?xml version = '1.0' encoding = 'windows-1252'?>
<!DOCTYPE application PUBLIC "-//Sun Microsystems, Inc.//DTD J2EE Application 1.3//EN" "http://java.sun.com/dtd/application_1_3.dtd">
<application>
<display-name>opencms</display-name>
<module>
<web>
<web-uri>opencms.war</web-uri>
<context-root>opencms</context-root>
</web>
</module>
</application>

4. Package EAR file: jar cvf opencms.ear *

Deployment


For deployment I usually use a script that uses admin.jar. Here is a sample I use on Windows:

set OC4JDIR=D:\apps\oc4j_extended_101202\j2ee\home
set FILEE=%1%
java -jar %OC4JDIR%\admin.jar ormi://localhost admin welcome -undeploy %FILEE%
java -jar %OC4JDIR%\admin.jar ormi://localhost admin welcome -deploy -deploymentName %FILEE% -file %FILEE%.ear
java -jar %OC4JDIR%\admin.jar ormi://localhost admin welcome -bindWebApp %FILEE% %FILEE% http-web-site %FILEE%

For Linux you need to figure out yourself how to replace the variable names in Unix style ;)

Login Problems


In the end of the installation I still faced some NPE exceptions, looks like they were related somehow to user management.
Once I re-started the instance I got following errors in the opencms.log:
19 Oct 2005 06:59:21,578 ERROR [ org.opencms.main.OpenCmsCore: 296] Critical error during OpenCms initialization: The OpenCms setup wizard is still enabled.

This can be fixed by setting the setup wizard setting to false in opencms.properties -file.

Once trying to open up the admin workspace using URL: http://localhost:8888/opencms/opencms/system/login, I will get the login dialog where I enter the default Admin username and password. From the log files seems like I get successful authentication but the workspace never shows up. The login dialog will always be shown to user. Seems like browser type (IE, TB) doesn't have anything to do with this.

The login problem is still to be resolved until OpenCMS can be successfully used with OC4J.

I'll be back.


No comments: