Problems in running ant in WebSphere studio site deveoper in bundles
Hi, I am using the WSSD 5.1.2 trial version and I am trying to run an ant script in side a bundle using a java program. It is as follows. package oulu.info.capnet.samples; import java.io.File; import org.apache.tools.ant.Project; import org.apache.tools.ant.ProjectHelper; /** * @Author: Tharanga Wijethilake * @Time : 10:54:25 */ public class AntRunner implements Runnable{ private String fileName="C:\\Documents and Settings\\tharanga\\My Documents\\IBM\\wssitedev51\\workspace\\Runner\\build.xml"; private static AntRunner ar; private Thread thread; /** * */ public AntRunner() { super(); } /* (non-Javadoc) * @see java.lang.Runnable#run() */ public void run() { antRun(); } public static AntRunner getInstance(){ if(ar==null){ ar=new AntRunner(); } return ar; } public void antRun(){ File buildFile=new File(fileName); if(buildFile.exists()){ Project p=new Project(); p.setUserProperty("ant.file",buildFile.getAbsolutePath()); p.init(); ProjectHelper helper=ProjectHelper.getProjectHelper(); p.addReference("ant.projectHelper", helper); helper.parse(p, buildFile); p.executeTarget(p.getDefaultTarget()); } else{ System.out.println("File not found"); } } public void start(){ thread=new Thread(this); thread.start(); } public void stop(){ thread=null; } } I did Every thing as indicated in the article "Invoking Apache Ant programmatically" (http://www-128.ibm.com/developerworks/websphere/library/techarticles/0502_gawor/0502_gawor.html) and I am tring to run the same ant script given in the article. but when I run the bundle activator it gives the following error. java.lang.NoClassDefFoundError: org/apache/tools/ant/Project at oulu.info.capnet.samples.AntRunner.antRun(AntRunner.java:47) at oulu.info.capnet.samples.AntRunner.run(AntRunner.java:34) at java.lang.Thread.run(Thread.java:513) Can some one suggest me what is wrong with this. I can run the class given in the article as a java application, it is only that I can not run it as a SMF bundle. I hope some one would answer me. Thank you in Advance. Tharanga Wijethilake
AW: Problems in running ant in WebSphere studio site deveoper in bundles
>I am using the WSSD 5.1.2 trial version and I am trying to run >an ant script in side a bundle using a java program. It is as follows. > > >java.lang.NoClassDefFoundError: org/apache/tools/ant/Project Sounds like the Ant jars are not accessible from your bundle Jan - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Check to See If Directory Exists
OK. I looked in the online documentation and read from the book "Java Development With Ant", but neither documented this behavior of . Thanks for your help, Bob Robert Pepersack Senior Lead Developer Maryland Insurance Administration 410-468-2054 >>> [EMAIL PROTECTED] 10/10/2006 4:29 PM >>> > I need to check to see if a directory exists, and if not, then create > the directory. But, if the directory already exists, then leave it > alone, because it may already contain some important files. I have more > than a dozen directories to check for, and I would like to find a way to > do this that's less verbose than a bunch of and > tasks. Does anyone know how? > > Here's the equivalent command from a batch file: > > if not exist c:\myapp mkdir c:\myapp Well, since is a no-op for an existing directory, you don't even need to use . And to process several dirs, either manually write all the s, or select the dirs in a or , and loop over it using Ant-Contrib's task. --DD - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Check to See If Directory Exists
Maybe not documented, but it's not too hard to discover empirically. bash:/work/ant-test/mkdir$ ant Buildfile: build.xml test: [mkdir] Created dir: /work/ant-test/mkdir/test BUILD SUCCESSFUL Total time: 0 seconds bash:/work/ant-test/mkdir$ ant Buildfile: build.xml test: BUILD SUCCESSFUL Total time: 0 seconds James Robert Pepersack wrote: OK. I looked in the online documentation and read from the book "Java Development With Ant", but neither documented this behavior of . Thanks for your help, Bob Robert Pepersack Senior Lead Developer Maryland Insurance Administration 410-468-2054 [EMAIL PROTECTED] 10/10/2006 4:29 PM >>> I need to check to see if a directory exists, and if not, then create the directory. But, if the directory already exists, then leave it alone, because it may already contain some important files. I have more than a dozen directories to check for, and I would like to find a way to do this that's less verbose than a bunch of and tasks. Does anyone know how? Here's the equivalent command from a batch file: if not exist c:\myapp mkdir c:\myapp Well, since is a no-op for an existing directory, you don't even need to use . And to process several dirs, either manually write all the s, or select the dirs in a or , and loop over it using Ant-Contrib's task. --DD - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
AW: Check to See If Directory Exists
Ok, not everyone does have a look into the source ;-) oata.taskdefs.MKdir.java:036: public class Mkdir extends Task { oata.taskdefs.MKdir.java: :... oata.taskdefs.MKdir.java:048:public void execute() throws BuildException { oata.taskdefs.MKdir.java: :... oata.taskdefs.MKdir.java:059:if (!dir.exists()) { oata.taskdefs.MKdir.java:060:boolean result = mkdirs(dir); I'll put a not into the manual (revision 462786). Jan >-Ursprüngliche Nachricht- >Von: Robert Pepersack [mailto:[EMAIL PROTECTED] >Gesendet: Mittwoch, 11. Oktober 2006 14:07 >An: user@ant.apache.org >Betreff: Re: Check to See If Directory Exists > >OK. I looked in the online documentation and read from the >book "Java Development With Ant", but neither documented this >behavior of . > >Thanks for your help, > >Bob > >Robert Pepersack >Senior Lead Developer >Maryland Insurance Administration >410-468-2054 > [EMAIL PROTECTED] 10/10/2006 4:29 PM >>> >> I need to check to see if a directory exists, and if not, then >create >> the directory. But, if the directory already exists, then leave it >> alone, because it may already contain some important files. I have >more >> than a dozen directories to check for, and I would like to find a way >to >> do this that's less verbose than a bunch of and > >> tasks. Does anyone know how? >> >> Here's the equivalent command from a batch file: >> >> if not exist c:\myapp mkdir c:\myapp > >Well, since is a no-op for an existing directory, you >don't even need to use . And to process several >dirs, either manually write all the s, or select the >dirs in a or , and loop over it using >Ant-Contrib's task. --DD > >- >To unsubscribe, e-mail: [EMAIL PROTECTED] For >additional commands, e-mail: [EMAIL PROTECTED] > > >- >To unsubscribe, e-mail: [EMAIL PROTECTED] >For additional commands, e-mail: [EMAIL PROTECTED] > > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: AW: Check to See If Directory Exists
Thanks everybody! Your responsiveness is part of why, as a new person to Ant, I love it already. In comparision to other forums I've posted questions to in the past, this forum is by far the best I've seen. Bob >>> [EMAIL PROTECTED] 10/11/2006 8:27 AM >>> Ok, not everyone does have a look into the source ;-) oata.taskdefs.MKdir.java:036: public class Mkdir extends Task { oata.taskdefs.MKdir.java: :... oata.taskdefs.MKdir.java:048:public void execute() throws BuildException { oata.taskdefs.MKdir.java: :... oata.taskdefs.MKdir.java:059:if (!dir.exists()) { oata.taskdefs.MKdir.java:060:boolean result = mkdirs(dir); I'll put a not into the manual (revision 462786). Jan >-Ursprüngliche Nachricht- >Von: Robert Pepersack [mailto:[EMAIL PROTECTED] >Gesendet: Mittwoch, 11. Oktober 2006 14:07 >An: user@ant.apache.org >Betreff: Re: Check to See If Directory Exists > >OK. I looked in the online documentation and read from the >book "Java Development With Ant", but neither documented this >behavior of . > >Thanks for your help, > >Bob > >Robert Pepersack >Senior Lead Developer >Maryland Insurance Administration >410-468-2054 > [EMAIL PROTECTED] 10/10/2006 4:29 PM >>> >> I need to check to see if a directory exists, and if not, then >create >> the directory. But, if the directory already exists, then leave it >> alone, because it may already contain some important files. I have >more >> than a dozen directories to check for, and I would like to find a way >to >> do this that's less verbose than a bunch of and > >> tasks. Does anyone know how? >> >> Here's the equivalent command from a batch file: >> >> if not exist c:\myapp mkdir c:\myapp > >Well, since is a no-op for an existing directory, you >don't even need to use . And to process several >dirs, either manually write all the s, or select the >dirs in a or , and loop over it using >Ant-Contrib's task. --DD > >- >To unsubscribe, e-mail: [EMAIL PROTECTED] For >additional commands, e-mail: [EMAIL PROTECTED] > > >- >To unsubscribe, e-mail: [EMAIL PROTECTED] >For additional commands, e-mail: [EMAIL PROTECTED] > > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] Robert Pepersack Senior Lead Developer Maryland Insurance Administration 410-468-2054 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Problems in running ant in WebSphere studio site deveoper in bundles
Thank you for the reply. Yes it seems so. but I did include them in the libraries in the build path. Trying to figure out what else I should do. Still have the same problem. Thank you. Tharanga Wijethilake - Original Message - From: <[EMAIL PROTECTED]> To: Sent: Wednesday, October 11, 2006 1:05 PM Subject: AW: Problems in running ant in WebSphere studio site deveoper in bundles >I am using the WSSD 5.1.2 trial version and I am trying to run an ant script in side a bundle using a java program. It is as follows. java.lang.NoClassDefFoundError: org/apache/tools/ant/Project Sounds like the Ant jars are not accessible from your bundle Jan - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
AW: Problems in running ant in WebSphere studio site deveoper in bundles
But does WSSD use that "build path"? Do you have to configure WSSD to include the Ant libs? Jan >-Ursprüngliche Nachricht- >Von: tharanga wijethilake [mailto:[EMAIL PROTECTED] >Gesendet: Mittwoch, 11. Oktober 2006 14:40 >An: Ant Users List >Betreff: Re: Problems in running ant in WebSphere studio site >deveoper in bundles > >Thank you for the reply. Yes it seems so. but I did include >them in the libraries in the build path. Trying to figure out >what else I should do. >Still have the same problem. >Thank you. >Tharanga Wijethilake > >- Original Message - >From: <[EMAIL PROTECTED]> >To: >Sent: Wednesday, October 11, 2006 1:05 PM >Subject: AW: Problems in running ant in WebSphere studio site >deveoper in bundles > > >> >I am using the WSSD 5.1.2 trial version and I am trying to run >>>an ant script in side a bundle using a java program. It is >as follows. >>> >>> >>>java.lang.NoClassDefFoundError: org/apache/tools/ant/Project >> >> >> Sounds like the Ant jars are not accessible from your bundle >> >> >> Jan >> >> - >> To unsubscribe, e-mail: [EMAIL PROTECTED] For >additional >> commands, e-mail: [EMAIL PROTECTED] >> >> > > >- >To unsubscribe, e-mail: [EMAIL PROTECTED] For >additional commands, e-mail: [EMAIL PROTECTED] > > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Problems in running ant in WebSphere studio site deveoper in bundles
I think the problem is that I have to specify the imported jars in the MANIFEST.MF file but it does not allow me to do so. I have to figure out how external packages can be imported in to the bundle. I think that is some thing to be handled in WebSphere IDE. Thanks for the reply. Tharanga Wijethilake - Original Message - From: <[EMAIL PROTECTED]> To: Sent: Wednesday, October 11, 2006 3:49 PM Subject: AW: Problems in running ant in WebSphere studio site deveoper in bundles But does WSSD use that "build path"? Do you have to configure WSSD to include the Ant libs? Jan -Ursprüngliche Nachricht- Von: tharanga wijethilake [mailto:[EMAIL PROTECTED] Gesendet: Mittwoch, 11. Oktober 2006 14:40 An: Ant Users List Betreff: Re: Problems in running ant in WebSphere studio site deveoper in bundles Thank you for the reply. Yes it seems so. but I did include them in the libraries in the build path. Trying to figure out what else I should do. Still have the same problem. Thank you. Tharanga Wijethilake - Original Message - From: <[EMAIL PROTECTED]> To: Sent: Wednesday, October 11, 2006 1:05 PM Subject: AW: Problems in running ant in WebSphere studio site deveoper in bundles >I am using the WSSD 5.1.2 trial version and I am trying to run an ant script in side a bundle using a java program. It is as follows. java.lang.NoClassDefFoundError: org/apache/tools/ant/Project Sounds like the Ant jars are not accessible from your bundle Jan - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: java.lang.InstantiationException:org.apache.tools.ant.Main
even i solved this problem after seeing what Arthi had done. Thanks a ton. Arti Singh wrote: > > Hi thanks, > I figured that out the hard way on ffriday.I had placed > weblogic.jar in my classpath , and hence my ant did no work.Problem solved > .I just placed the jar file in ant lib. > Thanks > Arti > > __ > Do You Yahoo!? > Tired of spam? Yahoo! Mail has the best spam protection around > http://mail.yahoo.com > -- View this message in context: http://www.nabble.com/java.lang.InstantiationException%3Aorg.apache.tools.ant.Main-tf164237.html#a6761383 Sent from the Ant - Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
How To Jail Ant Script by Options
Hi everybody. I use cruise control over Ant. And i've many projects managed by cruise control on different folders. How can i avoid that build.xml script can access to upper folder by an ant option. I cant lock build.xml content so i need to jail each script execution in it folder. Could you help me? Thanks, Kalden Administrator of http://dev.labo-linux.org - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Quiet output
I'm writing a build.xml file that tests a program. Before using ANT, I had a bash script that printed the results like init.d scripts do when started/stopped. For instance, for an input file to be tested, called mtp.mtp, it printed something like mtp.mtp [OK] if everything went ok, and mtp.mtp [!!] if something went wrong. In both cases, the real output was saved in a log file. Now I'm using ANT, I'd like it to be the same way, but the output happens to be way too verbose unless ANT is called with -quiet. Is there any way to force this quiet flag, or to hide the commands output? I don't like ANT to prefix the output with the command that produced it either. For instance, if I write Message ant prints something like [echo] Message Is there any way to hide that too? Cheers. smime.p7s Description: S/MIME Cryptographic Signature
Filterchaining individual property
is there a way to filterchain an individual property? The *org.apache.catalina.ant.ServerinfoTask *somehow supports the outputproperty attribute anyway, i only want the first line of that property.
Re: Filterchaining individual property
Tomcat's tasks support nested I/O redirectors. You should be able to specify an outputfilterchain with an outputproperty here. HTH, Matt --- Hunter Peress <[EMAIL PROTECTED]> wrote: > is there a way to filterchain an individual > property? > > The *org.apache.catalina.ant.ServerinfoTask *somehow > supports the > outputproperty attribute > > anyway, i only want the first line of that property. > __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Filterchaining individual property
Hi Matt, The type doesn't support the nested "outputfilterchain" element. On 10/11/06, Matt Benson <[EMAIL PROTECTED]> wrote: Tomcat's tasks support nested I/O redirectors. You should be able to specify an outputfilterchain with an outputproperty here. HTH, Matt --- Hunter Peress <[EMAIL PROTECTED]> wrote: > is there a way to filterchain an individual > property? > > The *org.apache.catalina.ant.ServerinfoTask *somehow > supports the > outputproperty attribute > > anyway, i only want the first line of that property. > __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Filterchaining individual property
OK fixed. http://localhost:8080/manager"; username="" password="" outputproperty="HI" > ${HI} it didnt matter that I gave redirector an output property but i needed to give the ant task an outputproperty On 10/11/06, Hunter Peress <[EMAIL PROTECTED]> wrote: Hi Matt, The type doesn't support the nested "outputfilterchain" element. On 10/11/06, Matt Benson < [EMAIL PROTECTED]> wrote: > > Tomcat's tasks support nested I/O redirectors. You > should be able to specify an outputfilterchain with an > outputproperty here. > > HTH, > Matt > > --- Hunter Peress <[EMAIL PROTECTED]> wrote: > > > is there a way to filterchain an individual > > property? > > > > The *org.apache.catalina.ant.ServerinfoTask *somehow > > supports the > > outputproperty attribute > > > > anyway, i only want the first line of that property. > > > > > __ > Do You Yahoo!? > Tired of spam? Yahoo! Mail has the best spam protection around > http://mail.yahoo.com > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > >
Re: Filterchaining individual property
It woud still be easiest if you could give any property to a filterchain instead of having to implement I/O redirection for everything. On 10/11/06, Hunter Peress <[EMAIL PROTECTED]> wrote: OK fixed. http://localhost:8080/manager"; username="" password="" outputproperty="HI" > ${HI} it didnt matter that I gave redirector an output property but i needed to give the ant task an outputproperty On 10/11/06, Hunter Peress <[EMAIL PROTECTED]> wrote: > > Hi Matt, > > The type doesn't support the nested > "outputfilterchain" element. > > > On 10/11/06, Matt Benson < [EMAIL PROTECTED]> wrote: > > > > Tomcat's tasks support nested I/O redirectors. You > > should be able to specify an outputfilterchain with an > > outputproperty here. > > > > HTH, > > Matt > > > > --- Hunter Peress < [EMAIL PROTECTED]> wrote: > > > > > is there a way to filterchain an individual > > > property? > > > > > > The *org.apache.catalina.ant.ServerinfoTask *somehow > > > supports the > > > outputproperty attribute > > > > > > anyway, i only want the first line of that property. > > > > > > > > > __ > > Do You Yahoo!? > > Tired of spam? Yahoo! Mail has the best spam protection around > > http://mail.yahoo.com > > > > - > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > >
Re: Quiet output
You might want to look at the -emacs command line option to surpress the 'prefixing' that appears on the output - Original Message From: Iván Pérez Domínguez <[EMAIL PROTECTED]> To: user@ant.apache.org Sent: Wednesday, October 11, 2006 2:54:30 PM Subject: Quiet output I'm writing a build.xml file that tests a program. Before using ANT, I had a bash script that printed the results like init.d scripts do when started/stopped. For instance, for an input file to be tested, called mtp.mtp, it printed something like mtp.mtp [OK] if everything went ok, and mtp.mtp [!!] if something went wrong. In both cases, the real output was saved in a log file. Now I'm using ANT, I'd like it to be the same way, but the output happens to be way too verbose unless ANT is called with -quiet. Is there any way to force this quiet flag, or to hide the commands output? I don't like ANT to prefix the output with the command that produced it either. For instance, if I write Message ant prints something like [echo] Message Is there any way to hide that too? Cheers.