View unanswered posts | View active topics



Reply to topic  [ 14 posts ] 
Error: Could not resolve to a component implementation. 
Author Message
Member

Joined: Fri Feb 13, 2009 3:34 am
Posts: 9
C:\projects\as3\com\degrafa\BarRenderer_Animated.mxml(83): Error: Could not resolve <degrafa:RoundedRectangle> to a component implementation.

Here's my code:
Code:
<mx:Canvas xmlns:mx="http://www.adobe.com/2006/mxml"
   xmlns:degrafa="com.degrafa.*"
   xmlns:Geometry="com.degrafa.geometry.*"
   xmlns:RoundedRectangle="com.degrafa.geometry.RoundedRectangle"
   xmlns:RoundedRectangleComplex="com.degrafa.geometry.RoundedRectangleComplex"
   xmlns:Paint="com.degrafa.paint.*"
   left="0" right="3"
   implements="mx.controls.listClasses.IDropInListItemRenderer"
    creationComplete="initListener()">
...
import com.degrafa.*;
import com.degrafa.geometry.*;
import com.degrafa.geometry.RoundedRectangle;
import com.degrafa.geometry.RoundedRectangleComplex;
...
// line 83
<degrafa:RoundedRectangle y="1" cornerRadius="2" id="bar1" graphicsTarget="{[this]}"  >
...
</degrafa:RoundedRectangle>


I also tried a combination of adding/removing certain import and namespace directives. I also tried changing the namespace for degrafa to: xmlns:degrafa="http://www.degrafa.com/2007".

Here's my directory structure:
Code:
C:\projects\twohour\chatSource - project directory
C:\projects\twohour\chatSource\src\org\davekeen\xiffer\view\components - mxml components directory:
C:\projects\as3\com\degrafa - degrafa (class files?) directory


My classpaths:
Code:
project classpaths: src, ../../as3
global classpaths: [none]


I tried putting the degrafa .mxml files in my main application directory (mxml components directory - location defined above). Then I tried putting them in the degrafa class files directory (location defined above). I'm builder using MVC though can't imagine that matters.

Help!


Sat Mar 07, 2009 6:16 pm
Profile
Admin

Joined: Wed Aug 31, 2005 7:27 am
Posts: 11548
Location: Paris, France
Did you add Degrafa SWC in your project, then in the project panel, right-click > Add to library?


Sun Mar 08, 2009 10:26 am
Profile WWW
Member

Joined: Fri Feb 13, 2009 3:34 am
Posts: 9
Thank you SO MUCH for the reply.

I didn't think I needed to add the SWC since I was adding the directory structure? (ie the .com.degrafa... folder with all those .as files) Do I need both or do I just need one or the other? I'll try adding the SWC now.

Thanks again!


Sun Mar 08, 2009 1:00 pm
Profile
Admin

Joined: Wed Aug 31, 2005 7:27 am
Posts: 11548
Location: Paris, France
Actually your classpath seems right - Degrafa sourcecode should be enough.

Still I'd suggest to reference the SWC (it contains manifest information for MXML) and look again at Degrafa doc & samples: the many xmlns declarations in your MXML don't look right.


Sun Mar 08, 2009 1:29 pm
Profile WWW
Member

Joined: Wed Apr 16, 2008 9:21 am
Posts: 17
Location: New Zealand
Hi, I think I can help. I'm one of the degrafa devs and all my contributions to degrafa have all been coded in ... FD :D .

You should just need/use a single namespace to access all the relevant mxml classes like Philippe suggests. But if you're using source code instead of the swc, you need to set up a reference to the manifest.xml in your project's compiler options in FlashDevelop, in addition to setting up the class paths, to support use of the namespace for the classes specified in the manifest in your mxml.

You need to put this line in Project settings->Compiler Options->Advanced Compiler Options:

-namespace http://www.degrafa.com/2007 D:\dev\beta3.2\Degrafa\manifest.xml
(change the second part - the file path- to point to the manifest.xml file in your degrafa classpath).

After this you just need to put in the single degrafa namespace mapping to xmlns:degrafa="http://www.degrafa.com/2007"

Hopefullt that should work...it does for me.


Sun Mar 08, 2009 9:01 pm
Profile WWW
Member

Joined: Fri Feb 13, 2009 3:34 am
Posts: 9
GWD and Phillipe, very much appreciate the help.

***GWD I didn't follow or have the exact path you described but guessing this is the same as what you said:
project -> properties -> compiler options (tab) -> (Advanced Section) / Additional compiler options

There was a String[] Array section where I clicked on ... button which gave me a screen and told me to enter strings in the collection. This is where I put this line:

namespace http://www.degrafa.com/2007 C:\Documents and Settings\wgardner\Desktop\Degrafa_Beta3.1_Source\manifest.xml

I copied the c:\.....(path to xml) into a browser to double check, and it pulled open the manifext.xml file that I got from Degrafa. So I know my path is right. However, when I try to build it, I don't get ANY errors, I just get "build failed". Wish that there are no errors to search that. I also tried with the "dash -" in front of the word namespace, but nothing. As soon as I take this out, the project builds and runs fine (so long as I comment out the calls to Degrafa components).

***Phillipe, I did try the SWC, but it didn't work right away, but I will take a closer look at it later. I assume the SWC can be put anywhere, but I did a right click and selected "add to library"? Maybe I have to remove namespaces or import statements. I'll try it some more.

Thanks.


Mon Mar 09, 2009 1:50 am
Profile
Admin

Joined: Wed Aug 31, 2005 7:27 am
Posts: 11548
Location: Paris, France
The dash is required - check in the Output panel (View menu) what exactly the compiler says.


Mon Mar 09, 2009 8:42 am
Profile WWW
Member

Joined: Fri Feb 13, 2009 3:34 am
Posts: 9
OK, after checking the output panel, I saw it didn't like my path "Documents and Settings" -- the space. I put the manifest.xml in a folder without a space. So now it's OK with the advanced compiler option namespace that was set, however, I'm still getting the error:

Code:
C:\projects\twohour\chatSource\src\org\davekeen\xiffer\view\components\ThermometerView.mxml(28): Error: Could not resolve <degrafa:DegrafaDataRenderer> to a component implementation.
<degrafa:DegrafaDataRenderer height="100%" color="#0000ff" width="100%" fontSize="14" fontFamily="Arial Bold" paddingBottom="0" right="0" />
Build halted with errors (fcsh).


If it helps, DegrafaDataRenderer should be referring to DegrafaDataRenderer.mxml which is in the same directory folder in my project as the other mxml files including ThermometerView.mxml which is calling it.

Here is my ThermometerView.mxml:

Code:
<?xml version="1.0" encoding="utf-8"?>
<mx:Box xmlns:mx="http://www.adobe.com/2006/mxml" xmlns:degrafa="http://www.degrafa.com/2007" horizontalScrollPolicy="off" verticalScrollPolicy="off" >
   <mx:Script>
      <![CDATA[
      import org.puremvc.as3.patterns.facade.Facade;
      import org.davekeen.xiffer.ApplicationFacade;
      import mx.controls.Alert;

      private var facade:ApplicationFacade = ApplicationFacade.getInstance();
      
      ]]>
      
   </mx:Script>
   <degrafa:DegrafaDataRenderer height="100%" color="#0000ff" width="100%" fontSize="14" fontFamily="Arial Bold" paddingBottom="0" right="0" />
</mx:Box>


Mon Mar 09, 2009 2:01 pm
Profile
Member

Joined: Fri Feb 13, 2009 3:34 am
Posts: 9
I also tried to "rebuild classpath cache" as well as restart FD. In case it helps, here's the complete output after I try to build:

Code:
Running process: C:\Program Files\FlashDevelop\Tools\fdbuild\fdbuild.exe "C:\projects\twohour\chatSource\chat.as3proj" -ipc e4034c01-437c-4c3f-9caa-5adadf6b3832 -compiler "C:\projects\jabber\flex_sdk_3" -library "C:\Program Files\FlashDevelop\Library"
Using the Flex Compiler Shell.
Building chat
mxmlc -load-config+=obj\chatConfig.xml -debug=true -incremental=true -benchmark=false -namespace http://www.degrafa.com/2007 C:\projects\twohour\manifest.xml -o obj\chat633721838472968750
INITIALIZING: Adobe Flex Compiler SHell (fcsh)
Starting new compile.
Loading configuration file C:\projects\jabber\flex_sdk_3\frameworks\flex-config.xml
Loading configuration file C:\projects\twohour\chatSource\obj\chatConfig.xml
(fcsh)
C:\projects\twohour\chatSource\src\org\davekeen\xiffer\view\components\ThermometerView.mxml(26): Error: Could not resolve <degrafa:DegrafaDataRenderer> to a component implementation.
<degrafa:DegrafaDataRenderer height="100%" color="#0000ff" width="100%" fontSize="14" fontFamily="Arial Bold" paddingBottom="0" right="0" />
Build halted with errors (fcsh).
Done (1)


Mon Mar 09, 2009 2:36 pm
Profile
Member

Joined: Fri Feb 13, 2009 3:34 am
Posts: 9
OK, I think I found a fix or workaround.

Before I explain how I got it to work, note that I had been able to write Degrafa code in my ThermometerView.mxml file and had been able to build, run, and everything as expected. Referring to external mxml components is when I had been getting the error.

#1) I removed the actual actionscript code libraries and used the .SWC instead. I also removed the reference to the manifest.xml file

#2) I changed the namespaces to have the full path to where I put the mxml files. Here's the code I used:
Code:
 xmlns:degrafa="org.davekeen.xiffer.view.components.degrafa.*"

Note that my main app folder which includes ThermometerView.mxml is located at org.davekeen.xiffer.view.components.

#3) So, I thought if the full path worked, specifying the directory directory relative to my current file like this should work too. But oddly it DOESN'T work:
Code:
 xmlns:degrafa="degrafa.*"


Anybody know why?

So I went back to using the original full path, but I was now getting an error in my first mxml component file. So I again put the full path to the component, and, bam!, it all totally works now!:
Code:
<mx:DataGridColumn headerText="Used" dataField="used" itemRenderer="org.davekeen.xiffer.view.components.degrafa.BarRenderer_Animated"/>


#1 - So, is there a way to do this so I don't have to reference everything with full paths?

#2 - On a side note, on 2 of my component pages, it seems I need the following as I've seen quite often:
Code:
xmlns:degrafa="http://www.degrafa.com/2007"


However, when you browse to the URL, the link is broken. So I am assuming when there's a URL for the namespace that it must be how the compiler knows which SWC to use for that namespace?

Thanks for the help guys!


Mon Mar 09, 2009 6:47 pm
Profile
Member

Joined: Wed Apr 16, 2008 9:21 am
Posts: 17
Location: New Zealand
Sorry, I missed the dash earlier when I copied/pasted for the namespace compiler option.

If you are using source code or the swc to set that up, then the degrafa namespace is just for the degrafa library, you shouldn't be trying to use it for your own custom components as well. E.g. there is no 'DegrafaDataRenderer' in the degrafa library, so you should not be using the degrafa namespace for that. And yes, the uri used for the namespace is not necessarily a 'real' live url, it is merely a unique identifier (at least that's how I think of it). It provides a way to map to the manifest.xml (either in the swc or manually set in the compiler options for source code - the swc already has the mapping between the uri and the manifest.xml - which is included inside the swc- so it is already 'known' to the compiler, for the source code you need to specify it). So you only get classes associated with that namespace in mxml that are specified in the associated manifest.xml. I assume that use of manifest files is how mxml code completion support works in Flexbuilder for swc libs.

So the degrafa namespace "http://www.degrafa.com/2007" only recognises the classnames specified in the degrafa manifest.xml (whether it's in the swc or whether you set it up in your compiler options for the source code with the -namespace option ).

You should really be using a different namespace for your own class paths in mxml if you're using them like that, versus the namespace for a library.

If you set up a namespace for a class path then you can only use that namespace to reference the classes in that package (because its not using a manifest.xml to provide specific mappings).

Personally I would do something like:
xmlns:renderers="org.davekeen.xiffer.view.components.degrafa.*"

if that package contains renderers.


This stuff can be difficult to get your head around first up - it was for me anyway, coming from a flash only background to flex - but starts to make sense pretty quickly, I can assure you. I can't say that I know this from reading or formal learning, I just adopted my own use of it from observation of other code snippets online and my own preferences (not always a good thing). I guess that's my way of saying 'this is not expert advice' :)


Mon Mar 09, 2009 8:43 pm
Profile WWW
Member

Joined: Thu Mar 19, 2009 1:06 pm
Posts: 4
I am also running into the problem with spaces in my path to the services-config.xml file, such as "C:/Program Files/etc...". I tried replacing spaces with '%20' with no luck. Is there no current way to include spaces in the path or do I have to currently limit myself to locations without spaces? It's ok if I do, I just want to make sure.


Thu Mar 19, 2009 1:10 pm
Profile
Member

Joined: Fri Feb 13, 2009 3:34 am
Posts: 9
I don't think %20 works for windows filesystems? Try putting using quotes around the whole path or maybe escape spaces with / like:

c:\Documents/ And/ Settings.....

or

"C:\Documents And Settings...."


Thu Mar 19, 2009 2:08 pm
Profile
Member

Joined: Thu Mar 19, 2009 1:06 pm
Posts: 4
No luck with either try. But I did finally get ../ working for backing up one directory so I can just use a relative path now. Thanks for the speedy reply!


Thu Mar 19, 2009 2:33 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 14 posts ] 

Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.