cancel
Showing results for 
Search instead for 
Did you mean: 

Starting Alfresco on Tomcat from Eclipse IDE

ipeters
Champ in-the-making
Champ in-the-making
Hi,

I'm trying to run Alfresco 3.2 from Eclipse. To that end I've followed the following documentation: http://wiki.alfresco.com/wiki/Alfresco_on_Eclipse

I am able to compile successfully, albeit with a bunch of "deprecated" warnings.
I've installed the Tomcat plugin, but could not find information on how this works other than finding the info on setting the Tomcat options.

More searching led me to this documentation: http://wiki.alfresco.com/wiki/Development_Environment
I created the database and skipped the steps related to checking out the code, since I already had done that.


I also followed the steps outlined in http://wiki.alfresco.com/wiki/Install_Tomcat6

In the Development Environment documentation it recommends using the "start-tomcat-application" target to launch the app server. However, doing so produced the following out-of-memory error:
14:42:01,393 ERROR [org.springframework.web.context.ContextLoader] Context initialization failed

Caused by: java.lang.OutOfMemoryError: PermGen space


Does launching Tomcat in this manner not take into consideration the server parameters I set under Eclipse -> Windows -> Preferences -> Tomcat -> JVM Settings?

If not, where would I set them?


At any rate, I would prefer to simply use the Eclipse menu item "Tomcat -> Start Tomcat". When I try this I only see the following vague indication of a problem in the Console: "<terminated> C:\alfresco_dev\Java\jre6\bin=javaw.exe"

Can someone advise me what the recommended way for testing Alfresco is, when working inside of Eclipse?

FWIW, my eventual goal is to simply define an action that kicks of an Oracle BPEL workflow, which is published as a web service. But first I'd like to make sure I have a firm grasp on building the entire application and setting up my development environment.

Thanks for any tips!

Ingo


PS. Update: I have seen the article on tuning at http://wiki.alfresco.com/wiki/JVM_Tuning . But in my case I'm using the new 3.2 release, so the scripts should reflect the higher PermGen space setting. But anyways, I would prefer to use the Eclipse tomcat plugin for launching the app server.
1 REPLY 1

fooblahblah
Champ in-the-making
Champ in-the-making
The way I've been doing it to set the env. vars used by ant to point to the same installation of Tomcat I have the Eclipse plugin pointed to.  Those can be defined something like this:

-Denv.TOMCAT_HOME=${workspace_loc}/apache-tomcat-6.0.20
-Denv.APP_TOMCAT_HOME=${workspace_loc}/apache-tomcat-6.0.20

I used an Eclipse external ant builder pointing to Alfresco source build.xml and installed the Tomcat tree into my local workspace as a project - hence the ${workspace_loc} Eclipse var.  I'm also using tomcat 6.0.20.  You would replace {workspace_loc}/apache-tomcat-6.0.20 with the path to Tomcat root.  The environment vars can be set directly on the ant external tool definition or you can set them globally.  I)

Then I run the the default ant target (build-tomcat) and it will compile the source tree, generate the alfresco.war and share.war and deploy these to your Tomcat install.  I typically only do this once in the beginning of a project and then work out the shared directory classpath for extensions, etc.

In the Tomcat plugin JVM settings I have the following for a Gentoo Linux system (Core2-duo 4gb  RAM):

-server -Xss1024K -Xms1G -Xmx2G -XX:MaxPermSize=128M -XX:NewSize=512m
-Denv.TOMCAT_HOME=<tomcat_root>
-Denv.APP_TOMCAT_HOME=<tomcat_root>
-Denv.alfresco.home=<tomcat_root>

Where <tomcat_root> is replaced with the full path to where you installed Tomcat and referenced it in the top level Tomcat settings. Note: AFAIK the Tomcat plugin does not expand Eclipse variables as you may be used to in other configuration dialogs.

Under the Classpath (before generated classpath) settings point to the <tomcat_root>/shared/classes directory.  This is where extensions can be placed such as alfresco-global.properties and other configuration customizations.

Once those are there you can run Tomcat from the Eclipse plugin (little icons in your toolbar).  Alfresco and share should expand and begin bootstrapping the db, etc.  Keep in mind you can customize the database and alf_root settings by placing a file in <tomcat_root>/shared/classes/alfresco-global.properties with the overrides.

YMMV on the memory settings.  I've converged on those via trial and error and reading other posts in the forums.

Hopefully this makes sense. 

Cheers,
-Jeff Simpson
Zia Consulting, Inc