WeSIP - Problem with <jsp:include> and RequestDispatcher

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

WeSIP - Problem with <jsp:include> and RequestDispatcher

Viliam Pucik
Hello,

there is a problem when using <jsp:include page"some/page.jsp"> tag in
a JSP page in WeSIP.

To reproduce the error:

For example: Download click2call application and put Test.jsp page
with the following content in it:

<jsp:include page="Click2Dial.jsp" />

into the same folder where Click2Dial.jsp is located. It will show
"HTTP Status 500 - Internal Server Error" after opening URL
http://localhost:8080/c2c/Test.jsp.

The error in a log file:

2009-03-15 20:49:29 StandardWrapperValve[jsp]: Servlet.service() for
servlet jsp threw exception
java.lang.NullPointerException
        at org.apache.jasper.runtime.JspRuntimeLibrary.include(Unknown Source)
        at org.apache.jsp.Test$jsp._jspService(Test$jsp.java:65)
        at org.apache.jasper.runtime.HttpJspBase.service(Unknown Source)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
        at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(Unknown
Source)
        at org.apache.jasper.servlet.JspServlet.serviceJspFile(Unknown Source)
        at org.apache.jasper.servlet.JspServlet.service(Unknown Source)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
        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:206)
        at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:596)
        at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:433)
        at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:946)
        at com.voztele.sipservlet.valves.ConvergedContextValve.invokeHTTP(ConvergedContextValve.java:144)
        at com.voztele.sipservlet.valves.ConvergedContextValve.invoke(ConvergedContextValve.java:64)
        at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:596)
        at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:433)
        at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:946)
        at org.apache.catalina.core.StandardHttpContext.invoke(StandardHttpContext.java:2377)
        at com.voztele.sipservlet.core.ConvergedContext.invoke(ConvergedContext.java:98)
        at com.voztele.sipservlet.valves.ConvergedHostValve.invokeHTTP(ConvergedHostValve.java:337)
        at com.voztele.sipservlet.valves.ConvergedHostValve.invoke(ConvergedHostValve.java:98)
        at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:596)
        at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:124)
        at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:594)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:118)
        at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:594)
        at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:433)
        at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:946)
        at com.voztele.sipservlet.valves.ConvergedEngineValve.invoke(ConvergedEngineValve.java:98)
        at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:596)
        at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:433)
        at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:946)
        at org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.java:994)
        at org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:1105)
        at java.lang.Thread.run(Thread.java:636)

Also the similar error happens when using

RequestDispatcher dispatcher =
getServletContext().getRequestDispatcher("/jsp/Click2Dial.jsp");
dispatcher.forward(request, response);

in a servlet.

It's a little bit frustrating :(


Regards

Viliam Pucik

_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: WeSIP - Problem with <jsp:include> and RequestDispatcher

Antonio Abajo
Hello Villiam,

I've tried to reproduce your problem and it works fine in my WeSIP.

I have the C2C application in wesip/wesipapps/click2call. Inside of application there is a jsp folder it cotains the Click2Call.jsp file. I've inserted into the same folder the Test.jsp with the include as you do and I've opened http://localhost:8080/click2call/jsp/Test.jsp and Click2Call.jsp has been showed.
I've tried your second problem and It's worked fine too.

I undestand that your Click2Call,jsp works fine and when you open the Test.jsp is when it doesn't works. Isn't it?

Firstable check your paths because in your mail explains  you connect to http://localhost:8080/c2c/Test.jsp. but in the example of Click2call is in http://localhost:8080/c2c/jsp/Click2Call.jsp and you include is <jsp:include page="Click2Dial.jsp" />
And you also can revise your JAVA_HOME environment variable because WeSIP imports the tools.jar library  relative to JAVA_HOME and uf  you want to use jsp's pages, this library has to be present.

Try it and tell me how are things.
Antonio.

De: Viliam Pucik [hidden email]
Fecha: 15 de marzo de 2009 21:20:34 GMT+01:00
Para: [hidden email]
Asunto: [OpenSIPS-Users] WeSIP - Problem with <jsp:include> and RequestDispatcher

Hello,

there is a problem when using <jsp:include page"some/page.jsp"> tag in
a JSP page in WeSIP.

To reproduce the error:

For example: Download click2call application and put Test.jsp page
with the following content in it:

<jsp:include page="Click2Dial.jsp" />

into the same folder where Click2Dial.jsp is located. It will show
"HTTP Status 500 - Internal Server Error" after opening URL
http://localhost:8080/c2c/Test.jsp.

The error in a log file:

2009-03-15 20:49:29 StandardWrapperValve[jsp]: Servlet.service() for
servlet jsp threw exception
java.lang.NullPointerException
    at org.apache.jasper.runtime.JspRuntimeLibrary.include(Unknown Source)
    at org.apache.jsp.Test$jsp._jspService(Test$jsp.java:65)
    at org.apache.jasper.runtime.HttpJspBase.service(Unknown Source)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(Unknown
Source)
    at org.apache.jasper.servlet.JspServlet.serviceJspFile(Unknown Source)
    at org.apache.jasper.servlet.JspServlet.service(Unknown Source)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    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:206)
    at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:596)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:433)
    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:946)
    at com.voztele.sipservlet.valves.ConvergedContextValve.invokeHTTP(ConvergedContextValve.java:144)
    at com.voztele.sipservlet.valves.ConvergedContextValve.invoke(ConvergedContextValve.java:64)
    at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:596)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:433)
    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:946)
    at org.apache.catalina.core.StandardHttpContext.invoke(StandardHttpContext.java:2377)
    at com.voztele.sipservlet.core.ConvergedContext.invoke(ConvergedContext.java:98)
    at com.voztele.sipservlet.valves.ConvergedHostValve.invokeHTTP(ConvergedHostValve.java:337)
    at com.voztele.sipservlet.valves.ConvergedHostValve.invoke(ConvergedHostValve.java:98)
    at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:596)
    at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:124)
    at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:594)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:118)
    at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:594)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:433)
    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:946)
    at com.voztele.sipservlet.valves.ConvergedEngineValve.invoke(ConvergedEngineValve.java:98)
    at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:596)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:433)
    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:946)
    at org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.java:994)
    at org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:1105)
    at java.lang.Thread.run(Thread.java:636)

Also the similar error happens when using

RequestDispatcher dispatcher =
getServletContext().getRequestDispatcher("/jsp/Click2Dial.jsp");
dispatcher.forward(request, response);

in a servlet.

It's a little bit frustrating :(


Regards

Viliam Pucik

_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users




_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users