Tuesday, November 17, 2009

appfuse EhCacheProvider.buildCache(86) | Could not find configuration

This was happening in my application for which I use Appfuse. I had configured a ehcache.xml for my models and was testing it with DAOs. The ehcache.xml was placed under test/resources. Jetty loads the ehcache.xml which is there in web/resources which I had not updated. After copying this the warning disappeared.

Solution:

1) If you are using Maven project structure, place your ehcache.xml under
\web\src\main\resources.


appfuse fatal error Error while expanding Unexpected end of ZLIB input stream

This happens usually when you run mvn install or mvn clean install on a appfuse project.

Here Maven is trying to download the tomcat distribution and store in a folder like c:\documents and settings\\local settings\temp\cargo....
If there is already a tomcat distribution in the above temp folder, it tries to use it. If this tomcat distribution is corrupt you get the above error message. It could be corrupt for many reasons, one of them being you terminated the maven command last time before tomcat was completely downloaded.

Solution:

1) Ask Maven to use a local tomcat instead of downloading it from the web:

Change the bottom of pom.xml from:


${cargo.container}


${cargo.container.url}
${installDir}


To:


${cargo.container}
${cargo.container.home}


http://appfuse.org/display/APF/FAQ#FAQ-useexistingtomcat


2) Delete the cargo folder under C:\Documents and Settings\\Local Settings\Temp

Run mvn after deleting it and give Maven enough time to download Tomcat.

You may also just delete the installs folder or even just the tomcat archive that is present in the installs folder. You may face the same problem even after deleting, that could be if your internet connection is not continuous.

If anyone finds an alternative solution please do leave a comment so that people can make use of it.



Wednesday, November 4, 2009

maven appfuse m2eclipse disable auto-build

The auto-build feature in eclipse is a pain, for more reasons than one. 
1)With every save maven kicks off its build.
2)It also starts downloading stuff from the internet everytime you start.

To avoid 1) turn off build automatically on your eclipse project by right clicking on the project.

 To avoid 2)

You can turn the 'automatic download feature' off by

Window>Preferences>Maven>

turn on offline, and turn off download repository
index updates.


Vinay.

appfuse eclipse The markup in the document following the root element must be well-formed. login.xml

Rename login.xml to login.xmlf indicating it is a XML fragment.

Sometimes the error tends to stick, delete the error message and restart eclipse.

To further reflect the change in the dtd, see here:

http://old.nabble.com/login.xml-not-well-formed-td12566966s2369.html

Vinay.

Appfuse Eclipse Invalid Character Constant Header.jsp

This occured when I imported a Maven project into eclipse after doing a mvn eclipse:eclipse.

Solution that worked for me:

Change: c:if test="${pageContext.request.locale.language != 'en'}"


To:
c:if test='${pageContext.request.locale.language != "en"}'


If you are looking for alternate solutions:

http://old.nabble.com/Eclipse-issue-with-header.jsp-EL-syntax-td13001614s2369.html

Vinay.