This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Tomcat blocks JSP Bean connection

 
tsa tham
Greenhorn
Posts: 2
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 20380
46
Chrome Eclipse IDE Java Windows
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
tsa tham
Greenhorn
Posts: 2
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 20380
46
Chrome Eclipse IDE Java Windows
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic