This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 132519 - Cannot run WS-I tools on Linux
Summary: Cannot run WS-I tools on Linux
Status: STARTED
Alias: None
Product: webservices
Classification: Unclassified
Component: SoapUI (show other bugs)
Version: 6.x
Hardware: All Linux
: P2 blocker (vote)
Assignee: omatzura
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-04-10 13:49 UTC by Lukas Jungmann
Modified: 2008-04-28 11:10 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Lukas Jungmann 2008-04-10 13:49:19 UTC
-have set environment property $WSI_HOME=/path/to/wsi-test-tools
-have some ejb module with web service
-deploy it
-"Create Web Service tests" for this service (use all defaults)
-set up WSI options in tools->soapUI->preferences (check all available options there)
-run "Check WSI Compliance" action on some node where that action is available

=>
Running WSI Analyzer for [MyWSPortBinding]

directory: /home/lukas/wsi-test-tools/java/bin

command: sh -c ./Analyzer.sh -config /tmp/wsi-analyzer-config37197.xml -assertionDescription true

sh: ./Analyzer.sh: not found

my environment:
lukas@ubuntu-m9:~$ uname -a
Linux ubuntu-m9 2.6.22-14-generic #1 SMP Tue Feb 12 07:42:25 UTC 2008 i686 GNU/Linux
Comment 1 omatzura 2008-04-13 22:56:35 UTC
Hi,

hmm.. is there no Analyzer.sh script in the /home/lukas/wsi-test-tools/java/bin folder?

regards,

/Ole
eviware.com
Comment 2 Lukas Jungmann 2008-04-14 16:42:19 UTC
there is:

lukas@ubuntu-m9:~$ ls -la /home/lukas/wsi-test-tools/java/bin/ | grep Analy
-rw-r--r-- 1 lukas lukas 4542 2005-07-15 15:29 Analyzer.bat
-rwxr-xr-x 1 lukas lukas 3979 2005-07-15 15:29 Analyzer.sh
Comment 3 Roderico Cruz 2008-04-14 19:44:55 UTC
Ole, I am just guessing here... Could it be the file separator problem when you invoke the Analyzer script? (i.e., "\"
vs. "/"). 
Comment 4 omatzura 2008-04-14 22:49:59 UTC
Hi Rico,

thanks for the tip, I can't find any code that doesn't use the File.seperatorChar constant here.. hmm.. 

jungi, could you please try running the invoked command from the command-line after the error occurs? ie change to the
specified directory and enter

sh -c ./Analyzer.sh -config /tmp/wsi-analyzer-config37197.xml -assertionDescription true

To see if this works at all!?

Thanks in advance!

regards,

/Ole
eviware.com

Comment 5 Lukas Jungmann 2008-04-15 00:51:32 UTC
No, even that does not work :-(

lukas@ubuntu-m9:~/wsi-test-tools/java/bin$ sh -c ./Analyzer.sh -config /tmp/wsi-analyzer-config30218.xml
-assertionDescription true
-config: 1: ./Analyzer.sh: not found
lukas@ubuntu-m9:~/wsi-test-tools/java/bin$


the cause of this issue is that sh scripts have CRLF line endings instead of LF only therefore sh is looking for
'#!/bin/sh^M' interpreter instead of pure '#!/bin/sh' (same is true for all other commands within a script)

so the correct fix seems to be to convert *.sh files to *nix format (= use LF line endings) - ie by using dos2unix tool

once this is fixed there are another issues:

to run Analyzer on the command line (bash) one has to call:
sh ./Analyzer.sh -config /tmp/wsi-analyzer-config30218.xml -assertionDescription true (or just ./Analyzer.sh -config
/tmp/wsi-analyzer-config30218.xml -assertionDescription true)

calling check WSI compliance from the IDE now ends with:

Running WSI Analyzer for [NewWebServicePortBinding]

directory: /home/lukas/wsi-test-tools/java/bin

command: sh -c ./Analyzer.sh -config /tmp/wsi-analyzer-config4511.xml -assertionDescription true

.: 54: Can't open /java/bin/setenv.sh

maybe removing 'sh -c' from the command could help, OTOH there can be something wrong on another place

hope this helps... ;-)
Comment 6 omatzura 2008-04-15 01:17:53 UTC
Hi!

thanks! I'm going to blame the incorrect line-endings on WS-I, these files are part of their distribution :-)

Regarding the inability to open "/java/bin/setenv.sh", I wonder if there is such a file? Could there be some permission
related problem?

regards!

/Ole
eviware.com
Comment 7 Lukas Jungmann 2008-04-15 01:45:07 UTC
yes, there is setenv.sh in $WSI_HOME/java/bin directory, it's called from Analyzer.sh and both files have the same
permissions.

so the part with incorrect line endings can be release noted as we can't do much with that (unless you'd like to
implement some check which would be able to detect incorrect line endings and fix them if needed before running the script).

Anyway it still looks like some fix on the soapui side is needed, probably on a place where it calls Analyzer script, so
it calls it correctly... and I don't know where that place is...
Comment 8 omatzura 2008-04-15 08:55:22 UTC
ok.. we'll try to set up an ubuntu installation to test this.. I'll let you know!

regards,

/Ole
eviware.com
Comment 9 Lukas Jungmann 2008-04-16 18:25:11 UTC
btw: calling:

sh -c "./Analyzer.sh -config /tmp/wsi-analyzer-config25941.xml -assertionDescription true"

instead of:

sh -c ./Analyzer.sh -config /tmp/wsi-analyzer-config25941.xml -assertionDescription true

should help (without quotes bash will take only ./Analyzer as an argument for sh's -c option and the rest as arguments
for sh script) ;)
Comment 10 omatzura 2008-04-16 20:54:56 UTC
Hi!

thanks.. actually, internally the entire line after sh -c is passed to the ProcessBuilder as one argument, so I figured
this should be handled by the receiving process as such.. I can try enclosing it with quotes for testing sake.. 

regards!

/Ole
eviware.com
Comment 11 omatzura 2008-04-16 21:54:11 UTC
Hi again,

there is an updated nbm with this fix at http://www.soapui.org/download/com-eviware-soapui-netbeans-module-2.0.3.nbm,
please try it to see if this works better.

thanks in advance!

regards,

/Ole
eviware.com
Comment 12 Lukas Jungmann 2008-04-16 23:43:51 UTC
now it ends with:

command: sh -c './Analyzer.sh -config /tmp/wsi-analyzer-config1905.xml -assertionDescription true'

/bin/sh: ./Analyzer.sh -config /tmp/wsi-analyzer-config1905.xml -assertionDescription true: not found

grrr, I'm running out of ideas what else to try... :-(
Comment 13 Lukas Jungmann 2008-04-17 00:01:48 UTC
one more experiment before going to bed:

following program works fine (process exit value is 0 and report is generated into tmp dir):

public static void main(String[] args) throws IOException, InterruptedException {
    ProcessBuilder pb = new ProcessBuilder("sh", "-c", "./Analyzer.sh -config /tmp/wsi-analyzer-config1900.xml
-assertionDescription true");
    pb.directory(new File(System.getenv("WSI_HOME"), "java/bin"));
    Process p = pb.start();
    System.out.println(p.waitFor());
}
Comment 14 omatzura 2008-04-23 20:55:05 UTC
Hi,

sorry for the delay on this.. The code you posted is more-or-less the same as in the application, I'm going to build an
udpated nbm with some minor fixes for you to try out.. ok?

regards!

/Ole
eviware.com
Comment 15 omatzura 2008-04-23 21:26:03 UTC
Hi again,

the nbm is now uploaded to http://www.soapui.org/download/com-eviware-soapui-netbeans-module-2.0.3.nbm, please have a go
to see if there is any improvement. Also make sure that the path to the WS-I tools in the soapUI Preferences is the
exact same as your WSI_HOME variable.

regards!

/Ole
eviware.com
Comment 16 Lukas Jungmann 2008-04-28 11:10:50 UTC
Hi,

 now I'm getting:

Running WSI Analyzer for [NewWebServiceXXXPortBinding]

directory: /home/lukas/wsi-test-tools/java/bin

command: sh -c ./Analyzer.sh -config /tmp/wsi-analyzer-config49000.xml -assertionDescription true

.: 54: Can't open /java/bin/setenv.sh

on the latest Ubuntu (8.04 has been released on Friday) :-(