activemq-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Holger Hoffstätte (JIRA) <>
Subject [jira] Commented: (AMQ-528) 4.0 M4 NullPointerException while shutting down
Date Fri, 23 Jun 2006 13:34:51 GMT
    [ ] 

Holger Hoffstätte commented on AMQ-528:

This one is *really* weird so I decided to ask Dawid Kurzyniec what might cause this. Here's
his reply:

Dawid Kurzyniec wrote:
> Holger Hoffstätte wrote:
>> Hello Dawid -
>> Could you please have a quick look at
>> and maybe post a
>> comment if you have any idea what might be going wrong there? It's very weird.
> I think the exception may be originating from native code
> (perf.highResCounter()). I suppose that something is freed in the JVM in
> the course of the shutdown, making it respond badly to highResCounter
> and resulting in the exception. (I've seen some analogous behavior with
> Java 1.4 logging: the loggers won't initialize during shutdown, so they
> won't print anything unless they did before the shutdown initiated).
> If this is the case, there's not much there can be done about it, except
> 1) trying a different JVM, or 2) switching to a different NanoTimer (for
> instance,
> or to use a custom nanotimer if you need more than ms granularity).
> Regards,
> Dawid

I'll try to see if the native JDK 1.5 nanoTimer could be used dynamically; this might help.
The other thing that the stack traces show is that the queue in question is the work queue
of an ExecutorService, so it seems to me that properly shutting down that service would also
solve the problem of the timer going away prematurely.

> 4.0 M4 NullPointerException while shutting down
> -----------------------------------------------
>          Key: AMQ-528
>          URL:
>      Project: ActiveMQ
>         Type: Bug

>     Versions: 4.0 M4
>  Environment: RedHat Linux Enterprise Server 3, Tomcat 5.5.15, MySQL 5.0.18 for Linux
>     Reporter: Leon Hu
>     Priority: Critical
>      Fix For: 4.0 RC2

> Setup: 
> 3 networked brokers, B1, B2, and B3, on 3 servers, connected using multicast discovery.
>  <broker useJmx="false" brokerName="B1"> 
>  <persistenceAdapter> 
>         <journaledJDBC journalLogFiles="5" dataDirectory="foo" dataSource="#mysql-ds"/>

>  </persistenceAdapter> 
>  <transportConnectors> 
>  <transportConnector uri="tcp://localhost:61616" discoveryUri="multicast://default"/>

>  </transportConnectors> 
>  <networkConnectors> 
>  <networkConnector uri="multicast://default"/> 
>  </networkConnectors> 
>  </broker> 
>  <bean id="mysql-ds" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close">

>            <property name="driverClassName" value="com.mysql.jdbc.Driver"/> 
>            <property name="url" value="jdbc:mysql://localhost/activemq?relaxAutoCommit=true"/>

>                  <property name="username" value="activemqUser"/> 
>                  <property name="password" value="activemqPwd"/> 
>                  <property name="poolPreparedStatements" value="true"/> 
>  </bean> 
> Similar for B2 and B3. 
> Two queues: Q1 and Q2. 
> Two producers, one for each queue, both producers connected to B1. 
> One Q1 cosumer connected to B1, another Q1 consumer on B2. 
> One Q2 consumer connected to B2, another Q2 consumer connected to B3. 
> Steps: 
> Start the brokers and start sending messages to the queue. 
> After a while, stop the brokers (Sequence does not matter) 
> See the errors in catalina.out of the Tomcat that has a broker with both producers and
consumers connected 
> The problems:
> 1. 
> Exception in thread "ActiveMQ Scheduler" java.lang.NullPointerException
>          at$SunPerfProvider.nanoTime(
>          at
>          at
>          at$ScheduledFutureTask.getDelay(
>  Exception in thread "ActiveMQ Scheduler" Exception in thread "ActiveMQ Scheduler" Exception
in thread "ActiveMQ Scheduler"      at
>          at
>          at$
>          at
>  java.lang.NullPointerException
>          at$SunPerfProvider.nanoTime(
>  Exception in thread "ActiveMQ Scheduler" Exception in thread "ActiveMQ Scheduler" Exception
in thread "ActiveMQ Scheduler"      at
>          at
>          at$ScheduledFutureTask.getDelay(
>          at
>          at
>  Exception in thread "ActiveMQ Scheduler" Exception in thread "ActiveMQ Scheduler"  
>          at
> 2. The same exception is logged to the log file (in my case catalina.out) for hundreds
of times, resulting a log file exceeding 150 MB in 2 minutes. 

This message is automatically generated by JIRA.
If you think it was sent incorrectly contact one of the administrators:
For more information on JIRA, see:

View raw message