mar1394 <[EMAIL PROTECTED]> writes: > > > I am using the 4.1.0 incubator version of ActiveMQ. I am trying to configure > Kaha persistence. I have this in activemq.xml: > > <persistenceAdapter> > <kahaPersistenceAdapter dir="../activemq-data" /> > </persistenceAdapter> > > I am running on RedHat Linux. uname -a returns: > Linux chill.jpl.nasa.gov 2.6.9-11.ELsmp #1 SMP Fri May 20 18:26:27 EDT 2005 > i686 i686 i386 GNU/Linux > > When I run activemq I get the exceptions below. It looks to me like the > KahaPersistenceAdapter class expects its "dir" attribute to be a File > object, when all that can be sent via XML is a string. > > ACTIVEMQ_HOME: /home/mdemore/apache-activemq-4.1.0-incubator > Loading message broker from: xbean:activemq.xml > ERROR: java.lang.RuntimeException: Failed to execute start task. Reason: > org.springframework.beans.factory.BeanCreationException: Error creating bean > with name 'org.apache.activemq.xbean.XBeanBrokerService' defined in class > path resource [activemq.xml]: Cannot create inner bean '(inner bean)' while > setting bean property 'persistenceAdapter'; nested exception is > org.springframework.beans.factory.UnsatisfiedDependencyException: Error > creating bean with name '(inner bean)#2' defined in class path resource > [activemq.xml]: Unsatisfied dependency expressed through constructor > argument with index 0 of type [java.io.File]: Could not convert constructor > argument value [../activemq-data] to required type [java.io.File]: Failed to > convert value of type [java.lang.String] to required type [java.io.File]; > nested exception is java.lang.IllegalArgumentException: Could not retrieve > File for class path resource [../activemq-data]: class path resource > [../activemq-data] cannot be resolved to URL because it does not exist > java.lang.RuntimeException: Failed to execute start task. Reason: > org.springframework.beans.factory.BeanCreationException: Error creating bean > with name 'org.apache.activemq.xbean.XBeanBrokerService' defined in class > path resource [activemq.xml]: Cannot create inner bean '(inner bean)' while > setting bean property 'persistenceAdapter'; nested exception is > org.springframework.beans.factory.UnsatisfiedDependencyException: Error > creating bean with name '(inner bean)#2' defined in class path resource > [activemq.xml]: Unsatisfied dependency expressed through constructor > argument with index 0 of type [java.io.File]: Could not convert constructor > argument value [../activemq-data] to required type [java.io.File]: Failed to > convert value of type [java.lang.String] to required type [java.io.File]; > nested exception is java.lang.IllegalArgumentException: Could not retrieve > File for class path resource [../activemq-data]: class path resource > [../activemq-data] cannot be resolved to URL because it does not exist > at > org.apache.activemq.console.command.StartCommand.runTask (StartCommand.java:70) > at > org.apache.activemq.console.command.AbstractCommand.execute (AbstractCommand.java:50) > at > org.apache.activemq.console.command.ShellCommand.runTask (ShellCommand.java:82) > at > org.apache.activemq.console.command.AbstractCommand.execute (AbstractCommand.java:50) > at > org.apache.activemq.console.command.ShellCommand.main(ShellCommand.java:46) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) > at > sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:25) > at java.lang.reflect.Method.invoke(Method.java:585) > at org.apache.activemq.console.Main.runTaskClass(Main.java:159) > at org.apache.activemq.console.Main.main(Main.java:91) > Caused by: org.springframework.beans.factory.BeanCreationException: Error > creating bean with name 'org.apache.activemq.xbean.XBeanBrokerService' > defined in class path resource [activemq.xml]: Cannot create inner bean > '(inner bean)' while setting bean property 'persistenceAdapter'; nested > exception is > org.springframework.beans.factory.UnsatisfiedDependencyException: Error > creating bean with name '(inner bean)#2' defined in class path resource > [activemq.xml]: Unsatisfied dependency expressed through constructor > argument with index 0 of type [java.io.File]: Could not convert constructor > argument value [../activemq-data] to required type [java.io.File]: Failed to > convert value of type [java.lang.String] to required type [java.io.File]; > nested exception is java.lang.IllegalArgumentException: Could not retrieve > File for class path resource [../activemq-data]: class path resource > [../activemq-data] cannot be resolved to URL because it does not exist > at > org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveIn nerBeanDefinition(BeanDefinitionValueResolver.java:205) > at > org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveVa lueIfNecessary(BeanDefinitionValueResolver.java:116) > at > org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.ap plyPropertyValues(AbstractAutowireCapableBeanFactory.java:955) > at > org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.po pulateBean(AbstractAutowireCapableBeanFactory.java:729) > at > org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.cr eateBean(AbstractAutowireCapableBeanFactory.java:416) > at > org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject (AbstractBeanFactory.java:245) > at > org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingl eton(DefaultSingletonBeanRegistry.java:141) > at > org.springframework.beans.factory.support.AbstractBeanFactory.getBean (AbstractBeanFactory.java:242) > at > org.springframework.beans.factory.support.AbstractBeanFactory.getBean (AbstractBeanFactory.java:156) > at > org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstant iateSingletons(DefaultListableBeanFactory.java:290) > at > org.springframework.context.support.AbstractApplicationContext.refresh (AbstractApplicationContext.java:348) > at > org.apache.xbean.spring.context.ClassPathXmlApplicationContext.<init> (ClassPathXmlApplicationContext.java:161) > at > org.apache.xbean.spring.context.ClassPathXmlApplicationContext.<init> (ClassPathXmlApplicationContext.java:51) > at > org.apache.activemq.xbean.XBeanBrokerFactory.createBroker (XBeanBrokerFactory.java:41) > at > org.apache.activemq.broker.BrokerFactory.createBroker(BrokerFactory.java:57) > at > org.apache.activemq.console.command.StartCommand.startBroker (StartCommand.java:82) > at > org.apache.activemq.console.command.StartCommand.runTask (StartCommand.java:47) > ... 10 more > Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: > Error creating bean with name '(inner bean)#2' defined in class path > resource [activemq.xml]: Unsatisfied dependency expressed through > constructor argument with index 0 of type [java.io.File]: Could not convert > constructor argument value [../activemq-data] to required type > [java.io.File]: Failed to convert value of type [java.lang.String] to > required type [java.io.File]; nested exception is > java.lang.IllegalArgumentException: Could not retrieve File for class path > resource [../activemq-data]: class path resource [../activemq-data] cannot > be resolved to URL because it does not exist > at > org.springframework.beans.factory.support.ConstructorResolver.createArgumentArr ay(ConstructorResolver.java:375) > at > org.springframework.beans.factory.support.ConstructorResolver.autowireConstruct or(ConstructorResolver.java:126) > at > org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.au towireConstructor(AbstractAutowireCapableBeanFactory.java:683) > at > org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.cr eateBeanInstance(AbstractAutowireCapableBeanFactory.java:621) > at > org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.cr eateBean(AbstractAutowireCapableBeanFactory.java:380) > at > org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveIn nerBeanDefinition(BeanDefinitionValueResolver.java:198) > ... 26 more > ERROR: java.lang.Exception: > org.springframework.beans.factory.BeanCreationException: Error creating bean > with name 'org.apache.activemq.xbean.XBeanBrokerService' defined in class > path resource [activemq.xml]: Cannot create inner bean '(inner bean)' while > setting bean property 'persistenceAdapter'; nested exception is > org.springframework.beans.factory.UnsatisfiedDependencyException: Error > creating bean with name '(inner bean)#2' defined in class path resource > [activemq.xml]: Unsatisfied dependency expressed through constructor > argument with index 0 of type [java.io.File]: Could not convert constructor > argument value [../activemq-data] to required type [java.io.File]: Failed to > convert value of type [java.lang.String] to required type [java.io.File]; > nested exception is java.lang.IllegalArgumentException: Could not retrieve > File for class path resource [../activemq-data]: class path resource > [../activemq-data] cannot be resolved to URL because it does not exist > java.lang.Exception: > org.springframework.beans.factory.BeanCreationException: Error creating bean > with name 'org.apache.activemq.xbean.XBeanBrokerService' defined in class > path resource [activemq.xml]: Cannot create inner bean '(inner bean)' while > setting bean property 'persistenceAdapter'; nested exception is > org.springframework.beans.factory.UnsatisfiedDependencyException: Error > creating bean with name '(inner bean)#2' defined in class path resource > [activemq.xml]: Unsatisfied dependency expressed through constructor > argument with index 0 of type [java.io.File]: Could not convert constructor > argument value [../activemq-data] to required type [java.io.File]: Failed to > convert value of type [java.lang.String] to required type [java.io.File]; > nested exception is java.lang.IllegalArgumentException: Could not retrieve > File for class path resource [../activemq-data]: class path resource > [../activemq-data] cannot be resolved to URL because it does not exist > at > org.apache.activemq.console.command.StartCommand.runTask (StartCommand.java:71) > at > org.apache.activemq.console.command.AbstractCommand.execute (AbstractCommand.java:50) > at > org.apache.activemq.console.command.ShellCommand.runTask (ShellCommand.java:82) > at > org.apache.activemq.console.command.AbstractCommand.execute (AbstractCommand.java:50) > at > org.apache.activemq.console.command.ShellCommand.main(ShellCommand.java:46) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) > at > sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:25) > at java.lang.reflect.Method.invoke(Method.java:585) > at org.apache.activemq.console.Main.runTaskClass(Main.java:159) > at org.apache.activemq.console.Main.main(Main.java:91) > Caused by: org.springframework.beans.factory.BeanCreationException: Error > creating bean with name 'org.apache.activemq.xbean.XBeanBrokerService' > defined in class path resource [activemq.xml]: Cannot create inner bean > '(inner bean)' while setting bean property 'persistenceAdapter'; nested > exception is > org.springframework.beans.factory.UnsatisfiedDependencyException: Error > creating bean with name '(inner bean)#2' defined in class path resource > [activemq.xml]: Unsatisfied dependency expressed through constructor > argument with index 0 of type [java.io.File]: Could not convert constructor > argument value [../activemq-data] to required type [java.io.File]: Failed to > convert value of type [java.lang.String] to required type [java.io.File]; > nested exception is java.lang.IllegalArgumentException: Could not retrieve > File for class path resource [../activemq-data]: class path resource > [../activemq-data] cannot be resolved to URL because it does not exist > at > org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveIn nerBeanDefinition(BeanDefinitionValueResolver.java:205) > at > org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveVa lueIfNecessary(BeanDefinitionValueResolver.java:116) > at > org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.ap plyPropertyValues(AbstractAutowireCapableBeanFactory.java:955) > at > org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.po pulateBean(AbstractAutowireCapableBeanFactory.java:729) > at > org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.cr eateBean(AbstractAutowireCapableBeanFactory.java:416) > at > org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject (AbstractBeanFactory.java:245) > at > org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingl eton(DefaultSingletonBeanRegistry.java:141) > at > org.springframework.beans.factory.support.AbstractBeanFactory.getBean (AbstractBeanFactory.java:242) > at > org.springframework.beans.factory.support.AbstractBeanFactory.getBean (AbstractBeanFactory.java:156) > at > org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstant iateSingletons(DefaultListableBeanFactory.java:290) > at > org.springframework.context.support.AbstractApplicationContext.refresh (AbstractApplicationContext.java:348) > at > org.apache.xbean.spring.context.ClassPathXmlApplicationContext.<init> (ClassPathXmlApplicationContext.java:161) > at > org.apache.xbean.spring.context.ClassPathXmlApplicationContext.<init> (ClassPathXmlApplicationContext.java:51) > at > org.apache.activemq.xbean.XBeanBrokerFactory.createBroker (XBeanBrokerFactory.java:41) > at > org.apache.activemq.broker.BrokerFactory.createBroker(BrokerFactory.java:57) > at > org.apache.activemq.console.command.StartCommand.startBroker (StartCommand.java:82) > at > org.apache.activemq.console.command.StartCommand.runTask (StartCommand.java:47) > ... 10 more > Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: > Error creating bean with name '(inner bean)#2' defined in class path > resource [activemq.xml]: Unsatisfied dependency expressed through > constructor argument with index 0 of type [java.io.File]: Could not convert > constructor argument value [../activemq-data] to required type > [java.io.File]: Failed to convert value of type [java.lang.String] to > required type [java.io.File]; nested exception is > java.lang.IllegalArgumentException: Could not retrieve File for class path > resource [../activemq-data]: class path resource [../activemq-data] cannot > be resolved to URL because it does not exist > at > org.springframework.beans.factory.support.ConstructorResolver.createArgumentArr ay(ConstructorResolver.java:375) > at > org.springframework.beans.factory.support.ConstructorResolver.autowireConstruct or(ConstructorResolver.java:126) > at > org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.au towireConstructor(AbstractAutowireCapableBeanFactory.java:683) > at > org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.cr eateBeanInstance(AbstractAutowireCapableBeanFactory.java:621) > at > org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.cr eateBean(AbstractAutowireCapableBeanFactory.java:380) > at > org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveIn nerBeanDefinition(BeanDefinitionValueResolver.java:198) > ... 26 more >
I'm currently using the following in my conf/activemq.xml and it works fine. <persistenceAdapter> <kahaPersistenceAdapter dir="${activemq.base}/activemq-data" /> </persistenceAdapter> Cheers, Philip