I will do that. Thanks.

But what I don’t understand is that I have not changed the
PersistenceFacade.java and the classes that uses it has not been changed
either.

I have only upgraded Struts and the dependencies.

Soren

-----Oprindelig meddelelse-----
Fra: ch...@chrismiles.org [mailto:ch...@chrismiles.org] 
Sendt: 26. maj 2010 17:15
Til: Struts Users Mailing List
Emne: Re: SV: PersistenceFacade

This appears not to be a Struts problem, just a coincidence as it clearly
states the problem is a null pointer exception, but I will point you to an
partial answer anyway.

When closing a database connection like that you should always check that
it is not null before closing it. Why it is null I could not tell you. You
should step through your code and make sure it is doing every it should be
before you call the close. If yuo are not obtaining a valid connection I
suggest starting there. You should probably be closing your database
within a finaly block as well.

Chris

> Of course. Here it comes
>
> 75203 [http-80-Processor24] ERROR
> org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/hb].[jsp]
> -
> Servlet.service() for servlet jsp threw exception
> java.lang.NullPointerException
>       at
>
nc.persistence.PersistenceFacade.closeConnection(PersistenceFacade.java:69)
>>

>>     public void closeConnection(Connection conn) {
>>
>>     try {
>>
>>       if(!conn.isClosed()) {
>>
>>         conn.close();
>>
>>       }
>>
>>     } catch (SQLException ex) {
>>
>>


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org

Reply via email to