Has anyone every experienced the following exception from a JSP:
Exception javax.servlet.ServletException: JSP Page threw a non-Exception
Throwable.
I am trying to access a method in a Java class bean called Print from within
my JSP. The Print method resides in a Java class bean (non-visual) that
contains the following code :
public int Print()
{
Runtime rt = Runtime.getRuntime();
Process proc;
try {
proc = rt.exec("LMWPrint /L=C:\\Program
Files\\lmw3\\LabelFiles\\thirty.qdf /P=2");
} catch (IOException e) {
writer.writeDebug("--* exec failed: error " + e.getMessage());
return (-1);
}
int exitStatus = -1000000;
do {
try {
exitStatus = proc.waitFor();
} catch (InterruptedException e) {
writer.writeDebug("wait interrupted " + e.getMessage());
}
} while (exitStatus == -1000000);
return (exitStatus);
}//end Print
The Print method launches another executable called LMWPrint.exe, which
resides on the same machine as my JSP, Java class bean code and JRUN Server.
Can you NOT start another executable on the same machine from a call within
a JSP to a method in a JavaBean? If I run the JavaBean as a stand alone
Java class, the Print method works, and spawns off another process that
opens LMWPrint.exe. But when I call the Print method from a JSP as follows:
<jsp:useBean id="Test" scope="session" class="TestProcess"/>
<%
int yes = Test.Print();
if ( yes == (-1) ) {%>
<H1>Error occurred trying to execute LMWPrint</H1>
<%} else %>
<h1>Automation of LMWPrint completed</h1>
I get the above error message.
Anyone have an ideas/suggestions?
Celeste
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.html
http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets