これは、サンプル javafx2.1 パッケージからサンプル DataApp アプリケーションを実行するときに直面する課題です。Netbeans 7.1.2、javafx 2.1、glassfish 3.1.2、Java EE6 を実行しています。
DataAppServer プロジェクトを右クリックするか、DataAppClient プロジェクトを右クリックして [実行] をクリックすると、次のエラー メッセージが表示されます。
C:\Users\Staples\Desktop\ITOWER STUDIO\javafx-samples-2.1.1\src\DataApp\DataAppServer\nbproject\build-impl.xml:533: The following error occurred while executing this line:
C:\Users\Staples\Desktop\ITOWER STUDIO\javafx-samples-2.1.1\src\DataApp\DataAppClient\build.xml:48: Problem: failed to create task or type javafx:com.sun.javafx.tools.ant:application
Cause: The name is undefined.
Action: Check the spelling.
Action: Check that any custom tasks/types have been declared.
Action: Check that any <presetdef>/<macrodef> declarations have taken place.
No types or tasks have been defined in this namespace yet
BUILD FAILED (total time: 8 seconds)**
同様の質問で説明されているように、タスク定義タグを追加しようとしましたが、同じエラーが発生します。プロジェクトを開いてMySQLデータベースに接続してもエラーはありませんでした。追加した taskdef タグは次のとおりです。
<taskdef resource="com/sun/javafx/tools/ant/antlib.xml"
uri="javafx:com.sun.javafx.tools.ant"
classpath="C:\Program Files(x86)\Oracle\JavaFX 2.1 SDK\lib\ant-javafx.jar"/>
48 行目は、次の文字列を示しています。
preloaderClass="dataapppreloader.DataAppPreloader"/>
および 533 行目には次のように表示されます。
<ant antfile="${project.DataAppClient}/build.xml" inheritall="false"target="jar">
ここで本当に立ち往生しています。助けが必要。ありがとう。