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.
- 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:
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:
- 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.
- Create a user that has access the databases above – I just gave my account total access. I named the user “gatein”.
- Stop your jboss server. Go into your serverdata directory and delete the gatein and hypersonic folders/directories.
- 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:
- And the following entries for the IDM database:
- Now check all that again and make sure everything is typed up right.
- Make sure you have the MySQL ConnectorJ jar on the classpath. I placed mine in the server lib directory.
- 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.