Solved

launch an exe prog from a servlet

Posted on 2001-07-10
6
263 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
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 

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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

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 will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.

708 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

18 Experts available now in Live!

Get 1:1 Help Now