struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Søren Blidorf <so...@nolas.dk>
Subject SV: SV: SV: PersistenceFacade
Date Wed, 26 May 2010 15:55:10 GMT
I feel like such an ass.

During the upgrade I must have deleted an initparam from the struts-config,
and that was why the PersistenceFacade didn’t work.

Sorry for wasting your time, but thanks for the effort.

Soren

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

Struts is only a facade round the existing JSP and servlet technologies so
I cant personally see them causing the problem (prove me wrong?).
Coincidences happen I am afraid (to myself included). Good luck debugging
your code.

Chris

> 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: chris@chrismiles.org [mailto:chris@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-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>
>


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


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


Mime
View raw message