M
miguelcampoy
Hi everybody!
Im developing a web application with JSP, and im finding this problem.
Im trying to create a text file with some information. This is an
extraction of the code im using:
....
import java.io.BufferedWriter;
import java.iutputStreamWriter;
import java.io.FileOutputStream;
....
public void toLogFile(String fileNameIn, String comentarioIn){
String path = "";
try{
BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(new
FileOutputStream(path + fileNameIn, true)));
String resultado = "";
bw.write("PEDIDO: ");
bw.newLine();
bw.write("Cliente: " + getClientName());
bw.newLine();
// code for finding what i want to write in the text file
if (suReferencia != "") resultado += "Referencia de cliente: " +
suReferencia + "\n";
resultado += "Comentarios: " +
Conversor.procesaComentario(comentarioIn) + "\n";
for(int i = 0; i < numDetalles; i++){
resultado += " - " + detalles.detalleToString() + "\n";
}
// Found what i want to write. Now i write it in the text file.
bw.write(resultado);
bw.newLine();
bw.flush();
bw.close();
}
catch(Exception e){
System.err.println("---Logger Exception---");
System.err.println("Mensaje: " + e);
}
}
This works fine in my development computer, whose operating system is
Windows XP, but when i try it in my production computer, with UNIX
instead of Windows, the JSP that calls the method "toLogFile" returns
this error (in spanish):
org.apache.jasper.JasperException: No se puede compilar la clase para
JSP
org.apache.jasper.compiler.DefaultErrorHandler.javacError(java.lang.String,
java.lang.Exception) (/usr/lib/libjasper5-compiler-5.0.30.jar.so)
org.apache.jasper.compiler.ErrorDispatcher.javacError(java.lang.String,
java.lang.Exception) (/usr/lib/libjasper5-compiler-5.0.30.jar.so)
org.apache.jasper.compiler.Compiler.generateClass(java.lang.String[])
(/usr/lib/libjasper5-compiler-5.0.30.jar.so)
org.apache.jasper.compiler.Compiler.compile(boolean, boolean)
(/usr/lib/libjasper5-compiler-5.0.30.jar.so)
org.apache.jasper.compiler.Compiler.compile(boolean)
(/usr/lib/libjasper5-compiler-5.0.30.jar.so)
org.apache.jasper.compiler.Compiler.compile()
(/usr/lib/libjasper5-compiler-5.0.30.jar.so)
org.apache.jasper.JspCompilationContext.compile()
(/usr/lib/libjasper5-compiler-5.0.30.jar.so)
org.apache.jasper.servlet.JspServletWrapper.service(javax.servlet.http.HttpServletRequest,
javax.servlet.http.HttpServletResponse, boolean)
(/usr/lib/libjasper5-compiler-5.0.30.jar.so)
org.apache.jasper.servlet.JspServlet.serviceJspFile(javax.servlet.http.HttpServletRequest,
javax.servlet.http.HttpServletResponse, java.lang.String,
java.lang.Throwable, boolean)
(/usr/lib/libjasper5-compiler-5.0.30.jar.so)
org.apache.jasper.servlet.JspServlet.service(javax.servlet.http.HttpServletRequest,
javax.servlet.http.HttpServletResponse)
(/usr/lib/libjasper5-compiler-5.0.30.jar.so)
javax.servlet.http.HttpServlet.service(javax.servlet.ServletRequest,
javax.servlet.ServletResponse) (/usr/lib/libservletapi5-5.0.30.jar.so)
org.apache.catalina.valves.ErrorReportValve.invoke(org.apache.catalina.Request,
org.apache.catalina.Response, org.apache.catalina.ValveContext)
(/usr/lib/libcatalina-5.0.30.jar.so)
org.apache.coyote.tomcat5.CoyoteAdapter.service(org.apache.coyote.Request,
org.apache.coyote.Response) (/usr/lib/libcatalina-5.0.30.jar.so)
org.apache.coyote.http11.Http11Processor.process(java.io.InputStream,
java.iutputStream) (/usr/lib/libtomcat-http11-5.0.30.jar.so)
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(org.apache.tomcat.util.net.TcpConnection,
java.lang.Object[]) (/usr/lib/libtomcat-http11-5.0.30.jar.so)
org.apache.tomcat.util.net.TcpWorkerThread.runIt(java.lang.Object[])
(/tmp/libtomcat-util-5.0.30.jar.sodbz2am.so)
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run()
(/tmp/libtomcat-util-5.0.30.jar.sodbz2am.so)
java.lang.Thread.run() (/usr/lib/libgcj.so.6.0.0)
In english, "No se puede compilar la clase para JSP", would be "the
class cannot be compiled for JSP".
Does anybody have an idea of what can be happening? I think the error
can be related with the Windows/UNIX difference, but im not sure.
Thank you in advance, and sorry for writing too much code and error
text.
Greetings
Im developing a web application with JSP, and im finding this problem.
Im trying to create a text file with some information. This is an
extraction of the code im using:
....
import java.io.BufferedWriter;
import java.iutputStreamWriter;
import java.io.FileOutputStream;
....
public void toLogFile(String fileNameIn, String comentarioIn){
String path = "";
try{
BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(new
FileOutputStream(path + fileNameIn, true)));
String resultado = "";
bw.write("PEDIDO: ");
bw.newLine();
bw.write("Cliente: " + getClientName());
bw.newLine();
// code for finding what i want to write in the text file
if (suReferencia != "") resultado += "Referencia de cliente: " +
suReferencia + "\n";
resultado += "Comentarios: " +
Conversor.procesaComentario(comentarioIn) + "\n";
for(int i = 0; i < numDetalles; i++){
resultado += " - " + detalles.detalleToString() + "\n";
}
// Found what i want to write. Now i write it in the text file.
bw.write(resultado);
bw.newLine();
bw.flush();
bw.close();
}
catch(Exception e){
System.err.println("---Logger Exception---");
System.err.println("Mensaje: " + e);
}
}
This works fine in my development computer, whose operating system is
Windows XP, but when i try it in my production computer, with UNIX
instead of Windows, the JSP that calls the method "toLogFile" returns
this error (in spanish):
org.apache.jasper.JasperException: No se puede compilar la clase para
JSP
org.apache.jasper.compiler.DefaultErrorHandler.javacError(java.lang.String,
java.lang.Exception) (/usr/lib/libjasper5-compiler-5.0.30.jar.so)
org.apache.jasper.compiler.ErrorDispatcher.javacError(java.lang.String,
java.lang.Exception) (/usr/lib/libjasper5-compiler-5.0.30.jar.so)
org.apache.jasper.compiler.Compiler.generateClass(java.lang.String[])
(/usr/lib/libjasper5-compiler-5.0.30.jar.so)
org.apache.jasper.compiler.Compiler.compile(boolean, boolean)
(/usr/lib/libjasper5-compiler-5.0.30.jar.so)
org.apache.jasper.compiler.Compiler.compile(boolean)
(/usr/lib/libjasper5-compiler-5.0.30.jar.so)
org.apache.jasper.compiler.Compiler.compile()
(/usr/lib/libjasper5-compiler-5.0.30.jar.so)
org.apache.jasper.JspCompilationContext.compile()
(/usr/lib/libjasper5-compiler-5.0.30.jar.so)
org.apache.jasper.servlet.JspServletWrapper.service(javax.servlet.http.HttpServletRequest,
javax.servlet.http.HttpServletResponse, boolean)
(/usr/lib/libjasper5-compiler-5.0.30.jar.so)
org.apache.jasper.servlet.JspServlet.serviceJspFile(javax.servlet.http.HttpServletRequest,
javax.servlet.http.HttpServletResponse, java.lang.String,
java.lang.Throwable, boolean)
(/usr/lib/libjasper5-compiler-5.0.30.jar.so)
org.apache.jasper.servlet.JspServlet.service(javax.servlet.http.HttpServletRequest,
javax.servlet.http.HttpServletResponse)
(/usr/lib/libjasper5-compiler-5.0.30.jar.so)
javax.servlet.http.HttpServlet.service(javax.servlet.ServletRequest,
javax.servlet.ServletResponse) (/usr/lib/libservletapi5-5.0.30.jar.so)
org.apache.catalina.valves.ErrorReportValve.invoke(org.apache.catalina.Request,
org.apache.catalina.Response, org.apache.catalina.ValveContext)
(/usr/lib/libcatalina-5.0.30.jar.so)
org.apache.coyote.tomcat5.CoyoteAdapter.service(org.apache.coyote.Request,
org.apache.coyote.Response) (/usr/lib/libcatalina-5.0.30.jar.so)
org.apache.coyote.http11.Http11Processor.process(java.io.InputStream,
java.iutputStream) (/usr/lib/libtomcat-http11-5.0.30.jar.so)
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(org.apache.tomcat.util.net.TcpConnection,
java.lang.Object[]) (/usr/lib/libtomcat-http11-5.0.30.jar.so)
org.apache.tomcat.util.net.TcpWorkerThread.runIt(java.lang.Object[])
(/tmp/libtomcat-util-5.0.30.jar.sodbz2am.so)
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run()
(/tmp/libtomcat-util-5.0.30.jar.sodbz2am.so)
java.lang.Thread.run() (/usr/lib/libgcj.so.6.0.0)
In english, "No se puede compilar la clase para JSP", would be "the
class cannot be compiled for JSP".
Does anybody have an idea of what can be happening? I think the error
can be related with the Windows/UNIX difference, but im not sure.
Thank you in advance, and sorry for writing too much code and error
text.
Greetings