First we need to get the war version of alfresco from a download site. The one I used was alfresco-labs-war-3Stable.zip. Extract the contents to a temporary folder.
The next step is to set up the database. If you’ve already installed the default version of Alfresco you’ll need to drop the database and recreate it. Either way, you’ll find mysql scripts in extra/databases/mysql for setting up or dropping the schema. See Using Alfresco for document management Part One for details on how to do a default install of Alfresco and for configuring Open Office.
You now need to extract alfresco.war to edit the contents. I expanded it into exploded/alfresco.war so I can copy the alfresco.war folder directly into my jboss application when I’m ready to deploy.
We need to configure the war for deployment in JBoss. You’ll find the config files needed in the extensions/extension folder. The ones we want are:
Copy these to exploded/alfresco.war/WEB-INF/classes/alfresco/extension
In custom-repository.properties you need to set the dir.root to point to where you want to store your alfresco data. Also uncomment and set the database values – don’t forget to disable the derby settings also.
Finally you need to set the external executable locations. What I did here was copy the ImageMagick and bin folders from the default Alfresco install into my root folder containing alf_data. Otherwise you will need to install missing executables yourself.
ooo.exe=C:/Program Files/OpenOffice.org 3/program/soffice
Now update the hibernate dialect in custom-hibernate-dialect.properties
# MySQL dialect (default) hibernate.dialect=org.hibernate.dialect.MySQLInnoDBDialect
I used JBoss 4.2.2 as my application server. Before deploying you should edit jboss-4.2.2.GA/server/default/deploy/ejb3.deployer/META-INF/persistence.properties to change hibernate.bytecode.provider from javassist to cglib.
To avoid getting permgen out of memory errors you will probably need to configure your JBOSS_HOME/bin/run.bat to increase the memory size.
set JAVA_OPTS=%JAVA_OPTS% -Xms512m -Xmx1024m -XX:PermSize=256m -XX:MaxPermSize=512
You can now try coping alfresco.war into your jboss application. Assuming this doesn’t cause a spectacular display of stack traces, when the server finally starts up you can try accessing the application at http://localhost:8080/alfresco.
You’re now ready to start figuring out how to use alfresco as it is, or integrate it with other applications.
Hi – thanks for this information. But something seems incorrect or incomplete.
First, I assume you are in Windows – I’m in Ubuntu, JBOSS 4.2.3, LABS3 … but, it does work if I simply expand the war file to /server/default/deploy/alfresco.war/ .. of course then I can’t set any of my custom properties i.e Alfresco data dir. etc.
So, when I place the three custom.* files in the extension directory and modify accordingly alfresco will not launch … it just crashes after the ” Initializing Spring root WebApplicationContext ” section of the log … By further experimentation I determined that the custom-repository-context.xml was the offending file. You don’t say what mods need to be made here – other than just having that file (?) I did find another web reference that said to comment out the hibernate section of this file or else Spring Framework will not start. That seemed promising but had no effect. So if I remove this file, but leave the other two then it launches and functions fine … EXCEPT … nothing in the custom-repository.properties file seems to have [over-ride]effect, i.e default dir.root is not changing. So this [extension] directory location and guidelines don’t seem right. I’ve seen some reference jboss app config overrides being placed in /server/default/conf .. ???
Can you or anyone offer insight into these disparities … I’ve scoured the forums to no avail. In the end I only used the Alfresco JBOSS wiki page and your information … but have this “little” problem …
Yes, these instructions cover a windows install where the steps in the first post have been carried out. I haven’t tried it on Ubuntu yet.
The custom-repository-context.xml file is the one that specifies that the custom-hibernate-dialect.properties and custom-repository.properties should be used – so to override the defaults you have to include it. This means that you could have a problem with any of the settings in those files.
I’ll try and duplicate the process on Ubuntu later today and see if it works the same for a non-windows platform.
Hi Shiela – thanks for your reply. Sorry for the delay in providing feedback. Your explanation of the relationship between the three files was very helpful. By explicitly pointing to the two config files I got everything on the “alfresco” side working by modifying custom-repository-context.xml as noted below (THIS NEXT LINE CHANGED):
– – – – – – – –
So, now I can’t get “share” to work 🙁 The log-on page displays, but then I get the “Failed to Login: The remote server may be unavailable or your authentication details have not been recognized.” message. I’ve tried all the stuff mentioned on the alfresco forums to no avail. Basically, the share.war is in the deploy directory with no other configuration changes. I tried letting jboss expand it to tmp dir, and also manually exploded in the deploy directory – same results either way.
Any special tricks or necessary configs to get share working with jboss 4.2.3 that you know about?
sorry, the code excerpt messed up … can you delete? I’ll try again with the xhtml tags … 🙁
sorry, sorry – I guess wordpress doesn’t like any tags in my comments, Please feel free to delete this mess. Here are the two key changes I made in the custom-repository-context.xml file … without the tags 🙂
override basic repository properties using the value tag: file:/usr/local/jboss-4.2.3.GA/server/default/deploy/alfresco.war/WEB-INF/classes/alfresco/extension/custom-repository.properties
override hibernate dialect using the value tag: file:/usr/local/jboss-4.2.3.GA/server/default/deploy/alfresco.war/WEB-INF/classes/alfresco/extension/custom-hibernate-dialect.properties
I haven’t used alfresco share yet so I can’t help you with that. You should try posting on one of the alfresco forums as someone should know more there.
Can you give me an example for deploying an sample extension in tomcat server.