You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by dege <de...@pointclickcare.com> on 2006/08/21 22:25:46 UTC

derby db failing on restart

We are developing on Resin 3.x using spring to configure ActiveMQ 4. 
Whenever we do a hot deploy (deploy a class to the webapps/ROOT/WEB-INF
directory while resin is running) resin has to unload and then reload the
spring context.  However, when it does this the derby db used for ActiveMQ's
journaling fails to restart resulting in JMS no longer functioning.

 In the activemq config file I have the  useShutdownHook flag set to true
but it only seems to matter when you actually shutdown Resin as opposed to
having the spring context reloaded.

I'm assuming its related to  the derby database not being notified that a
restart has happened but I'm not sure how to fix this.  Anyone have any
ideas? 

A portion of the stack trace is below.

21/08/2006 15:58:44.857 [resin-21] DEBUG Could not get JDBC connection:
Failed to start database 'derbydb', see the next
 exception for details., due to: Another instance of Derby may have already
booted the database C:\mpgi_staging\PCC\pcc_
messages\journal\derbydb.
ERROR XSDB6: Another instance of Derby may have already booted the database
C:\mpgi_staging\PCC\pcc_messages\journal\der
bydb.
        at
org.apache.derby.iapi.error.StandardException.newException(Unknown Source)
        at
org.apache.derby.impl.store.raw.data.BaseDataFileFactory.privGetJBMSLockOnDB(Unknown
Source)
        at
org.apache.derby.impl.store.raw.data.BaseDataFileFactory.run(Unknown Source)
        at java.security.AccessController.doPrivileged(Native Method)
        at
org.apache.derby.impl.store.raw.data.BaseDataFileFactory.getJBMSLockOnDB(Unknown
Source)
        at
org.apache.derby.impl.store.raw.data.BaseDataFileFactory.boot(Unknown
Source)
        at org.apache.derby.impl.services.monitor.BaseMonitor.boot(Unknown
Source)
        at
org.apache.derby.impl.services.monitor.TopService.bootModule(Unknown Source)
        at
org.apache.derby.impl.services.monitor.BaseMonitor.startModule(Unknown
Source)
        at
org.apache.derby.iapi.services.monitor.Monitor.bootServiceModule(Unknown
Source)
        at org.apache.derby.impl.store.raw.RawStore.boot(Unknown Source)
        at org.apache.derby.impl.services.monitor.BaseMonitor.boot(Unknown
Source)
        at
org.apache.derby.impl.services.monitor.TopService.bootModule(Unknown Source)
        at
org.apache.derby.impl.services.monitor.BaseMonitor.startModule(Unknown
Source)
        at
org.apache.derby.iapi.services.monitor.Monitor.bootServiceModule(Unknown
Source)
        at org.apache.derby.impl.store.access.RAMAccessManager.boot(Unknown
Source)
        at org.apache.derby.impl.services.monitor.BaseMonitor.boot(Unknown
Source)
        at
org.apache.derby.impl.services.monitor.TopService.bootModule(Unknown Source)
        at
org.apache.derby.impl.services.monitor.BaseMonitor.startModule(Unknown
Source)
        at
org.apache.derby.iapi.services.monitor.Monitor.bootServiceModule(Unknown
Source)
        at org.apache.derby.impl.db.BasicDatabase.bootStore(Unknown Source)
        at org.apache.derby.impl.db.BasicDatabase.boot(Unknown Source)
        at org.apache.derby.impl.services.monitor.BaseMonitor.boot(Unknown
Source)
        at
org.apache.derby.impl.services.monitor.TopService.bootModule(Unknown Source)
        at
org.apache.derby.impl.services.monitor.BaseMonitor.bootService(Unknown
Source)
        at
org.apache.derby.impl.services.monitor.BaseMonitor.startProviderService(Unknown
Source)
        at
org.apache.derby.impl.services.monitor.BaseMonitor.findProviderAndStartService(Unknown
Source)
        at
org.apache.derby.impl.services.monitor.BaseMonitor.startPersistentService(Unknown
Source)
        at
org.apache.derby.impl.services.monitor.BaseMonitor.startPersistentService(Unknown
Source)
        at
org.apache.derby.iapi.services.monitor.Monitor.startPersistentService(Unknown
Source)
        at org.apache.derby.impl.jdbc.EmbedConnection.bootDatabase(Unknown
Source)
        at org.apache.derby.impl.jdbc.EmbedConnection.<init>(Unknown Source)
        at org.apache.derby.impl.jdbc.EmbedConnection30.<init>(Unknown
Source)
        at org.apache.derby.jdbc.Driver30.getNewEmbedConnection(Unknown
Source)
        at org.apache.derby.jdbc.InternalDriver.connect(Unknown Source)
        at org.apache.derby.jdbc.EmbeddedDataSource.getConnection(Unknown
Source)
        at org.apache.derby.jdbc.EmbeddedDataSource.getConnection(Unknown
Source)
        at
org.apache.activemq.store.jdbc.TransactionContext.getConnection(TransactionContext.java:54)
        at
org.apache.activemq.store.jdbc.JDBCPersistenceAdapter.createAdapter(JDBCPersistenceAdapter.java:229)
        at
org.apache.activemq.store.jdbc.JDBCPersistenceAdapter.getAdapter(JDBCPersistenceAdapter.java:213)
        at
org.apache.activemq.store.jdbc.JDBCPersistenceAdapter.start(JDBCPersistenceAdapter.java:139)
        at
org.apache.activemq.store.journal.JournalPersistenceAdapter.start(JournalPersistenceAdapter.java:215)
        at
org.apache.activemq.broker.BrokerService.createRegionBroker(BrokerService.java:930)
        at
org.apache.activemq.broker.BrokerService.createBroker(BrokerService.java:888)
        at
org.apache.activemq.broker.BrokerService.getBroker(BrokerService.java:458)
        at
org.apache.activemq.broker.BrokerService.start(BrokerService.java:361)
        at
org.apache.activemq.xbean.XBeanBrokerService.afterPropertiesSet(XBeanBrokerService.java:43)
        at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowi
-- 
View this message in context: http://www.nabble.com/derby-db-failing-on-restart-tf2142524.html#a5914237
Sent from the ActiveMQ - User forum at Nabble.com.


Re: derby db failing on restart

Posted by James Strachan <ja...@gmail.com>.
On 11/10/06, dege <de...@pointclickcare.com> wrote:
>
> Any update on this?

Afraid not - no idea why you're having this problem.

To simplify your hot-swap configuration it might be easier to run the
ActiveMQ broker as a separate process from your hot-swapping wars.

-- 

James
-------
http://radio.weblogs.com/0112098/

Re: derby db failing on restart

Posted by dege <de...@pointclickcare.com>.
Any update on this?
Thanks

dege wrote:
> 
> Attached is the application log with debugging turned on
> At line 1657 is where resin starts to unload and then reload the
> application context as a result of deploying an updated class file to the
> webapps WEB-INF/classes directory.
> 
> I looked at the derby.log and it is empty.
> 
> In terms of configuration we use the
> org.springframework.web.context.ContextLoaderListener which loads our
> context file on startup.  This context file in turn loads a local broker 
> 
> <bean id="broker" class="org.apache.activemq.xbean.BrokerFactoryBean">
>     <property name="config"
> value="classpath:config/activemq_pcc_broker4.xml" />
>     <property name="start" value="true" />
>   </bean>
> 
> the config file looks like the following:
> 
> <beans xmlns="http://activemq.org/config/1.0">
> 
>   <broker  useJmx="true" brokerName="pccapp" persistent="true"
> useShutdownHook="true">
>     <transportConnectors>
>            <transportConnector uri="vm://pccapp"/>
>     </transportConnectors>
> 
>   <persistenceAdapter>
>   <journaledJDBC journalLogFiles="5"
> dataDirectory="./pcc_messages/journal" /> 
>   </persistenceAdapter>
> 
> </broker>
> </beans>
> 
> 
> We also setup a some message driven pojo's pointing to a remote broker
> that isn't up which is why you see all the other connect errors.  In
> development this is hardly ever up unless we are working on that part of
> the application.
> 
> 
>  http://www.nabble.com/file/903/esolutions.log esolutions.log 
> 

-- 
View this message in context: http://www.nabble.com/derby-db-failing-on-restart-tf2142524.html#a7283881
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: derby db failing on restart

Posted by dege <de...@pointclickcare.com>.
Attached is the application log with debugging turned on
At line 1657 is where resin starts to unload and then reload the application
context as a result of deploying an updated class file to the webapps
WEB-INF/classes directory.

I looked at the derby.log and it is empty.

In terms of configuration we use the
org.springframework.web.context.ContextLoaderListener which loads our
context file on startup.  This context file in turn loads a local broker 

<bean id="broker" class="org.apache.activemq.xbean.BrokerFactoryBean">
    <property name="config"
value="classpath:config/activemq_pcc_broker4.xml" />
    <property name="start" value="true" />
  </bean>

the config file looks like the following:

<beans xmlns="http://activemq.org/config/1.0">

  <broker  useJmx="true" brokerName="pccapp" persistent="true"
useShutdownHook="true">
    <transportConnectors>
           <transportConnector uri="vm://pccapp"/>
    </transportConnectors>

  <persistenceAdapter>
  <journaledJDBC journalLogFiles="5" dataDirectory="./pcc_messages/journal"
/> 
  </persistenceAdapter>

</broker>
</beans>


We also setup a some message driven pojo's pointing to a remote broker that
isn't up which is why you see all the other connect errors.  In development
this is hardly ever up unless we are working on that part of the
application.



-- 
View this message in context: http://www.nabble.com/derby-db-failing-on-restart-tf2142524.html#a5929474
Sent from the ActiveMQ - User forum at Nabble.com.


Re: derby db failing on restart

Posted by James Strachan <ja...@gmail.com>.
Could you show us your log? How are you configuring ActiveMQ & how are
you starting/stopping the broker?

On 8/21/06, dege <de...@pointclickcare.com> wrote:
>
> We are developing on Resin 3.x using spring to configure ActiveMQ 4.
> Whenever we do a hot deploy (deploy a class to the webapps/ROOT/WEB-INF
> directory while resin is running) resin has to unload and then reload the
> spring context.  However, when it does this the derby db used for ActiveMQ's
> journaling fails to restart resulting in JMS no longer functioning.
>
>  In the activemq config file I have the  useShutdownHook flag set to true
> but it only seems to matter when you actually shutdown Resin as opposed to
> having the spring context reloaded.
>
> I'm assuming its related to  the derby database not being notified that a
> restart has happened but I'm not sure how to fix this.  Anyone have any
> ideas?
>
> A portion of the stack trace is below.
>
> 21/08/2006 15:58:44.857 [resin-21] DEBUG Could not get JDBC connection:
> Failed to start database 'derbydb', see the next
>  exception for details., due to: Another instance of Derby may have already
> booted the database C:\mpgi_staging\PCC\pcc_
> messages\journal\derbydb.
> ERROR XSDB6: Another instance of Derby may have already booted the database
> C:\mpgi_staging\PCC\pcc_messages\journal\der
> bydb.
>         at
> org.apache.derby.iapi.error.StandardException.newException(Unknown Source)
>         at
> org.apache.derby.impl.store.raw.data.BaseDataFileFactory.privGetJBMSLockOnDB(Unknown
> Source)
>         at
> org.apache.derby.impl.store.raw.data.BaseDataFileFactory.run(Unknown Source)
>         at java.security.AccessController.doPrivileged(Native Method)
>         at
> org.apache.derby.impl.store.raw.data.BaseDataFileFactory.getJBMSLockOnDB(Unknown
> Source)
>         at
> org.apache.derby.impl.store.raw.data.BaseDataFileFactory.boot(Unknown
> Source)
>         at org.apache.derby.impl.services.monitor.BaseMonitor.boot(Unknown
> Source)
>         at
> org.apache.derby.impl.services.monitor.TopService.bootModule(Unknown Source)
>         at
> org.apache.derby.impl.services.monitor.BaseMonitor.startModule(Unknown
> Source)
>         at
> org.apache.derby.iapi.services.monitor.Monitor.bootServiceModule(Unknown
> Source)
>         at org.apache.derby.impl.store.raw.RawStore.boot(Unknown Source)
>         at org.apache.derby.impl.services.monitor.BaseMonitor.boot(Unknown
> Source)
>         at
> org.apache.derby.impl.services.monitor.TopService.bootModule(Unknown Source)
>         at
> org.apache.derby.impl.services.monitor.BaseMonitor.startModule(Unknown
> Source)
>         at
> org.apache.derby.iapi.services.monitor.Monitor.bootServiceModule(Unknown
> Source)
>         at org.apache.derby.impl.store.access.RAMAccessManager.boot(Unknown
> Source)
>         at org.apache.derby.impl.services.monitor.BaseMonitor.boot(Unknown
> Source)
>         at
> org.apache.derby.impl.services.monitor.TopService.bootModule(Unknown Source)
>         at
> org.apache.derby.impl.services.monitor.BaseMonitor.startModule(Unknown
> Source)
>         at
> org.apache.derby.iapi.services.monitor.Monitor.bootServiceModule(Unknown
> Source)
>         at org.apache.derby.impl.db.BasicDatabase.bootStore(Unknown Source)
>         at org.apache.derby.impl.db.BasicDatabase.boot(Unknown Source)
>         at org.apache.derby.impl.services.monitor.BaseMonitor.boot(Unknown
> Source)
>         at
> org.apache.derby.impl.services.monitor.TopService.bootModule(Unknown Source)
>         at
> org.apache.derby.impl.services.monitor.BaseMonitor.bootService(Unknown
> Source)
>         at
> org.apache.derby.impl.services.monitor.BaseMonitor.startProviderService(Unknown
> Source)
>         at
> org.apache.derby.impl.services.monitor.BaseMonitor.findProviderAndStartService(Unknown
> Source)
>         at
> org.apache.derby.impl.services.monitor.BaseMonitor.startPersistentService(Unknown
> Source)
>         at
> org.apache.derby.impl.services.monitor.BaseMonitor.startPersistentService(Unknown
> Source)
>         at
> org.apache.derby.iapi.services.monitor.Monitor.startPersistentService(Unknown
> Source)
>         at org.apache.derby.impl.jdbc.EmbedConnection.bootDatabase(Unknown
> Source)
>         at org.apache.derby.impl.jdbc.EmbedConnection.<init>(Unknown Source)
>         at org.apache.derby.impl.jdbc.EmbedConnection30.<init>(Unknown
> Source)
>         at org.apache.derby.jdbc.Driver30.getNewEmbedConnection(Unknown
> Source)
>         at org.apache.derby.jdbc.InternalDriver.connect(Unknown Source)
>         at org.apache.derby.jdbc.EmbeddedDataSource.getConnection(Unknown
> Source)
>         at org.apache.derby.jdbc.EmbeddedDataSource.getConnection(Unknown
> Source)
>         at
> org.apache.activemq.store.jdbc.TransactionContext.getConnection(TransactionContext.java:54)
>         at
> org.apache.activemq.store.jdbc.JDBCPersistenceAdapter.createAdapter(JDBCPersistenceAdapter.java:229)
>         at
> org.apache.activemq.store.jdbc.JDBCPersistenceAdapter.getAdapter(JDBCPersistenceAdapter.java:213)
>         at
> org.apache.activemq.store.jdbc.JDBCPersistenceAdapter.start(JDBCPersistenceAdapter.java:139)
>         at
> org.apache.activemq.store.journal.JournalPersistenceAdapter.start(JournalPersistenceAdapter.java:215)
>         at
> org.apache.activemq.broker.BrokerService.createRegionBroker(BrokerService.java:930)
>         at
> org.apache.activemq.broker.BrokerService.createBroker(BrokerService.java:888)
>         at
> org.apache.activemq.broker.BrokerService.getBroker(BrokerService.java:458)
>         at
> org.apache.activemq.broker.BrokerService.start(BrokerService.java:361)
>         at
> org.apache.activemq.xbean.XBeanBrokerService.afterPropertiesSet(XBeanBrokerService.java:43)
>         at
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowi
> --
> View this message in context: http://www.nabble.com/derby-db-failing-on-restart-tf2142524.html#a5914237
> Sent from the ActiveMQ - User forum at Nabble.com.
>
>


-- 

James
-------
http://radio.weblogs.com/0112098/