Two Laptop Bag*
The moose likes Ant, Maven and Other Build Tools and the fly likes maven/ant/ldap problems Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » Ant, Maven and Other Build Tools
Bookmark "maven/ant/ldap problems" Watch "maven/ant/ldap problems" New topic
Author

maven/ant/ldap problems

Phil Crick
Greenhorn

Joined: May 17, 2006
Posts: 10
I've got a peculiar problem that I don't seem to be able to get to the bottom of, perhaps you guys can help out?

I've got some .sh scripts that run on SunOS. The scripts perform various ldap tasks. e.g. :



I can run the scripts straight from bash and they work fine. Here's were maven and ant come into it...

I've got a maven file (plugin.jelly) that has a goal in it that calls an ant:exec target to execute the scripts described above.

This doesn't seem to work. It starts to execute the .sh file ok but fails when it comes across ldap commands with the following error:

ldap_simple_bind: Invalid DN syntax
ldap_simple_bind: additional info: Invalid DN

I guess there's something wrong somewhere - probably ldap related - but I don't know what and after some searching I've not found anything obvious.

The other annoying thing is that this works fine running under cygwin on Win XP.

Any help appreciated.
Carol Enderlin
drifter
Ranch Hand

Joined: Oct 10, 2000
Posts: 1364
More details might help, like code maven/ant code snippets.
Phil Crick
Greenhorn

Joined: May 17, 2006
Posts: 10
How do you get xml in here? Don't seem to be able to figure out how to do it. Swapping the angle brackets for & lt; and & gt; doesn't seem to work. That's why the code wasn't here in the first place
[ May 18, 2006: Message edited by: Phil Crick ]
Carol Enderlin
drifter
Ranch Hand

Joined: Oct 10, 2000
Posts: 1364
I don't usually have a problem with xml, but it just nuked my response.

Without any code I can only take a stab at a potential problem. (I'm an ant user, not a maven user).

Are you using arguments with spaces in them or using multiple arg's?

I've had trouble using this style of specifying the params:
arg line="-v -h $host -p $port -D $username -w $password -a -f myldiffile"

I've had more luck with this style of specifying the params.
arg value="-v"
arg value="-h"
arg value="$host"
arg value="-p"
arg value="$port"
arg value="$username"
arg value="-w"
arg value="$password"
arg value="-a"
arg value="-f"
arg value="myldiffile"


If that's not the problem, does your ant target work using ant?
[ May 18, 2006: Message edited by: Carol Enderlin ]
Phil Crick
Greenhorn

Joined: May 17, 2006
Posts: 10
The maven goal looks like this (minus angle brackets):






To reiterate, calling the script from the command prompt works fine, using maven via ant:exec doesn't. I've not tried it from ant direct - I'll give that a go and see what happens, although ultimately it needs to work from maven.
Phil Crick
Greenhorn

Joined: May 17, 2006
Posts: 10
The ldapscript.sh looks like this:

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: maven/ant/ldap problems