Thank you, I've read over that page a few times. But actually the more I look
at this, the more I believe there is actually a TomEE bug here.

If you attempt to set persistent=true, but _not_ use JDBC persistence, TomEE
soft-crashes on startup and fails to create an ActiveMQ broker. Looking at
the code here: 

https://github.com/apache/tomee/blob/fdc0d09418dd40c81605dbdc1594709450c7839c/container/openejb-core/src/main/java/org/apache/openejb/resource/activemq/ActiveMQResourceAdapter.java

and here:

https://github.com/apache/tomee/blob/fdc0d09418dd40c81605dbdc1594709450c7839c/container/openejb-core/src/main/java/org/apache/openejb/resource/activemq/ActiveMQ5Factory.java

Reading the code, I think what is _supposed_ to happen is that by default
TomEE will use KahaDB by default when you set persistent=true and use JDBC
when you specify persistent=true and a DataSource name in the resource
adapter.

Instead, TomEE seems to assume that when you set persistent=true you also
have specificed a DataSource  which is causing the problem:


Example:

        </Container>
                <Resource
                id="ActiveMQResourceAdapter"
                type="ActiveMQResourceAdapter">
                BrokerXmlConfig =
broker:(ssl://xx0.xxx.com:61617?needClientAuth=true,network:static:ssl://xx1.xxx.com:61617)?persistent=true
                ServerUrl = vm://localhost
        </Resource>

Results in:

INFO: Creating Resource(id=ActiveMQResourceAdapter)
log4j:WARN No appenders could be found for logger
(org.apache.openejb.resource.activemq.ActiveMQResourceAdapter).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for
more info.
Jan 27, 2014 3:39:43 PM
org.apache.openejb.resource.activemq.ActiveMQ5Factory createBroker
INFO: ActiveMQ5Factory creating broker
Jan 27, 2014 3:39:43 PM
org.apache.openejb.resource.activemq.ActiveMQResourceAdapter
createInternalBroker
SEVERE: Failed to start ActiveMQ
java.lang.Exception: ActiveMQFactory.createBroker.InvocationTargetException
        at
org.apache.openejb.resource.activemq.ActiveMQFactory.createBroker(ActiveMQFactory.java:127)
        at
org.apache.openejb.resource.activemq.ActiveMQResourceAdapter.createInternalBroker(ActiveMQResourceAdapter.java:130)
        at
org.apache.openejb.resource.activemq.ActiveMQResourceAdapter.start(ActiveMQResourceAdapter.java:120)
        at
org.apache.openejb.assembler.classic.Assembler.createResource(Assembler.java:2172)
        at
org.apache.openejb.assembler.classic.Assembler.buildContainerSystem(Assembler.java:490)
        at 
org.apache.openejb.assembler.classic.Assembler.build(Assembler.java:409)
        at org.apache.openejb.OpenEJB$Instance.<init>(OpenEJB.java:148)
        at org.apache.openejb.OpenEJB.init(OpenEJB.java:296)
        at 
org.apache.tomee.catalina.TomcatLoader.initialize(TomcatLoader.java:246)
        at org.apache.tomee.catalina.TomcatLoader.init(TomcatLoader.java:134)
        at
org.apache.tomee.catalina.ServerListener.lifecycleEvent(ServerListener.java:122)
        at
org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
        at
org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
        at
org.apache.catalina.util.LifecycleBase.setStateInternal(LifecycleBase.java:402)
        at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:110)
        at org.apache.catalina.startup.Catalina.load(Catalina.java:640)
        at org.apache.catalina.startup.Catalina.load(Catalina.java:665)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:606)
        at org.apache.catalina.startup.Bootstrap.load(Bootstrap.java:281)
        at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:455)
Caused by: java.lang.reflect.InvocationTargetException
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:606)
        at
org.apache.openejb.resource.activemq.ActiveMQFactory.createBroker(ActiveMQFactory.java:121)
        ... 22 more
Caused by: java.lang.IllegalArgumentException: Unknown datasource Default
Unmanaged JDBC Database
        at
org.apache.openejb.resource.activemq.ActiveMQ5Factory.createBroker(ActiveMQ5Factory.java:92)
        ... 27 more

Jan 27, 2014 3:39:43 PM org.apache.openejb.assembler.classic.Assembler
createRecipe
INFO: Creating Resource(id=ActiveMQConnectionFactory)
Jan 27, 2014 3:39:43 PM org.apache.openejb.assembler.classic.Assembler
createResource
INFO: Creating ConnectionManager for Resource(id=ActiveMQConnectionFactory)



--
View this message in context: 
http://openejb.979440.n4.nabble.com/ActiveMQ-Kahadb-tp4667283p4667332.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Reply via email to