You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by alex xander <xa...@yahoo.com> on 2007/07/13 11:10:57 UTC

Struts 2 Spring IOC problem

i have some problem with Spring IOC
i use struts 2.x, hibernate 3.x and spring 2.x
my problem is
the destroy-method in my class don't respon anything
it's looks like spring doesn't recognize my destroy method
<bean     id="persistenceManager" class="com.bba.persistence.hibernate.HibernatePersistenceManager" 
            init-method="init"
            destroy-method="destroy"
            singleton="false">
        <property name="sessionFactory" ref="mySessionFactory"/>
        
    </bean>

i already implement org.springframework.beans.factory.DisposableBean in my class
can anyone help me

       
---------------------------------
Get the Yahoo! toolbar and be alerted to new email wherever you're surfing. 

Re: Struts 2 Spring IOC problem

Posted by alex xander <xa...@yahoo.com>.
i don't put that code in struts.xml, i put in application-context.xml
my problem is, i need to destroy my bean, but in spring reference that i read, the prototype bean is cannot use destroy-method="destroy" syntax to destroy it. can anyone give me some solution. thx chris for your answer

Chris Pratt <th...@gmail.com> wrote: I'm definitely no expert, but I think you're mixing new syntax with
old.  If I remember correctly singleton="false" was replaced with
scope="prototype".  So maybe it was treating your beans as singletons,
which is why they were never getting destroyed.
  (*Chris*)

On 7/13/07, alex xander  wrote:
> i have some problem with Spring IOC
> i use struts 2.x, hibernate 3.x and spring 2.x
> my problem is
> the destroy-method in my class don't respon anything
> it's looks like spring doesn't recognize my destroy method
> 
>             init-method="init"
>             destroy-method="destroy"
>             singleton="false">
>         

>
>     

>
> i already implement org.springframework.beans.factory.DisposableBean in my class
> can anyone help me
>
>
> ---------------------------------
> Get the Yahoo! toolbar and be alerted to new email wherever you're surfing.

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



       
---------------------------------
Building a website is a piece of cake. 
Yahoo! Small Business gives you all the tools to get online.

Re: Struts 2 Spring IOC problem

Posted by Chris Pratt <th...@gmail.com>.
I'm definitely no expert, but I think you're mixing new syntax with
old.  If I remember correctly singleton="false" was replaced with
scope="prototype".  So maybe it was treating your beans as singletons,
which is why they were never getting destroyed.
  (*Chris*)

On 7/13/07, alex xander <xa...@yahoo.com> wrote:
> i have some problem with Spring IOC
> i use struts 2.x, hibernate 3.x and spring 2.x
> my problem is
> the destroy-method in my class don't respon anything
> it's looks like spring doesn't recognize my destroy method
> <bean     id="persistenceManager" class="com.bba.persistence.hibernate.HibernatePersistenceManager"
>             init-method="init"
>             destroy-method="destroy"
>             singleton="false">
>         <property name="sessionFactory" ref="mySessionFactory"/>
>
>     </bean>
>
> i already implement org.springframework.beans.factory.DisposableBean in my class
> can anyone help me
>
>
> ---------------------------------
> Get the Yahoo! toolbar and be alerted to new email wherever you're surfing.

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