You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@geronimo.apache.org by fmchale <fm...@cisco.com> on 2008/07/10 03:46:54 UTC

Stateful Session Bean NoSuchObjectException

Hello,

After much research I have become completely stumped and confused on this
issue (pardon me as well if its something simple, I am learning JEE
development).  I currently have a Stateful Session bean that is accessed by
web clients.  After approximately 20 minutes I get a NoSuchObjectException -
Stateful Session Bean has timed out.  Is there anyway I can set the timeout
to be longer then 20 minutes. Im assuming that after 20 minutes the timeout
occurs and instead of passivating the bean is completely destroyed.  Here is
a snippet of important bean parts.

public @Stateful class InternTempBean implements InternTemp{

	@PersistenceContext(unitName="MatchMakerModel",
type=PersistenceContextType.EXTENDED)
	EntityManager emMatchMaker;
	
	public InternTempBean(){
	}

        .. some more bean methods

	@Remove
	public void mergeIntern(Intern_Temp intern){
		emMatchMaker.merge(intern);
	}

I was thinking maybe there was some setting I could tell openejb to not
timeout after 20 minutes.
Can anyone guide me in the right direction here.

Thanks,
Fred

-- 
View this message in context: http://www.nabble.com/Stateful-Session-Bean-NoSuchObjectException-tp18374356s134p18374356.html
Sent from the Apache Geronimo - Users mailing list archive at Nabble.com.


Re: Stateful Session Bean NoSuchObjectException

Posted by fmchale <fm...@cisco.com>.
Sounds great, I will be busy for the next week with a work project.  But I
would love to work more on this.  Thanks a ton all.

David Blevins wrote:
> 
> 
> On Jul 9, 2008, at 9:12 PM, fmchale wrote:
> 
>>
>> Thanks Kevan this works great, do you know if this has to be set for  
>> the
>> whole of openejb or can it be set on  a ejb by ejb basis?
> 
> It's possible to configure a second stateful container with a  
> different timeout and deploy some beans in the no timeout container  
> and other beans into the short timeout container.
> 
> There isn't much doc on this, so if you'd like to try it let me know  
> and we can blaze that trail together.
> 
> -David
> 
>> Kevan Miller wrote:
>>>
>>>
>>> On Jul 9, 2008, at 9:46 PM, fmchale wrote:
>>>
>>>>
>>>> Hello,
>>>>
>>>> After much research I have become completely stumped and confused on
>>>> this
>>>> issue (pardon me as well if its something simple, I am learning JEE
>>>> development).  I currently have a Stateful Session bean that is
>>>> accessed by
>>>> web clients.  After approximately 20 minutes I get a
>>>> NoSuchObjectException -
>>>> Stateful Session Bean has timed out.  Is there anyway I can set the
>>>> timeout
>>>> to be longer then 20 minutes. Im assuming that after 20 minutes the
>>>> timeout
>>>> occurs and instead of passivating the bean is completely destroyed.
>>>> Here is
>>>> a snippet of important bean parts.
>>>>
>>>> public @Stateful class InternTempBean implements InternTemp{
>>>>
>>>> 	@PersistenceContext(unitName="MatchMakerModel",
>>>> type=PersistenceContextType.EXTENDED)
>>>> 	EntityManager emMatchMaker;
>>>> 	
>>>> 	public InternTempBean(){
>>>> 	}
>>>>
>>>>       .. some more bean methods
>>>>
>>>> 	@Remove
>>>> 	public void mergeIntern(Intern_Temp intern){
>>>> 		emMatchMaker.merge(intern);
>>>> 	}
>>>>
>>>> I was thinking maybe there was some setting I could tell openejb to
>>>> not
>>>> timeout after 20 minutes.
>>>> Can anyone guide me in the right direction here.
>>>
>>> As you've figured out, the default timeout is 20 minutes.
>>>
>>> To alter this default:
>>>
>>> 1. stop your server
>>> 2. edit var/config/config.xml
>>> 3. locate the openejb module element and make it looks something  
>>> like:
>>>
>>>     <module name="org.apache.geronimo.configs/openejb/2.1.2-SNAPSHOT/
>>> car">
>>>         <gbean name="EJBNetworkService">
>>>             <attribute name="port">${OpenEJBPort + PortOffset}</
>>> attribute>
>>>             <attribute name="host">${ServerHostname}</attribute>
>>>         </gbean>
>>>         <gbean name="DefaultStatefulContainer">
>>>             <attribute name="properties">PoolSize=1000
>>>               TimeOut=30</attribute>
>>>         </gbean>
>>>     </module>
>>>
>>> For an infinite TimeOut, set the value to 0.
>>>
>>> --kevan
>>>
>>>
>>
>> -- 
>> View this message in context:
>> http://www.nabble.com/Stateful-Session-Bean-NoSuchObjectException-tp18374356s134p18375532.html
>> Sent from the Apache Geronimo - Users mailing list archive at  
>> Nabble.com.
>>
>>
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Stateful-Session-Bean-NoSuchObjectException-tp18374356s134p18395850.html
Sent from the Apache Geronimo - Users mailing list archive at Nabble.com.


Re: Stateful Session Bean NoSuchObjectException

Posted by David Blevins <da...@visi.com>.
On Jul 9, 2008, at 9:12 PM, fmchale wrote:

>
> Thanks Kevan this works great, do you know if this has to be set for  
> the
> whole of openejb or can it be set on  a ejb by ejb basis?

It's possible to configure a second stateful container with a  
different timeout and deploy some beans in the no timeout container  
and other beans into the short timeout container.

There isn't much doc on this, so if you'd like to try it let me know  
and we can blaze that trail together.

-David

> Kevan Miller wrote:
>>
>>
>> On Jul 9, 2008, at 9:46 PM, fmchale wrote:
>>
>>>
>>> Hello,
>>>
>>> After much research I have become completely stumped and confused on
>>> this
>>> issue (pardon me as well if its something simple, I am learning JEE
>>> development).  I currently have a Stateful Session bean that is
>>> accessed by
>>> web clients.  After approximately 20 minutes I get a
>>> NoSuchObjectException -
>>> Stateful Session Bean has timed out.  Is there anyway I can set the
>>> timeout
>>> to be longer then 20 minutes. Im assuming that after 20 minutes the
>>> timeout
>>> occurs and instead of passivating the bean is completely destroyed.
>>> Here is
>>> a snippet of important bean parts.
>>>
>>> public @Stateful class InternTempBean implements InternTemp{
>>>
>>> 	@PersistenceContext(unitName="MatchMakerModel",
>>> type=PersistenceContextType.EXTENDED)
>>> 	EntityManager emMatchMaker;
>>> 	
>>> 	public InternTempBean(){
>>> 	}
>>>
>>>       .. some more bean methods
>>>
>>> 	@Remove
>>> 	public void mergeIntern(Intern_Temp intern){
>>> 		emMatchMaker.merge(intern);
>>> 	}
>>>
>>> I was thinking maybe there was some setting I could tell openejb to
>>> not
>>> timeout after 20 minutes.
>>> Can anyone guide me in the right direction here.
>>
>> As you've figured out, the default timeout is 20 minutes.
>>
>> To alter this default:
>>
>> 1. stop your server
>> 2. edit var/config/config.xml
>> 3. locate the openejb module element and make it looks something  
>> like:
>>
>>     <module name="org.apache.geronimo.configs/openejb/2.1.2-SNAPSHOT/
>> car">
>>         <gbean name="EJBNetworkService">
>>             <attribute name="port">${OpenEJBPort + PortOffset}</
>> attribute>
>>             <attribute name="host">${ServerHostname}</attribute>
>>         </gbean>
>>         <gbean name="DefaultStatefulContainer">
>>             <attribute name="properties">PoolSize=1000
>>               TimeOut=30</attribute>
>>         </gbean>
>>     </module>
>>
>> For an infinite TimeOut, set the value to 0.
>>
>> --kevan
>>
>>
>
> -- 
> View this message in context: http://www.nabble.com/Stateful-Session-Bean-NoSuchObjectException-tp18374356s134p18375532.html
> Sent from the Apache Geronimo - Users mailing list archive at  
> Nabble.com.
>
>


Re: Stateful Session Bean NoSuchObjectException

Posted by fmchale <fm...@cisco.com>.
Thanks Kevan this works great, do you know if this has to be set for the
whole of openejb or can it be set on  a ejb by ejb basis?

Kevan Miller wrote:
> 
> 
> On Jul 9, 2008, at 9:46 PM, fmchale wrote:
> 
>>
>> Hello,
>>
>> After much research I have become completely stumped and confused on  
>> this
>> issue (pardon me as well if its something simple, I am learning JEE
>> development).  I currently have a Stateful Session bean that is  
>> accessed by
>> web clients.  After approximately 20 minutes I get a  
>> NoSuchObjectException -
>> Stateful Session Bean has timed out.  Is there anyway I can set the  
>> timeout
>> to be longer then 20 minutes. Im assuming that after 20 minutes the  
>> timeout
>> occurs and instead of passivating the bean is completely destroyed.   
>> Here is
>> a snippet of important bean parts.
>>
>> public @Stateful class InternTempBean implements InternTemp{
>>
>> 	@PersistenceContext(unitName="MatchMakerModel",
>> type=PersistenceContextType.EXTENDED)
>> 	EntityManager emMatchMaker;
>> 	
>> 	public InternTempBean(){
>> 	}
>>
>>        .. some more bean methods
>>
>> 	@Remove
>> 	public void mergeIntern(Intern_Temp intern){
>> 		emMatchMaker.merge(intern);
>> 	}
>>
>> I was thinking maybe there was some setting I could tell openejb to  
>> not
>> timeout after 20 minutes.
>> Can anyone guide me in the right direction here.
> 
> As you've figured out, the default timeout is 20 minutes.
> 
> To alter this default:
> 
> 1. stop your server
> 2. edit var/config/config.xml
> 3. locate the openejb module element and make it looks something like:
> 
>      <module name="org.apache.geronimo.configs/openejb/2.1.2-SNAPSHOT/ 
> car">
>          <gbean name="EJBNetworkService">
>              <attribute name="port">${OpenEJBPort + PortOffset}</ 
> attribute>
>              <attribute name="host">${ServerHostname}</attribute>
>          </gbean>
>          <gbean name="DefaultStatefulContainer">
>              <attribute name="properties">PoolSize=1000
>                TimeOut=30</attribute>
>          </gbean>
>      </module>
> 
> For an infinite TimeOut, set the value to 0.
> 
> --kevan
> 
> 

-- 
View this message in context: http://www.nabble.com/Stateful-Session-Bean-NoSuchObjectException-tp18374356s134p18375532.html
Sent from the Apache Geronimo - Users mailing list archive at Nabble.com.


Re: Stateful Session Bean NoSuchObjectException

Posted by Kevan Miller <ke...@gmail.com>.
On Jul 9, 2008, at 9:46 PM, fmchale wrote:

>
> Hello,
>
> After much research I have become completely stumped and confused on  
> this
> issue (pardon me as well if its something simple, I am learning JEE
> development).  I currently have a Stateful Session bean that is  
> accessed by
> web clients.  After approximately 20 minutes I get a  
> NoSuchObjectException -
> Stateful Session Bean has timed out.  Is there anyway I can set the  
> timeout
> to be longer then 20 minutes. Im assuming that after 20 minutes the  
> timeout
> occurs and instead of passivating the bean is completely destroyed.   
> Here is
> a snippet of important bean parts.
>
> public @Stateful class InternTempBean implements InternTemp{
>
> 	@PersistenceContext(unitName="MatchMakerModel",
> type=PersistenceContextType.EXTENDED)
> 	EntityManager emMatchMaker;
> 	
> 	public InternTempBean(){
> 	}
>
>        .. some more bean methods
>
> 	@Remove
> 	public void mergeIntern(Intern_Temp intern){
> 		emMatchMaker.merge(intern);
> 	}
>
> I was thinking maybe there was some setting I could tell openejb to  
> not
> timeout after 20 minutes.
> Can anyone guide me in the right direction here.

As you've figured out, the default timeout is 20 minutes.

To alter this default:

1. stop your server
2. edit var/config/config.xml
3. locate the openejb module element and make it looks something like:

     <module name="org.apache.geronimo.configs/openejb/2.1.2-SNAPSHOT/ 
car">
         <gbean name="EJBNetworkService">
             <attribute name="port">${OpenEJBPort + PortOffset}</ 
attribute>
             <attribute name="host">${ServerHostname}</attribute>
         </gbean>
         <gbean name="DefaultStatefulContainer">
             <attribute name="properties">PoolSize=1000
               TimeOut=30</attribute>
         </gbean>
     </module>

For an infinite TimeOut, set the value to 0.

--kevan