Hi Matt,

On 8 Oct 2007 at 9:56, Matt Raible wrote:

> I would recommend using the Tomcat Maven Plugin instead of Cargo if
> you want to deploy to a running Tomcat (vs. testing against an
> installed one).
> 
> http://mojo.codehaus.org/tomcat-maven-plugin/deployment.html
> 
> You will need to make sure you have credentials setup properly for the
> Manager application.
> 
> http://mojo.codehaus.org/tomcat-maven-plugin/configuration.html

Thanks for the tip.  I've now travelled down this path, but ran into and solved 
another problem that I thought I'd document here, hence the 
change of subject line.  I followed the links you posted and set everything up 
without a problem.  I then tried to run it inside Eclipse and 
ran into the "OutOfMemoryError: Java Heap Space" problem.  No big deal, I 
thought, I've seen stuff about that before.  A quick google 
turned up your comments in:

http://www.nabble.com/-JIRA--Updated:-(APF-900)-Using-appfuse:full-source-on-modular-Struts-project-throws-
java.lang.OutOfMemoryError:-Java-heap-space-p12778891s2369.html

so I set my MAVEN_OPTS environment variable (this is a Windoze 2000 box BTW) as 
recommended, restarted Eclipse - still the same 
problem :-(  Looking more closely at the Eclipse-Maven Plugin FAQ, at the very 
bottom of this page:

http://docs.codehaus.org/display/M2ECLIPSE/Project+FAQ#ProjectFAQ-M2HOMEenvironmentvariable

I saw the note "Maven Integration for Eclipse currently is not using M2_HOME 
environment variable and generally any other environment 
variables.", which I guess explained why setting the MAVEN_OPTS environment 
variable didn't work.

So, the way I solved the problem in the end was to set the relevant options on 
my Java Compiler in Eclipse by:

1.      From the Eclipse main menu, choose "Window" then "Preferences".
2.      On the Preferences dialog, expand "Java" in the left-hand column.
3.      Then, under Java, click "Installed JREs".
4.      The main part of the Preferences window will now list your installed 
JREs with the one currently used being ticked.
5.      Select the "default" JRE and click the "Edit" button to the right of it.
6.      Part way down the "Edit JRE" dialog, you'll see a field labeled 
"Default VM Arguments".  Go to this and put in your -X memory 
arguments.  I used "-Xms128M -Xmx256M".

After doing this, I was able to use the tomcat:deploy goal within Eclipse 
without getting Java Heap Space memory errors.

Hope this saves someone else some time and frustration!

Cheers,
Rob Hills
Waikiki, Western Australia
Mobile +61 (412) 904-357
Fax: +61 (8) 9529-2137

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to