Skip to main content

"__TimerPool not found" in clustered mode

11 replies [Last post]
lilwong
Offline
Joined: 2007-09-05

Hi,

I keep hitting on the following error when running in clustered mode:

-----------
[#|2007-12-28T08:12:42.500+0800|WARNING|sun-appserver9.1|javax.enterprise.system.container.ejb.entity.lifecycle|_ThreadID=57;_ThreadName=p: thread-pool-1; w: 36;_RequestID=ec45ba68-d015-4dbc-9565-93d9c55b8621;|JDO74004: Bean 'TimerMigrationBean' method setEntityContext:
com.sun.jdo.api.persistence.support.JDOFatalUserException: JDO76604: JNDI lookup for cmp-resource 'jdbc/__TimerPool' failed.
NestedException: javax.naming.NameNotFoundException: __TimerPool not found
at com.sun.jdo.spi.persistence.support.sqlstore.ejb.SunContainerHelper.getPersistenceManagerFactory(SunContainerHelper.java:330)
at com.sun.jdo.spi.persistence.support.sqlstore.ejb.CMPHelper.getPersistenceManagerFactory(CMPHelper.java:218)
at com.sun.ejb.containers.TimerMigrationBean649625130_ConcreteImpl.jdoLookupPersistenceManagerFactory(TimerMigrationBean649625130_ConcreteImpl.java:243)
at com.sun.ejb.containers.TimerMigrationBean649625130_ConcreteImpl.setEntityContext(TimerMigrationBean649625130_ConcreteImpl.java:194)
at com.sun.ejb.containers.EntityContainer$EntityContextFactory.create(EntityContainer.java:2515)
at com.sun.ejb.containers.util.pool.NonBlockingPool.preload(NonBlockingPool.java:280)
at com.sun.ejb.containers.util.pool.NonBlockingPool.doResize(NonBlockingPool.java:507)
at com.sun.ejb.containers.util.pool.NonBlockingPool$IdleBeanWork.run(NonBlockingPool.java:605)
at com.sun.ejb.containers.util.pool.NonBlockingPool$IdleBeanWork.service(NonBlockingPool.java:597)
at com.sun.ejb.containers.util.WorkAdapter.doWork(WorkAdapter.java:75)
at com.sun.corba.ee.impl.orbutil.threadpool.ThreadPoolImpl$WorkerThread.run(ThreadPoolImpl.java:555)

NestedStackTrace:
javax.naming.NameNotFoundException: __TimerPool not found
at com.sun.enterprise.naming.TransientContext.doLookup(TransientContext.java:216)
at com.sun.enterprise.naming.TransientContext.lookup(TransientContext.java:188)
at com.sun.enterprise.naming.TransientContext.lookup(TransientContext.java:192)
at com.sun.enterprise.naming.SerialContextProviderImpl.lookup(SerialContextProviderImpl.java:74)
at com.sun.enterprise.naming.LocalSerialContextProviderImpl.lookup(LocalSerialContextProviderImpl.java:111)
at com.sun.enterprise.naming.SerialContext.lookup(SerialContext.java:398)
at javax.naming.InitialContext.lookup(InitialContext.java:392)
at com.sun.jdo.spi.persistence.support.sqlstore.ejb.SunContainerHelper.getPersistenceManagerFactory(SunContainerHelper.java:299)
at com.sun.jdo.spi.persistence.support.sqlstore.ejb.CMPHelper.getPersistenceManagerFactory(CMPHelper.java:218)
at com.sun.ejb.containers.TimerMigrationBean649625130_ConcreteImpl.jdoLookupPersistenceManagerFactory(TimerMigrationBean649625130_ConcreteImpl.java:243)
at com.sun.ejb.containers.TimerMigrationBean649625130_ConcreteImpl.setEntityContext(TimerMigrationBean649625130_ConcreteImpl.java:194)
at com.sun.ejb.containers.EntityContainer$EntityContextFactory.create(EntityContainer.java:2515)
at com.sun.ejb.containers.util.pool.NonBlockingPool.preload(NonBlockingPool.java:280)
at com.sun.ejb.containers.util.pool.NonBlockingPool.doResize(NonBlockingPool.java:507)
at com.sun.ejb.containers.util.pool.NonBlockingPool$IdleBeanWork.run(NonBlockingPool.java:605)
at com.sun.ejb.containers.util.pool.NonBlockingPool$IdleBeanWork.service(NonBlockingPool.java:597)
at com.sun.ejb.containers.util.WorkAdapter.doWork(WorkAdapter.java:75)
at com.sun.corba.ee.impl.orbutil.threadpool.ThreadPoolImpl$WorkerThread.run(ThreadPoolImpl.java:555)
-----------

When I check on the __TimerPool JDBC resource under the Resources tab, it's enabled for the default "server" target. I cannot add my cluster configuration as one of the targets as it would give me an error "Creation or deletion of the system resource reference jdbc/__TimerPool is not allowed.".

Can I know what does this error mean and what are its implications? I guess how to fix it would be pretty useful as well :)

Thanks!
Wong

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
mvatkina
Offline
Joined: 2005-04-04

Hi Wong,

Timer service is purely for application-level usage. So if you don't need it, just ignore the error message all together.

Regards,
-marina

Jagadish Prasath Ramu

On Wed, 2008-01-09 at 21:54 -0800, glassfish@javadesktop.org wrote:
> Hi Marina,
>
> Thanks for the pointer.
>
> Regarding "if I need the timer service", I'm actually not using the Timer service in any of my code, but instead of trying to disable it, I was worried that Glassfish itself uses the Timer service for its own tasks. Say for example it may be using the Timer service to synchronize between the 2 instances? Would this be possible? Or is the Timer service purely for application-level usage?
>
> I don't understand what you mean when you say that "an embedded JavaDB database is not useful in a cluster". Can I trouble you to explain this a little bit more?
Embedded JavaDB will run within the caller's JVM. Derby(JavaDB) engine
does not run as a separate process. So, it will be available only within
one appserver instance and not across instances.

For more information :
http://db.apache.org/derby/papers/DerbyTut/embedded_intro.html

Thanks,
-Jagadish
>
> My application is supported by an Oracle database, I'll first create the schema in Oracle and point it there and see how it goes from there.
>
> Thanks!
> Wong
> [Message sent by forum member 'lilwong' (lilwong)]
>
> http://forums.java.net/jive/thread.jspa?messageID=253117
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@glassfish.dev.java.net
> For additional commands, e-mail: users-help@glassfish.dev.java.net
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@glassfish.dev.java.net
For additional commands, e-mail: users-help@glassfish.dev.java.net

lilwong
Offline
Joined: 2007-09-05

Yes, I understand what it means now.

Thanks!
Wong

lilwong
Offline
Joined: 2007-09-05

Hi Marina,

Thanks for the pointer.

Regarding "if I need the timer service", I'm actually not using the Timer service in any of my code, but instead of trying to disable it, I was worried that Glassfish itself uses the Timer service for its own tasks. Say for example it may be using the Timer service to synchronize between the 2 instances? Would this be possible? Or is the Timer service purely for application-level usage?

I don't understand what you mean when you say that "an embedded JavaDB database is not useful in a cluster". Can I trouble you to explain this a little bit more?

My application is supported by an Oracle database, I'll first create the schema in Oracle and point it there and see how it goes from there.

Thanks!
Wong

lilwong
Offline
Joined: 2007-09-05

Hi,

May I know when setting up an alternate connection pool for the TimerPool, what Resource Type should I use? The default __TimerPool connection pool is of type "XADataSource" while at the application level, I have been creating my DB connection pool as "DataSource".

A brief search on the web turned up this: "You need an XADataSource if you want to execute a Distributed Transaction. You need a Distributed Transaction if you have a transaction with 2 or more different (not equal) DataSources."

http://www.inetsoftware.de/products/jdbc/mssql/configuration/XADataSourc...

It doesn't LOOK like the TimerPool would span multiple data sources, so can I go ahead and create it as a normal "DataSource" connection pool?

Thanks,
Wong

mvatkina
Offline
Joined: 2005-04-04

This requirement comes in place if your application uses another resource, besides the TimerPool in the same transaction. To be able to commit properly, at least 1 of 2 resources need to be XA. If you are using the same database for the application and the timer service, you do not need to create 2 pools, just 2 jdbc resources that point to the same pool (or even tell the timer service via domain.xml settings which jdbc resource to use instead of the __TimerPool, but I personally think that it's more complicated).

HTH,
-marina

lilwong
Offline
Joined: 2007-09-05

Hmmm, this falls solidly into "has to be tried to be understood" for me... I'll run a few tests to confirm if I understand what you're saying, thanks!

km
Offline
Joined: 2005-10-28

Hi Wong,

It means that the __TimerPool is not available as a resource definition in your clustered
instance(s).

This is rather ugly. You should either logon to admin console and modify the ejb-timer
datasource to *point to* the global definition or create your own timer datasource.

If you look into domain.xml, you'll find that resource-ref is available only for the DAS
and not for other server instances.

- Kedar

mvatkina
Offline
Joined: 2005-04-04

Wong, Kedar,

In 9.0 and 8.x documentation it was a bit clearer, but Timer service by default uses an embedded JavaDB database to store the timers. In a cluster it's not useful, so the settings are not complete, so that if you need the timer service, please manually change the corresponding pool settings to use a global database, or change the pool name to be the one you already preconfigured. Then follow the regular steps for enabling a database in a cluster.

9.1 docs has only this: http://docs.sun.com/app/docs/doc/819-3672/6n5sj2ssd?l=en&a=view&q=TimerPool

Regards,
-marina

chinmayee_srivathsa
Offline
Joined: 2007-05-07

Is this the info that Wong is looking for?
http://docs.sun.com/app/docs/doc/820-3850/gfkrc?a=view

mvatkina
Offline
Joined: 2005-04-04

I'm not sure. His problem was that it's enabled only in DAS in a clustered env.