Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Java > Java Open Source > Apache Tomcat
|
Apache Tomcat General discussion of the Apache Tomcat servlet container. For discussions specific to the Professional Apache Tomcat book, please see the book discussion forum for that book.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Apache Tomcat section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 27th, 2005, 09:35 AM
Authorized User
 
Join Date: Jun 2003
Posts: 60
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to rushman
Default Tomcat 5 and Axis: erratic behavior

Hello @ all!

I'm completely flabbergasted! I wrote a simple web service using the JWS technique on Axis (simple java application which

extension have been changed to ".jws" and then dropped in the Axis webapp directory under Tomcat). Now, let the fun part

begin...

I wrote two client apps for my web service(one in Java, one in an obscure scripting language...).

I started Tomcat 5 from the cmd prompt (TOMCAT_HOME/bin/tomcat5.exe). Both of my client apps returned with the expected

results. This is great! But...

I restarted Tomcat with Procrun Service Manager Version 1.0.0.0 this time. Guess what? None of my two clients returned with

the expected results!

After a little investigation, I realized that a file output in the java.io.tmpdir wasn't being written when I run Tomcat from

Procrun... here's a snippet of my code:

Code:
/** begin snippet **/
String[] cmd = { "cmd", 
                 " /c", 
                 "diff", 
                 "-Bwy", 
                 "-W1",
                 originalFilePath, 
                 modifiedFilePath, 
                 ">",
                 diffOutputPath) 
               };

Process process = Runtime.getRuntime().exec(cmd);

InputStream ierr = process.getErrorStream();
InputStream iin = process.getInputStream();                
while (ierr.available() > 0) {
    ierr.read();
}
while (iin.available() > 0) {
    iin.read();
}

int exitVal = process.waitFor();

//BLABLABLA...

/** end snippet **/
As you can see, I'm trying to redirect the output from "DIFF" to a new file (which will be stored in the temp dir).

Soooooo...

My question boils down to this:

"WHY DOES THIS WORK WHEN I START TOMCAT FROM THE COMMAND LINE AND IT DOESN'T WHEN I START THE SERVER WITH PROCRUN???"

or, if I simplify again:

"WHY ME? WHY?"

Please folks, enlighten me!

Rushman

p.s. The winner of this contest will be granted eternal admiration from my part.

Dijkstra's law on Programming and Inertia:

If you don't know what your program is supposed to do, don't try to write it.
__________________
Dijkstra's law on Programming and Inertia:

If you don't know what your program is supposed to do, don't try to write it.





Similar Threads
Thread Thread Starter Forum Replies Last Post
erratic cursor behavior Tim Johnson Access 4 November 27th, 2007 07:30 AM
Axis and Tomcat using swa sample crazycomputers Apache Tomcat 0 July 20th, 2006 03:55 PM
Tomcat 5 and Axis: erratic behavior rushman BOOK: Professional Apache Tomcat 1 June 8th, 2006 04:33 AM
JWS Axis Tomcat (posted to Apache Tomcat too) rushman Servlets 0 April 15th, 2005 09:32 AM
Tomcat 5 and Axis: JWS problem rushman Apache Tomcat 0 April 15th, 2005 09:30 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.