PDA

View Full Version : JSP + JSPSmart issues :|


oooyeaherz
06-20-2006, 12:27 AM
Well I'm having such a fun time with this application that someone handed me... Two wonderful problems for the price of 1 splitting headache :|

Basically this application does one annoying thing, it uses JSPSmart/SmartUpload package to generate PDF's & upload it (or something like that) and come to find out... the freakin thing don't work. :|

And to make things even more fun... after doing a google search it seems that the only way to get the code itself is from www.jspsmart.com . Well surprise surprise it seems that someone recently took that site and using it for making a nice google Ad revenue with no download link in... site (no pun intended... ok maybe a little :p)

Oh and the fun don't stop there :|

One of the .jsp pages that seems to deal with that process gives this message

type Exception report

message

description The server encountered an internal error () that prevented it from fulfilling this request.

exception

org.apache.jasper.JasperException
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:207)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:240)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:187)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:809)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:200)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:146)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:209)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.j ava:596)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:433)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:948)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:144)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.j ava:596)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:433)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:948)
at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2358)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:133)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.j ava:596)
at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:118)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.j ava:594)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:116)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.j ava:594)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:433)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:948)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:127)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.j ava:596)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:433)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:948)
at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:152)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:799)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.jav a:705)
at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:577)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:683)
at java.lang.Thread.run(Thread.java:534)


root cause

java.lang.IllegalStateException
at org.apache.coyote.tomcat4.CoyoteResponseFacade.sendRedirect(CoyoteResponseFacade.java:290)
at org.apache.jsp.ReportsProc_jsp._jspService(ReportsProc_jsp.java:124)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:92)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:809)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:162)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:240)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:187)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:809)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:200)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:146)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:209)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.j ava:596)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:433)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:948)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:144)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.j ava:596)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:433)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:948)
at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2358)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:133)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.j ava:596)
at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:118)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.j ava:594)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:116)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.j ava:594)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:433)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:948)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:127)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.j ava:596)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:433)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:948)
at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:152)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:799)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.jav a:705)
at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:577)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:683)
at java.lang.Thread.run(Thread.java:534)


From what I understand reading & searching for the root cause it seems that it may be a buffer issue but setting the buffer size up whether it's
<% page buffer=500kb %> (and this method doesn't even seem to do anything based on the getBufferSize method still giving me the default 8kb value :| )

or using the response.setPageBuffer(512,000); solution. Thus I've tried reading the source code of the JSPSmart classes using acouple of decompilers but they don't seem to like me with JCavaj giving me a error on one of the class files (the SmartUpload of all the files wouldn't you know it which is the key component in this wild wild ride) & Eclipse not even allowing me to copy & paste (WTF IS THE POINT OF NOT ALLOWING COPY AND PASTE?!?! :mad: ).

So in the end I can't find & check up on a freshly available JSPSmart file to ensure that integrity is ok and I'm still stuck on these friggin error messages. So can anyone help me? Pleeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeese? :\

oooyeaherz
06-20-2006, 03:54 PM
heh, fun times

Found a better version of the Cavaj decompiler utility which is specifically geared for Windows and was able to output the SmartUpload class for me. Except the SmartUpload was giving me an error.

But upon further searching it seems that Koders.com does provide even better source code then from what is generated from the SmartUpload class files @ http://www.koders.com/?s=smartupload&la=Java&li=*&scope=FPNRHMFBV1Q7P9AA6NM9BPRFYC . Unfortunately while everything now compiles with no errors I still get the same exact ugly long winded error message from invoking it via JSP. Also noticed that acouple of the functions from within the SmartUpload class are depriciated (a init, initialize, and service) and wonder how much of a factor that would be.
I wonder how hard the previous developer who had this application running clockwork was laughing when he left this project... heh -_-

oooyeaherz
06-22-2006, 04:19 PM
Update:

Still having a problem but seems I have found that JSPSmart isn't the issue as of now... (damn why it took me so long to figure this out!! >_< )

Seems that looking into the generated servlet of ReportsProc_jsp shows that I'm not able to redirect toward response.sendRedirect(strWebPath) where in the ReportsProc.jsp page itself strWebPath = "http://localhost:8090/ABC/Reports/"

Which kind of brings me back to one of my guesses in first post of this perhaps being a redirect issue. Because typing that address in my browser takes me right to the listing of Reports documents so since the address doesn't seem incorrect based on that do anyone have any idea on what the culprit could possibly be? :(

oooyeaherz
06-22-2006, 07:19 PM
Update:

Still having a problem but seems I have found that JSPSmart isn't the issue as of now... (damn why it took me so long to figure this out!! >_< )

Seems that looking into the generated servlet of ReportsProc_jsp shows that I'm not able to redirect toward response.sendRedirect(strWebPath) where in the ReportsProc.jsp page itself strWebPath = "http://localhost:8090/ABC/Reports/"

Which kind of brings me back to one of my guesses in first post of this perhaps being a redirect issue. Because typing that address in my browser takes me right to the listing of Reports documents so since the address doesn't seem incorrect based on that do anyone have any idea on what the culprit could possibly be? :(

Heh, turns out I again simplified the issue abit more from this... apparently this issue of the redirected url is caused by the generated servlet not running the code that I specified within my JSP file.

When I first took over this program, the default value within the ReortsProc.jsp file was the following:

if (strAction != null){
String strReportPath = "";
String strReportDir = "C:\\tomcat\\webapps\\ABC\\Reports\\";
//String strWebPath = "http://localhost/ABC/Reports/";
String strWebPath = "Reports/";
//long strTimeStamp = (new java.util.Date()).getTime();
String strTimeStamp = "";

And of course eventually used the comments as a hint of what value I should use for strWebPath thus me writing this

if (strAction != null){
String strReportPath = "";
String strReportDir = "C:\\Tomcat4\\webapps\\ABC\\Reports\\";
//String strWebPath = "http://localhost/ABC/Reports/";
String strWebPath = "http://localhost:8090/ABC/Reports/";
//long strTimeStamp = (new java.util.Date()).getTime();
String strTimeStamp = (new java.util.Date()).getTime();

Yet I still get the long winded error message which eventually look at what's in the 'generated' ReportsProc_jsp.java file and when reading it... it shows this value for strWebPath:

if (strAction != null){
String strReportPath = "";
String strReportDir = "C:\\tomcat\\webapps\\ABC\\Reports\\";
//String strWebPath = "http://localhost/ABC/Reports/";
String strWebPath = "Reports/";
//long strTimeStamp = (new java.util.Date()).getTime();
String strTimeStamp = "";

And as you can see, it's as if whatever I'm writing to the JSP file doesn't do anything, even when I erase the generated source & class servlets for ReportsProc_jsp I still go back to what some guy wrote acouple months ago. So it seems that this is my fatal downfall of this app. Even though I'm still pecking away at this issue so I don't come off as a lazy slacker (and maybe someone else may find it helpful as they Google error messages), any help, thoughts, suggestions or hints would be greatly appreciated :)