Hi all, I'm trying to embed ant into an application but I have a lot of problems. I have tried to change the classloader, and when I call to java task all works fine but if I put a taskdef ant cannot find the class.
Example: <?xml version="1.0" encoding="ISO-8859-15" ?> <project name="TestLoaderDemonio" default="defecto" basedir="."> <description> Prueba cargador de librerias </description> <taskdef name="mitask" classname="test.TestTask" /> <target name="defecto" description="Único target que se lanza desde QDemonio" > <java classname="test.TestLoaderDemonio" failonerror="true" outputproperty="outputproperty" errorproperty="errorproperty"> <classpath> <pathelement path="${java.class.path}"/> </classpath> </java> <echo message="Out: ${outputproperty}"/> <echo message="Error: ${errorproperty}"/> <mitask mensaje="Lanzamos mi task" /> </target> </project> If I execute ant in the command line all works fine: ant -f buildLoader.xml -lib /home/chuchi/wd/QDemonioTareas/src/test/resources -debug But if I execute the Launcher from a java class, It does not work: public static void main(String[] args) { String args2[] = { "-f", TestLoaderExtDemonio.class.getResource("/buildLoader.xml").getPath(), "-lib", "/home/chuchi/wd/QDemonioTareas/src/test/resources", "-debug" }; Launcher.main(args2); } The error is a ClassNotFoundException (test.TestTask) Can you help me? I have been reading two days in FAQ, List, Google... But I cannot see any solution Regards, Chuchi Pulse para ir al sitio web Jesús Barbero Rodríguez Departamento de Análisis y Programación - Desarrollo tecnológico Zoco Gran Santander, 1ª Planta ■ 39011 Peñacastillo ■ Santander ■ ESPAÑA Tel.: +34 902 233 323 ■ Fax: +34 902 234 280 AVISO LEGAL: Este mensaje contiene información destinada exclusivamente al usuario de destino, pudiendo contener información confidencial o protegida legalmente. Si, por un error de envío o transmisión, ha recibido este mensaje y usted no es el destinatario del mismo, por favor, notifique de este hecho al remitente y no use, informe, distribuya, imprima, copie o difunda este mensaje bajo ningún medio . Cualquier opinión en él contenida, es exclusiva de su autor y no representa necesariamente la opinión de Quiter Servicios Informáticos, S.L. LEGAL WARNING: This e-mail and any attachment, contain information intended solely for the addressee and may contain confidential information or legally protected data. If you are not the intended recipient, please notify the sender and do not use, disclose, distribute, copy, print or rely on this e-mail under any circumstances. The views and opinions expressed are the authorŽs own and do not necessarily reflect those of Quiter Servicios Informáticos, S.L.