Installing GateIn 3.1 on My JBoss 5.1 Instance

A while back I wrote about the new JBoss portal and how to get it working. During that process I failed to figure out how to install the portal on a preexisting JBoss app server. I’ve spent a couple of hours digging at this and have pieced together how to get the job done. No clue why the guys over at JBoss don’t think this concept deserves a page in the user manual or reference guide.

I’m working with JBoss AS 5.1 and GateIn3.1 on my Win7-64 machine with JDK 1.6_u23.

Installation directories:

  • C:dev_toolsjboss-5.1.0.GA
  • C:Javajdk1.6.0_23
  • C:eclipseeclipse 3.6

The process isn’t that difficult. Its just not documented anywhere – can’t imagine why. Kind of annoying really –  I pieced this together by trolling the forums and Jira tickets.

To get going grab the latest GateIn download from the jboss site. Extract this somewhere on your machine. Dig into the extracted files and locate the deploy directory here: GateIn-3.1.0-GAserverdefaultdeploy. Shutdown your jboss server instance. Move or copy gatein.ear to your jboss server’s default deploy directory. Optionally you can do the same with all the gatein-sample* war file.

Now head on over to your jboss deploy directory jboss-5.1.0.GAserverdefaultdeploy and open up the file properties-service.xml and add an additional property to the system properties mbean like this:

<mbean code=”org.jboss.varia.property.SystemPropertiesService”
name=”jboss:type=Service,name=SystemProperties”>
<attribute name=”Properties”>
exo.conf.dir.name=gatein
</attribute>
</mbean>

Now in theory everything should work, but before we jump ahead and startup the server, lets check the data directory and conf directories to make sure things look ok. The gatein conf directory is here: jboss-5.1.0.GAserverdefaultconfgatein. By default gatein is going to use hsql as its database, but if you configure the configuration.properties file correctly it can be setup to use MySQL or other databases (I’ll try this later).

When using HSQL gatein stores its data over here: jboss-5.1.0.GAserverdefaultdata. If you want to dump the database and start over or if like me you messed it all up trying to the get thing installed you can simply delete the gatein and hypersonic directories and gatein will re-build a blank portal configuration for you.

With all the checked the portal should be good to go, start it up with the usual jboss deal. It will take a while to build everything the first time and you should check the console and logs output for any errors.

Switching over to MySQL – 21-Feb-2011:

Wow – that sure was more work than expected. Every once in a while I’m reminded about the skill of writing and organizing things – glad I got that ‘ol liberal arts degree. After a bunch of hours poking around, pondering the vague instructions in the reference manual, and cursing myself for pathetic typing I have put together the steps to get MySQL 5.x working as the DB backend for GatIn. With no further ado:

  1. Create MySQL databases making sure you set Latin 1 Default Collation as the characterset. I used MySQL workbench to do this. Create a database called gatein_portal and gatein_idm.
  2. Create a user that has access the databases above – I just gave my account total access. I named the user “gatein”.
  3. Stop your jboss server. Go into your serverdata directory and delete the gatein and hypersonic folders/directories.
  4. You’ll need to edit the configuration.properties file in jboss-5.1.0.GAserverdefaultconf so that it has the following entries for the JCR database:
    gatein.jcr.config.type=local
    gatein.jcr.datasource.name=java:jdbcjcr
    gatein.jcr.datasource.dialect=auto
    gatein.jcr.datasource.driver=com.mysql.jdbc.Driver
    gatein.jcr.datasource.url=jdbc:mysql://localhost:3306/gatein_portal
    gatein.jcr.datasource.username=gatein
    gatein.jcr.datasource.passwor=your pwd
  5. And the following entries for the IDM database:
    gatein.idm.datasource.name=java:jdbcidm
    gatein.idm.datasource.driver=com.mysql.jdbc.Driver
    gatein.idm.datasource.url=jdbc:mysql://localhost:3306/gatein_idm
    gatein.idm.datasource.username=gatein
    gatein.idm.datasource.password=your pwd
  6. Now check all that again and make sure everything is typed up right.
  7. Make sure you have the MySQL ConnectorJ jar on the classpath.  I placed mine in the server lib directory.
  8. Take all GateIn war files out of the deploy directory except the main gaetin.ear file.

With all that done you should be able to start up jboss and access the portal. Carefully watch the console and check for errors. If you see anything about keylengths then you did not set the Latin1 characterset. If you see errors about not creating a connection pool then you did not set the access for your user correctly. If you see anything about the drivers not being found then you either don’t have the MySQL driver on the classpath or the names for the databases are not right in the properties file. Good luck.

One benefit to MySQL I can already see is that the portal seems faster and it definitely takes less RAM. I’ll load it with jMeter to get some solid numbers.

Next step will be putting all the extra war files back in place and get them working and then I’ll take a look at gadgets and portlets.

5 Responses

    • Beren says:

      Cool – thanks very much for that. Looks very helpful. What are you doing for gadgets? I’ve been looking around for pre-built gadgets. I’m amazed to see that there are virtually none.

  1. Джамал says:

    You were visited by excellent thought

  2. vikas says:

    Hi,
    I wanted to install GateIn on Jboss 6.0 . So, copied gatein.ear to deploy folder of Jboss6.0. But, am getting this exception ..

    vfs:///D:/devworks/jboss-as-6-withGateIn/server/default/deploy/gatein-sample-skin.war” is in error due to the following reason(s):
    org.jboss.xb.binding.JBossXBRuntimeException: filter cannot appear in this position. Expected content of web-app is unordered_sequence:
    error-page* welcome-file-list? servlet-mapping* login-config? mime-mapping* distributable? session-config? security-role* taglib*
    security-constraint* context-param* servlet* {all descriptionGroup}? {unordered_sequence jndiEnvironmentRefsGroup}?
    Deployment
    “vfs:///D:/devworks/jboss-as-6-withGateIn/server/default/deploy/gatein.ear” is in error due to the following reason(s): java.lang.IllegalStateException:
    Attempting to access a non-started producer!
    Deployment “vfs:///D:/devworks/jboss-as-6-withGateIn/server/default/deploy/gatein-sample-extension.ear” is in
    error due to the following reason(s): java.lang.ClassNotFoundException: org.gatein.wci.api.GateInServlet from BaseClassLoader@78e59b
    {vfs:///D:/devworks/jboss-as-6-withGateIn/server/default/deploy/gatein-sample-extension.ear/sample-ext.war/}
    Deployment
    “vfs:///D:/devworks/jboss-as-6-withGateIn/server/default/deploy/gatein-sample-portal.ear” is in error due to the following reason(s):
    java.lang.ClassNotFoundException: org.exoplatform.services.rest.servlet.RestServlet from BaseClassLoader@5ab328{vfs
    :///D:/devworks/jboss-as-6-withGateIn/server/default/deploy/gatein-sample-portal.ear/rest-sample-portal.war/}
    Deployment ”
    jboss.web.deployment:war=/starter” is in error due to the following reason(s): org.jboss.deployers.spi.DeploymentException:
    URL file:/D:/devworks/jboss-as-6-withGateIn/server/default/tmp/vfs/automount790cc3f5b41da84d/starter.war-518b533f8667bcc1/

    • Beren says:

      I don’t think GateIn is supported yet on 6 – you are probably seeing errors due to differences in the deployment descriptors and stuff like that.

Leave a Reply