Solved

launch an exe prog from a servlet

Posted on 2001-07-10
6
270 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
MS Dynamics Made Instantly Simpler

Make Your Microsoft Dynamics Investment Count  & Drastically Decrease Training Time by Providing Intuitive Step-By-Step WalkThru Tutorials.

 

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

[Webinar] Learn How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them. Thursday, July 13, 2017 10:00 A.M. PDT

Question has a verified solution.

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

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.
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
Viewers learn about the “for” loop and how it works in Java. By comparing it to the while loop learned before, viewers can make the transition easily. You will learn about the formatting of the for loop as we write a program that prints even numbers…
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.
Suggested Courses

631 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