Re: Force PATH env variable - Enabling .DLL loading

2006-01-12 Thread Steve Loughran

Dominique Devienne wrote:

On 1/10/06, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:


If a .dll depends on another .dll, then it must be found in
the system-specific, on Windows the Path (on *nix,
LD_LIBRARY_PATH usually).


So to be platform independend you use both?
java
env value=${thePath} key=PATH/
env value=${thePath} key=LD_LIBRARY_PATH/
/java



Jokes appart, to really be as platform independent as one can be
when not doing 100% pure Java, using java.library.path only is the way
to go. This implies using JNI native libraries which are mostly
self-containted, i.e. don't depend on other native libs (.dll, .so,
etc... Steve ;-) except for system libraries found by default.

But even Path/LD_LIBRARY_PATH can be hacked around I think, as I've
seen one clever developer do, by pre-emptive loading of the libs
depended upon using System.loadLibrary... You need JNI lib Top, which
depends on Middle, which depends on Bottom, and by
System.loadLibrary(Bottom) first explictly, then Middle, and then
finally Top, it seems to work and Top has all its dependencies
already satified. Weird, I know, but this developer was using this
hack to work around WebStart limitations regarding Java apps that
required native JNI libs. Not recommended for the faint of heart ;-)
Some developers are too clever for their own good ;-))) I'd never have
thought of this scheme. --DD



We were doing some low-level stuff that demonstrated that 
System.loadLibrary on win32 uses ::LoadLibrary() and not ::LoadLibraryEx 
to load things. you can see the difference in chained loads. If your DLL 
(implicitly) loads another DLL, and you load the first lib using JNI 
calls, the second lib only gets loaded if it is in the PATH, even if the 
second one is in the same dir as the first one. You need to rework your 
native code to do its own DLL loading to deal with it.


-steve

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: EJB compile

2006-01-12 Thread Steve Loughran

Uri Zeituni wrote:

Hi,
I need to compile my Beans: create stubs and skeletons. I need to deploy them on Websphere. Does anyone knows how to do that? 
I saw that ejbc task is supported only for Weblogic, in addition I did not see any EJB compile task defined in Websphere's ANT tasks.

Can anyone give a hint or help?
Many thanks,
Uri Zeituni



if you can, use EJb3 or hibernate. Hibernate is good and it works, EJB3 
is, well, a kind of standardised hibernate. But with it and the 
annotations, you can

 -do persistence without any extra steps after compiling
 -test your persistence in simple junit tests.

things are still a bit unstable right now, but I would think very hard 
indeed about writing classic/legacy beans right now.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



replaceregex, only the first match

2006-01-12 Thread Rebhan, Gilbert

Hi,

i have problem with replaceregex.

my script uses a xmlpropertyfile which is generated by
another process.Sometimes there are doubled propertynames
in that file

i have to =
1. load the xmlpropertyfile, check for doubled properties
2. if doubled properties are found, i have to delete the first
   occurence in the propertyfile
3. then unset the loaded properties and load the cleaned
xmlpropertyfile

so i tried it that way =

1. loading the propertyfile, then using grep task from Antelope
   with a regex to check whether the propertyname in doubt occurs
   two times  works fine

2. with if isset property=set via grep task 

then

copy file=C:/test/props.xml tofile=C:test/propss.xml
filterchain
tokenfilter
replaceregex byline=false pattern=lt;vers.modul\..+
replace=/
replaceregex byline=false pattern=lt;vers.module.+
replace=/
tokenfilter
/filterchain

/copy

doesn't work as i expected. i thought, when using byline=false only
the
first match of my regex is replaced, but all occurences are replaced.
i tried also several flags with the same result.

3. then unset all properties of the original xmlproperty via unset task
from Antelope, move the cleaned up xmlproperty to the original
file name, as this name is referenced in several other following
scripts
and load it again

Questions =

- how to replace only the first match via replaceregex ?
- are there any other ways with ant ?

Any hints ?

Regards, Gilbert

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: replaceregex, only the first match

2006-01-12 Thread Andrew Goktepe
Remove the tokenfilter tags, and then your script will only replace the
first occurrence.

copy file=C:/test/props.xml tofile=C:test/propss.xml
   filterchain
   replaceregex byline=false pattern=lt;vers.modul\..+
replace=/
   replaceregex byline=false pattern=lt;vers.module.+
replace=/
   /filterchain
/copy

-Andrew

On 1/12/06, Rebhan, Gilbert [EMAIL PROTECTED] wrote:


 Hi,

 i have problem with replaceregex.

 my script uses a xmlpropertyfile which is generated by
 another process.Sometimes there are doubled propertynames
 in that file

 i have to =
 1. load the xmlpropertyfile, check for doubled properties
 2. if doubled properties are found, i have to delete the first
   occurence in the propertyfile
 3. then unset the loaded properties and load the cleaned
xmlpropertyfile

 so i tried it that way =

 1. loading the propertyfile, then using grep task from Antelope
   with a regex to check whether the propertyname in doubt occurs
   two times  works fine

 2. with if isset property=set via grep task

 then

 copy file=C:/test/props.xml tofile=C:test/propss.xml
filterchain
tokenfilter
replaceregex byline=false pattern=lt;vers.modul\..+
 replace=/
replaceregex byline=false pattern=lt;vers.module.+
 replace=/
tokenfilter
/filterchain

 /copy

 doesn't work as i expected. i thought, when using byline=false only
 the
 first match of my regex is replaced, but all occurences are replaced.
 i tried also several flags with the same result.

 3. then unset all properties of the original xmlproperty via unset task
from Antelope, move the cleaned up xmlproperty to the original
file name, as this name is referenced in several other following
 scripts
and load it again

 Questions =

 - how to replace only the first match via replaceregex ?
 - are there any other ways with ant ?

 Any hints ?

 Regards, Gilbert

 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]




Re: running junit from ant

2006-01-12 Thread Lothar Krenzien
Here's an extract of the diagnostic output (ant -diagnostic) :

--- Ant diagnostics report ---
Apache Ant version 1.6.5 compiled on June 2 2005

---
 Implementation Version (JDK1.2+ only)
---
core tasks : 1.6.5
optional tasks : 1.6.5

---
 ANT_HOME/lib jar listing
---
ant.home: D:\prog\ant-1.6.5

.

---
 Tasks availability
---
image : Missing dependency com.sun.media.jai.codec.FileSeekableStream
sshexec : Missing dependency com.jcraft.jsch.UserInfo
scp : Missing dependency com.jcraft.jsch.UserInfo
jdepend : Missing dependency jdepend.xmlui.JDepend
^^

What does it mean ? Do I need some missing libraries ?

---
 XML Parser information
---
XML Parser : org.apache.xerces.jaxp.SAXParserImpl
XML Parser Location: D:\prog\ant-1.6.5\lib\xercesImpl.jar

---
 System properties
---
java.runtime.name : Java(TM) 2 Runtime Environment, Standard Edition
sun.boot.library.path : C:\Programme\Java\jdk1.5.0_05\jre\bin
java.vm.version : 1.5.0_05-b05
ant.library.dir : D:\prog\ant-1.6.5\lib
java.vm.vendor : Sun Microsystems Inc.
java.vendor.url : http://java.sun.com/
path.separator : ;
java.vm.name : Java HotSpot(TM) Client VM
file.encoding.pkg : sun.io
user.country : DE
sun.os.patch.level : Service Pack 2
java.vm.specification.name : Java Virtual Machine Specification
user.dir : W:\application\webapp\deploy
java.runtime.version : 1.5.0_05-b05
java.awt.graphicsenv : sun.awt.Win32GraphicsEnvironment
java.endorsed.dirs : C:\Programme\Java\jdk1.5.0_05\jre\lib\endorsed
os.arch : x86

.

The debug output (ant -debug) :

target name=test time=0 seconds
task location=W:\application\webapp\deploy\build.xml:76:  
name=exec time=0 seconds
   
message priority=info![CDATA[]]/message
message 
priority=info![CDATA[W:\application\webapp\binset 
JAVA_HOME=C:\Programme\Java\jdk1.5.0_05 ]]/message
message priority=info![CDATA[]]/message
message 
priority=info![CDATA[W:\application\webapp\binset 
CAYENNE_HOME=D:\prog\cayenne-1.2M10 ]]/message
message priority=info![CDATA[]]/message
message 
priority=info![CDATA[W:\application\webapp\binset 
CATALINA_HOME=d:\prog\jakarta-tomcat-5.5.4 ]]/message
/task
message priority=debug![CDATA[Found 
D:\prog\ant-1.6.5\lib\junit.jar]]/message
message priority=debug![CDATA[Found 
D:\prog\ant-1.6.5\lib\ant-launcher.jar]]/message
message priority=debug![CDATA[Found 
D:\prog\ant-1.6.5\lib\ant.jar]]/message
message priority=debug![CDATA[Found 
D:\prog\ant-1.6.5\lib\ant-junit.jar]]/message
message priority=debug![CDATA[Found 
D:\prog\ant-1.6.5\lib\junit.jar]]/message
message priority=debug![CDATA[Found 
D:\prog\ant-1.6.5\lib\ant-launcher.jar]]/message
message priority=debug![CDATA[Found 
D:\prog\ant-1.6.5\lib\ant.jar]]/message
message priority=debug![CDATA[Found 
D:\prog\ant-1.6.5\lib\ant-junit.jar]]/message
task location=W:\application\webapp\deploy\build.xml:89:  
name=junit time=0 seconds/task
/target


I've just tried using the Ant XMLLogger (-logger org.apache.tools.ant.XmlLogger 
) and got the following output:

target name=test time=0 seconds
task location=W:\application\webapp\deploy\build.xml:76:  
name=exec time=0 seconds
.
/task
task location=W:\application\webapp\deploy\build.xml:89:  
name=junit time=0 seconds/task
/target


And my target looks like:

target name=test depends=compile  
 exec dir=./bin executable=cmd
arg line=/c setenv.bat/
 /exec

   junit haltonerror=true haltonfailure=true printsummary=true
 classpath refid=class.path /

formatter type=plain usefile=true/
batchtest todir=${bin.dir} fork=true
  fileset dir=${out.dir}/WEB-INF/classes/sr2/test/  
  
  filename name=**/TestRunner/
  /fileset
/batchtest

   /junit
  /target

The class TestRunner start either the SwingGUI or the TextGUI depending on on 
command line switch. But not a single test but a test suite. 
Is it a problem that I created the Testclasses with Eclipse ? Or that I use 
Log4J ?

Thanks Lothar

Ant Users List 

Classpath

2006-01-12 Thread Paulo Jorge Guedes
Hi,

I created an enterprise project with NetBeans and I need to build it
with ant, from the command line.
I'm having a problem with the classpath. I need to import javax.ejb.*
but it won't find the proper jar (j2ee.jar).
The only way I can make ant to find it is setting the attribute
classpathref in the javac element, inside my target. The problem is
that I can't tweak the script file that defines the javac action because
it is automatically generated by netbeans. I can only hack a generic
file that calls the other file named build-impl.xml.
Do you have any suggestion?

Paulo


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: replaceregex, only the first match

2006-01-12 Thread Rebhan, Gilbert

Hi,

Oops, of course, missed that , thanks !!

I've used that before, but didn't remember ;-)

btw, there are some gotchas i regularly run in,

i.e. when using

equals arg1=${foo} arg2=bla/

you have to use the syntax ${}

but when using 

isset property=foo/

you have to write it without ${}


Regards, Gilbert
 

-Original Message-
From: Andrew Goktepe [mailto:[EMAIL PROTECTED] 
Sent: Thursday, January 12, 2006 3:08 PM
To: Ant Users List
Subject: Re: replaceregex, only the first match

Remove the tokenfilter tags, and then your script will only replace
the
first occurrence.

copy file=C:/test/props.xml tofile=C:test/propss.xml
   filterchain
   replaceregex byline=false pattern=lt;vers.modul\..+
replace=/
   replaceregex byline=false pattern=lt;vers.module.+
replace=/
   /filterchain
/copy

-Andrew

On 1/12/06, Rebhan, Gilbert [EMAIL PROTECTED] wrote:


 Hi,

 i have problem with replaceregex.

 my script uses a xmlpropertyfile which is generated by
 another process.Sometimes there are doubled propertynames
 in that file

 i have to =
 1. load the xmlpropertyfile, check for doubled properties
 2. if doubled properties are found, i have to delete the first
   occurence in the propertyfile
 3. then unset the loaded properties and load the cleaned
xmlpropertyfile

 so i tried it that way =

 1. loading the propertyfile, then using grep task from Antelope
   with a regex to check whether the propertyname in doubt occurs
   two times  works fine

 2. with if isset property=set via grep task

 then

 copy file=C:/test/props.xml tofile=C:test/propss.xml
filterchain
tokenfilter
replaceregex byline=false pattern=lt;vers.modul\..+
 replace=/
replaceregex byline=false pattern=lt;vers.module.+
 replace=/
tokenfilter
/filterchain

 /copy

 doesn't work as i expected. i thought, when using byline=false only
 the
 first match of my regex is replaced, but all occurences are replaced.
 i tried also several flags with the same result.

 3. then unset all properties of the original xmlproperty via unset
task
from Antelope, move the cleaned up xmlproperty to the original
file name, as this name is referenced in several other following
 scripts
and load it again

 Questions =

 - how to replace only the first match via replaceregex ?
 - are there any other ways with ant ?

 Any hints ?

 Regards, Gilbert

 -
 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]



specifying include files in a lib in the war

2006-01-12 Thread General Email
I'd like to specify a list of files to include in the lib inside a war task.
  Looks like this:
  
   lib dir=c:/lib

includes name=webService.jar,
  common.jar,
  utils.jar,/
   
  /lib
  
  lib specifies a fileset which I though supported  includes with a comma 
separated list of files to include.   However I get an error saying that lib 
doesn't support includes  and I'm forced to change to include (without the 
's') and  include each file individually.
  How can I get around this and specify a list of files?
  
  Thnx.
  

-
Yahoo! Photos – Showcase holiday pictures in hardcover
 Photo Books. You design it and we’ll bind it!

Re: specifying include files in a lib in the war

2006-01-12 Thread Petar Tahchiev
On 12/01/06, General Email [EMAIL PROTECTED] wrote:

 I'd like to specify a list of files to include in the lib inside a war
 task.
   Looks like this:

lib dir=c:/lib

 includes name=webService.jar,
   common.jar,
   utils.jar,/

   /lib

   lib specifies a fileset which I though supported  includes with a
 comma separated list of files to include.   However I get an error saying
 that lib doesn't support includes  and I'm forced to change to include
 (without the 's') and  include each file individually.
   How can I get around this and specify a list of files?

   Thnx.


 -
 Yahoo! Photos – Showcase holiday pictures in hardcover
 Photo Books. You design it and we'll bind it!


I can't see what is the problem with :

fileset dir=c:\lib
  include name=**/*.jar/
/fileset

0h, and also you forgot to close your quotations marks here:
  utils.jar,/
Doesn't ant complains it?

--
Regards, Petar!


Strange behavior with cvstagdiff task

2006-01-12 Thread Scott, Brian
Hello friends - 

I'm experiencing some very strange behavior when specifying multiple values in 
the package definition.  Specifically, if I add multiple space delimited values 
for package I get a different number of differences reported in tagdiff.html. 

So, for example, if my tag includes:

cvstagdiff  
cvsRoot=:pserver:CVS_USER:[EMAIL 
PROTECTED]:/cvs_repository
destfile=tagdiff.xml
package=mobile/config 
startTag=start_tag
endTag=end_tag 


I will get the expected number of entries returned in tagdiff.html/tagdiff.xml.

Likewise, if my tag includes: 

cvstagdiff  
cvsRoot=:pserver:CVS_USER:[EMAIL 
PROTECTED]:/cvs_repository
destfile=tagdiff.xml
package=mobile/jsp 
startTag=start_tag
endTag=end_tag 

I get the expected number of entries.  

However, if my tag is:

cvstagdiff  
cvsRoot=:pserver:CVS_USER:[EMAIL 
PROTECTED]:/cvs_repository
destfile=tagdiff.xml
package=mobile/jsp mobile/config 
startTag=start_tag
endTag=end_tag 

I get fewer files than I would expect to see if I were to simply add the files 
from the two previous examples.  While these are dummied up entries, I am not 
crossing modules; just different directory structures within the same module.  

Can anyone help; the notion of modifying my process to individual detect 
differences on a folder by folder basis gives me a sinking feeling. 

Thank you.
brian  


Re: specifying include files in a lib in the war

2006-01-12 Thread General Email
That will work with 'include' but it doesn't like 'includes' and then a list of 
comma separated file names. 
  That is the problem.
  
  And yes...forgot the end quote there...typo in my post.

Petar Tahchiev [EMAIL PROTECTED] wrote:  On 12/01/06, General Email  wrote:

 I'd like to specify a list of files to include in the 
 inside a 
 task.
   Looks like this:




 
  


0h, and also you forgot to close your quotations marks here:
  utils.jar,/
Doesn't ant complains it?

--
Regards, Petar!




-
Yahoo! Photos – Showcase holiday pictures in hardcover
 Photo Books. You design it and we’ll bind it!

Re: running junit from ant

2006-01-12 Thread Stefan Bodewig
On Thu, 12 Jan 2006, Lothar Krenzien [EMAIL PROTECTED] wrote:

 ---
  Tasks availability
 ---
 image : Missing dependency
 com.sun.media.jai.codec.FileSeekableStream sshexec : Missing
 dependency com.jcraft.jsch.UserInfo scp : Missing dependency
 com.jcraft.jsch.UserInfo jdepend : Missing dependency
 jdepend.xmlui.JDepend
 ^^
 
 What does it mean ? Do I need some missing libraries ?

Only if you intend to use one of these tasks.  If so, check the
library dependencies section in the manual.

junit haltonerror=true haltonfailure=true
printsummary=true classpath refid=class.path /
 
   formatter type=plain usefile=true/ batchtest
   todir=${bin.dir} fork=true fileset
   dir=${out.dir}/WEB-INF/classes/sr2/test/
   filename name=**/TestRunner/ /fileset
   /batchtest
   
/junit /target
 
 The class TestRunner start either the SwingGUI or the TextGUI

Ah, so you are not really using the junit task at all that way.

junit runs tests inside a test runner of its own, not one JUnit's
runners.  Ant only captures the results of tests run by its own
TestRunner.  So from Ant's perspective TestRunner is the only test it
needs to keep track of.

Stefan

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: specifying include files in a lib in the war

2006-01-12 Thread Petar Tahchiev
On 12/01/06, General Email [EMAIL PROTECTED] wrote:

 That will work with 'include' but it doesn't like 'includes' and then a
 list of comma separated file names.
   That is the problem.

   And yes...forgot the end quote there...typo in my post.

 Petar Tahchiev [EMAIL PROTECTED] wrote:  On 12/01/06, General
 Email  wrote:
 
  I'd like to specify a list of files to include in the
 inside a
  task.
Looks like this:
 
 

 
 



 0h, and also you forgot to close your quotations marks here:
   utils.jar,/
 Doesn't ant complains it?

 --
 Regards, Petar!




 -
 Yahoo! Photos – Showcase holiday pictures in hardcover
 Photo Books. You design it and we'll bind it!


Sorry, my fault. I see now what you want.
First if you want to include a list of comma separated files you can use
this:

lib dir=${basedir}/WEB-INF/lib includes=WEB-INF/web.xml,
WEB-INF/my.xml/

Second if you want to include a set of files you can use this:

lib dir=thirdparty/libs
 exclude name=jdbc1.jar/
/lib

where you point to the directory you want to use and exclude certain files.

Hope that helps!
--
Regards, Petar!