JBoss 5 and Alfresco 3.3 on Mac OS-X
UPDATE 6-13-2010: I gave a go again with the 3.3 community release and figured out how to run the installer. If you get the context menu to popup and pick off open this, and then select to open it with the terminal it will start correctly. Kind of random luck I guess to figure that out. Once I did that the system installed with my MySQL and its own tomcat install. I’m going to try the jboss route again with this database working properly…
Unfortunately I got my 17″ PowerBook stolen. Bummer…so all my development tools went with them. Luckily I didn’t have anything too sensitive on that machine, but it is quite a bummer. I have my new machine now – so now I need to install some things. I’ve got some trouble with our Alfresco instance so I’ll be installing MySQL, JBoss 5.1, and Alfresco 3.3 along with IntelliJ to do some investigating. I’ll walk thru the steps in this post.
Alfresco 3.3 is a pretty nice tool for collaborating on documents, however working with MS Office is a constant battle to stay ahead of the latest tricks from Redmond. The latest trick is a change in how documents are opened when downloaded from the web with Internet Explorer. These changes effect Office 2007 products – Word and Excel in particular. When you click on a link to a .doc/docx file IE will start he download and then transfer the download to the app (Word in this case). Word will then perform the download, but since Word has a new browser session, the web session is not there and the download fails. This mechanism in 2007 is a new “feature”.
To resolve the issue I’ll need to get Alfresco installed and check into how the links to documents are formed.
Installing JBoss 5.1 AS
This is pretty simple – but you’d think there could be a simple doc from the community that tells you what the deal is. To get JBoss installed simply download the ZIP file, extract it to your Mac somewhere (I just placed it under my user directory), and then check permissions on the run.sh file. JBoss should startup from a command line from the bin directory simply type executing: ./run.sh – you should do this now and check for any errors.
Prior to getting MySQL, make sure you have Xcode and MacPorts installed. After that I Would just follow the instructions here. You can also look at my post on getting Drupal working on OS-X. I have some additional tips on MySQL installation there…ok maybe not. For some reason macports is not working. I keep getting an error – either make is not found or I get missing files – Error 64. I poked around, but found no help. I’ll drop back to doing the install the old fashioned way.
Grab the dmg file from: http://dev.mysql.com/downloads/mysql/
Then mount it and run the installer. Take all the defaults.
These instructions are helpful. After running the installer you should be able to startup mysql with this command from /usr/local/mysql: sudo ./bin/mysqld_safe. When you reboot the server should startup for you. The next question is a tool for creating a database. Those tricky guys at MySQL (or is that Oracle now?) have eliminated the old GUI tools and now you have to use the “Workbench”.
That’s ok – but it took me a while to figure out that the 5.1 release only does data modeling. After trying to figure out what the heck was wrong for a good two hours – because the MySQL site is already updated for 5.2 but never actually says this anywhere as far as I can tell- I downloaded the 5.2 beta and sure enough there’s a whole bunch of new stuff. You’d think they could put a “hey all the docs on our site assume you are using the beta and not the GA release”. Sheesh….anyway…
Its a decent tool – got my db created and an alfresco user account setup pretty quick. It is nice to have a single tool to do everything, although it is not entirely obvious from the tool when things are committed to the database. A bit freaky to me.
While you are still at the MySQL site might as well download the latest JDBC drivers – called Connector/J. After the download, extract the tar file and just throw that into the main lib folder under your jboss server. Don’t do that in a production setting – put it in a specific server lib directory, but for a local dev server this is fine.
Installing and Starting Up Alfresco
This should be easy – right? Well I downloaded the Mac installer – but the type is not recognized on my Mac – keep in mind this is a pristine and brand new MacBook Pro – there’s no instructions really on the alfresco site to help you out so I guess I have to go to plan B: installing using the WAR file. I grabbed the .WAR file and looked at it – no instructions. There’s a readme.txt that says you can find install instructions on share.alfresco.com. I registered for that, but I don’t see the document library they mention.
So I grabbed the war – extracted it and placed the folder into my jboss server’s deploy directory. I then changed the name of the folder to alfresco.war.
After that you’ll need to edit two files:
- WEB-INFclassesalfrescorepository.properties – database properties
In repository properties you need to update the jdbc and schema settings for your database. Here’s the JDBC URL I used for MySQL:
In hibernate-cfg.properties you need to explicitly set the dialect despite what the comment in the file says…or maybe not. See below…
Now you will need to add extra memory to your JAVA_OPTS in the main binrun.conf file for jboss. I used these settings:
-Xms512m -Xmx1024m -XX:MaxPermSize=512m
That should get the stuff to work.
What’s missing in this deal is all the details of how exactly to do this. For starters you’ll need to add your JDBC config information to the repository.properties file located here:
Here’s the jdbc string I used:
Then you will need to check the hibernate config stuff too. I would first try not messing with this file and see if things work. In the end, I think not messing with this file was best. I tried this as a way to eliminate errors but then went back to the original file.
I’ve gotten mired down in the guts of trying to resolve some exceptions when starting up the system. JBoss starts up, I see the schema for alfresco is created ok, but now I am getting some null pointers in the startup log that essentially lead to the app server not deploying the application successfully.
I solved some initial problems with exceptions in the logs by removing several jar files causing conflicts with JBoss’ own jars. These are all the jars related to XML processing. I got of all of the errors , but now I’m stuck with a null pointer error that I cannot resolve:
09:20:18,746 INFO [STDOUT] 09:20:18,746 INFO [service.descriptor.DescriptorService] Alfresco started (Community): Current version 3.3.0 (2765) schema 4009 – Originally installed version 3.3.0 (2765) schema 4009
09:20:23,271 INFO [STDOUT] 09:20:23,271 User:System INFO [extensions.webscripts.AbstractRuntimeContainer] Initialised Repository Web Script Container (in 791.43ms)
09:20:23,275 INFO [STDOUT] 09:20:23,273 ERROR [web.context.ContextLoader] Context initialization failed
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at $Proxy38.start(Unknown Source)
In the end I have to admit that setting this up on a Mac is a serious hassle compared to either Linux or Windows. Its too bad – the hardware is nice (except for that mouse). The battery life and screen are especially nice. I’ll keep plugging away at this – I’ll get it worked out, but for now I’m jumping back to my Win-doze machine to get the coding I need to do done.