[JBoss Messaging] - Persistent Problem in JBM 2.0.0 BETA4
by kazuno
Hello.
I'm evaluating JBoss Messaging 2.0.0 BETA4 .
And, I tried the following procedure to check JBM's persistence functionality.
1. Start up JBM.
2. Check MessageCount of ExampleQue by jconsole. and 0 message found.
3. Producer sends a hundred messages to ExampleQue by a single transaction. and commit.
4. Check MessageCount of ExampleQue by jconsole. and 100 messages found.
5. Kill JBM process by Windows Taskmanager.
6. Start up JBM again.
7. Check MessageCount of ExampleQue by jconsole. and 100 messages found. It's OK.
...and I tried once more.
9. Procducer sends a hundred messages to ExampleQue by a single transaction. and commit.
10. Check MessageCount of ExampleQue by jconsole. and 200s message found.
11. Kill JBM process by Windows Taskmanager.
12. Start up JBM again.
13. Check MessageCount of ExampleQue by jconsole. and only 105s message found!
My 95 messages have gone somewhere. persistence functionality does not seem to work properly.
I confirmed following by jconsole.
o JournalSyncTransactional is true.
o ExampleQueie is durable.
o DLQ and ExpilyQueue has no message. (MessageAdded, MessageCound are 0)
And my environment is
o Windows XP SP3
o Sun JDK 1.6.0_15
o JBoss Messaging 2.0.0 BETA4
Any comments or suggestion?
* Producer.java
| import java.util.HashMap;
| import java.util.Map;
|
| import javax.jms.Connection;
| import javax.jms.ConnectionFactory;
| import javax.jms.DeliveryMode;
| import javax.jms.Message;
| import javax.jms.MessageProducer;
| import javax.jms.Queue;
| import javax.jms.Session;
|
| import org.jboss.messaging.core.config.TransportConfiguration;
| import org.jboss.messaging.integration.transports.netty.NettyConnectorFactory;
| import org.jboss.messaging.jms.JBossQueue;
| import org.jboss.messaging.jms.client.JBossConnectionFactory;
|
| /**
| * A Producer That connecto to JBM and send 100 messages then commits.
| */
| public class Producer {
|
| public static void main(String[] args) throws Exception {
|
| Connection connection = null;
| Queue queue = null;
| Session session = null;
| MessageProducer producer = null;
|
| try {
|
| // Step 1. Create a ConnectionFactory
| Map<String, Object> params = new HashMap<String, Object>();
| params.put("jbm.remoting.netty.host","localhost");
| params.put("jbm.remoting.netty.port","5445");
| TransportConfiguration transportConfiguration =
| new TransportConfiguration(NettyConnectorFactory.class.getName(), params);
| ConnectionFactory cf = new JBossConnectionFactory(transportConfiguration);
|
| // Step 2. Create a Connection and start.
| connection = cf.createConnection();
| connection.start();
|
| // Step 3. Create a Session that transactedl.
| session = connection.createSession(true, Session.SESSION_TRANSACTED);
|
| // Step 4. Create a Queue.
| queue = new JBossQueue("ExampleQueue");
|
| // Step 5. Create a Producer.
| producer = session.createProducer(queue);
|
| // Step 7. Set delivery mode to persistent.
| producer.setDeliveryMode(DeliveryMode.PERSISTENT);
|
| // Step 8. Send 100 messages.
| for (int i = 0; i < 100; i++) {
| Message message = session.createObjectMessage(new Integer(i));
| producer.send(message);
| System.out.println("message " + Integer.toString(i) + " sent.");
| }
|
| // Step 9. Commit.
| session.commit();
| System.out.println("commited!");
|
|
| } finally {
| if (producer != null) {
| producer.close();
| }
| if (session != null) {
| session.rollback();
| session.close();
| }
| if (connection != null) {
| connection.close();
| }
| }
|
| }
| }
|
* jbm-configuration.xml
| <configuration xmlns="urn:jboss:messaging"
| xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
| xsi:schemaLocation="urn:jboss:messaging /schema/jbm-configuration.xsd">
|
| <connectors>
| <connector name="netty">
| <factory-class>org.jboss.messaging.integration.transports.netty.NettyConnectorFactory</factory-class>
| <param key="jbm.remoting.netty.host" value="${jbm.remoting.netty.host:localhost}" type="String"/>
| <param key="jbm.remoting.netty.port" value="${jbm.remoting.netty.port:5445}" type="Integer"/>
| </connector>
| </connectors>
|
| <acceptors>
| <acceptor name="netty">
| <factory-class>org.jboss.messaging.integration.transports.netty.NettyAcceptorFactory</factory-class>
| <param key="jbm.remoting.netty.host" value="${jbm.remoting.netty.host:localhost}" type="String"/>
| <param key="jbm.remoting.netty.port" value="${jbm.remoting.netty.port:5445}" type="Integer"/>
| </acceptor>
| </acceptors>
|
| <security-settings>
| <security-setting match="#">
| <permission type="createTempQueue" roles="guest"/>
| <permission type="deleteTempQueue" roles="guest"/>
| <permission type="consume" roles="guest"/>
| <permission type="send" roles="guest"/>
| </security-setting>
| </security-settings>
|
| <address-settings>
| <!--default for catch all-->
| <address-setting match="#">
| <clustered>false</clustered>
| <dead-letter-address>jms.queue.DLQ</dead-letter-address>
| <expiry-address>jms.queue.ExpiryQueue</expiry-address>
| <redelivery-delay>0</redelivery-delay>
| <max-size-bytes>-1</max-size-bytes>
| <page-size-bytes>10485760</page-size-bytes>
| <distribution-policy-class>org.jboss.messaging.core.server.impl.RoundRobinDistributor</distribution-policy-class>
| <message-counter-history-day-limit>10</message-counter-history-day-limit>
| </address-setting>
| </address-settings>
|
| <paging-directory>../data/paging</paging-directory>
| <bindings-directory>../data/bindings</bindings-directory>
| <journal-directory>../data/journal</journal-directory>
| <large-messages-directory>../data/large-messages</large-messages-directory>
|
| </configuration>
|
* jbm-jms.xml
| <configuration xmlns="urn:jboss:messaging"
| xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
| xsi:schemaLocation="urn:jboss:messaging /schema/jbm-jms.xsd">
|
| <connection-factory name="ConnectionFactory">
| <connector-ref connector-name="netty"/>
| <entries>
| <entry name="ConnectionFactory"/>
| <entry name="XAConnectionFactory"/>
| <entry name="java:/ConnectionFactory"/>
| <entry name="java:/XAConnectionFactory"/>
| </entries>
| </connection-factory>
|
| <queue name="DLQ">
| <entry name="/queue/DLQ"/>
| </queue>
| <queue name="ExpiryQueue">
| <entry name="/queue/ExpiryQueue"/>
| </queue>
| <queue name="ExampleQueue">
| <entry name="/queue/ExampleQueue"/>
| </queue>
| <topic name="ExampleTopic">
| <entry name="/topic/ExampleTopic"/>
| </topic>
|
| </configuration>
|
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4250609#4250609
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4250609
16 years, 10 months
[JBoss Cache: Core Edition] - NullPointerException with mvcc
by stef_user
I'm getting NullPointerException when i'm trying to remove a parent and a child node in the same transaction. The parent is in the cache but the child isn't. It seems like when the parent is removed it tries to remove the child too but the node doesn't exists.
Here is the stack trace:
Caused by: java.lang.NullPointerException
at org.jboss.cache.commands.write.RemoveNodeCommand.recursivelyMarkAsRemoved(RemoveNodeCommand.java:103)
at org.jboss.cache.commands.write.RemoveNodeCommand.perform(RemoveNodeCommand.java:80)
at org.jboss.cache.interceptors.CallInterceptor.invokeCommand(CallInterceptor.java:108)
at org.jboss.cache.interceptors.CallInterceptor.handleAlterCacheMethod(CallInterceptor.java:173)
at org.jboss.cache.interceptors.CallInterceptor.visitRemoveNodeCommand(CallInterceptor.java:143)
at org.jboss.cache.commands.write.RemoveNodeCommand.acceptVisitor(RemoveNodeCommand.java:125)
at org.jboss.cache.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:116)
at org.jboss.cache.interceptors.EvictionInterceptor.visitRemoveNodeCommand(EvictionInterceptor.java:223)
at org.jboss.cache.commands.write.RemoveNodeCommand.acceptVisitor(RemoveNodeCommand.java:125)
at org.jboss.cache.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:116)
at org.jboss.cache.interceptors.MVCCLockingInterceptor.handleRemoveNodeCommand(MVCCLockingInterceptor.java:117)
at org.jboss.cache.interceptors.base.PrePostProcessingCommandInterceptor.visitRemoveNodeCommand(PrePostProcessingCommandInterceptor.java:126)
at org.jboss.cache.commands.write.RemoveNodeCommand.acceptVisitor(RemoveNodeCommand.java:125)
at org.jboss.cache.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:116)
at org.jboss.cache.interceptors.base.CommandInterceptor.handleDefault(CommandInterceptor.java:131)
at org.jboss.cache.commands.AbstractVisitor.visitRemoveNodeCommand(AbstractVisitor.java:75)
at org.jboss.cache.commands.write.RemoveNodeCommand.acceptVisitor(RemoveNodeCommand.java:125)
at org.jboss.cache.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:116)
at org.jboss.cache.interceptors.TxInterceptor.attachGtxAndPassUpChain(TxInterceptor.java:301)
at org.jboss.cache.interceptors.TxInterceptor.handleDefault(TxInterceptor.java:283)
at org.jboss.cache.commands.AbstractVisitor.visitRemoveNodeCommand(AbstractVisitor.java:75)
at org.jboss.cache.commands.write.RemoveNodeCommand.acceptVisitor(RemoveNodeCommand.java:125)
at org.jboss.cache.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:116)
at org.jboss.cache.interceptors.base.CommandInterceptor.handleDefault(CommandInterceptor.java:131)
at org.jboss.cache.commands.AbstractVisitor.visitRemoveNodeCommand(AbstractVisitor.java:75)
at org.jboss.cache.commands.write.RemoveNodeCommand.acceptVisitor(RemoveNodeCommand.java:125)
at org.jboss.cache.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:116)
at org.jboss.cache.interceptors.InvocationContextInterceptor.handleAll(InvocationContextInterceptor.java:178)
at org.jboss.cache.interceptors.InvocationContextInterceptor.visitRemoveNodeCommand(InvocationContextInterceptor.java:88)
at org.jboss.cache.commands.write.RemoveNodeCommand.acceptVisitor(RemoveNodeCommand.java:125)
at org.jboss.cache.interceptors.InterceptorChain.invoke(InterceptorChain.java:287)
at org.jboss.cache.invocation.CacheInvocationDelegate.removeNode(CacheInvocationDelegate.java:478)
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4250597#4250597
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4250597
16 years, 10 months