tomcat-taglibs-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Morgan Delagrange" <morga...@rcnchicago.com>
Subject Re: Problem with DBTags
Date Fri, 10 Aug 2001 22:30:17 GMT
Actually release() isn't even called at the end of the page anymore; now it is only called
at garbage collection time.

For now, I'll assume it is a problem w/ tag caching and see if I can prevent the NullPointerException.

BTW if you get the chance, you may want to try the very latest build.  I added a release call
to ResultSetTag just yesterday.

- Morgan

Steve Philp wrote on 8/10/01 6:29 am:

>Morgan Delagrange wrote:
>> 
>> You could also send me the 
>stack trace, if it shows  which 
>tag is generating the null 
>pointer.  It's  possible I need 
>to implement recent 
>clarifications to  the Servlet 
>spec.
>
>
>Here's the trace I get when 
>attempting to use two 
>statements (same 
>connection) on a single page:
>
>500 Servlet Exception
>
>java.lang.NullPointerExceptio
>n
>        at
>centura.java.sqlbase.Sqlbase
>ResultSet.getColumnType(S
>qlbaseResultSet.java:419)  at
>org.apache.taglibs.jdbc.result
>set.GetColumnTag.doStartT
>ag(GetColumnTag.java:124)  
>at 
>_index__jsp._jspService(/apc
>-ecsr/index.jsp:38)  at 
>com.caucho.jsp.JavaPage.ser
>vice(JavaPage.java:87)  at 
>com.caucho.jsp.JavaPage.sub
>service(JavaPage.java:81)  
>at 
>com.caucho.jsp.Page.service(
>Page.java:398)  at
>com.caucho.server.http.Filter
>ChainPage.doFilter(FilterChai
>nPage.java:166)  at
>com.caucho.server.http.Invoc
>ation.service(Invocation.java
>:272)  at
>com.caucho.server.http.Cach
>eInvocation.service(CacheInv
>ocation.java:128)  at
>com.caucho.server.http.QRe
>questDispatcher.forward(QR
>equestDispatcher.java:209)  
>at
>com.caucho.server.http.QRe
>questDispatcher.forward(QR
>equestDispatcher.java:96)  
>at
>com.caucho.server.http.FileS
>ervlet.service(FileServlet.jav
>a:288)  at
>com.caucho.server.http.Filter
>ChainServlet.doFilter(FilterC
>hainServlet.java:82)  at
>com.caucho.server.http.Invoc
>ation.service(Invocation.java
>:272)  at
>com.caucho.server.http.Cach
>eInvocation.service(CacheInv
>ocation.java:128)  at
>com.caucho.server.http.Runn
>erRequest.handleRequest(Ru
>nnerRequest.java:334)  at
>com.caucho.server.http.Runn
>erRequest.handleConnection
>(RunnerRequest.java:266)  
>at 
>com.caucho.server.TcpConne
>ction.run(TcpConnection.jav
>a:140)  at 
>java.lang.Thread.run(Thread
>.java:484)
>
>
>Resin 2.0.1 (built Tue Jul 10 
>13:13:19 PDT 2001) 
>
>
>Here's the page that 
>generates the error:
>
><%@ page session="true" 
>%>
><%@ taglib uri="/WEB-
>INF/request.tld" 
>prefix="req"  %>
><%@ taglib uri="/WEB-
>INF/session.tld" 
>prefix="sess" %>
><%@ taglib uri="/WEB-
>INF/dbtags.tld"  prefix="sql"  
>%>
> 
><sql:connection id="conn1">
>        
><sql:jndiName>java:comp/e
>nv/jdbc/advdb</sql:jndiNa
>me>
></sql:connection>
> 
><req:request 
>id="reqProperties"/>
> 
><req:isuserinrole 
>role="salesagent">
>        <sql:statement 
>id="stmt1" conn="conn1">
>                <sql:query>
>                        select sacode, 
>dbname from security_cust 	
>		where logon_id = 
>'<jsp:getProperty 
>name="reqProperties" 
>property="remoteUser"/>'
>                </sql:query>
>                <sql:resultSet 
>id="rs1">
>                        
><sess:setattribute 
>name="salesagentCode"> 	
>			
><sql:getColumn 
>position="1"/>
>			
></sess:setattribute>
>                        
><sess:setattribute 
>name="jndiDBName"> 		
>		<sql:getColumn 
>position="2"/>
>			
></sess:setattribute>
>                </sql:resultSet>
>        </sql:statement>
>        <sql:connection 
>id="conn2">
>                
><sql:jndiName><sess:attribu
>te 
>name="jndiDBName"/></sq
>l:jndiName>
>        </sql:connection>
> 
>        <sql:statement 
>id="stmt2" conn="conn2">
>                <sql:query>
>                        select saname 
>from salesagent 			
>where sacode = 
><sess:attribute 
>name="salesagentCode"/>
>                </sql:query>
>                <sql:resultSet 
>id="rs2">
>                        
><sess:setattribute 
>name="salesagentName"> 	
>			
><sql:getColumn 
>position="1"/>
>			
></sess:setattribute>
>                </sql:resultSet>
>        </sql:statement>
></req:isuserinrole>
> 
><jsp:forward 
>page="/mainMenu.jsp"/>
>
>
>My question to the Resin 
>author received the following 
>explanation of what might 
>cause problems.  I admit I'm a 
>complete newbie to Java, 
>JSP, and taglibs, so I'm not 
>sure of the implications of his 
>statement:
>
>	There are two possible 
>changes in the taglibs.  First 
>any attributes, 	e.g. 
>setFoo, must only be set by 
>the servlet engine.  Some 
>taglibs set
>a 
>	default value if the user 
>hasn't set the attribute.  
>Second, the taglib 	needs to 
>initialize in the doStartTag 
>method.  It can't rely on the 	
>release() method.  The 
>release() is called before the 
>end of the page, 	but it's 
>not called in between reuse.
>
>
>Thanks for your continued 
>help,
>
>--
>Steve Philp
>Advance Packaging 
>Corporation
>sphilp@ameritech.net


Mime
View raw message