Skip navigation
Currently Being Moderated

Trouble Building FlexUnit 4

Apr 29, 2010 12:06 AM

Hi all, I downloaded flexunit 4 from github and am trying to run "ant -v clean package" as it says to do in the build.xml file.

 

I am getting a failed build I believe with the following error:

 

BUILD FAILED

/Users/dave/Downloads/flexunit-flexunit-4.0.0-RC2-68-g91fcfdd/build.xm l:57: The following error occurred while executing this line:

/Users/dave/Downloads/flexunit-flexunit-4.0.0-RC2-68-g91fcfdd/FlexUnit 4/build.xml:125: taskdef class com.adobe.ac.pmd.ant.FlexPmdAntTask cannot be found

at org.apache.tools.ant.ProjectHelper.addLocationToBuildException(Projec tHelper.java:508)

at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:418)

at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)

at sun.reflect.GeneratedMethodAccessor1.invoke(Unknown Source)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces sorImpl.java:25)

at java.lang.reflect.Method.invoke(Method.java:597)

at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.jav a:106)

at org.apache.tools.ant.Task.perform(Task.java:348)

at org.apache.tools.ant.Target.execute(Target.java:357)

at org.apache.tools.ant.Target.performTasks(Target.java:385)

at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1337)

at org.apache.tools.ant.Project.executeTarget(Project.java:1306)

at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExe cutor.java:41)

at org.apache.tools.ant.Project.executeTargets(Project.java:1189)

at org.apache.tools.ant.Main.runBuild(Main.java:758)

at org.apache.tools.ant.Main.startAnt(Main.java:217)

at org.apache.tools.ant.launch.Launcher.run(Launcher.java:257)

at org.apache.tools.ant.launch.Launcher.main(Launcher.java:104)

Caused by: /Users/dave/Downloads/flexunit-flexunit-4.0.0-RC2-68-g91fcfdd/FlexUni t4/build.xml:125: taskdef class com.adobe.ac.pmd.ant.FlexPmdAntTask cannot be found

at org.apache.tools.ant.taskdefs.Definer.addDefinition(Definer.java:609)

at org.apache.tools.ant.taskdefs.Definer.execute(Definer.java:228)

at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)

at sun.reflect.GeneratedMethodAccessor1.invoke(Unknown Source)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces sorImpl.java:25)

at java.lang.reflect.Method.invoke(Method.java:597)

at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.jav a:106)

at org.apache.tools.ant.Task.perform(Task.java:348)

at org.apache.tools.ant.Target.execute(Target.java:357)

at org.apache.tools.ant.Target.performTasks(Target.java:385)

at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1337)

at org.apache.tools.ant.helper.SingleCheckExecutor.executeTargets(Single CheckExecutor.java:38)

at org.apache.tools.ant.Project.executeTargets(Project.java:1189)

at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:416)

... 16 more

Caused by: java.lang.ClassNotFoundException: com.adobe.ac.pmd.ant.FlexPmdAntTask

at org.apache.tools.ant.AntClassLoader.findClassInComponents(AntClassLoa der.java:1400)

at org.apache.tools.ant.AntClassLoader.findClass(AntClassLoader.java:134 1)

at org.apache.tools.ant.AntClassLoader.loadClass(AntClassLoader.java:108 8)

at java.lang.ClassLoader.loadClass(ClassLoader.java:250)

at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:398)

at java.lang.Class.forName0(Native Method)

at java.lang.Class.forName(Class.java:247)

at org.apache.tools.ant.taskdefs.Definer.addDefinition(Definer.java:583)

... 29 more

--- Nested Exception ---

/Users/dave/Downloads/flexunit-flexunit-4.0.0-RC2-68-g91fcfdd/FlexUnit 4/build.xml:125: taskdef class com.adobe.ac.pmd.ant.FlexPmdAntTask cannot be found

at org.apache.tools.ant.taskdefs.Definer.addDefinition(Definer.java:609)

at org.apache.tools.ant.taskdefs.Definer.execute(Definer.java:228)

at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)

at sun.reflect.GeneratedMethodAccessor1.invoke(Unknown Source)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces sorImpl.java:25)

at java.lang.reflect.Method.invoke(Method.java:597)

at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.jav a:106)

at org.apache.tools.ant.Task.perform(Task.java:348)

at org.apache.tools.ant.Target.execute(Target.java:357)

at org.apache.tools.ant.Target.performTasks(Target.java:385)

at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1337)

at org.apache.tools.ant.helper.SingleCheckExecutor.executeTargets(Single CheckExecutor.java:38)

at org.apache.tools.ant.Project.executeTargets(Project.java:1189)

at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:416)

at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)

at sun.reflect.GeneratedMethodAccessor1.invoke(Unknown Source)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces sorImpl.java:25)

at java.lang.reflect.Method.invoke(Method.java:597)

at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.jav a:106)

at org.apache.tools.ant.Task.perform(Task.java:348)

at org.apache.tools.ant.Target.execute(Target.java:357)

at org.apache.tools.ant.Target.performTasks(Target.java:385)

at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1337)

at org.apache.tools.ant.Project.executeTarget(Project.java:1306)

at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExe cutor.java:41)

at org.apache.tools.ant.Project.executeTargets(Project.java:1189)

at org.apache.tools.ant.Main.runBuild(Main.java:758)

at org.apache.tools.ant.Main.startAnt(Main.java:217)

at org.apache.tools.ant.launch.Launcher.run(Launcher.java:257)

at org.apache.tools.ant.launch.Launcher.main(Launcher.java:104)

Caused by: java.lang.ClassNotFoundException: com.adobe.ac.pmd.ant.FlexPmdAntTask

at org.apache.tools.ant.AntClassLoader.findClassInComponents(AntClassLoa der.java:1400)

at org.apache.tools.ant.AntClassLoader.findClass(AntClassLoader.java:134 1)

at org.apache.tools.ant.AntClassLoader.loadClass(AntClassLoader.java:108 8)

at java.lang.ClassLoader.loadClass(ClassLoader.java:250)

at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:398)

at java.lang.Class.forName0(Native Method)

at java.lang.Class.forName(Class.java:247)

at org.apache.tools.ant.taskdefs.Definer.addDefinition(Definer.java:583)

... 29 more

--- Nested Exception ---

java.lang.ClassNotFoundException: com.adobe.ac.pmd.ant.FlexPmdAntTask

at org.apache.tools.ant.AntClassLoader.findClassInComponents(AntClassLoa der.java:1400)

at org.apache.tools.ant.AntClassLoader.findClass(AntClassLoader.java:134 1)

at org.apache.tools.ant.AntClassLoader.loadClass(AntClassLoader.java:108 8)

at java.lang.ClassLoader.loadClass(ClassLoader.java:250)

at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:398)

at java.lang.Class.forName0(Native Method)

at java.lang.Class.forName(Class.java:247)

at org.apache.tools.ant.taskdefs.Definer.addDefinition(Definer.java:583)

at org.apache.tools.ant.taskdefs.Definer.execute(Definer.java:228)

at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)

at sun.reflect.GeneratedMethodAccessor1.invoke(Unknown Source)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces sorImpl.java:25)

at java.lang.reflect.Method.invoke(Method.java:597)

at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.jav a:106)

at org.apache.tools.ant.Task.perform(Task.java:348)

at org.apache.tools.ant.Target.execute(Target.java:357)

at org.apache.tools.ant.Target.performTasks(Target.java:385)

at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1337)

at org.apache.tools.ant.helper.SingleCheckExecutor.executeTargets(Single CheckExecutor.java:38)

at org.apache.tools.ant.Project.executeTargets(Project.java:1189)

at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:416)

at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)

at sun.reflect.GeneratedMethodAccessor1.invoke(Unknown Source)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces sorImpl.java:25)

at java.lang.reflect.Method.invoke(Method.java:597)

at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.jav a:106)

at org.apache.tools.ant.Task.perform(Task.java:348)

at org.apache.tools.ant.Target.execute(Target.java:357)

at org.apache.tools.ant.Target.performTasks(Target.java:385)

at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1337)

at org.apache.tools.ant.Project.executeTarget(Project.java:1306)

at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExe cutor.java:41)

at org.apache.tools.ant.Project.executeTargets(Project.java:1189)

at org.apache.tools.ant.Main.runBuild(Main.java:758)

at org.apache.tools.ant.Main.startAnt(Main.java:217)

at org.apache.tools.ant.launch.Launcher.run(Launcher.java:257)

at org.apache.tools.ant.launch.Launcher.main(Launcher.java:104)

 

Total time: 18 seconds

 

Thanks for any help!

 
Replies 1 2 Previous Next
  • Currently Being Moderated
    Apr 29, 2010 6:00 AM   in reply to mdmave

    i dont know that this has been tested on air two yet. i will try to reproduce.

     
    |
    Mark as:
  • Currently Being Moderated
    Apr 29, 2010 6:24 AM   in reply to mdmave

    @mdmave - The build we use has a dependency on FlexPMD, FlexCPD, and FlexMetrics.  For now we don't bundle it with our build, so if you download the appropriate JARs and add them to your Ant libs directory that should solve the issue (use Ant installation instructions -- http://opensource.adobe.com/wiki/display/flexpmd/FlexPMD).  If you don't want to mess with FlexPMD, then you can go into /FlexUnit4/build.xml project and comment lines 125-139 and it shoudl run w/o the hooks into FlexPMD.  Also a note, if you're attempting to use the Ant task with player="air" and functionality from AIR 2.0 in your test SWF, it may not work as the namespace on the descriptor is for AIR 1.5.  That being said, I'll add another hook to specify the version of the AIR SDK, being used so we can avoid this problem going forward.

     

    -Brian

     
    |
    Mark as:
  • Currently Being Moderated
    Apr 29, 2010 12:12 PM   in reply to mdmave

    @mdmave - Just to be clear, to use FlexUnit4, you don't have to build it from source to use and/or distribute it.  http://flexunit.org has the FlexUnit4 library available for download and we have a CI server which offers the latest bleeding edge builds of the library build against almost every Flex 3 and 4 SDK @ http://builds.flexunit.org.  What's your goal in building FlexUnit4 from source?  Do you have a customization you'd like to add to FlexUnit4 requiring a fresh build?

     

    As far as getting FlexPMD to work with Ant on your machine with respect to our build, on MacOSX you can place the JARs that came with the zip for the Ant tasks into the /usr/share/ant/lib folder.  Try commenting out the suggested lines in the FlexUnit4/build.xml script first to get the build working and then if you'd like to add FlexPMD reporting for a custom build, give it a shot.  I think you'll find less hurdles that way.

     

    -Brian

     
    |
    Mark as:
  • Currently Being Moderated
    Apr 29, 2010 1:01 PM   in reply to mdmave

    Inside that flexunit4-flex4 area that you found, you should see a zip file named flexunit.zip (no version number)

     

    Download that and extract it. There is a jar file, along with a bunch of swcs inside of it. You likely only need to the flexunit-core* and the flexunit-uiListener* from this zip. Take those files and drop them into the libs folder of your Flex project.

     

    You will now have access to the FlexUnit framework.

     

    The turnkey main main file (http://github.com/flexunit/flexunit/blob/master/FlexUnit4Turnkey/src/F lexUnit4Turnkey.mxml) should give you a good idea of how to run tests. Basically, whatever is passed to run, is introspected and executed.

     

    HTH,

    Mike

     
    |
    Mark as:
  • Currently Being Moderated
    May 4, 2010 5:12 AM   in reply to mdmave

    any chance you could get me a whole project to look at? i really want to try to debug this one and understand what is happening.

     

    mike

     
    |
    Mark as:
  • Currently Being Moderated
    May 4, 2010 5:14 AM   in reply to Michael Labriola

    also, once we have this figured out, would you mind making that post into a wiki page on flexunit.org to help others?

     
    |
    Mark as:
  • Currently Being Moderated
    May 4, 2010 1:42 PM   in reply to mdmave

    Thanks so much.

     

    That error is a really, really bad one. In FlexUnit 4 we needed to separate the idea of a method closure from a test completion.. meaning that just because a method completes... and perhaps even the entire call stack completes, doesn't mean the test is complete and the framework should go on. There could be something async, or we could just be pausing to let Flash Player advance a frame and not time out.

     

    This error means that a given portion of the callstack completed and then... later, it was asked to complete again. This can never happen under normal conditions so most likely it means something (let's call it test A) was thought to have failed via timeout or some other method, the framework proceeded and then the test A completed... very bad indeed.

     

    So, this has my full attention. I will let you know what I find.

     

    Mike

     
    |
    Mark as:
  • Currently Being Moderated
    May 4, 2010 1:44 PM   in reply to mdmave

    that's interesting. You might notice 'C:\Users\dmoore' in the path of the error. dMoore is a developer here at digital primates. That concerns me as it means that particular code was build on his machine. There shouldn't be anything running on your side not built from our build system or your machine, so I need to track out how this is happening,

     

    I am now guessing we have an incompatible version of a library somewhere in the library path we need to find.

     

    Mike

     
    |
    Mark as:
  • Currently Being Moderated
    May 5, 2010 7:35 PM   in reply to mdmave

    @mdmave - If you look into the build script you're running, the anttasks goal just builds the FU4 Ant task and nothing else, so the build isn't lying, it's produced a JAR for you in the FlexUnit4AntTask/target directory.  If you want to build the entire library and its supplemental libraries, try running "ant -v clean package" as suggested in the build file.  Please note, that you will need to have FlexPMD, FlexCPD, and FlexMetrics on your Ant library class path to use the build in its current state.  The error you're seeing when running "ant core" is because these libraries are not available to Ant.  If you don't feel like digging into FlexPMD and its cousins, just comment out lines 125-139 in FlexUnit4/build.xml (http://github.com/flexunit/flexunit/blob/master/FlexUnit4/build.xml) and run "ant -v clean package".  In the next release we have a flag that will turn off PMD checks, it is not currently available in the flexunit master branch as of yet.

     

    Let me know how it goes or if I can help any further.

     

    -Brian


     
    |
    Mark as:
  • Currently Being Moderated
    May 6, 2010 4:10 PM   in reply to mdmave

    Just wanted to let you know I am working on this.... only problem is I have not been able to make it fail.

     

    Even running the swfs, without rebuilding, right out fo the project you sent, they all succeed.

     

    Not giving up, jet letting you know,

    Mike

     
    |
    Mark as:
  • Currently Being Moderated
    May 11, 2010 1:37 PM   in reply to Michael Labriola

    I just wanted to mention that I've also see the "Whoa... been asked to send another complete and I already did that" error message before while running Turnkey project. Whenever I tried to run the unit tests in the Turnkey project, I would see the error messages somewhere in the middle of the execution and then the unit tests would just hang and never finishes. I haven't messed around with the Turnkey project in a while but I figured I should confirm the existence of the issue.

     
    |
    Mark as:
  • Currently Being Moderated
    May 11, 2010 2:12 PM   in reply to sanggpark

    Were you in builder or ant when you saw this?

     
    |
    Mark as:
  • Currently Being Moderated
    May 11, 2010 2:57 PM   in reply to Michael Labriola

    I don't think I was using ant.... yeah I was just trying to run unit test. So I was just clicking on "Execute FlexUnit Tests" to run the tests

     
    |
    Mark as:
  • Currently Being Moderated
    May 11, 2010 5:42 PM   in reply to Michael Labriola

    that's interesting. You might notice 'C:\Users\dmoore' in the path of the error. dMoore is a developer here at digital primates. That concerns me as it means that particular code was build on his machine. There shouldn't be anything running on your side not built from our build system or your machine, so I need to track out how this is happening,

     

    I am now guessing we have an incompatible version of a library somewhere in the library path we need to find.

     

    Mike

     

    So I was writing unit test and looking at stack trace and just realized I also see C:\Users\dmoore\ in several different places. I was using lib file from the Turnkey project and that's probably what was causing that. I switched to the swc file from the website and

     

    at flex.lang.reflect::Method/apply()[C:\Users\dmoore\Documents\_Producti on\Flex Unit 4\GIT\FlexUnit4\src\flex\lang\reflect\Method.as:208]

    is now

    at flex.lang.reflect::Method/apply()[E:\hudson\jobs\FlexUnit4-Flex3.5\wo rkspace\FlexUnit4\src\flex\lang\reflect\Method.as:208]

     

    so he's probably doing something similar.

     
    |
    Mark as:
  • Currently Being Moderated
    May 11, 2010 5:53 PM   in reply to sanggpark

    Yep, I am guessing the turnkey project is having a build issue because, try as I may, I have not been able to reproduce this issue on any machine with the actual code base.

     

    I am going to try grabbing the turnkey directly and reproducing this that way just to be sure I can see the issue,

    Mike

     
    |
    Mark as:
  • Currently Being Moderated
    May 19, 2010 12:00 PM   in reply to mdmave

    Yep, a couple of things, which is why it was a pain to diagnose.

     

    First, the libraries in the turnkey project were not being properly updated in all cases, so some were out of sync causing issue #1

     

    Second, we identified an issue in the difference of the split() method of the Array class running on Mac versus PC in some specific circumstances. Still working on this one with Adobe.

     

    We were planning to let you know this was fixed in the next day or so after we heard back on the Array issue, but you beat me to the punch.

     

    Mike

     
    |
    Mark as:
  • Currently Being Moderated
    May 19, 2010 12:10 PM   in reply to mdmave

    If you are going to build in Flash Builder, you will also need to import the UIListener project (and maybe the CIListener) into your workspace, then all should be well.

     

    Mike

     
    |
    Mark as:
  • Currently Being Moderated
    May 19, 2010 12:26 PM   in reply to mdmave

    The error with the ant script is the one Brian mentioned earlier in the thread, it is looking for flex pmd, which you likely don't have.

     

    Regarding FB resolving this to a component, it looks at the namespace and then finds a matching library which uses that namespace, in this case the UIListener... is there any more information in your Flash Builder error you can provide. This is how I build every day for dev so I know it works.,.. I jut need to understand what is different about your environment.

     

    Are you Flex Builder or Flash Builder, version?

    Mac or PC?

     

    Mike

     
    |
    Mark as:
  • Currently Being Moderated
    May 19, 2010 12:30 PM   in reply to mdmave

    @mdmave - Try running:

     

    ant -v -DskipPmd=true clean package

     

    I will try to make skipping PMD a default in future updates.

     

    This will produce the flexunit.zip file in the working directory from which the ant script was run.  Inside the zip is the turnkey project with the libraries built into it.  We've also included the sample CI project for those interested in playing with it.  You should be able to open the turnkey project with Flex/Flash Builder and have things work correctly.  Let me know if they do not so I can update the build.

     

    -Brian

     
    |
    Mark as:
  • Currently Being Moderated
    May 19, 2010 12:39 PM   in reply to mdmave

    Thanks. You are building the Flex UI as a Flex 4 project. However, it is actually a Flex 3 project.

     

    Between those versions, the UI was the big change. So, even if the remainder of your project is Flex 4 (which is not a problem) you need to build the UI in Flex 3 and all will be well.

     

    Mike

     
    |
    Mark as:
  • Currently Being Moderated
    May 19, 2010 12:57 PM   in reply to mdmave

    @mdmave - If you're using Mike's 4.1 branch, you won't find the latest build updates.  simb's and my fork have the build changes.  I haven't had a chance to pull in all of Mike's latest changes however.  Maybe we can get some pull requests into Sim between Mike and I and get an integraiton build out there for everyone.  I'll try to get the ball rolling.

     

    -Brian

     
    |
    Mark as:
  • Currently Being Moderated
    May 19, 2010 1:02 PM   in reply to legrosb

    Hmm, nm, looks like the main master was updated a few days, guess you're running that.  I probably just need to catch up then.

     

    -Brian

     
    |
    Mark as:
  • Currently Being Moderated
    Feb 22, 2011 2:53 PM   in reply to mdmave

    Are you using the Flex 3 or 4 release?

     

    I'd appreciate if you could download our 4.1 RC2 development release and see if you have the same issue.  The Flex 4 version can be found here

     

    http://www.flexunit.org/releases/flexunit-4.1.0_RC2-4-4.1.0.16076.zip

     

    Thanks,

     

    Simeon Bateman

     

    Principal Instigator

    PNW Rain LLC

    simeon@pnwrain.com

    503-616-4405

     
    |
    Mark as:
1 2 Previous Next

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points