Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

There is an unfortunate issue, specifically when deploying under JBoss 5: you will need to remove the Xerces .jar from the Magnolia CMS webapps: if deploying using WAR files, you can remove it from the archive, or with the following Unix command zip -d path-to-magnolia.war WEB-INF/lib/xercesImpl-2.8.1.jar. If deploying using an exploded directory, simply remove the WEB-INF/lib/xercesImpl-2.8.1.jar file. See 

Jira
serverMagnolia
keyMAGNOLIA-2577
 for technical details. If you get exception messages such as org.jboss.xb.binding.JBossXBException: Failed to create a new SAX parser or java.lang.ClassCastException: org.apache.xerces.parsers.XIncludeAwareParserConfiguration, this is the issue you're hitting.

JBoss 7 and log4j

JBoss 7 Application Server adds its own log4j logging configuration. If you want to your own log4j logging configuration in your deployment, you need to exclude the JBoss configuration first.

Create a new file jboss-deployment-structure.xml under the WEB-INF folder with this content:

Code Block
languagehtml/xml
<jboss-deployment-structure>
  <deployment>
  <!-- Exclusions allow you to prevent the server from automatically adding some dependencies -->
    <exclusions>
      <module name="org.apache.log4j" />
      <module name="org.slf4j" />
    </exclusions>
  </deployment>
</jboss-deployment-structure>

See How do I use log4j.properties or log4j.xml instead of using the logging subsystem configuration?

WebLogic 9 conflict with JDOM library

WebLogic 9 also ships with an old version of JDom which later leads to issues in parsing of XML documents. Issues will be noted as exceptions such as:

Code Block
languagenone
java.lang.NoSuchMethodError: org.jdom.Element.getParent()Lorg/jdom/Element;
   at org.jaxen.jdom.DocumentNavigator.getParentAxisIterator(DocumentNavigator.java:252)
   at org.jaxen.DefaultNavigator.getParentNode(DefaultNavigator.java:275)
   at org.jaxen.

...

expr.NodeComparator.getDepth(NodeComparator.java:164)
   at org.jaxen.expr.NodeComparator.compare(NodeComparator.java:107)
   at java.util.Arrays.mergeSort(Arrays.java:1284)

To resolve, provide newer JDOM/Jaxen libraries by adding jdom-1.0.jarjaxen-1.0-FCS-full.jarxom-1.1.jar and saxpath-1.0-FCS.jar to PRE_CLASSPATH variable in the setDomainEnv.sh script.

WebLogic 10 conflict with commons-lang library

When deploying on Weblogic 10, there is a version conflict while using commons-lang. While Weblogic-10 is distributed with commons-lang-2.3.jar, JackRabbit and Magnolia CMS need at least commons-lang-2.4.jar. To resolve this issue, modify setDomainEnv.sh of Weblogic and add commons-lang-2.4.jar to the PRE_CLASSPATH. Since version 2.4 commons-lang doesn't remove any methods, but only adds new API and fixes known bugs, there is no adverse effect from this change to the Weblogic installation.

WebLogic 12c conflict with Bouncy Castle library

Magnolia uses the Bouncy Castle cryptography package to decode the license key and to secure the activation process. WebLogic 12c is distributed with bcprov-jdk16-1.45.jar but Magnolia is distributed with bcprov-jdk16-1.46.jar. This leads to a library version conflict.

Symptom: there is no error shown on the Magnolia license form but the license is not registered. In the log you can find this stack trace:

Code Block
languagenone
SEVERE: Can't read license for module enterprise
org.bouncycastle.openpgp.PGPException: can't set up signature object.
	at org.bouncycastle.openpgp.PGPOnePassSignature.initVerify(Unknown Source)
	at org.bouncycastle.openpgp.PGPOnePassSignature.initVerify(Unknown Source)
	at info.magnolia.license.LicenseProcessor.extractLicense(LicenseProcessor.java:176)
	at info.magnolia.license.LicenseProcessor.extractLicense(LicenseProcessor.java:202)
	at info.magnolia.license.LicenseManager.onRegister(LicenseManager.java:229)
	at info.magnolia.cms.beans.config.ObservedManager.reload(ObservedManager.java:135)
	at info.magnolia.cms.beans.config.ObservedManager.reload(ObservedManager.java:120)
	at info.magnolia.cms.beans.config.ObservedManager$1.onEvent(ObservedManager.java:86)
	at info.magnolia.cms.util.ObservationUtil$ObservationBasedDelayedExecutor$1.run(ObservationUtil.java:256)
	at info.magnolia.cms.util.DelayedExecutor$RunnableWrapper.run(DelayedExecutor.java:105)
	at EDU.oswego.cs.dl.util.concurrent.ClockDaemon$RunLoop.run(Unknown Source)
	at java.lang.Thread.run(Thread.java:695)
Caused by: java.security.NoSuchAlgorithmException: Error constructing implementation (algorithm: SHA1WithRSAEncryption, provider: BC, class: org.bouncycastle.jce.provider.JDKDigestSignature$SHA1WithRSAEncryption)
	at java.security.Provider$Service.newInstance(Provider.java:1245)
	at sun.security.jca.GetInstance.getInstance(GetInstance.java:220)
	at sun.security.jca.GetInstance.getInstance(GetInstance.java:202)
	at java.security.Signature.getInstance(Signature.java:367)
	... 12 more 

To resolve, do one of the following:

  • Edit setDomainEnv.sh in WebLogic and add bcprov-jdk16-1.46.jar to PRE_CLASSPATH or
  • Remove bcprov-jdk16-1.45.jar from WebLogic 12c common libraries.

WebLogic 12c conflict with Google Guava library

Magnolia cannot render images stored in dam workspace. Google Guava library is used for rendering of images.

Symptom:

Code Block
languagenone
java.lang.RuntimeException: java.lang.NoClassDefFoundError: Could not initialize class com.google.common.cache.LocalCache

Workaround:

 Modify the weblogic.xml file in your application's WEB-INF folder with the prefer-application-packages  element:

Code Block
languagexml
firstline1
<container-descriptor>
   <prefer-application-packages>
	 <package-name>com.google.common.*</package-name>
   </prefer-application-packages>
</container-descriptor>

Mac OS X 10.5 - Leopard

If you use Mac OS X 10.5 or 10.6, you should update to at least 10.5.8 or 10.6.2. Earlier versions cause issues where, when two or more instances are started in the same container, some or all connections are dropped.

The symptoms are that Tomcat is unreachable ("kCFErrorDomainCFNetwork:302") but no log message clearly identifies the issue. Sometimes pages can be loaded but resources cannot, leading to missing images or stylesheets. Another symptom is that you have to kill the Tomcat process to stop it (-HUP works) because the shutdown script cannot reach the running process either. See MAGNOLIA-1959 for more details and comment on your own experience.

...

  1. Find the current maximum number of open files per user in a single session: 
    ulimit -n 
    By default the number is 1024 which is too small.
  2. Edit the limits.conf file: 
    sudo gedit /etc/security/limits.conf
  3. Add the following lines to the file: 
    * soft nofile 10000 
    * hard nofile 50000 
    This sets for all users a soft limit of 10000 open files and a hard limit of 50000. These are just example numbers. Set them according to your system needs. Note that the wildcard option applies only to regular users, not to superuser. If you run Magnolia CMS as superuser replace the asterisk with root.
  4. Save the file.
  5. Edit the configuration file for session-related modules: 
    sudo gedit /etc/pam.d/common-session
  6. Add the following line to the file: 
    session required pam_limits.so
  7. Save the file.
  8. Restart Ubuntu.
  9. Verify the new maximum number of open files: 
    ulimit -n 
    The command should now return 10000.

...

  1. Open <CATALINA_HOME>/conf/server.xml in a text editor. This file is under your Magnolia CMS installation directory.
  2. Find the following section and set the value of portto  to something other than 8080, for example 8090:

    Code Block
    xml
    xml
    <!-- Define a non-SSL HTTP/1.1 Connector on port 8080 -->
    <Connector port="8090" maxHttpHeaderSize="8192"
               maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
               enableLookups="false" redirectPort="8443" acceptCount="100"
               connectionTimeout="20000" disableUploadTimeout="true" />
    

...

  1. Log into the author instance at http://localhost:8090/magnoliaAuthor/.magnolia.
  2. Go to Configuration.
  3. Set the value of /server/defaultBaseUrl property to http://localhost:8090/magnolia/
  4. Log into the public instance at http://localhost:8090/magnoliaPublic/.magnolia.
  5. Go to Configuration.
  6. Set the value of /server/defaultBaseUrl property to http://localhost:8090/magnolia/

Now the Welcome page at http://localhost:8090 has the correct URLs too.

The port also needs to be changed in publishing configuration, otherwise activating changes from the author to public instance fails.

...

Info

If you want to run two different Tomcats simultaneously you need to change other ports too. This is useful if you want to run different versions of Magnolia CMS at the same time. In <CATALINA_HOME>/conf/server.xml, change the port numbers for the shutdown and AJP sections and any custom sections you have enabled.

...

CATALINA_HOME environment variable identifies the Tomcat home directory, for example C:\Program Files\magnolia\apache-tomcat. Usually Magnolia CMS finds this directory automatically. When you type magnolia_control.bat start in the bin directory to start the system, a second script named startup.bat tries to find Tomcat home. It assumes that Tomcat home is one level above the bin directory where you issued the command, and sets the value of CATALINA_HOME to that directory.

...

If the Java Virtual Machine (JVM) does not have enough memory you may see a java.lang.OutOfMemoryError in the startup log and Magnolia CMS fails to start.

Code Block
xml
xml
Exception in thread "Timer-1" java.lang.OutOfMemoryError: Java heap space
at org.apache.jackrabbit.core.query.lucene.IndexingQueue.getFinishedDocuments

...

  1. Stop the server. 
    ./magnolia_control.sh stop
  2. Open file /apache-tomcat/bin/setenv.sh (/apache-tomcat/bin/setenv.bat on Windows) in a text editor.
  3. Edit the Xmx parameter to set a new maximum heap size. Default size for Magnolia CMS is 512M, try a higher amount such as 1024M.
  4. Save the file and start the server. 
    ./magnolia_control.sh start && tail -f ../logs/catalina.out

...