<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Blog::Log &#187; appfuse</title>
	<atom:link href="http://www.stpe.se/tag/appfuse/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.stpe.se</link>
	<description>Not a blog, more a log.</description>
	<lastBuildDate>Wed, 02 Jun 2010 13:01:58 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Error deploying AppFuse application on Tomcat</title>
		<link>http://www.stpe.se/2008/07/error-deploying-appfuse-application-on-tomcat/</link>
		<comments>http://www.stpe.se/2008/07/error-deploying-appfuse-application-on-tomcat/#comments</comments>
		<pubDate>Thu, 17 Jul 2008 08:04:36 +0000</pubDate>
		<dc:creator>stefan</dc:creator>
				<category><![CDATA[coding]]></category>
		<category><![CDATA[appfuse]]></category>
		<category><![CDATA[tomcat]]></category>

		<guid isPermaLink="false">http://www.stpe.se/?p=30</guid>
		<description><![CDATA[When trying to deploy an AppFuse application on Tomcat I received the following error: org.apache.jasper.JasperException: Unable to compile class for JSP: An error occurred at line: 153 in the generated java file Type mismatch: cannot convert from null to int An error occurred at line: 168 in the generated java file Cannot cast from Object [...]]]></description>
			<content:encoded><![CDATA[<p>When trying to deploy an AppFuse application on Tomcat I received the following error:</p>
<blockquote><p>org.apache.jasper.JasperException: Unable to compile class for JSP:</p>
<p>An error occurred at line: 153 in the generated java file<br />
Type mismatch: cannot convert from null to int</p>
<p>An error occurred at line: 168 in the generated java file<br />
Cannot cast from Object to int</p></blockquote>
<p>The source of the error turned out to be due to the Constants.java file containing a variable that was not a String. Changing it into a string (and add appropriate type-casting in the application) got rid of the error.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.stpe.se/2008/07/error-deploying-appfuse-application-on-tomcat/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Date fields in forms using Spring and AppFuse</title>
		<link>http://www.stpe.se/2008/07/date-fields-in-forms-using-spring-and-appfuse/</link>
		<comments>http://www.stpe.se/2008/07/date-fields-in-forms-using-spring-and-appfuse/#comments</comments>
		<pubDate>Wed, 09 Jul 2008 08:50:14 +0000</pubDate>
		<dc:creator>stefan</dc:creator>
				<category><![CDATA[coding]]></category>
		<category><![CDATA[appfuse]]></category>
		<category><![CDATA[spring]]></category>

		<guid isPermaLink="false">http://www.stpe.se/?p=24</guid>
		<description><![CDATA[I had some problems getting date fields to work (and return a friendly error message) so here comes a little documentation for future reference. This was in an AppFuse based Spring Framework project. The model contains a java.util.Date property and simply exposing it as usual in a form will cause an exception since Spring doesn&#8217;t [...]]]></description>
			<content:encoded><![CDATA[<p>I had some problems getting date fields to work (and return a friendly error message) so here comes a little documentation for future reference. This was in an AppFuse based Spring Framework project.</p>
<p>The model contains a java.util.Date property and simply exposing it as usual in a form will cause an exception since Spring doesn&#8217;t know how to convert the string into a Date:</p>
<blockquote><p>Failed to convert property value of type  to required type  for property startTime; nested exception is java.lang.IllegalArgumentException: Cannot convert value of type  to required type  for property startTime: no matching editors or conversion strategy found</p></blockquote>
<p>To solve this we need a custom property editor. It may be registered by overriding the initBinder() method of a controller. Spring already contains a CustomDateEditor that we may use for this purpose.</p>
<pre class="brush: java;">
protected void initBinder(HttpServletRequest request,
                          ServletRequestDataBinder binder) {
    SimpleDateFormat dateFormat =
        new SimpleDateFormat(getText(&quot;date.format&quot;, request.getLocale()));
    dateFormat.setLenient(false);
    binder.registerCustomEditor(Date.class, null, new CustomDateEditor(dateFormat, true));
}</pre>
<p>Note that you may replace the getText() call with a hard-coded &#8220;yyyy-MM-dd&#8221; or similar, at least for debugging purposes.</p>
<p>If it is an AppFuse project and the controller extends BaseFormController then you don&#8217;t need this since the CustomDateEditor is already registered in the BaseFormController.initBinder() method.</p>
<p>Now it should work, however, the error message isn&#8217;t especially user-friendly when entering an invalid date:</p>
<blockquote><p>Failed to convert property value of type  to required type  for property startTime; nested exception is java.lang.IllegalArgumentException: Could not parse date: Unparseable date: &#8220;2008-37-09&#8243;</p></blockquote>
<p>Better error messages may be provided using the resource file of the application (make sure you have a ResourceBundleMessageSource set up) by specifying typeMismatch error message for this type:</p>
<blockquote><p>typeMismatch.java.util.Date={0} is an invalid date.</p></blockquote>
<p>The {0} will be replaced by the property name, in this case startTime, which may not be desired. This may be overridden by setting a custom error message for this specific property:</p>
<blockquote><p>typeMismatch.startTime=Start time is an invalid date.</p></blockquote>
<p>Do also make sure to update validation.xml accordingly.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.stpe.se/2008/07/date-fields-in-forms-using-spring-and-appfuse/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>AppFuse and NetBeans: part 2</title>
		<link>http://www.stpe.se/2008/06/appfuse-and-netbeans-part-2/</link>
		<comments>http://www.stpe.se/2008/06/appfuse-and-netbeans-part-2/#comments</comments>
		<pubDate>Thu, 19 Jun 2008 21:02:24 +0000</pubDate>
		<dc:creator>stefan</dc:creator>
				<category><![CDATA[coding]]></category>
		<category><![CDATA[appfuse]]></category>
		<category><![CDATA[maven]]></category>
		<category><![CDATA[netbeans]]></category>

		<guid isPermaLink="false">http://www.stpe.se/?p=21</guid>
		<description><![CDATA[Some more tips about getting an AppFuse generated application into NetBeans. Pick archetype of choice, e.g.: mvn archetype:create -DarchetypeGroupId=org.appfuse.archetypes -DarchetypeArtifactId=appfuse-basic-spring -DremoteRepositories=http://static.appfuse.org/releases -DarchetypeVersion=2.0.2 -DgroupId=com.mycompany.app -DartifactId=myproject Run mvn Generate full sources: mvn appfuse:full-source Install the Maven plugin in NetBeans (Tools / Plugins / Search for Maven). Open the project (located the pom.xml file) Right-click the project name [...]]]></description>
			<content:encoded><![CDATA[<p>Some more tips about getting an AppFuse generated application into NetBeans.</p>
<ol>
<li>Pick archetype of choice, e.g.: <strong>mvn archetype:create -DarchetypeGroupId=org.appfuse.archetypes -DarchetypeArtifactId=appfuse-basic-spring -DremoteRepositories=http://static.appfuse.org/releases -DarchetypeVersion=2.0.2 -DgroupId=com.mycompany.app -DartifactId=myproject</strong></li>
<li>Run <strong>mvn</strong></li>
<li>Generate full sources: <strong>mvn appfuse:full-source</strong></li>
<li>Install the Maven plugin in NetBeans (Tools / Plugins / Search for Maven).</li>
<li>Open the project (located the pom.xml file)</li>
<li>Right-click the project name and select <strong>Properties</strong></li>
<li>In categories, select <strong>Run</strong>. Chose a server.</li>
<li>In categories, select <strong>Actions</strong>. Check the box for <strong>Use external Maven for build execution</strong>.</li>
<li>In main window, select <strong>Tools </strong>/ <strong>Options </strong>/ <strong>Miscellaneous </strong>/ <strong>Maven 2</strong>.</li>
<li>Now <strong>Run</strong> the project, and after a while a browser should open pointing you to the login screen.</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://www.stpe.se/2008/06/appfuse-and-netbeans-part-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Manually run AppFuse WebTests</title>
		<link>http://www.stpe.se/2008/06/manually-run-appfuse-webtests/</link>
		<comments>http://www.stpe.se/2008/06/manually-run-appfuse-webtests/#comments</comments>
		<pubDate>Tue, 17 Jun 2008 12:03:15 +0000</pubDate>
		<dc:creator>stefan</dc:creator>
				<category><![CDATA[coding]]></category>
		<category><![CDATA[appfuse]]></category>
		<category><![CDATA[canoo]]></category>
		<category><![CDATA[cargo]]></category>
		<category><![CDATA[maven]]></category>
		<category><![CDATA[webtest]]></category>

		<guid isPermaLink="false">http://www.stpe.se/?p=20</guid>
		<description><![CDATA[Sometime it may be useful to manually run the (Canoo) web tests for AppFuse applications to be able to see what goes wrong. Accomplish this by making the test web container pause upon start using: mvn -Dcargo.wait Then the application (using default values) is reachable at: http://localhost:8081/&#60;app_name&#62;/ Where &#60;app_name&#62; might be something like appname-1.0-SNAPSHOT depending [...]]]></description>
			<content:encoded><![CDATA[<p>Sometime it may be useful to manually run the (Canoo) web tests for AppFuse applications to be able to see what goes wrong. Accomplish this by making the test web container pause upon start using:</p>
<blockquote><p>mvn -Dcargo.wait</p></blockquote>
<p>Then the application (using default values) is reachable at:</p>
<blockquote><p>http://localhost:8081/&lt;app_name&gt;/</p></blockquote>
<p>Where &lt;app_name&gt; might be something like <em>appname-1.0-SNAPSHOT</em> depending on your configuration.</p>
<p>If a test fails it might also be a good idea to take a look at how the pages retrieved actually look like, they are saved (by default) in the directory <strong>target\webtest-data</strong>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.stpe.se/2008/06/manually-run-appfuse-webtests/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Create table from object for AppFuse</title>
		<link>http://www.stpe.se/2008/06/create-table-from-object-for-appfuse/</link>
		<comments>http://www.stpe.se/2008/06/create-table-from-object-for-appfuse/#comments</comments>
		<pubDate>Mon, 16 Jun 2008 14:53:31 +0000</pubDate>
		<dc:creator>stefan</dc:creator>
				<category><![CDATA[coding]]></category>
		<category><![CDATA[appfuse]]></category>
		<category><![CDATA[maven]]></category>

		<guid isPermaLink="false">http://www.stpe.se/?p=19</guid>
		<description><![CDATA[Once mapped in hibernate.cfg.xml run: mvn test-compile hibernate3:hbm2ddl]]></description>
			<content:encoded><![CDATA[<p>Once mapped in hibernate.cfg.xml run:</p>
<blockquote><p><strong>mvn test-compile hibernate3:hbm2ddl</strong></p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://www.stpe.se/2008/06/create-table-from-object-for-appfuse/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Skip AppFuse tests</title>
		<link>http://www.stpe.se/2008/06/skip-appfuse-tests/</link>
		<comments>http://www.stpe.se/2008/06/skip-appfuse-tests/#comments</comments>
		<pubDate>Mon, 16 Jun 2008 14:51:25 +0000</pubDate>
		<dc:creator>stefan</dc:creator>
				<category><![CDATA[coding]]></category>
		<category><![CDATA[appfuse]]></category>
		<category><![CDATA[maven]]></category>

		<guid isPermaLink="false">http://www.stpe.se/?p=18</guid>
		<description><![CDATA[To skip tests when running/compiling using AppFuse projects, set the maven.test.skip property: mvn jetty:run-war -Dmaven.test.skip=true]]></description>
			<content:encoded><![CDATA[<p>To skip tests when running/compiling using AppFuse projects, set the maven.test.skip property:</p>
<blockquote><p><strong>mvn jetty:run-war -Dmaven.test.skip=true</strong></p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://www.stpe.se/2008/06/skip-appfuse-tests/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>AppFuse and NetBeans</title>
		<link>http://www.stpe.se/2008/05/appfuse-and-netbeans/</link>
		<comments>http://www.stpe.se/2008/05/appfuse-and-netbeans/#comments</comments>
		<pubDate>Tue, 27 May 2008 04:54:18 +0000</pubDate>
		<dc:creator>stefan</dc:creator>
				<category><![CDATA[coding]]></category>
		<category><![CDATA[appfuse]]></category>
		<category><![CDATA[maven]]></category>
		<category><![CDATA[netbeans]]></category>

		<guid isPermaLink="false">http://www.stpe.se/?p=15</guid>
		<description><![CDATA[Opening an AppFuse in NetBeans might be done in two ways, two ways that I managed to mix up the first time&#8230; Either install the Maven plugin Mevenide2 for NetBeans, then you may simply open the Maven project generated by AppFuse directly. Without the Maven plugin, then you need to convert to project using mvn [...]]]></description>
			<content:encoded><![CDATA[<p>Opening an <a href="http://appfuse.org/">AppFuse</a> in NetBeans might be done in two ways, two ways that I managed to mix up the first time&#8230;</p>
<p>Either install the Maven plugin Mevenide2 for NetBeans, then you may simply open the Maven project generated by AppFuse directly. Without the Maven plugin, then you need to convert to project using <strong>mvn netbeans:netbeans</strong> (see <a href="http://www.stpe.se/2008/05/appfuse-generate-netbeans-project-files/">previous post</a>). Opening up a converted project with the NetBeans Maven plugin installed will result in badness.</p>
<p>Wondering where the source is? See <a href="http://www.stpe.se/2008/05/generate-full-source-with-appfuse/">this post</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.stpe.se/2008/05/appfuse-and-netbeans/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Generate full-source with AppFuse</title>
		<link>http://www.stpe.se/2008/05/generate-full-source-with-appfuse/</link>
		<comments>http://www.stpe.se/2008/05/generate-full-source-with-appfuse/#comments</comments>
		<pubDate>Sat, 24 May 2008 18:52:25 +0000</pubDate>
		<dc:creator>stefan</dc:creator>
				<category><![CDATA[coding]]></category>
		<category><![CDATA[appfuse]]></category>
		<category><![CDATA[maven]]></category>

		<guid isPermaLink="false">http://www.stpe.se/?p=14</guid>
		<description><![CDATA[In AppFuse 2.x you don&#8217;t automatically get the full source of the generated project. To generate the source, run: mvn appfuse:full-source On my Ubuntubox this all went well, but on my work laptop running Windows XP it failed with the fatal error: Illegal character in path at index 18: file:/C:/Documents and Settings/myuser/.m2/repository/org/apache/ant/ant/1.7.0/ant-1.7.0.jar Turned out to [...]]]></description>
			<content:encoded><![CDATA[<p>In AppFuse 2.x you don&#8217;t automatically get the full source of the generated project. To generate the source, run:</p>
<blockquote><p>mvn appfuse:full-source</p></blockquote>
<p>On my Ubuntubox this all went well, but on my work laptop running Windows XP it failed with the fatal error:</p>
<blockquote><p>Illegal character in path at index 18: file:/C:/Documents and Settings/<em>myuser</em>/.m2/repository/org/apache/ant/ant/1.7.0/ant-1.7.0.jar</p></blockquote>
<p>Turned out to be because of the spaces in the path, a not so uncommon problem for *nix stuff running under Windows.</p>
<p>To solve this you may either move your maven artifact repository to a path without a space, or edit the maven settings.xml so the path no longer includes a space. This is achieved by using DOS short names. To see what a files short name is, open the command prompt and run <strong>dir /X</strong>.</p>
<p>The <strong>settings.xml</strong> is likely located in the conf directory where you installed Apache Maven, in my case it was:</p>
<blockquote><p>C:\Program Files\Apache Software Foundation\apache-maven-2.0.9\conf\settings.xml</p></blockquote>
<p>I added an entry (if there is already one, edit it) for localRepository:</p>
<blockquote><p>&lt;localRepository&gt;C:\DOCUME~1\<em>myuser</em>\.m2\repository&lt;/localRepository&gt;</p></blockquote>
<p>Now everything worked and I got BUILD SUCCESSFUL. Please note that the actual path is likely different on your setup. Change it as appropriate.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.stpe.se/2008/05/generate-full-source-with-appfuse/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>AppFuse: Generate NetBeans project files</title>
		<link>http://www.stpe.se/2008/05/appfuse-generate-netbeans-project-files/</link>
		<comments>http://www.stpe.se/2008/05/appfuse-generate-netbeans-project-files/#comments</comments>
		<pubDate>Fri, 23 May 2008 13:24:09 +0000</pubDate>
		<dc:creator>stefan</dc:creator>
				<category><![CDATA[coding]]></category>
		<category><![CDATA[appfuse]]></category>
		<category><![CDATA[maven]]></category>
		<category><![CDATA[netbeans]]></category>

		<guid isPermaLink="false">http://www.stpe.se/?p=13</guid>
		<description><![CDATA[Using mvn netbeans:netbeans to generate a NetBeans project from AppFuse failed with the following build error: The plugin &#8216;org.apache.maven.plugins:maven-netbeans-plugin&#8217; does not exist or no valid version could be found Apprently it cannot find the netbeans plugin. To fix this, open the pom.xml of the project and add a new plugin repository: &#60;pluginRepositories&#62; ... keep the [...]]]></description>
			<content:encoded><![CDATA[<p>Using <strong>mvn netbeans:netbeans</strong> to generate a NetBeans project from AppFuse failed with the following build error:</p>
<blockquote><p>The plugin &#8216;org.apache.maven.plugins:maven-netbeans-plugin&#8217; does not exist or no valid version could be found</p></blockquote>
<p>Apprently it cannot find the netbeans plugin. To fix this, open the pom.xml of the project and add a new plugin repository:</p>
<pre>
    &lt;pluginRepositories&gt;

        ... keep the existing one ...

        &lt;pluginRepository&gt;
          &lt;id&gt;agilejava&lt;/id&gt;
          &lt;name&gt;Agilejava&lt;/name&gt;
          &lt;url&gt;http://agilejava.com/maven/&lt;/url&gt;
        &lt;/pluginRepository&gt;
    &lt;/pluginRepositories&gt;
</pre>
<p>That&#8217;s it.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.stpe.se/2008/05/appfuse-generate-netbeans-project-files/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
