None of the jars have the 'vm' file where it's expected:
META-INF/services/org/apache/activemq/broker/vm

META-INF/services/org/apache/activemq/broker/ has only the following four
files:
- agent
- broker
- properties
- xbean

There's a 'vm' file in META-INF/services/org/apache/activemq/transport. I
copied this to the META-INF/**/broker directory, which resulted in...
java.io.IOException: Could load vm factory:java.lang.ClassCastException:
org.apache.activemq.transport.vm.VMTransportFactory

Given this, I'm not sure whether starting an embedded broker using the vm
transport and configuring it using an external configuration file --
http://activemq.apache.org/vm-transport-reference.html -- works.

Any ideas?

Next, I'll try doing this in one of the alternate ways.

--aslam

a k'wala wrote:
> 
> I'm trying to use the VM Transport, launched in a JUnit TestSetup. Here's
> how I create the broker:
> 
> String brokerUri =
> "vm://localhost?brokerConfig=xbean:file:../mtx-unit-test/testing/activemq/activemq.xml";
> BrokerService broker = BrokerFactory.createBroker(new URI(brokerUri));
> 
> This causes the following exception:
> java.io.IOException: Could load vm factory:java.io.IOException: Could not
> find factory class for resource:
> META-INF/services/org/apache/activemq/broker/vm
>       at
> org.apache.activemq.util.IOExceptionSupport.create(IOExceptionSupport.java:27)
>       at
> org.apache.activemq.broker.BrokerFactory.createBrokerFactoryHandler(BrokerFactory.java:43)
>       at
> org.apache.activemq.broker.BrokerFactory.createBroker(BrokerFactory.java:70)
>       at
> org.apache.activemq.broker.BrokerFactory.createBroker(BrokerFactory.java:54)
> ...[truncated]
> Caused by: java.io.IOException: Could not find factory class for resource:
> META-INF/services/org/apache/activemq/broker/vm
>       at
> org.apache.activemq.util.FactoryFinder.doFindFactoryProperies(FactoryFinder.java:92)
>       at
> org.apache.activemq.util.FactoryFinder.newInstance(FactoryFinder.java:52)
> 
> The only info I could find on this is:
> http://activemq.apache.org/ioexception-could-not-find-class-for-resource.html
> ...which says that I need to have the distro jar in my classpath. I have
> both, activemq-core-5.0.0.jar and activemq-all-5.0.0.jar in the classpath.
> 
> What else should I check?
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/factory%3Ajava.io.IOException%3A-Could-not-find-factory-class-for-resource%3A-META-INF-services-org...-tp16167726s2354p16202156.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Reply via email to