<?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>Jakob Külzer &#187; Flex Modules</title>
	<atom:link href="http://www.jakusys.de/blog/tag/flex-modules/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.jakusys.de/blog</link>
	<description>Ninja Coding Monkey goes Canada</description>
	<lastBuildDate>Sun, 02 Jan 2011 20:12:51 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.3</generator>
		<item>
		<title>Grails GraniteDS Plugin and Flex Modules &#8211; Could not resolve ? to a component implementation</title>
		<link>http://www.jakusys.de/blog/2009/10/grails-graniteds-plugin-and-flex-modules-could-not-resolve-to-a-component-implementation/</link>
		<comments>http://www.jakusys.de/blog/2009/10/grails-graniteds-plugin-and-flex-modules-could-not-resolve-to-a-component-implementation/#comments</comments>
		<pubDate>Fri, 02 Oct 2009 19:30:00 +0000</pubDate>
		<dc:creator>Jakob Külzer</dc:creator>
				<category><![CDATA[Flex]]></category>
		<category><![CDATA[Grails]]></category>
		<category><![CDATA[Flex Modules]]></category>
		<category><![CDATA[Gotcha]]></category>
		<category><![CDATA[GraniteDS]]></category>

		<guid isPermaLink="false">http://www.jakusys.de/blog/?p=1107</guid>
		<description><![CDATA[I'm currently working a lot with the Grails GraniteDS plugin. Just recently I've started to separate my application into modules and ran into a really nasty error. It took me some time to figure it out, hopefully I can save you from going through all this. The Flex web tier compiler usually gives me this [...]]]></description>
			<content:encoded><![CDATA[<p>I'm currently working a lot with the Grails GraniteDS plugin. Just recently I've started to separate my application into modules and ran into a really nasty error.</p>
<p>It took me some time to figure it out, hopefully I can save you from going through all this.</p>
<p>The Flex web tier compiler usually gives me this error:</p>
<pre>Error: Could not resolve &lt;namespace:Component&gt; to a component implementation.

 &lt;namespace:Component/&gt;

error during compilation Could not resolve &lt;namespace:Component&gt; to a component implementation.</pre>
<p>Initial research confirmed what I thought, this error is caused by a mismatch between a XML namespace declaration and the actual location of a component. However the location and the namespace declaration looked right and the issue occurred only <strong>after</strong> I had moved the questionable component into a separate module.</p>
<p>After two painful hours I realized that the Flex webtier compiler, as configured with GraniteDS, <strong>resolves namespaces relative to modules, not relative to the source folder</strong>. D'oh!</p>
<p>The solution I came up with was simple, might be naïve though. I figured that if resolution is relative to the Module and not to the source folder, there might be no such source folder as I would expect it. A quick look into the flex-config.xml found in &lt;GRAILS_PROJ&gt;/web-app/WEB-INF/flex/flex-config.xml confirmed this:</p>
<pre>&lt;!-- List of path elements that form the roots of ActionScript class hierarchies. --&gt;
<strong> &lt;!-- not set --&gt;</strong>
 &lt;!--
 &lt;source-path&gt;
 &lt;path-element&gt;string&lt;/path-element&gt;
 &lt;/source-path&gt;
 --&gt;</pre>
<p>So there is no explicit source path set. So I changed it so it would point to &lt;GRAILS_PROJ&gt;/grails-app/views/flex:</p>
<pre>&lt;!-- List of path elements that form the roots of ActionScript class hierarchies. --&gt;
 &lt;!-- not set --&gt;
 &lt;source-path&gt;
<strong> &lt;path-element&gt;../../../grails-app/views/flex&lt;/path-element&gt;</strong>
 &lt;/source-path&gt;</pre>
<p>Voilá - it works. However, as mentioned earlier, this might be a very limited solution, but for now it works.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jakusys.de/blog/2009/10/grails-graniteds-plugin-and-flex-modules-could-not-resolve-to-a-component-implementation/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

