This week's book giveaway is in the Design and Architecture forum.
We're giving away four copies of Communication Patterns: A Guide for Developers and Architects and have Jacqui Read on-line!
See this thread for details.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Devaka Cooray
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Tim Moores
  • Carey Brown
  • Mikalai Zaikin
Bartenders:
  • Lou Hamers
  • Piet Souris
  • Frits Walraven

Deploying executable within a WAR

 
Ranch Hand
Posts: 230
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello:

I wasn't sure under which forum to post this but here goes . . .

Java 5

I am deploying an executable inside my WAR so that the code within the WAR can execute it at runtime. The executable is a command line program which executes when running from the OS command line. It runs in both Windows and Linux. My web app uses:

Runtime rt = Runtime.getRuntime();
rt.exec("xxxx");

to call this program. When I run the web app in JDevelper's embedded OC4J (Windows), the code executes as normal. However, when I deploy it on a remote server running under Linux, it doesn't function properly (I'm taking into account the executable is different). In the Linux server, if I navigate into the exploded WAR and execute at it at the command line, it works perfectly. Only when I execute from within the web app does it fail. Keep in mind that once the application is deployed on Linux I have to manually do a "chmod u+x" on the executable.

The command line program is supposed to convert a FO document to a PDF, but when the web app tries to execute it, I only get an empty PDF.

Any thoughts on this would be greatly appreciated.

Eric
 
John Eric Hamacher
Ranch Hand
Posts: 230
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I figured it out. The application required System.getProperty("file.separator") instead of "/". go figure.

Thanks?
 
This tiny ad is suggesting that maybe she should go play in traffic.
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic