You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by Tim Bain <tb...@alumni.duke.edu> on 2019/11/08 06:31:00 UTC

Re: Java.io.ioexception Unknown data type:51

That's especially strange that the data type would switch from 51 to 49;
that sounds to me like the data being read got updated/replaced between the
two occurrences, but to an object type that's still not recognized, which
is very strange.

Is there anything in your activemq.xml that would be hard-coding the
OpenWire format to a non-default version of the protocol? If not, could you
download the 5.15.8 source, import it into an IDE, set a breakpoint at the
first line of org.apache.activemq.openwire.OpenWireFormat.setVersion(int),
and tell us the value being passed as the version parameter? Since this
problem occurs on startup, you'll need to set suspend=true when enabling
the debug port on the broker.

Also, if you can set a breakpoint at
org.apache.activemq.store.jdbc.JDBCPersistenceAdapter.getLastMessageBrokerSequenceId()
and show us the bytes in the msg byte array, maybe something about the
content might be recognizable, which might then help us figure out why it's
getting written improperly if that is indeed what's happening. It's
something of a shot in the dark, but that's where we're at.

Does this problem occur if you start this version of the broker on an empty
database/schema? And if not, does it occur if you play a small amount of
data through that empty broker and then restart it?

Alternatively, how set are you on using JDBC as your data store technology?
The only other post that asked about this error (
http://activemq.2283324.n4.nabble.com/Unrecognized-Data-Type-51-JDBCPersistenceAdapter-getLastMessageBrokerSequenceId-td4235069.html,
from 8 years ago and using 5.5.1) said that he didn't encounter this error
when using KahaDB, so a switch to KahaDB could be an easy "solution" if it
meets your needs.

Tim

On Thu, Oct 31, 2019 at 4:53 AM adisco <so...@homeoffice.gov.uk>
wrote:

> Update - so just checked after the upgrade last night and the error has
> re-occurred albeit with a different unknown data type. Please see the stack
> trace below? Any ideas on what next to try?
>
>
>
> WARN | Could not create JDBC tables; they could already exist. Failure was:
> INSERT INTO ACTIVEMQ_LOCK(ID) VALUES (1) Message: ERROR: duplicate key
> value
> violates unique constraint "activemq_lock_pkey"
> Detail: Key (id)=(1) already exists. SQLState: 23505 Vendor code: 0
> WARN | Failure details: ERROR: duplicate key value violates unique
> constraint "activemq_lock_pkey"
> Detail: Key (id)=(1) already exists.
> org.postgresql.util.PSQLException: ERROR: duplicate key value violates
> unique constraint "activemq_lock_pkey"
> Detail: Key (id)=(1) already exists.
> at
>
> org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2094)[postgresql-jdbc.jar:]
> at
>
> org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1827)[postgresql-jdbc.jar:]
> at
>
> org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:255)[postgresql-jdbc.jar:]
> at
>
> org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:508)[postgresql-jdbc.jar:]
> at
>
> org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:370)[postgresql-jdbc.jar:]
> at
>
> org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:362)[postgresql-jdbc.jar:]
> at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native
> Method)[:]
> at
>
> java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)[:]
> at
>
> java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)[:]
> at java.base/java.lang.reflect.Method.invoke(Method.java:566)[:]
> at
>
> org.postgresql.ds.jdbc23.AbstractJdbc23PooledConnection$StatementHandler.invoke(AbstractJdbc23PooledConnection.java:453)[postgresql-jdbc.jar:]
> at com.sun.proxy.$Proxy8.execute(Unknown Source)[:]
> at
>
> org.apache.activemq.store.jdbc.adapter.DefaultJDBCAdapter.executeStatement(DefaultJDBCAdapter.java:114)[activemq-jdbc-store-5.15.9.jar:5.15.9]
> at
>
> org.apache.activemq.store.jdbc.adapter.DefaultJDBCAdapter.doCreateTables(DefaultJDBCAdapter.java:92)[activemq-jdbc-store-5.15.9.jar:5.15.9]
> at
>
> org.apache.activemq.store.jdbc.JDBCPersistenceAdapter.init(JDBCPersistenceAdapter.java:307)[activemq-jdbc-store-5.15.9.jar:5.15.9]
> at
>
> org.apache.activemq.broker.LockableServiceSupport.preStart(LockableServiceSupport.java:89)[activemq-broker-5.15.9.jar:5.15.9]
> at
>
> org.apache.activemq.util.ServiceSupport.start(ServiceSupport.java:54)[activemq-client-5.15.9.jar:5.15.9]
> at
>
> org.apache.activemq.broker.BrokerService.doStartPersistenceAdapter(BrokerService.java:687)[activemq-broker-5.15.9.jar:5.15.9]
> at
>
> org.apache.activemq.broker.BrokerService.startPersistenceAdapter(BrokerService.java:671)[activemq-broker-5.15.9.jar:5.15.9]
> at
>
> org.apache.activemq.broker.BrokerService.start(BrokerService.java:635)[activemq-broker-5.15.9.jar:5.15.9]
> at
>
> org.apache.activemq.xbean.XBeanBrokerService.afterPropertiesSet(XBeanBrokerService.java:73)[activemq-spring-5.15.9.jar:5.15.9]
> at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native
> Method)[:]
> at
>
> java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)[:]
> at
>
> java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)[:]
> at java.base/java.lang.reflect.Method.invoke(Method.java:566)[:]
> at
>
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeCustomInitMethod(AbstractAutowireCapableBeanFactory.java:1763)[spring-beans-4.3.18.RELEASE.jar:4.3.18.RELEASE]
> at
>
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1700)[spring-beans-4.3.18.RELEASE.jar:4.3.18.RELEASE]
> at
>
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1630)[spring-beans-4.3.18.RELEASE.jar:4.3.18.RELEASE]
> at
>
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:555)[spring-beans-4.3.18.RELEASE.jar:4.3.18.RELEASE]
> at
>
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:483)[spring-beans-4.3.18.RELEASE.jar:4.3.18.RELEASE]
> at
>
> org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:312)[spring-beans-4.3.18.RELEASE.jar:4.3.18.RELEASE]
> at
>
> org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)[spring-beans-4.3.18.RELEASE.jar:4.3.18.RELEASE]
> at
>
> org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:308)[spring-beans-4.3.18.RELEASE.jar:4.3.18.RELEASE]
> at
>
> org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197)[spring-beans-4.3.18.RELEASE.jar:4.3.18.RELEASE]
> at
>
> org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:761)[spring-beans-4.3.18.RELEASE.jar:4.3.18.RELEASE]
> at
>
> org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:867)[spring-context-4.3.18.RELEASE.jar:4.3.18.RELEASE]
> at
>
> org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:543)[spring-context-4.3.18.RELEASE.jar:4.3.18.RELEASE]
> at
>
> org.apache.xbean.spring.context.ResourceXmlApplicationContext.<init>(ResourceXmlApplicationContext.java:64)[xbean-spring-4.2.jar:4.2]
> at
>
> org.apache.xbean.spring.context.ResourceXmlApplicationContext.<init>(ResourceXmlApplicationContext.java:52)[xbean-spring-4.2.jar:4.2]
> at
>
> org.apache.activemq.xbean.XBeanBrokerFactory$1.<init>(XBeanBrokerFactory.java:104)[activemq-spring-5.15.9.jar:5.15.9]
> at
>
> org.apache.activemq.xbean.XBeanBrokerFactory.createApplicationContext(XBeanBrokerFactory.java:104)[activemq-spring-5.15.9.jar:5.15.9]
> at
>
> org.apache.activemq.xbean.XBeanBrokerFactory.createBroker(XBeanBrokerFactory.java:67)[activemq-spring-5.15.9.jar:5.15.9]
> at
>
> org.apache.activemq.broker.BrokerFactory.createBroker(BrokerFactory.java:71)[activemq-broker-5.15.9.jar:5.15.9]
> at
>
> org.apache.activemq.broker.BrokerFactory.createBroker(BrokerFactory.java:54)[activemq-broker-5.15.9.jar:5.15.9]
> at
>
> org.apache.activemq.console.command.StartCommand.runTask(StartCommand.java:87)[activemq-console-5.15.9.jar:5.15.9]
> at
>
> org.apache.activemq.console.command.AbstractCommand.execute(AbstractCommand.java:63)[activemq-console-5.15.9.jar:5.15.9]
> at
>
> org.apache.activemq.console.command.ShellCommand.runTask(ShellCommand.java:154)[activemq-console-5.15.9.jar:5.15.9]
> at
>
> org.apache.activemq.console.command.AbstractCommand.execute(AbstractCommand.java:63)[activemq-console-5.15.9.jar:5.15.9]
> at
>
> org.apache.activemq.console.command.ShellCommand.main(ShellCommand.java:104)[activemq-console-5.15.9.jar:5.15.9]
> at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native
> Method)[:]
> at
>
> java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)[:]
> at
>
> java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)[:]
> at java.base/java.lang.reflect.Method.invoke(Method.java:566)[:]
> at
>
> org.apache.activemq.console.Main.runTaskClass(Main.java:262)[activemq.jar:5.15.9]
> at
> org.apache.activemq.console.Main.main(Main.java:115)[activemq.jar:5.15.9]
> INFO | Database lock driver override not found for :
> [postgresql_native_driver]. Will use default implementation.
> INFO | Attempting to acquire the exclusive lock to become the Master broker
> INFO | Becoming the master on dataSource:
> org.postgresql.ds.PGPoolingDataSource@5a865416
> INFO | PListStore:[/opt/activemq/data/localhost/tmp_storage] started
> INFO | JobSchedulerStore: /opt/activemq/data/localhost/scheduler started.
> ERROR | Failed to start Apache ActiveMQ (localhost, null)
> java.io.IOException: Unknown data type: 49
> at
>
> org.apache.activemq.openwire.OpenWireFormat.doUnmarshal(OpenWireFormat.java:359)[activemq-client-5.15.9.jar:5.15.9]
> at
>
> org.apache.activemq.openwire.OpenWireFormat.unmarshal(OpenWireFormat.java:201)[activemq-client-5.15.9.jar:5.15.9]
> at
>
> org.apache.activemq.store.jdbc.JDBCPersistenceAdapter.getLastMessageBrokerSequenceId(JDBCPersistenceAdapter.java:266)[activemq-jdbc-store-5.15.9.jar:5.15.9]
> at
>
> org.apache.activemq.broker.region.DestinationFactoryImpl.getLastMessageBrokerSequenceId(DestinationFactoryImpl.java:147)[activemq-broker-5.15.9.jar:5.15.9]
> at
>
> org.apache.activemq.broker.region.RegionBroker.<init>(RegionBroker.java:130)[activemq-broker-5.15.9.jar:5.15.9]
> at
>
> org.apache.activemq.broker.jmx.ManagedRegionBroker.<init>(ManagedRegionBroker.java:108)[activemq-broker-5.15.9.jar:5.15.9]
> at
>
> org.apache.activemq.broker.BrokerService.createRegionBroker(BrokerService.java:2399)[activemq-broker-5.15.9.jar:5.15.9]
> at
>
> org.apache.activemq.broker.BrokerService.createRegionBroker(BrokerService.java:2391)[activemq-broker-5.15.9.jar:5.15.9]
> at
>
> org.apache.activemq.broker.BrokerService.createBroker(BrokerService.java:2348)[activemq-broker-5.15.9.jar:5.15.9]
> at
>
> org.apache.activemq.broker.BrokerService.getBroker(BrokerService.java:1045)[activemq-broker-5.15.9.jar:5.15.9]
> at
>
> org.apache.activemq.broker.BrokerService.getAdminConnectionContext(BrokerService.java:2619)[activemq-broker-5.15.9.jar:5.15.9]
> at
>
> org.apache.activemq.broker.BrokerService.startVirtualConsumerDestinations(BrokerService.java:2780)[activemq-broker-5.15.9.jar:5.15.9]
> at
>
> org.apache.activemq.broker.BrokerService.startDestinations(BrokerService.java:2610)[activemq-broker-5.15.9.jar:5.15.9]
> at
>
> org.apache.activemq.broker.BrokerService.doStartBroker(BrokerService.java:739)[activemq-broker-5.15.9.jar:5.15.9]
> at
>
> org.apache.activemq.broker.BrokerService.startBroker(BrokerService.java:733)[activemq-broker-5.15.9.jar:5.15.9]
> at
>
> org.apache.activemq.broker.BrokerService.start(BrokerService.java:636)[activemq-broker-5.15.9.jar:5.15.9]
> at
>
> org.apache.activemq.xbean.XBeanBrokerService.afterPropertiesSet(XBeanBrokerService.java:73)[activemq-spring-5.15.9.jar:5.15.9]
> at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native
> Method)[:]
> at
>
> java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)[:]
> at
>
> java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)[:]
> at java.base/java.lang.reflect.Method.invoke(Method.java:566)[:]
> at
>
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeCustomInitMethod(AbstractAutowireCapableBeanFactory.java:1763)[spring-beans-4.3.18.RELEASE.jar:4.3.18.RELEASE]
> at
>
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1700)[spring-beans-4.3.18.RELEASE.jar:4.3.18.RELEASE]
> at
>
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1630)[spring-beans-4.3.18.RELEASE.jar:4.3.18.RELEASE]
> at
>
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:555)[spring-beans-4.3.18.RELEASE.jar:4.3.18.RELEASE]
> at
>
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:483)[spring-beans-4.3.18.RELEASE.jar:4.3.18.RELEASE]
> at
>
> org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:312)[spring-beans-4.3.18.RELEASE.jar:4.3.18.RELEASE]
> at
>
> org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)[spring-beans-4.3.18.RELEASE.jar:4.3.18.RELEASE]
> at
>
> org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:308)[spring-beans-4.3.18.RELEASE.jar:4.3.18.RELEASE]
> at
>
> org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197)[spring-beans-4.3.18.RELEASE.jar:4.3.18.RELEASE]
> at
>
> org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:761)[spring-beans-4.3.18.RELEASE.jar:4.3.18.RELEASE]
> at
>
> org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:867)[spring-context-4.3.18.RELEASE.jar:4.3.18.RELEASE]
> at
>
> org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:543)[spring-context-4.3.18.RELEASE.jar:4.3.18.RELEASE]
> at
>
> org.apache.xbean.spring.context.ResourceXmlApplicationContext.<init>(ResourceXmlApplicationContext.java:64)[xbean-spring-4.2.jar:4.2]
> at
>
> org.apache.xbean.spring.context.ResourceXmlApplicationContext.<init>(ResourceXmlApplicationContext.java:52)[xbean-spring-4.2.jar:4.2]
> at
>
> org.apache.activemq.xbean.XBeanBrokerFactory$1.<init>(XBeanBrokerFactory.java:104)[activemq-spring-5.15.9.jar:5.15.9]
> at
>
> org.apache.activemq.xbean.XBeanBrokerFactory.createApplicationContext(XBeanBrokerFactory.java:104)[activemq-spring-5.15.9.jar:5.15.9]
> at
>
> org.apache.activemq.xbean.XBeanBrokerFactory.createBroker(XBeanBrokerFactory.java:67)[activemq-spring-5.15.9.jar:5.15.9]
> at
>
> org.apache.activemq.broker.BrokerFactory.createBroker(BrokerFactory.java:71)[activemq-broker-5.15.9.jar:5.15.9]
> at
>
> org.apache.activemq.broker.BrokerFactory.createBroker(BrokerFactory.java:54)[activemq-broker-5.15.9.jar:5.15.9]
> at
>
> org.apache.activemq.console.command.StartCommand.runTask(StartCommand.java:87)[activemq-console-5.15.9.jar:5.15.9]
> at
>
> org.apache.activemq.console.command.AbstractCommand.execute(AbstractCommand.java:63)[activemq-console-5.15.9.jar:5.15.9]
> at
>
> org.apache.activemq.console.command.ShellCommand.runTask(ShellCommand.java:154)[activemq-console-5.15.9.jar:5.15.9]
> at
>
> org.apache.activemq.console.command.AbstractCommand.execute(AbstractCommand.java:63)[activemq-console-5.15.9.jar:5.15.9]
> at
>
> org.apache.activemq.console.command.ShellCommand.main(ShellCommand.java:104)[activemq-console-5.15.9.jar:5.15.9]
> at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native
> Method)[:]
> at
>
> java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)[:]
> at
>
> java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)[:]
> at java.base/java.lang.reflect.Method.invoke(Method.java:566)[:]
> at
>
> org.apache.activemq.console.Main.runTaskClass(Main.java:262)[activemq.jar:5.15.9]
> at
> org.apache.activemq.console.Main.main(Main.java:115)[activemq.jar:5.15.9]
> INFO | Apache ActiveMQ 5.15.9 (localhost, null) is shutting down
> INFO | Connector ssl stopped
> INFO | JobSchedulerStore: /opt/activemq/data/localhost/scheduler stopped.
> INFO | PListStore:[/opt/activemq/data/localhost/tmp_storage] stopped
> INFO | Apache ActiveMQ 5.15.9 (localhost, null) uptime 2.143 seconds
> INFO | Apache ActiveMQ 5.15.9 (localhost, null) is shutdown
> INFO | Closing org.apache.activemq.xbean.XBeanBrokerFactory$1@3a44431a:
> startup date [Thu Oct 31 *09:41:19 UTC 2019]; root of context hierarchy
> WARN | Exception encountered during context initialization - cancelling
> refresh attempt: org.springframework.beans.factory.BeanCreationException:
> Error creating bean with name
> 'org.apache.activemq.xbean.XBeanBrokerService#0' defined in class path
> resource [activemq.xml]: Invocation of init method failed; nested exception
> is java.io.IOException: Unknown data type: 49
> ERROR: java.lang.RuntimeException: Failed to execute start task. Reason:
> java.lang.IllegalStateException: BeanFactory not initialized or already
> closed - call 'refresh' before accessing beans via the ApplicationContext*
> java.lang.RuntimeException: Failed to execute start task. Reason:
> java.lang.IllegalStateException: BeanFactory not initialized or already
> closed - call 'refresh' before accessing beans via the ApplicationContext
> at
>
> org.apache.activemq.console.command.StartCommand.runTask(StartCommand.java:91)
> at
>
> org.apache.activemq.console.command.AbstractCommand.execute(AbstractCommand.java:63)
> at
>
> org.apache.activemq.console.command.ShellCommand.runTask(ShellCommand.java:154)
> at
>
> org.apache.activemq.console.command.AbstractCommand.execute(AbstractCommand.java:63)
> at
>
> org.apache.activemq.console.command.ShellCommand.main(ShellCommand.java:104)
> at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native
> Method)
> at
>
> java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
> at
>
> java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> at java.base/java.lang.reflect.Method.invoke(Method.java:566)
> at org.apache.activemq.console.Main.runTaskClass(Main.java:262)
> at org.apache.activemq.console.Main.main(Main.java:115)
> Caused by: java.lang.IllegalStateException: BeanFactory not initialized or
> already closed - call 'refresh' before accessing beans via the
> ApplicationContext
> at
>
> org.springframework.context.support.AbstractRefreshableApplicationContext.getBeanFactory(AbstractRefreshableApplicationContext.java:170)
> at
>
> org.springframework.context.support.AbstractApplicationContext.destroyBeans(AbstractApplicationContext.java:1032)at
>
> org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:556)
> at
>
> org.apache.xbean.spring.context.ResourceXmlApplicationContext.<init>(ResourceXmlApplicationContext.java:64)
> at
>
> org.apache.xbean.spring.context.ResourceXmlApplicationContext.<init>(ResourceXmlApplicationContext.java:52)
> at
>
> org.apache.activemq.xbean.XBeanBrokerFactory$1.<init>(XBeanBrokerFactory.java:104)
> at
>
> org.apache.activemq.xbean.XBeanBrokerFactory.createApplicationContext(XBeanBrokerFactory.java:104)
> at
>
> org.apache.activemq.xbean.XBeanBrokerFactory.createBroker(XBeanBrokerFactory.java:67)
> at
>
> org.apache.activemq.broker.BrokerFactory.createBroker(BrokerFactory.java:71)
> at
>
> org.apache.activemq.broker.BrokerFactory.createBroker(BrokerFactory.java:54)
> at
>
> org.apache.activemq.console.command.StartCommand.runTask(StartCommand.java:87)
> ... 10 more
> ERROR: java.lang.IllegalStateException: BeanFactory not initialized or
> already closed - call 'refresh' before accessing beans via the
> ApplicationContext
> java.lang.IllegalStateException: BeanFactory not initialized or already
> closed - call 'refresh' before accessing beans via the ApplicationContext
> at
>
> org.springframework.context.support.AbstractRefreshableApplicationContext.getBeanFactory(AbstractRefreshableApplicationContext.java:170)
> at
>
> org.springframework.context.support.AbstractApplicationContext.destroyBeans(AbstractApplicationContext.java:1032)
> at
>
> org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:556)
> at
>
> org.apache.xbean.spring.context.ResourceXmlApplicationContext.<init>(ResourceXmlApplicationContext.java:64)
> at
>
> org.apache.xbean.spring.context.ResourceXmlApplicationContext.<init>(ResourceXmlApplicationContext.java:52)
> at
>
> org.apache.activemq.xbean.XBeanBrokerFactory$1.<init>(XBeanBrokerFactory.java:104)
> at
>
> org.apache.activemq.xbean.XBeanBrokerFactory.createApplicationContext(XBeanBrokerFactory.java:104)
> at
>
> org.apache.activemq.xbean.XBeanBrokerFactory.createBroker(XBeanBrokerFactory.java:67)
> at
>
> org.apache.activemq.broker.BrokerFactory.createBroker(BrokerFactory.java:71)
> at
>
> org.apache.activemq.broker.BrokerFactory.createBroker(BrokerFactory.java:54)
> at
>
> org.apache.activemq.console.command.StartCommand.runTask(StartCommand.java:87)
> at
>
> org.apache.activemq.console.command.AbstractCommand.execute(AbstractCommand.java:63)
> at
>
> org.apache.activemq.console.command.ShellCommand.runTask(ShellCommand.java:154)
> at
>
> org.apache.activemq.console.command.AbstractCommand.execute(AbstractCommand.java:63)
> at
>
> org.apache.activemq.console.command.ShellCommand.main(ShellCommand.java:104)
> at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native
> Method)
> at
>
> java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
> at
>
> java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> at java.base/java.lang.reflect.Method.invoke(Method.java:566)
> at org.apache.activemq.console.Main.runTaskClass(Main.java:262)
> at org.apache.activemq.console.Main.main(Main.java:115)
>
>
>
> --
> Sent from:
> http://activemq.2283324.n4.nabble.com/ActiveMQ-User-f2341805.html
>

Re: Java.io.ioexception Unknown data type:51

Posted by adisco <so...@homeoffice.gov.uk.INVALID>.
Tim Bain wrote
> That's especially strange that the data type would switch from 51 to 49;
> that sounds to me like the data being read got updated/replaced between
> the
> two occurrences, but to an object type that's still not recognized, which
> is very strange.

Yes, I thought so as well  which led me to confirm (and make sure)  that all
the versions in play were recent and compatible. In the process, I
discovered that the Datasource in the PostgesSQL JDBC jar
(PGPoolingDataSource) had been deprecated and the recommendation was to use
the PGSimpleDatasource and then to implement an external Connection Pooling
solution. I chose Hikari.
So full steps taken :-


1)	Updated activemq library to 5.15.9
2)	Updated the Postgres JDBC jar to 42.2.8
3)	Amended the Datasource from deprecated Pooling to a SimpleConnection
Datasource
4)	Incorporated HikariCP as our Connection Pooling solution.

Example activemq config :-
   <bean id="postgres-ds" class="com.zaxxer.hikari.HikariDataSource"
destroy-method="close">
        <property name="dataSourceClassName"
value="org.postgresql.ds.PGSimpleDataSource" />
        <property name="maximumPoolSize" value="20" />
        <property name="dataSourceProperties" >
         <props>
          <prop key="portNumber">5432</prop>
          <prop key="databaseName">activemq</prop>
          <prop key="serverName">activemq.db.url</prop>
          <prop key="user">activemq</prop>
          <prop key="password">activemq.db.password</prop>
          <prop key="sslMode">verify-ca</prop>
          <prop key="sslRootCert">rds.root.cert.url</prop>
          <prop key="logUnclosedConnections">true</prop>
         </props>
        </property>
    </bean>
 
It's been over a week and this has been very stable instead of the daily
issues we were having. There is still an issue getting the connection to RDS
to work with the "very-full" (hence the verify-ca value) but this is very
good progress for now.

Many thanks for pointing me in the right direction






--
Sent from: http://activemq.2283324.n4.nabble.com/ActiveMQ-User-f2341805.html