Hello,

it seems you were right regarding explicit JMS configuration. We had configured only a ActiveMQResourceAdapter resource in the tomee.xml. We've now added a javax.jms.ConnectionFactory resource and:

    <Container id="MyJmsMdbContainer" ctype="MESSAGE">
        ResourceAdapter = MyJmsResourceAdapter
    </Container>

    As per: http://tomee.apache.org/jms-resources-and-mdb-container.html

    And the warnings are now gone!

    Thank you!

Emmanuel

On 11/05/17 15:01, Romain Manni-Bucau wrote:
Hi

think we miss some logs but looks like you can use multiple MDB
configuration which starts one instance each (or default to one instance
each), maybe configure explicitly JMS resources.


Romain Manni-Bucau
@rmannibucau <https://twitter.com/rmannibucau> |  Blog
<https://blog-rmannibucau.rhcloud.com> | Old Blog
<http://rmannibucau.wordpress.com> | Github <https://github.com/rmannibucau> |
LinkedIn <https://www.linkedin.com/in/rmannibucau> | JavaEE Factory
<https://javaeefactory-rmannibucau.rhcloud.com>

2017-05-11 11:43 GMT+02:00 Emmanuel Touzery <[email protected]>
:

Hello,

     we are running multiple applications on one TomEE+ instance, and
several of them make use of ActiveMQ.

     What happens then is that TomEE attempts to start ActiveMQ several
times. It results in errors in the log file as the extra startup attempts
fail due to the port already being used, but as far as we can tell, despite
the error, everything works fine. It seems as though TomEE should just skip
start ActiveMQ if it's already running. Should we configure TomEE
differently to avoid this issue?

     Regards,

Emmanuel

PS: the logs:

11-May-2017 09:14:49.531 INFO [main] org.apache.openejb.resource.ac
tivemq.ActiveMQ5Factory.createBroker ActiveMQ5Factory creating broker
11-May-2017 09:14:49.908 INFO [main] 
org.apache.activemq.broker.BrokerService.<clinit>
Loaded the Bouncy Castle security provider.
11-May-2017 09:14:50.008 INFO [main] org.apache.openejb.resource.ac
tivemq.ActiveMQ5Factory.createBroker Using ActiveMQ startup timeout of
10000ms
11-May-2017 09:14:50.009 INFO [ActiveMQFactory start and checkpoint]
org.apache.openejb.resource.activemq.ActiveMQ5Factory$1.run Starting
ActiveMQ BrokerService
11-May-2017 09:14:50.335 INFO [ActiveMQFactory start and checkpoint]
org.apache.activemq.broker.BrokerService.doStartPersistenceAdapter Using
Persistence Adapter: MemoryPersistenceAdapter
11-May-2017 09:14:50.545 INFO [34] 
org.apache.activemq.broker.jmx.ManagementContext$1.run
JMX consoles can connect to service:jmx:rmi:///jndi/rmi://
localhost:1099/jmxrmi
11-May-2017 09:14:50.611 INFO [ActiveMQFactory start and checkpoint]
org.apache.activemq.broker.BrokerService.doStartBroker Apache ActiveMQ
5.14.3 (localhost, ID:localhost-46298-1494494090400-0:1) is starting
11-May-2017 09:14:50.633 INFO [ActiveMQFactory start and checkpoint]
org.apache.activemq.transport.TransportServerThreadSupport.doStart
Listening for connections at: tcp://localhost:61616
11-May-2017 09:14:50.634 INFO [ActiveMQFactory start and checkpoint]
org.apache.activemq.broker.TransportConnector.start Connector
tcp://localhost:61616 started
11-May-2017 09:14:50.635 INFO [ActiveMQFactory start and checkpoint]
org.apache.activemq.broker.BrokerService.doStartBroker Apache ActiveMQ
5.14.3 (localhost, ID:localhost-46298-1494494090400-0:1) started
11-May-2017 09:14:50.635 INFO [ActiveMQFactory start and checkpoint]
org.apache.activemq.broker.BrokerService.doStartBroker For help or more
information please see: http://activemq.apache.org
11-May-2017 09:14:50.639 WARNING [ActiveMQFactory start and checkpoint]
org.apache.activemq.broker.BrokerService.checkUsageLimit Temporary Store
limit is 51200 mb (current store usage is 0 mb). The data directory:
/opt/app/apache-tomee-plus-7.0.3-LECIP/logs only has 10861 mb of usable
space. - resetting to maximum available disk space: 10861 mb
11-May-2017 09:14:50.707 INFO [32] 
org.apache.openejb.resource.activemq.ActiveMQ5Factory$1.run
Starting ActiveMQ checkpoint
11-May-2017 09:14:50.708 INFO [main] org.apache.openejb.resource.ac
tivemq.ActiveMQ5Factory.createBroker ActiveMQ broker started

     And then later in the startup sequence:

11-May-2017 09:14:59.014 INFO [localhost-startStop-1]
org.apache.openejb.resource.activemq.ActiveMQ5Factory.createBroker
ActiveMQ5Factory creating broker
11-May-2017 09:14:59.017 SEVERE [localhost-startStop-1]
org.apache.openejb.resource.activemq.ActiveMQResourceAdapter.createInternalBroker
Failed to start ActiveMQ
  java.lang.Exception: ActiveMQFactory.createBroker.I
nvocationTargetException
     at org.apache.openejb.resource.activemq.ActiveMQFactory.createB
roker(ActiveMQFactory.java:128)
     at org.apache.openejb.resource.activemq.ActiveMQResourceAdapter
.createInternalBroker(ActiveMQResourceAdapter.java:150)
     at org.apache.openejb.resource.activemq.ActiveMQResourceAdapter
.start(ActiveMQResourceAdapter.java:140)
     at org.apache.openejb.assembler.classic.Assembler.doCreateResou
rce(Assembler.java:3051)
     at org.apache.openejb.assembler.classic.Assembler.createResourc
e(Assembler.java:2803)
     at org.apache.openejb.config.ConfigurationFactory.doInstall(Con
figurationFactory.java:466)
     at org.apache.openejb.config.ConfigurationFactory.install(Confi
gurationFactory.java:459)
     at org.apache.openejb.config.AutoConfig.installResource(AutoCon
fig.java:2194)
     at org.apache.openejb.config.AutoConfig.getResourceId(AutoConfi
g.java:2043)
     at org.apache.openejb.config.AutoConfig.getResourceId(AutoConfi
g.java:1978)
     at org.apache.openejb.config.AutoConfig.installResource(AutoCon
fig.java:2181)
     at org.apache.openejb.config.AutoConfig.autoCreateResource(Auto
Config.java:2068)
     at org.apache.openejb.config.AutoConfig.getResourceId(AutoConfi
g.java:2056)
     at org.apache.openejb.config.AutoConfig.getResourceId(AutoConfi
g.java:1978)
     at org.apache.openejb.config.AutoConfig.processResourceRef(Auto
Config.java:1218)
     at org.apache.openejb.config.AutoConfig.deploy(AutoConfig.java:873)
     at org.apache.openejb.config.AutoConfig.deploy(AutoConfig.java:201)
     at org.apache.openejb.config.ConfigurationFactory$Chain.deploy(
ConfigurationFactory.java:420)
     at org.apache.openejb.config.ConfigurationFactory.configureAppl
ication(ConfigurationFactory.java:1037)
     at org.apache.tomee.catalina.TomcatWebAppBuilder.startInternal(
TomcatWebAppBuilder.java:1276)
     at org.apache.tomee.catalina.TomcatWebAppBuilder.configureStart
(TomcatWebAppBuilder.java:1124)
     at org.apache.tomee.catalina.GlobalListenerSupport.lifecycleEve
nt(GlobalListenerSupport.java:133)
     at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(Li
fecycleBase.java:94)
     at org.apache.catalina.core.StandardContext.startInternal(Stand
ardContext.java:5087)
     at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.
java:150)
     at org.apache.catalina.core.ContainerBase.addChildInternal(Cont
ainerBase.java:752)
     at org.apache.catalina.core.ContainerBase.addChild(ContainerBas
e.java:728)
     at org.apache.catalina.core.StandardHost.addChild(StandardHost.
java:734)
     at org.apache.catalina.startup.HostConfig.deployDescriptor(Host
Config.java:596)
     at org.apache.catalina.startup.HostConfig$DeployDescriptor.run(
HostConfig.java:1805)
     at java.util.concurrent.Executors$RunnableAdapter.call(
Executors.java:511)
     at java.util.concurrent.FutureTask.run(FutureTask.java:266)
     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPool
Executor.java:1142)
     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoo
lExecutor.java:617)
     at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.reflect.InvocationTargetException
     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce
ssorImpl.java:62)
     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe
thodAccessorImpl.java:43)
     at java.lang.reflect.Method.invoke(Method.java:498)
     at org.apache.openejb.resource.activemq.ActiveMQFactory.createB
roker(ActiveMQFactory.java:122)
     ... 34 more
Caused by: java.io.IOException: Failed to bind to server socket:
tcp://localhost:61616 due to: java.net.BindException: Address already in
use (Bind failed)
     at org.apache.activemq.util.IOExceptionSupport.create(IOExcepti
onSupport.java:34)
     at org.apache.activemq.transport.tcp.TcpTransportServer.bind(Tc
pTransportServer.java:143)
     at org.apache.activemq.transport.tcp.TcpTransportFactory.doBind
(TcpTransportFactory.java:62)
     at org.apache.activemq.transport.TransportFactorySupport.bind(T
ransportFactorySupport.java:40)
     at org.apache.activemq.broker.BrokerService.createTransportConn
ector(BrokerService.java:2477)
     at org.apache.activemq.broker.BrokerService.addConnector(Broker
Service.java:337)
     at org.apache.openejb.resource.activemq.ActiveMQ5Factory.newDef
aultBroker(ActiveMQ5Factory.java:289)
     at org.apache.openejb.resource.activemq.ActiveMQ5Factory.create
Broker(ActiveMQ5Factory.java:99)
     ... 39 more
Caused by: java.net.BindException: Address already in use (Bind failed)
     at java.net.PlainSocketImpl.socketBind(Native Method)
     at java.net.AbstractPlainSocketImpl.bind(AbstractPlainSocketImp
l.java:387)
     at java.net.ServerSocket.bind(ServerSocket.java:375)
     at java.net.ServerSocket.<init>(ServerSocket.java:237)
     at javax.net.DefaultServerSocketFactory.createServerSocket(Serv
erSocketFactory.java:231)
     at org.apache.activemq.transport.tcp.TcpTransportServer.bind(Tc
pTransportServer.java:140)
     ... 45 more



Reply via email to