Re: running a jar file via perl cgi
- From: bew_ba@xxxxxxx (bernd wegener)
- Date: 21 Jul 2005 05:49:11 -0700
Butterpants <admin@xxxxxxxxx> wrote in message news:<rWADe.7729$je2.697111@xxxxxxxxxxxxxxxxxxxxx>...
> I have a jar file that works well by typing on the shell
> ./java -jar myjar.jar in.txt out.txt
>
> but when i try to create a cgi script it will not write the out.txt file
> There is a textarea form as the input, when user hits submit the script
> below gets called. The script gets as far as writing the in.txt file
> with the correct contents but no out.txt file is created so the problem
> must lie with executing the jar file. Any idea why not?
>
> #!/usr/bin/perl
> use strict;
> use CGI qw/:standard/;
> my $goal=param("goal");
> print header;
> print start_html;
> print "<h3>co</h3>";
> print "<xmp>\n";
> print "goal is this: $goal";
> print `echo "$goal" > in.txt`;
> print `./java -jar ModuleB.jar in.txt out.txt`;
> print `cat out.txt`;
> #print `rm -f in.txt out.txt`;
> print "</xmp>\n";
> print end_html;
I have only a guess: it could be path problem. Your CGI-Environment
possibly does not know the pathes. Use absolute pathes instead of
../java , ModuleB.jar etc.
Cheers
Bernd
.
- References:
- running a jar file via perl cgi
- From: Butterpants
- running a jar file via perl cgi
- Prev by Date: socket connection not being reset correctly
- Next by Date: how to set time to allow servlet finish process before forward
- Previous by thread: running a jar file via perl cgi
- Next by thread: Java LOC Counter
- Index(es):