Looking through your stack trace, I can see you're using 5.13.1, not 5.3.1,
which is a good thing. (If you were using 5.3.1, I'd tell you no one was
likely to help you with a version that old.)

It looks like that exception is probably being thrown in
org.apache.activemq.store.kahadb.disk.journal.DataFileAccessor.readRecord(),
probably at the line where byte[] data is initialized. I advise you to do
the following:

   1. Download the 5.13.1 source code (via a sources JAR or Git).
   2. In your debugger, set a breakpoint on the catch block in
   DataFileAccessor.readRecord ().
   3. Attach a debugger to the broker when starting it (use suspend=y since
   this is occurring during initialization).
   4. When you hit the breakpoint, use the Drop To Frame feature (in
   Eclipse, or similar in whatever debugger you're using) to return to the
   beginning of the method, then step through again to confirm that the
   initializer of the data local variable is the problem. If it is, you'll
   find that location.getSize() is less than 5, and the question will be "why?"
   5. You can reset the Location's size to Location.NOT_SET to re-read the
   content from disk to confirm that the bytes really do indicate invalid
   content, but assuming that's the case, it's going to be hard to determine
   why the file has those bytes once they've already been written.
   6. Were there any disk write failures or anything similar while running
   the broker prior to these errors occurring?
   7. Do you need to keep the content in KahaDB? If not, you should be able
   to just delete the journal files and the index and then start with an empty
   broker.
   8. If you absolutely can't afford to lose the content in KahaDB (except
   maybe the seemingly-corrupted record that it's failing to load at the
   moment), you'll probably need to figure out the byte signature of KahaDB
   and then determine where the next message starts, and either remove this
   invalid message by editing the file or modify the content to give a length
   that's valid for the location where the next message starts.

Hope this helps.
Tim

On Thu, Mar 8, 2018 at 8:00 PM, n-swd <n-saw...@jp.fujitsu.com> wrote:

> Hi.
>
> When I started ActiveMQ (5.3.1) , the following logs are output and can not
> be started.
> What kind of cause can be considered?
>
> 2018-03-09 11:43:32,468 | INFO  | Refreshing
> org.apache.activemq.xbean.XBeanBrokerFactory$1@2eeda025: startup date [Fri
> Mar 09 11:43:32 JST 2018]; root of context hierarchy |
> org.apache.activemq.xbean.XBeanBrokerFactory$1 | WrapperSimpleAppMain
> 2018-03-09 11:43:35,073 | INFO  | Loading properties file from URL
> [file:/var/opt/FJSVimaps/domains/imaps0/imapsbroker_
> push/conf/credentials-enc.properties]
> | org.jasypt.spring31.properties.EncryptablePropertyPlaceholderConfigurer
> |
> WrapperSimpleAppMain
> 2018-03-09 11:43:37,388 | INFO  | Using Persistence Adapter:
> KahaDBPersistenceAdapter[/var/opt/FJSVimaps/domains/imaps0/
> imapsbroker_push/data/kahadb]
> | org.apache.activemq.broker.BrokerService | WrapperSimpleAppMain
> 2018-03-09 11:43:37,480 | INFO  | JMX consoles can connect to
> service:jmx:rmi:///jndi/rmi://localhost:1099/jmxrmi |
> org.apache.activemq.broker.jmx.ManagementContext | JMX connector
> 2018-03-09 11:43:38,195 | INFO  | KahaDB is version 6 |
> org.apache.activemq.store.kahadb.MessageDatabase | WrapperSimpleAppMain
> 2018-03-09 11:43:42,028 | ERROR | Failed to start Apache ActiveMQ
> ([broker0,
> null], java.io.IOException: Invalid location: 531:11590936, :
> java.lang.NegativeArraySizeException) |
> org.apache.activemq.broker.BrokerService | WrapperSimpleAppMain
> 2018-03-09 11:43:42,043 | INFO  | Apache ActiveMQ 5.13.1 (broker0, null) is
> shutting down | org.apache.activemq.broker.BrokerService |
> WrapperSimpleAppMain
> 2018-03-09 11:43:42,047 | INFO  | Connector mqtt+ssl stopped |
> org.apache.activemq.broker.TransportConnector | WrapperSimpleAppMain
> 2018-03-09 11:43:42,059 | INFO  |
> PListStore:[/var/opt/FJSVimaps/domains/imaps0/
> imapsbroker_push/data/broker0/tmp_storage]
> stopped | org.apache.activemq.store.kahadb.plist.PListStoreImpl |
> WrapperSimpleAppMain
> 2018-03-09 11:43:42,062 | INFO  | Stopping async queue tasks |
> org.apache.activemq.store.kahadb.KahaDBStore | WrapperSimpleAppMain
> 2018-03-09 11:43:42,064 | INFO  | Stopping async topic tasks |
> org.apache.activemq.store.kahadb.KahaDBStore | WrapperSimpleAppMain
> 2018-03-09 11:43:42,067 | INFO  | Stopped KahaDB |
> org.apache.activemq.store.kahadb.KahaDBStore | WrapperSimpleAppMain
> 2018-03-09 11:43:42,692 | INFO  | Apache ActiveMQ 5.13.1 (broker0, null)
> uptime 5.493 seconds | org.apache.activemq.broker.BrokerService |
> WrapperSimpleAppMain
> 2018-03-09 11:43:42,696 | INFO  | Apache ActiveMQ 5.13.1 (broker0, null) is
> shutdown | org.apache.activemq.broker.BrokerService | WrapperSimpleAppMain
> 2018-03-09 11:43:42,700 | INFO  | Closing
> org.apache.activemq.xbean.XBeanBrokerFactory$1@2eeda025: startup date [Fri
> Mar 09 11:43:32 JST 2018]; root of context hierarchy |
> org.apache.activemq.xbean.XBeanBrokerFactory$1 | WrapperSimpleAppMain
> 2018-03-09 11:43:42,708 | WARN  | Exception thrown from LifecycleProcessor
> on context close | org.apache.activemq.xbean.XBeanBrokerFactory$1 |
> WrapperSimpleAppMain
> java.lang.IllegalStateException: LifecycleProcessor not initialized - call
> 'refresh' before invoking lifecycle methods via the context:
> org.apache.activemq.xbean.XBeanBrokerFactory$1@2eeda025: startup date [Fri
> Mar 09 11:43:32 JST 2018]; root of context hierarchy
>         at
> org.springframework.context.support.AbstractApplicationContext.
> getLifecycleProcessor(AbstractApplicationContext.
> java:357)[spring-context-4.1.9.RELEASE.jar:4.1.9.RELEASE]
>         at
> org.springframework.context.support.AbstractApplicationContext.doClose(
> AbstractApplicationContext.java:884)[spring-context-4.1.
> 9.RELEASE.jar:4.1.9.RELEASE]
>         at
> org.springframework.context.support.AbstractApplicationContext.close(
> AbstractApplicationContext.java:843)[spring-context-4.1.
> 9.RELEASE.jar:4.1.9.RELEASE]
>         at
> org.apache.activemq.hooks.SpringContextHook.run(
> SpringContextHook.java:30)[activemq-spring-5.13.1.jar:5.13.1]
>         at
> org.apache.activemq.broker.BrokerService.stop(BrokerService.java:873)[
> activemq-broker-5.13.1.jar:5.13.1]
>         at
> org.apache.activemq.xbean.XBeanBrokerService.stop(
> XBeanBrokerService.java:122)[activemq-spring-5.13.1.jar:5.13.1]
>         at
> org.apache.activemq.broker.BrokerService.start(BrokerService.java:627)[
> activemq-broker-5.13.1.jar:5.13.1]
>         at
> org.apache.activemq.xbean.XBeanBrokerService.afterPropertiesSet(
> XBeanBrokerService.java:73)[activemq-spring-5.13.1.jar:5.13.1]
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
> Method)[:1.7.0_55]
>         at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:
> 57)[:1.7.0_55]
>         at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(
> DelegatingMethodAccessorImpl.java:43)[:1.7.0_55]
>         at java.lang.reflect.Method.invoke(Method.java:606)[:1.7.0_55]
>         at
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFac
> tory.invokeCustomInitMethod(AbstractAutowireCapableBeanFac
> tory.java:1700)[spring-beans-4.1.9.RELEASE.jar:4.1.9.RELEASE]
>         at
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFac
> tory.invokeInitMethods(AbstractAutowireCapableBeanFac
> tory.java:1639)[spring-beans-4.1.9.RELEASE.jar:4.1.9.RELEASE]
>         at
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFac
> tory.initializeBean(AbstractAutowireCapableBeanFac
> tory.java:1568)[spring-beans-4.1.9.RELEASE.jar:4.1.9.RELEASE]
>         at
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFac
> tory.doCreateBean(AbstractAutowireCapableBeanFac
> tory.java:539)[spring-beans-4.1.9.RELEASE.jar:4.1.9.RELEASE]
>         at
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFac
> tory.createBean(AbstractAutowireCapableBeanFac
> tory.java:476)[spring-beans-4.1.9.RELEASE.jar:4.1.9.RELEASE]
>         at
> org.springframework.beans.factory.support.AbstractBeanFactory$1.
> getObject(AbstractBeanFactory.java:303)[spring-beans-4.1.9.
> RELEASE.jar:4.1.9.RELEASE]
>         at
> org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.
> getSingleton(DefaultSingletonBeanRegistry.java:230)[spring-beans-4.1.9.
> RELEASE.jar:4.1.9.RELEASE]
>         at
> org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(
> AbstractBeanFactory.java:299)[spring-beans-4.1.9.RELEASE.
> jar:4.1.9.RELEASE]
>         at
> org.springframework.beans.factory.support.AbstractBeanFactory.getBean(
> AbstractBeanFactory.java:194)[spring-beans-4.1.9.RELEASE.
> jar:4.1.9.RELEASE]
>         at
> org.springframework.beans.factory.support.DefaultListableBeanFactory.
> preInstantiateSingletons(DefaultListableBeanFactory.
> java:755)[spring-beans-4.1.9.RELEASE.jar:4.1.9.RELEASE]
>         at
> org.springframework.context.support.AbstractApplicationContext.
> finishBeanFactoryInitialization(AbstractApplicationContext.
> java:762)[spring-context-4.1.9.RELEASE.jar:4.1.9.RELEASE]
>         at
> org.springframework.context.support.AbstractApplicationContext.refresh(
> AbstractApplicationContext.java:480)[spring-context-4.1.
> 9.RELEASE.jar:4.1.9.RELEASE]
>         at
> org.apache.xbean.spring.context.ResourceXmlApplicationContext.<init>(
> ResourceXmlApplicationContext.java:64)[xbean-spring-3.18.jar:3.18]
>         at
> org.apache.xbean.spring.context.ResourceXmlApplicationContext.<init>(
> ResourceXmlApplicationContext.java:52)[xbean-spring-3.18.jar:3.18]
>         at
> org.apache.activemq.xbean.XBeanBrokerFactory$1.<init>(
> XBeanBrokerFactory.java:104)[activemq-spring-5.13.1.jar:5.13.1]
>         at
> org.apache.activemq.xbean.XBeanBrokerFactory.createApplicationContext(
> XBeanBrokerFactory.java:104)[activemq-spring-5.13.1.jar:5.13.1]
>         at
> org.apache.activemq.xbean.XBeanBrokerFactory.createBroker(
> XBeanBrokerFactory.java:67)[activemq-spring-5.13.1.jar:5.13.1]
>         at
> org.apache.activemq.broker.BrokerFactory.createBroker(
> BrokerFactory.java:71)[activemq-broker-5.13.1.jar:5.13.1]
>         at
> org.apache.activemq.broker.BrokerFactory.createBroker(
> BrokerFactory.java:54)[activemq-broker-5.13.1.jar:5.13.1]
>         at
> org.apache.activemq.console.command.StartCommand.runTask(
> StartCommand.java:87)[activemq-console-5.13.1.jar:5.13.1]
>         at
> org.apache.activemq.console.command.AbstractCommand.
> execute(AbstractCommand.java:63)[activemq-console-5.13.1.jar:5.13.1]
>         at
> org.apache.activemq.console.command.ShellCommand.runTask(
> ShellCommand.java:154)[activemq-console-5.13.1.jar:5.13.1]
>         at
> org.apache.activemq.console.command.AbstractCommand.
> execute(AbstractCommand.java:63)[activemq-console-5.13.1.jar:5.13.1]
>         at
> org.apache.activemq.console.command.ShellCommand.main(
> ShellCommand.java:104)[activemq-console-5.13.1.jar:5.13.1]
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
> Method)[:1.7.0_55]
>         at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:
> 57)[:1.7.0_55]
>         at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(
> DelegatingMethodAccessorImpl.java:43)[:1.7.0_55]
>         at java.lang.reflect.Method.invoke(Method.java:606)[:1.7.0_55]
>         at
> org.apache.activemq.console.Main.runTaskClass(Main.java:
> 262)[activemq.jar:5.13.1]
>         at
> org.apache.activemq.console.Main.main(Main.java:115)[activemq.jar:5.13.1]
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
> Method)[:1.7.0_55]
>         at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:
> 57)[:1.7.0_55]
>         at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(
> DelegatingMethodAccessorImpl.java:43)[:1.7.0_55]
>         at java.lang.reflect.Method.invoke(Method.java:606)[:1.7.0_55]
>         at
> org.tanukisoftware.wrapper.WrapperSimpleApp.run(
> WrapperSimpleApp.java:240)[wrapper.jar:3.2.3]
>         at java.lang.Thread.run(Thread.java:745)[:1.7.0_55]
> 2018-03-09 11:43:42,732 | 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: Invalid location: 531:11590936, :
> java.lang.NegativeArraySizeException |
> org.apache.activemq.xbean.XBeanBrokerFactory$1 | WrapperSimpleAppMain
>
>
>
>
> --
> Sent from: http://activemq.2283324.n4.nabble.com/ActiveMQ-User-
> f2341805.html
>

Reply via email to