aspose file tools*
The moose likes Tomcat and the fly likes Tomcat blocks JSP Bean connection Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Tomcat blocks JSP Bean connection " Watch "Tomcat blocks JSP Bean connection " New topic
Author

Tomcat blocks JSP Bean connection

tsa tham
Greenhorn

Joined: Mar 01, 2012
Posts: 2
Hi,
I have a JSP bean running in apache Tomcat 7.0.26. This bean opens a connection to a Java server running in the same machine, and sends/receives data, passing it to a JSP page
It works fine, but when I define a security constraint in web.xml, and set a user login and password in tomcat-users.xml, connection blocks the stack trace:

java.lang.NullPointerExceptionRun started at test.NetBean.send(NetBean.java:68)
org.apache.jsp.tele_jsp._jspService(tele_jsp.java:93)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:432)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:224)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:169)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:581)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:927)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:987)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:579)
at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:1805)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
at java.lang.Thread.run(Thread.java:722)

Thanks in advance
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19762
    
  20

I'd start with investigating what's on line 68 of class test.NetBean. That's where the NPE originates from.

If that's not the cause of the problem because an invalid argument is passed to this method, you should check out class org.apache.jsp.tele_jsp. This is an automatically generated class based on your tele.jsp file. You can find its source in <TOMCAT>\work\Catalina\localhost\<WEBAPP>. Check out line 93 and try to trace it back to your original JSP file.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
tsa tham
Greenhorn

Joined: Mar 01, 2012
Posts: 2
Rob Spoor wrote:I'd start with investigating what's on line 68 of class test.NetBean. That's where the NPE originates from.

If that's not the cause of the problem because an invalid argument is passed to this method, you should check out class org.apache.jsp.tele_jsp. This is an automatically generated class based on your tele.jsp file. You can find its source in <TOMCAT>\work\Catalina\localhost\<WEBAPP>. Check out line 93 and try to trace it back to your original JSP file.


Hi,
thanks for your replay the method in line 93 witch related to test.NetBean work fine before I Define a Security Constraint on this Application in tomcat to protect some pages when I comment that in web.xml and tomcat-users.xml then it work fine and the bean open connection and send/received data from the server , only after Security Constraint defined in tomcat the problem occurs and the bean open connection but when the method net.send() try to send data an exception thrown .
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19762
    
  20

But did you check why the NullPointerException is thrown? Exceptions always have a reason, you just need to find it. By looking at the two locations I hinted at you should be able to get further.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Tomcat blocks JSP Bean connection