activemq-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ernest Wallace (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (AMQ-4050) Broker unable to distribute messages to consumers with NegativeArraySizeException loading message from JDBC Persistence
Date Fri, 14 Sep 2012 16:08:07 GMT

    [ https://issues.apache.org/jira/browse/AMQ-4050?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13455891#comment-13455891
] 

Ernest Wallace commented on AMQ-4050:
-------------------------------------

Broker initialization code:

				String host = InetAddress.getLocalHost().getHostAddress();
				String brokerName = host + ":" + ServerProperties.getJobqueueBrokerPort();
				broker = new BrokerService();
				broker.setBrokerName(brokerName);
				broker.setBrokerId(brokerName);
				broker.setUseJmx(true);
				broker.setSchedulerSupport(true);

				//Setup dead letter queue
				IndividualDeadLetterStrategy deadLetterStrategy = new IndividualDeadLetterStrategy();
				deadLetterStrategy.setQueuePrefix("DLQ.");
				deadLetterStrategy.setUseQueueForQueueMessages(true);
				PolicyMap destinationPolicy = new PolicyMap();
				ArrayList<PolicyEntry> entries = new ArrayList<PolicyEntry>();
				PolicyEntry entry = new PolicyEntry();
				entry.setQueue(">");
				entry.setDeadLetterStrategy(deadLetterStrategy);
                                entries.add(entry);
				destinationPolicy.setPolicyEntries(entries);
				broker.setDestinationPolicy(destinationPolicy);

				//Setup destinations
				ActiveMQDestination[] destinations = new ActiveMQDestination[]
				{
						new ActiveMQQueue("q.intelliworks.job"),
						new ActiveMQTopic("t.intelliworks.config")
				};
				broker.setDestinations(destinations);

				//Setup persistence
				JDBCPersistenceAdapter jdbcPersistenceAdapter = new JDBCPersistenceAdapter();
				jdbcPersistenceAdapter.setCreateTablesOnStartup(false);
				jdbcPersistenceAdapter.setDataSource(dataSource);
				jdbcPersistenceAdapter.setUseDatabaseLock(false);
				broker.setPersistenceAdapter(jdbcPersistenceAdapter);
				broker.setPersistent(true);

				//Setup transports
				TransportConnector connector = new TransportConnector();
				connector.setUri(new URI("tcp://" + broker.getBrokerName()));
				connector.setDiscoveryUri(new URI("multicast://default?group="
						+ ServerProperties.getJobqueueMulticastGroup()));
				broker.addConnector(connector);
				broker.start();
				broker.waitUntilStopped();


                
> Broker unable to distribute messages to consumers with NegativeArraySizeException loading
message from JDBC Persistence
> -----------------------------------------------------------------------------------------------------------------------
>
>                 Key: AMQ-4050
>                 URL: https://issues.apache.org/jira/browse/AMQ-4050
>             Project: ActiveMQ
>          Issue Type: Bug
>          Components: Broker
>    Affects Versions: 5.5.1
>         Environment: Broker is running in JVM via java code initialization.  JDBC Persistence
Adapter to MySQL database.  Production is CentOS.  Replicable on MacOS 10.7, Java 1.6.0_35,
5.1.63 MySQL Community Server 
>            Reporter: Ernest Wallace
>         Attachments: ACTIVEMQ_MSGS.sql
>
>
> When trying to distribute messages to consumers a corrupted message causes the Broker
to stall and stop distributing messages with a NegativeArraySizeException.  I can supply a
sql dump of ACTIVEMQ_MSGS with the offending message to reproduce.
> Stack:
> 11:41:47:996]|[09-14-2012]|[SYSOUT]|[INFO]|[11]|: java.lang.NegativeArraySizeException|
> [11:41:47:996]|[09-14-2012]|[SYSOUT]|[INFO]|[11]|: 	at org.apache.activemq.openwire.v6.BaseDataStreamMarshaller.looseUnmarshalByteSequence(BaseDataStreamMarshaller.java:639)|
> [11:41:47:996]|[09-14-2012]|[SYSOUT]|[INFO]|[11]|: 	at org.apache.activemq.openwire.v6.MessageMarshaller.looseUnmarshal(MessageMarshaller.java:229)|
> [11:41:47:997]|[09-14-2012]|[SYSOUT]|[INFO]|[11]|: 	at org.apache.activemq.openwire.v6.ActiveMQMessageMarshaller.looseUnmarshal(ActiveMQMessageMarshaller.java:101)|
> [11:41:47:997]|[09-14-2012]|[SYSOUT]|[INFO]|[11]|: 	at org.apache.activemq.openwire.v6.ActiveMQTextMessageMarshaller.looseUnmarshal(ActiveMQTextMessageMarshaller.java:101)|
> [11:41:47:997]|[09-14-2012]|[SYSOUT]|[INFO]|[11]|: 	at org.apache.activemq.openwire.OpenWireFormat.doUnmarshal(OpenWireFormat.java:364)|
> [11:41:47:997]|[09-14-2012]|[SYSOUT]|[INFO]|[11]|: 	at org.apache.activemq.openwire.OpenWireFormat.unmarshal(OpenWireFormat.java:204)|
> [11:41:47:997]|[09-14-2012]|[SYSOUT]|[INFO]|[11]|: 	at org.apache.activemq.store.jdbc.JDBCPersistenceAdapter.getLastMessageBrokerSequenceId(JDBCPersistenceAdapter.java:236)|
> [11:41:47:997]|[09-14-2012]|[SYSOUT]|[INFO]|[11]|: 	at org.apache.activemq.broker.region.DestinationFactoryImpl.getLastMessageBrokerSequenceId(DestinationFactoryImpl.java:145)|
> [11:41:47:998]|[09-14-2012]|[SYSOUT]|[INFO]|[11]|: 	at org.apache.activemq.broker.region.RegionBroker.<init>(RegionBroker.java:122)|
> [11:41:47:998]|[09-14-2012]|[SYSOUT]|[INFO]|[11]|: 	at org.apache.activemq.broker.jmx.ManagedRegionBroker.<init>(ManagedRegionBroker.java:99)|
> [11:41:47:998]|[09-14-2012]|[SYSOUT]|[INFO]|[11]|: 	at org.apache.activemq.broker.BrokerService.createRegionBroker(BrokerService.java:1830)|
> [11:41:47:998]|[09-14-2012]|[SYSOUT]|[INFO]|[11]|: 	at org.apache.activemq.broker.BrokerService.createRegionBroker(BrokerService.java:1824)|
> [11:41:47:998]|[09-14-2012]|[SYSOUT]|[INFO]|[11]|: 	at org.apache.activemq.broker.BrokerService.createBroker(BrokerService.java:1781)|
> [11:41:47:998]|[09-14-2012]|[SYSOUT]|[INFO]|[11]|: 	at org.apache.activemq.broker.BrokerService.getBroker(BrokerService.java:766)|
> [11:41:47:999]|[09-14-2012]|[SYSOUT]|[INFO]|[11]|: 	at org.apache.activemq.broker.BrokerService.getAdminConnectionContext(BrokerService.java:2037)|
> [11:41:47:999]|[09-14-2012]|[SYSOUT]|[INFO]|[11]|: 	at org.apache.activemq.broker.BrokerService.startDestinations(BrokerService.java:2024)|
> [11:41:47:999]|[09-14-2012]|[SYSOUT]|[INFO]|[11]|: 	at org.apache.activemq.broker.BrokerService.start(BrokerService.java:495)|
> [11:41:47:999]|[09-14-2012]|[SYSOUT]|[INFO]|[11]|: 	at com.myapp.server.jobqueue.broker.BrokerUtils$BrokerStart.run(BrokerUtils.java:111)|
> [11:41:47:999]|[09-14-2012]|[SYSOUT]|[INFO]|[11]|: 	at java.lang.Thread.run(Thread.java:680)|

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message