Solved

launch an exe prog from a servlet

Posted on 2001-07-10
6
264 Views
Last Modified: 2013-11-24
I launch an executable program from a servlet with

Process proc = Runtime.getRuntime().exec("d:\\servlets\test.exe")

This exe use some dll to access a SYBASE database
(d:\Sybase\dll\...) and when i try the servlet, i get a message on the server:

the dll libcs.dll can not be found in the specified path
d:\servlets\;.;c:\winnt\system32;c:\winnt\system;c:\winnt;c:\winnt;c:\winnt\system32;

and test.exe is not executed.

There is no probleme when i launch test.exe in MS-DOS (or by double-clicking on it) or when i put test.exe in d:\sybase\dll and then try to lauch it with the servlet
but it should not stay in this directory.

d:\Sybase\dll\ is in my PATH

can somebody help me please ?

Laurent.
0
Comment
Question by:laurentj
  • 3
  • 2
6 Comments
 
LVL 92

Accepted Solution

by:
objects earned 200 total points
ID: 6268521
The Sybase dll is not in the path used by the servlet:
d:\servlets\;.;c:\winnt\system32;c:\winnt\system;c:\winnt;c:\winnt;c:\winnt\system32;

Either add d:/sybase/dll to the path used by your servlet container, or pass a suitable environment via the exec call.
0
 
LVL 2

Expert Comment

by:mgaurav
ID: 6269153
Give the path "d:\sybase" in the environment path, that's the least you can do.
0
 

Author Comment

by:laurentj
ID: 6269355
My servlet run with APACHE/JSERV.
I change Jserv.properties :

 wrapper.path=d:\sybase\dll

and it works !

thanks.
0
DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

 

Author Comment

by:laurentj
ID: 6269365
My servlet run with APACHE/JSERV.
I change Jserv.properties :

 wrapper.path=d:\sybase\dll

and it works !

thanks.
0
 
LVL 92

Expert Comment

by:objects
ID: 6271441
Good to hear :)
Thanks for the points.
0
 

Author Comment

by:laurentj
ID: 6272329
another problem :

i use

Process proc = Runtime.getRuntime().exec("d:\\servlets\test.exe \"my string     end of string\"")

and when i display the param that test.exe get :
"my string end of string" and not
"my string     end of string" (spaces are reduce to one space !)

i try with a test.bat (echo %1) and i get the same pb !

any idea ?
0

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Java 1603 Error 3 50
split53 challenge 7 79
Java / Linux and Regular Expressions 11 70
Java DateChooser? 3 29
INTRODUCTION Working with files is a moderately common task in Java.  For most projects hard coding the file names, using parameters in configuration files, or using command-line arguments is sufficient.   However, when your application has vi…
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.

910 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now