Portal 6 on JBoss 5.1 #

Add following to portal-ext.properties

hibernate.validator.apply_to_ddl=false
hibernate.validator.autoregister_listeners=false

Although Liferays jboss-web.xml is set correctly, JBoss 5.1 may still pick up the older hibernate-validator.jar in the commons/lib folder. The exception coming is:

java.lang.NoSuchMethodException: org.hibernate.validator.ClassValidator.<init>(...

Another way to fix this is to try to upgrade/remove hibernate-validation.jar in commons/lib. Source.

Installing Liferay 5.2 SP3 on JBoss 6 (M1) #

Read full article here.

Deployment order in JBoss 5 #

Sometimes the order of deployed units matters. Typical scenario is when portal is deployed under certain context (e.g. /liferay) and there are other plugins installed (e.g. themes). On startup it may happens that JBoss 5 tries to deploy plugins first (for example: /jedi-theme before /liferay); obviously this will not work.

One solution is to define the deployment order in JBoss 5 so portal (/liferay) loads first, before any other war application. For this, open: jboss-5.1.0/server/default/conf/bootstrap/deployers.xml and add the following:

   <bean name="topContextComparator">
      <constructor factoryClass="org.jboss.system.deployers.LegacyDeploymentContextComparator" factoryMethod="getInstance"/>
      <property name="suffixOrder" class="java.util.Map">
            <map keyClass="java.lang.String" valueClass="java.lang.Integer">
               <entry>
                  <key>liferay.war</key>
                  <value>690</value>
               </entry>
               <entry>
                  <key>.war</key>
                  <value>700</value>
               </entry>
            </map>
         </property>
      </bean>

We set here the ordering value (690) for liferay.war to be less then any other war file (700); JBoss will now load portal before any other plugin (or war application).

Web console #

In order to have the JBoss Web console on the web profile, one needs to copy the "management" folder from the JBoss default configuration into web.

But, this will result in an error. If you read carefully, the error message says:

NOT FOUND Depends on 'jboss.jmx:name=Invoker,protocol=jrmp,service=proxyFactory,type=adaptor'

That message actually means that the JBoss proxy factory invoker adaptor, based on the JRMP protocol, cannot be found. Differently from the default profile, the web profile deploys that component using the HTTP protocol. That declaration is actually defined in jmx-invoker-service.xml.

Now, to make the JBoss web console use the HTTP JMX invoker:

  • Open the file management/console-mgr.sar/META-INF/jboss-service.xml
  • Find the declaration: <depends>jboss.jmx:type=adaptor,name=Invoker,protocol=jrmp,service=proxyFactory</depends>
  • In that line, change jrmp into http
  • Restart JBoss (that change is not taken into account in real time sometimes)

HSQLDB and "length must be specified in type definition: VARBINARY" #

If you experience the following exception:

java.sql.SQLException: length must be specified in type definition: VARBINARY
        at org.hsqldb.jdbc.Util.sqlException(Util.java:232)
        at org.hsqldb.jdbc.JDBCStatement.fetchResult(JDBCStatement.java:1838)
        at org.hsqldb.jdbc.JDBCStatement.executeUpdate(JDBCStatement.java:207)
        at org.jboss.resource.adapter.jdbc.WrappedStatement.executeUpdate(WrappedStatement.java:249)

do the following:

  • Open the JBOSS_HOME/server/< servername>/conf/standardjbosscmp-jdbc.xml
  • Search for the "Hypersonic SQL" type-mappping in the file.
  • Change
<type-mapping>
         <name>Hypersonic SQL</name>
         <row-locking-template/>
         ...
         <mapping>
            <java-type>java.lang.Object</java-type>
            <!-- hsqldb only supports directly serializable objects for sql type OBJECT -->
            <jdbc-type>VARBINARY</jdbc-type>
            <sql-type>VARBINARY</sql-type>
         </mapping>
         ...
      </type-mapping>

to

<type-mapping>
         <name>Hypersonic SQL</name>
         <row-locking-template/>
         ...
         <mapping>
            <java-type>java.lang.Object</java-type>
            <!-- hsqldb only supports directly serializable objects for sql type OBJECT -->
            <jdbc-type>VARBINARY</jdbc-type>
            <sql-type>VARBINARY(1024)</sql-type>
         </mapping>
          ...
      </type-mapping>

Note the change in the sql-type value. It is set to random value 1024, so you might need to change it. After this change, restart the server.

0 Attachments
4692 Views
Average (0 Votes)
Comments

Showing 1 Comment

Jakub B
10/18/11 1:34 PM

Are the changes required when you download the bundle for Jboss 5.1 / Liferay 6?