Tomcat performance on high load
Hi, I am using TomEE to host high loaded app and at some point found with VisualVM there is a bottleneck when there is a lot of concurrent requests (about 400-600 req/sec) - almost all CPU time is occupied by TaskQueue.poll() calls and general response latency becomes very slow. I tried APR/Nio connectors and different threading setting and that didn't help anyhow. Tuning amount of threads in thread pools didn't help. How to interpret this? What I might be doing wrong? What can be tuned? Here is a VisualVM top output: Hot spots - method; self time [%]; self time; self time (cpu) org.apache.tomcat.util.threads.TaskQueue.poll() 75.508965 57 668 249 ms (75,5%) 0,000 ms net.spy.memcached.internal.OperationFuture.get()14.22508 10 864 079 ms (14,2%) 6 798 ms net.spy.memcached.internal.BulkGetFuture.internalGet() 5.644 4 308 270 ms (5,6%) 0,000 ms org.apache.tomcat.util.net.NioEndpoint$Poller.run() 0.71728086 547 806 ms (0,7%) 530 252 ms org.quartz.core.QuartzSchedulerThread.run() 0.69727546 532 528 ms (0,7%) 0,000 ms Regards, Alex -- View this message in context: http://openejb.979440.n4.nabble.com/Tomcat-performance-on-high-load-tp4658847.html Sent from the OpenEJB User mailing list archive at Nabble.com.
Re: ActiveMQ 1.5.1 issue with an ActiveMQ embedded broker
Any comments on this? Issue is easily reproduced when posting jms message. -- View this message in context: http://openejb.979440.n4.nabble.com/ActiveMQ-1-5-1-issue-with-an-ActiveMQ-embedded-broker-tp4658482p4658557.html Sent from the OpenEJB User mailing list archive at Nabble.com.
ActiveMQ 1.5.1 issue with an ActiveMQ embedded broker
Hi, Seems that there is an issue on latest TomEE 1.5.1-SNAPSHOT when using ActiveMQ embedded broker. However on 1.5 everything is perfect. When posting to a topic, message reaches the destination, but container throws following exception: Exception in thread "ActiveMQ VMTransport: vm://localhost#2-2" java.lang.InternalError: java.lang.InternalError: java.lang.reflect.InvocationTargetException at org.apache.openejb.util.proxy.LocalBeanProxyFactory.createProxy(LocalBeanProxyFactory.java:137) at org.apache.openejb.util.proxy.LocalBeanProxyFactory.createProxy(LocalBeanProxyFactory.java:143) at org.apache.openejb.util.proxy.LocalBeanProxyFactory.newProxyInstance(LocalBeanProxyFactory.java:56) at org.apache.openejb.core.mdb.EndpointFactory.createEndpoint(EndpointFactory.java:70) at org.apache.activemq.ra.ServerSessionPoolImpl.createEndpoint(ServerSessionPoolImpl.java:92) at org.apache.activemq.ra.ServerSessionPoolImpl.createServerSessionImpl(ServerSessionPoolImpl.java:76) at org.apache.activemq.ra.ServerSessionPoolImpl.getServerSession(ServerSessionPoolImpl.java:116) at org.apache.activemq.ActiveMQConnectionConsumer.dispatch(ActiveMQConnectionConsumer.java:129) at org.apache.activemq.ActiveMQConnection$3.processMessageDispatch(ActiveMQConnection.java:1840) at org.apache.activemq.command.MessageDispatch.visit(MessageDispatch.java:109) at org.apache.activemq.ActiveMQConnection.onCommand(ActiveMQConnection.java:1821) at org.apache.activemq.transport.ResponseCorrelator.onCommand(ResponseCorrelator.java:116) at org.apache.activemq.transport.MutexTransport.onCommand(MutexTransport.java:50) at org.apache.activemq.transport.vm.VMTransport.iterate(VMTransport.java:241) at org.apache.activemq.thread.PooledTaskRunner.runTask(PooledTaskRunner.java:129) at org.apache.activemq.thread.PooledTaskRunner$1.run(PooledTaskRunner.java:47) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) at java.lang.Thread.run(Thread.java:680) My broker config is following: BrokerXmlConfig=broker:(tcp://localhost:61616)?useJmx=false ServerUrl = vm://localhost MaximumRedeliveries 10 DataSource ResourceAdapter = ActiveMQProvider TransactionSupport = none ResourceAdapter = ActiveMQProvider Regards, Alex -- View this message in context: http://openejb.979440.n4.nabble.com/ActiveMQ-1-5-1-issue-with-an-ActiveMQ-embedded-broker-tp4658482.html Sent from the OpenEJB User mailing list archive at Nabble.com.
Re: tomee.xml configuration for high load
Thanks for the support. I tried TomEE 1.5-SNAPSHOT with Tomcat pool and faced the same behavior. It's remarkable that JDBC 3/4 drivers behave a bit differently. While JDBC4 was hanging after connection pool exceeded, with JDBC3 I received exceptions on DBCP that connection can't be leased from pool. Finally I've found the issue it wasn't related to TomEE infrastructure, but it was in the code. At one place connection was taken in a way - jdbcTemplate.getDatasource().getConnection() but wasn't released back afterwards. So adding DataSourceUtils.releaseConnection(connection, jdbcTemplate.getDatasource()); fixed this problem. Thank you guys for your time and pointing to the possible issue origin. Regards, Alex -- View this message in context: http://openejb.979440.n4.nabble.com/tomee-xml-configuration-for-high-load-tp4657577p4657653.html Sent from the OpenEJB User mailing list archive at Nabble.com.
Re: tomee.xml configuration for high load
Basically Postgres is not used much - we use Membase to cache everything in RAM but few operations are still DB dependant. Usually there are about 50-70 connections active according to what Postgres says. -- View this message in context: http://openejb.979440.n4.nabble.com/tomee-xml-configuration-for-high-load-tp4657577p4657593.html Sent from the OpenEJB User mailing list archive at Nabble.com.
Re: tomee.xml configuration for high load
Hm. Here is DataSource configuration in TomEE JdbcDriver = org.postgresql.Driver JdbcUrl = jdbc:postgresql://localhost:5432/datasource UserName = user Password = password InitialSize = 20 MaxActive = 200 ValidationQuery = SELECT 1 JtaManaged = true Here is datasource retirieval in Spring This is how create jdbctemplate instance: public RdbmsDAOFactory(DataSource ds) { jdbcTemplate = new JdbcTemplate(ds); } What I might be missing? I am planning to switch to CDI instead of Spring but anyways it's interesting to know where I am wrong. Thanks. -- View this message in context: http://openejb.979440.n4.nabble.com/tomee-xml-configuration-for-high-load-tp4657577p4657590.html Sent from the OpenEJB User mailing list archive at Nabble.com.
Re: tomee.xml configuration for high load
Here is my stateless container configuration AccessTimeout = 5 seconds MaxSize = 100 MinSize = 1 StrictPooling = false MaxAge = 0 hours IdleTimeout = 0 minutes -- View this message in context: http://openejb.979440.n4.nabble.com/tomee-xml-configuration-for-high-load-tp4657577p4657580.html Sent from the OpenEJB User mailing list archive at Nabble.com.
tomee.xml configuration for high load
Hello, I have a question on tomee.xml configuration for highly loaded system. In my application all business logic is implemented in stateless EJB components. When load starts to grow, particular components stop responding to client requests, however others do fine and container continues working - for me it looks like pool of particular EJB components exceeded some max size and requests are hanging waiting for free resources. In logs there are no exceptions just this line each time I request "hanged" EJB: INFO: JSR-330 'javax.inject.Inject' annotation found and supported for autowiring This happens on TomEE v1.0 and ob nightly builds of Sep 9-10. The only way to restore operation is kill because it's even impossible to stop it. Any comments/recommendations? Thanks, Alex -- View this message in context: http://openejb.979440.n4.nabble.com/tomee-xml-configuration-for-high-load-tp4657577.html Sent from the OpenEJB User mailing list archive at Nabble.com.
Re: Remote debug
We also used manual specification port and other options, however found that if we specify as you did - "JAVA_OPTS="-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8787" " we have some strange Tomcat crashes on shutdown. We found that adding "jpda" startup option works much better $TOMEE_HOME/bin/startup.sh: substitute last line exec "$PRGDIR"/"$EXECUTABLE" start "$@ with exec "$PRGDIR"/"$EXECUTABLE" *jpda* start "$@ Regards, Alex -- View this message in context: http://openejb.979440.n4.nabble.com/Remote-debug-tp4657541p4657543.html Sent from the OpenEJB User mailing list archive at Nabble.com.
Hot deploy/re-deploy
Hello, What code hot swap/deploy capabilities are available in OpenEJB/TomEE? I am interested in a scenario where I point TomEE to exploded EAR folder where EJB class files are updated by IDE or whatever and dynamically hot swapped into container. There are 3rd party plugins like JRebel, but it doesn't support hot-swapping EJB for OpenEJB in case of stuctural changes (i.e new business methods added) and also requires explicit rebuild and undeploy/deploy performed. Thanks, Alex -- View this message in context: http://openejb.979440.n4.nabble.com/Hot-deploy-re-deploy-tp4657477.html Sent from the OpenEJB User mailing list archive at Nabble.com.
Re: Strange MDB invocation behavior
After a lot of investigation I've found a problem here on forum. I was using TomEE v1.0 with ActiveMQ client jar v5.5.1 which has some bug or whatever. Everything works smoothly with latest Tomee v1.1 build. There are no exceptions, however I am periodically checking logs for any kind of related problems. I'll let you know if any. Thanks for the support. -- View this message in context: http://openejb.979440.n4.nabble.com/Strange-MDB-invocation-behavior-tp4656801p4657321.html Sent from the OpenEJB User mailing list archive at Nabble.com.
Re: Strange MDB invocation behavior
I have added more logging and found that container occasionally issues following Exception when it sends JMS message. What the problem might be? I am creating connection in @PostConstruct method and then reusing it when posting messages (Session/Producers are created per send operations and not shared). Posting might occur from different threads. Should I create connection per message send operation or sharing Connection instance is fine? javax.jms.JMSException: The resource is allready being used in transaction context. at org.apache.activemq.ra.ManagedTransactionContext.setUseSharedTxContext(ManagedTransactionContext.java:47) at org.apache.activemq.ra.ManagedSessionProxy.setUseSharedTxContext(ManagedSessionProxy.java:67) at org.apache.activemq.ra.ManagedConnectionProxy.createSessionProxy(ManagedConnectionProxy.java:122) at org.apache.activemq.ra.ManagedConnectionProxy.createQueueSession(ManagedConnectionProxy.java:150) 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:597) at org.apache.openejb.resource.AutoConnectionTracker$ConnectionInvocationHandler.invoke(AutoConnectionTracker.java:125) at $Proxy75.createQueueSession(Unknown Source) at com.bmm.dao.jms.AQueueMessageSender.createSession(AQueueMessageSender.java:23) at com.bmm.dao.jms.AMessageSender.post(AMessageSender.java:112) at com.bmm.dao.jms.SynchronizerClient.post(SynchronizerClient.java:52) 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:597) at org.apache.openejb.core.interceptor.ReflectionInvocationContext$Invocation.invoke(ReflectionInvocationContext.java:181) at org.apache.openejb.core.interceptor.ReflectionInvocationContext.proceed(ReflectionInvocationContext.java:163) at org.apache.openejb.monitoring.StatsInterceptor.record(StatsInterceptor.java:176) at org.apache.openejb.monitoring.StatsInterceptor.invoke(StatsInterceptor.java:95) at sun.reflect.GeneratedMethodAccessor118.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.apache.openejb.core.interceptor.ReflectionInvocationContext$Invocation.invoke(ReflectionInvocationContext.java:181) at org.apache.openejb.core.interceptor.ReflectionInvocationContext.proceed(ReflectionInvocationContext.java:163) at org.apache.openejb.cdi.CdiInterceptor.invoke(CdiInterceptor.java:129) at org.apache.openejb.cdi.CdiInterceptor.access$000(CdiInterceptor.java:45) at org.apache.openejb.cdi.CdiInterceptor$1.call(CdiInterceptor.java:66) at org.apache.openejb.cdi.CdiInterceptor.aroundInvoke(CdiInterceptor.java:72) at sun.reflect.GeneratedMethodAccessor117.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.apache.openejb.core.interceptor.ReflectionInvocationContext$Invocation.invoke(ReflectionInvocationContext.java:181) at org.apache.openejb.core.interceptor.ReflectionInvocationContext.proceed(ReflectionInvocationContext.java:163) at org.apache.openejb.core.interceptor.InterceptorStack.invoke(InterceptorStack.java:138) at org.apache.openejb.core.stateless.StatelessContainer._invoke(StatelessContainer.java:226) at org.apache.openejb.core.stateless.StatelessContainer.invoke(StatelessContainer.java:178) at org.apache.openejb.core.ivm.EjbObjectProxyHandler$AsynchronousCall.call(EjbObjectProxyHandler.java:296) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303) at java.util.concurrent.FutureTask.run(FutureTask.java:138) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) at java.lang.Thread.run(Thread.java:662) -- View this message in context: http://openejb.979440.n4.nabble.com/Strange-MDB-invocation-behavior-tp4656801p4657302.html Sent from the OpenEJB User mailing list archive at Nabble.com.
Re: Strange MDB invocation behavior
We thought of network issue as well but it also reproduces in the case when TomEE and ActiveMQ are on the same host. For us it also seems like a kind of hibernation, when 1-st message awakes some hibernated component and then it becomes alive again but first message gets lost. -- View this message in context: http://openejb.979440.n4.nabble.com/Strange-MDB-invocation-behavior-tp4656801p4656805.html Sent from the OpenEJB User mailing list archive at Nabble.com.
Re: Strange MDB invocation behavior
Not exactly. System is running all the time. When users are doing some particular actions we use to send JMS messages and everything works fine in 99.9% of cases. After off hours (absolutely no activity at all for about 4-6 hours from the users) where the are no requests and hence JMS invocations, first JMS message delivery to the topic doesn't occur. In other words after about of 4-6 hours of inactivity, first user comes to the system, does some action that triggers JMS message send operation and that message doesn't get delivered to the MDB listeners. All subsequent messages send via the system successfully delivered without any other efforts done to the application (no shutdown/re-deploy). In logs there are no exceptions and any other suspicious things. So the only one message is lost after off hours (inactivity) and then system works as expected till next off hours period after which we face the same 1-st message loss problem. I'll check ability to send via broker managemet console as well, thanks for the suggestion. Regards, Alex -- View this message in context: http://openejb.979440.n4.nabble.com/Strange-MDB-invocation-behavior-tp4656801p4656803.html Sent from the OpenEJB User mailing list archive at Nabble.com.
Strange MDB invocation behavior
Hello, I am facing a strange behavior with MDB's that are listening on topics. After long application inactive time (in other words - system is not used overnight (3-4 hours)) first JMS message send to the topic NEVER reaches destination (I have couple of MDBs listening on the topic and neither of them gets invoked). I.e MDB isn't invoked (according to the verbose logs). All next subsequent send operations works fine and all messages reach destinations. According to our observations this doesn't happen with JMS Queues which uses the same infrastructure code referenced below. What might be a problem? What we are doing incorrectly? Here is a code I use to send messages to the topic (without spaces, looks like forum engine strips some URLs) http:// pastebin.com /kZ5W0kXS So having this code to send messages to topic/queue I use following approach: 1. inject sender into ejb bean: @EJB private IISMClient ismClient; 2. invoke send function ismClient.post(notification); Here is my tomee.xml (without spaces) http:// pastebin.com /kcdBcgEw Here is how we use @MessageDriven annotation. And as I mentioned after long user inactivity first message sent to the topic ismTopic never gets delivered to the listeners: @MessageDriven(activationConfig = { @ActivationConfigProperty( propertyName = "destinationType", propertyValue = "javax.jms.Topic"), @ActivationConfigProperty( propertyName = "destination", propertyValue = "ismTopic") }) public class TestListener extends AGenericListener implements MessageListener { @Override public void onMessage(Message msg) { TextMessage tm = (TextMessage) msg; try { String message = tm.getText(); logger.info("TestListener [message]: " + message); setRawPacket(message); process(); } catch (JMSException e) { e.printStackTrace(); } } } Sender and listeners resides currently under the same TomEE 1.0 instance on the same machine. Could you please check what I might be doing wrong? Thanks, Alex -- View this message in context: http://openejb.979440.n4.nabble.com/Strange-MDB-invocation-behavior-tp4656801.html Sent from the OpenEJB User mailing list archive at Nabble.com.
Re: DuplicateDeploymentIdException when deploying ear with application.xml
Thanks for pointing to that jira entry. Adding ?daemon=true to the uri fixed the problem. Now TomEE stops fine without need to stop ActiveMQ first. Also during deploy/redeploy process there are no issues with jsp and servlets which was the case in 1.0.0 version. Thanks a lot for the support! Regards, Alex -- View this message in context: http://openejb.979440.n4.nabble.com/DuplicateDeploymentIdException-when-deploying-ear-with-application-xml-tp4655362p4656799.html Sent from the OpenEJB User mailing list archive at Nabble.com.
Re: DuplicateDeploymentIdException when deploying ear with application.xml
I sent it my previous post (Jul 26, 2012; 12:02pm) with a link - looks like system rejected it. Dump could be found here - http:// sharetext.org /EPGC (without spaces) -- View this message in context: http://openejb.979440.n4.nabble.com/DuplicateDeploymentIdException-when-deploying-ear-with-application-xml-tp4655362p4656638.html Sent from the OpenEJB User mailing list archive at Nabble.com.
Re: DuplicateDeploymentIdException when deploying ear with application.xml
Is there any news on this? Should I have to sent more related info? Thanks. -- View this message in context: http://openejb.979440.n4.nabble.com/DuplicateDeploymentIdException-when-deploying-ear-with-application-xml-tp4655362p4656621.html Sent from the OpenEJB User mailing list archive at Nabble.com.
Re: DuplicateDeploymentIdException when deploying ear with application.xml
1. Not sure I understood what do you mean. But we can't run ActiveMQ under TomEE, we are running separate ActiveMQ cluster 2. Upgrade of ActiveMQ to 5.6.0 haven't helped. Same hang occurs on application undeploy/TomEE shutdown -- View this message in context: http://openejb.979440.n4.nabble.com/DuplicateDeploymentIdException-when-deploying-ear-with-application-xml-tp4655362p4656532.html Sent from the OpenEJB User mailing list archive at Nabble.com.
Re: DuplicateDeploymentIdException when deploying ear with application.xml
I was keep trying to figure out why TomEE hangs on undeploy/shutdown for me (and that doesnt happen for you) and looks like I have found the reason. When I have active MDBs listening on queues/topics TomEE doesn't stop until ActiveMQ is shut down. Here is a test application where there are either ejb and mdb - http://www.4shared.com/zip/Sj1fMmQX/testear2.html. ActiveMQ version I use is 5.5.1. TomEE - 1.0. We were able to reproduce behavior on every platform (Windows/MacOS/Linux). Steps for reproduction: 1. Start ActiveMQ (/Work/java/apache-activemq-5.5.1/bin/activemq start) 2. Start TomEE (/Work/java/tomee-remote/bin/startup.sh) 3. Deploy application with MDB (/Work/java/tomee-remote/bin/tomee.sh deploy /tmp/eartest-0.0.1-SNAPSHOT.ear) 4. Ensure application has been loaded 5. Stop TomEE or try undeploying application 6. On shutdown TomEE will hang with following in catalina.out 22.07.2012 13:31:08 org.apache.coyote.AbstractProtocol stop INFO: Stopping ProtocolHandler ["ajp-bio-8009"] 22.07.2012 13:31:08 org.apache.openejb.server.SimpleServiceManager stop INFO: Stopping server services 22.07.2012 13:31:08 org.apache.openejb.assembler.classic.Assembler destroyApplication INFO: Undeploying app: openejb 22.07.2012 13:31:08 org.apache.openejb.assembler.classic.Assembler destroy INFO: Closing DataSource: BerimbiDataSourceUnmanaged 22.07.2012 13:31:08 org.apache.openejb.assembler.classic.Assembler destroy INFO: Closing DataSource: BerimbiDataSourceManaged 22.07.2012 13:31:08 org.apache.openejb.assembler.classic.Assembler destroy INFO: Stopping ResourceAdapter: ActiveMQProvider 22.07.2012 13:31:08 org.apache.openejb.resource.activemq.ActiveMQResourceAdapter stop INFO: Stopping ActiveMQ 22.07.2012 13:31:08 org.apache.openejb.resource.activemq.ActiveMQResourceAdapter stopImpl INFO: Stopped ActiveMQ broker 22.07.2012 13:31:08 org.apache.coyote.AbstractProtocol destroy INFO: Destroying ProtocolHandler ["http-bio-8080"] 22.07.2012 13:31:08 org.apache.coyote.AbstractProtocol destroy INFO: Destroying ProtocolHandler ["ajp-bio-8009"] 7. Stop ActiveMQ (/Work/java/apache-activemq-5.5.1/bin/activemq stop) 8. Check TomEE, it should stop right after ActiveMQ killed When I shut down ActiveMQ before TomEE, TomEE releases fine without any hangs. So somehow TomEE waiting somewhat from ActiveMQ. The same happens when TomEE and ActiveMQ running on different machines. My tomee.xml contains following in regards of ActiveMQ configuration: BrokerXmlConfig = ServerUrl = tcp://localhost:61616 ResourceAdapter = ActiveMQProvider ResourceAdapter = ActiveMQProvider Is there any issue with my config/MDB configuration? Regards, Alex -- View this message in context: http://openejb.979440.n4.nabble.com/DuplicateDeploymentIdException-when-deploying-ear-with-application-xml-tp4655362p4656478.html Sent from the OpenEJB User mailing list archive at Nabble.com.
Re: DuplicateDeploymentIdException when deploying ear with application.xml
I did use folder name when wrote you previous message instead of ear name but it didn't work as described. Using relative path being outside of the $TOMEE_HOME doesn't work as well - it can't find deployed application: $TOMEE_HOME/bin/tomee.sh undeploy apps/BMM-0.0.2-SNAPSHOT undeploying apps/BMM-0.0.2-SNAPSHOT 28.06.2012 16:52:08 org.apache.openejb.client.EventLogger log INFO: RemoteInitialContextCreated{providerUri=http://localhost:8080/tomee/ejb} Module with moduleId "apps/BMM-0.0.2-SNAPSHOT" does not exist. -- View this message in context: http://openejb.979440.n4.nabble.com/DuplicateDeploymentIdException-when-deploying-ear-with-application-xml-tp4655362p4655869.html Sent from the OpenEJB User mailing list archive at Nabble.com.
Re: OpenEJB remote ejbd provider in TomEE
Thanks, that worked great. -- View this message in context: http://openejb.979440.n4.nabble.com/OpenEJB-remote-ejbd-provider-in-TomEE-tp4655799p4655866.html Sent from the OpenEJB User mailing list archive at Nabble.com.
Re: DuplicateDeploymentIdException when deploying ear with application.xml
Sorry for not responding for quite long time on this. Yes, you are right, you need to use tomee.sh for that to reproduce the issue. Exact steps are: 1. Deploy application MBP-Almos:testear2 tomee.sh deploy /tmp/eartest-0.0.1-SNAPSHOT.ear 2. Check jsp page/servlet MBP-Almos:testear2 wget http://localhost:8080/frontend/test.jsp -O - http://www.w3.org/TR/html4/loose.dtd";> Client test page 3. Undeploy application tomee.sh undeploy /Work/java/apache-tomee-plus-1.0.0/apps/eartest-0.0.1-SNAPSHOT/ 4. Check servlet/jsp page availability wget http://localhost:8080/frontend/test.jsp -O - http://www.w3.org/TR/html4/loose.dtd";> Client test page It's still available. Tries to access EJB results in the error messages stated above. -- View this message in context: http://openejb.979440.n4.nabble.com/DuplicateDeploymentIdException-when-deploying-ear-with-application-xml-tp4655362p4655796.html Sent from the OpenEJB User mailing list archive at Nabble.com.
OpenEJB remote ejbd provider in TomEE
Hi, I need to expose my EJB beans for the remote calls. What's the best way of doing that? What I've been doing I tried adding ejbd.properties to $TOMEE_HOME/conf.d/ server = org.apache.openejb.server.ejbd.EjbServer bind= 127.0.0.1 port= 4201 threads = 200 disabled = false backlog = 2000 discovery = ejb:ejbd://{bind}:{port} only_from = 127.0.0.1,192.168.1.1 which haven't given any results - logs shows only 1 admin service bounded on 4200/tcp lsof -n -i4TCP:4201 | grep LISTEN also doesn't show anything expected INFO: ** Bound Services ** INFO: NAME IP PORT INFO: admin127.0.0.1 4200 INFO: --- INFO: Ready! I've also tried putting following to $TOMEE_HOME/conf/system.properties ejbd.disabled=false ejbd.bind=127.0.0.1 ejbd.server=org.apache.openejb.server.ejbd.EjbServer ejbd.port=4201 ejbd.name=ejbd ejbd.threads=200 ejbd.only_from=127.0.0.1,192.168.1.1 openejb.embedded.remotable=true but again without any success. However for bare OpenEJB 3/4 without tomcat layer such approach works great. So how should I enable ejbd service for remote EJB interaction in TomEE? Thanks, Alex -- View this message in context: http://openejb.979440.n4.nabble.com/OpenEJB-remote-ejbd-provider-in-TomEE-tp4655799.html Sent from the OpenEJB User mailing list archive at Nabble.com.
Re: DuplicateDeploymentIdException when deploying ear with application.xml
Just discovered one more issue though ;). I have an EAR which is periodically gets deployed to TomEE from Jenkins. EAR consists WAR with JSP/Servlets and JAR with EJB components. First deploy goes always fine but after that issues start to appear. Here is a steps for reproduction for a problems I've discovered 0. TomEE started without any custom applications deployed 1. zz-1.0-SNAPSHOT.ear gets deployed to TomEE using tomee.sh deploy command, deploy goes fine 2. Everything works fine - servlets and EJBs 3. undeploy of zz-1.0-SNAPSHOT happens 4. [first problem] JSPs and Servlets are still accessible 5. zz-1.0-SNAPSHOT.ear gets deployed again 6. tomee.sh says deploy went well 7. JSP/Servlets are accessible 8. [second problem] any attempt to access EJB defined in the mentioned EAR gives exception: java.lang.IllegalStateException: Bean 'bmm/AuthBean' has been undeployed. org.apache.openejb.core.ivm.BaseEjbProxyHandler.getBeanContext(BaseEjbProxyHandler.java:568) org.apache.openejb.core.ivm.BaseEjbProxyHandler.isValidReference(BaseEjbProxyHandler.java:326) org.apache.openejb.core.ivm.BaseEjbProxyHandler.invoke(BaseEjbProxyHandler.java:224) $Proxy69.authorize(Unknown Source) com.bmm.request.handlers.AuthenticateCommand.execute(AuthenticateCommand.java:27) com.bmm.servlet.RequestHelper.perform(RequestHelper.java:30) com.bmm.servlet.FrontServlet.doPost(FrontServlet.java:36) javax.servlet.http.HttpServlet.service(HttpServlet.java:641) javax.servlet.http.HttpServlet.service(HttpServlet.java:722) -- View this message in context: http://openejb.979440.n4.nabble.com/DuplicateDeploymentIdException-when-deploying-ear-with-application-xml-tp4655362p4655622.html Sent from the OpenEJB User mailing list archive at Nabble.com.
Re: Arquillian remote adapter usage problem
Yes, latest code on trunk works fine in the mentioned regards. Thanks. Is arquillian-tomee-remote it expected to appear on maven repositories? If yes which ones as it's not very handy to keep local custom built stuff. -- View this message in context: http://openejb.979440.n4.nabble.com/Arquillian-remote-adapter-usage-problem-tp4655605p4655621.html Sent from the OpenEJB User mailing list archive at Nabble.com.
Re: Arquillian remote adapter usage problem
Also playing with arquillian.xml options gave following results: after I specified appWorkingDir there I got DuplicateDeploymentIdException however there were no applications deployed that contain same EJB identifiers: /Volumes/Work/java/tomee-remote/apps 14.06.2012 11:17:26 org.apache.catalina.core.StandardServer await WARNING: StandardServer.await: Invalid command '' received 14.06.2012 11:17:28 org.apache.openejb.client.EventLogger log INFO: RemoteInitialContextCreated{providerUri=http://localhost:8080/tomee/ejb} 14.06.2012 11:17:28 org.apache.openejb.util.JarExtractor extract INFO: Extracting jar: /Volumes/Work/java/tomee-remote/apps/0/test.ear 14.06.2012 11:17:28 org.apache.openejb.util.JarExtractor extract INFO: Extracted path: /Volumes/Work/java/tomee-remote/apps/0/test 14.06.2012 11:17:28 org.apache.openejb.util.JarExtractor extract INFO: Extracting jar: /Volumes/Work/java/tomee-remote/apps/0/test/arquillian-protocol.war 14.06.2012 11:17:28 org.apache.openejb.util.JarExtractor extract INFO: Extracted path: /Volumes/Work/java/tomee-remote/apps/0/test/arquillian-protocol 14.06.2012 11:17:28 org.apache.openejb.config.DeploymentLoader addFacesConfigs INFO: faces config file is null 14.06.2012 11:17:28 org.apache.openejb.util.OptionsLog info INFO: Using 'openejb.deployments.classpath.filter.systemapps=false' 14.06.2012 11:17:29 org.apache.openejb.config.ConfigurationFactory configureApplication INFO: Configuring enterprise application: /Volumes/Work/java/tomee-remote/apps/0/test 14.06.2012 11:17:29 org.apache.openejb.config.InitEjbDeployments deploy INFO: Auto-deploying ejb bmm/TestBean: EjbDeployment(deployment-id=bmm/TestBean) 14.06.2012 11:17:29 org.apache.openejb.config.AppInfoBuilder build INFO: Enterprise application "/Volumes/Work/java/tomee-remote/apps/0/test" loaded. 14.06.2012 11:17:29 org.apache.openejb.assembler.classic.Assembler createApplication INFO: Assembling app: /Volumes/Work/java/tomee-remote/apps/0/test 14.06.2012 11:17:29 org.apache.openejb.assembler.classic.Assembler createApplication SEVERE: Application cannot be deployed as it contains deployment-ids which are in use: app: /Volumes/Work/java/tomee-remote/apps/0/test org.apache.openejb.DuplicateDeploymentIdException: Application cannot be deployed as it contains deployment-ids which are in use: app: /Volumes/Work/java/tomee-remote/apps/0/test bmm/TestBean at org.apache.openejb.assembler.classic.Assembler.createApplication(Assembler.java:540) at org.apache.openejb.assembler.classic.Assembler.createApplication(Assembler.java:506) at org.apache.openejb.assembler.classic.Assembler.createApplication(Assembler.java:502) at org.apache.openejb.assembler.DeployerEjb.deploy(DeployerEjb.java:184) at org.apache.openejb.assembler.DeployerEjb.deploy(DeployerEjb.java:110) 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:597) at org.apache.openejb.core.interceptor.ReflectionInvocationContext$Invocation.invoke(ReflectionInvocationContext.java:181) at org.apache.openejb.core.interceptor.ReflectionInvocationContext.proceed(ReflectionInvocationContext.java:163) at org.apache.openejb.monitoring.StatsInterceptor.record(StatsInterceptor.java:176) at org.apache.openejb.monitoring.StatsInterceptor.invoke(StatsInterceptor.java:95) 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:597) at org.apache.openejb.core.interceptor.ReflectionInvocationContext$Invocation.invoke(ReflectionInvocationContext.java:181) at org.apache.openejb.core.interceptor.ReflectionInvocationContext.proceed(ReflectionInvocationContext.java:163) at org.apache.openejb.cdi.CdiInterceptor.invoke(CdiInterceptor.java:129) at org.apache.openejb.cdi.CdiInterceptor.access$000(CdiInterceptor.java:45) at org.apache.openejb.cdi.CdiInterceptor$1.call(CdiInterceptor.java:66) at org.apache.openejb.cdi.CdiInterceptor.aroundInvoke(CdiInterceptor.java:72) 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:597) at org.apache.openejb.core.interceptor.ReflectionInvocationContext$Invocation.invoke(ReflectionInvocationContext.java:181) at org.apache.openejb.core.interceptor.ReflectionInvocation
Re: DuplicateDeploymentIdException when deploying ear with application.xml
Thanks, that worked fine. -- View this message in context: http://openejb.979440.n4.nabble.com/DuplicateDeploymentIdException-when-deploying-ear-with-application-xml-tp4655362p4655604.html Sent from the OpenEJB User mailing list archive at Nabble.com.
Arquillian remote adapter usage problem
Hi, I tried to use arquillian remote adapter to test my application but it fails. Frankly speaking embedded fails as well but now I need to have remote working Here is exception on "mvn test" INFO: RemoteInitialContextCreated{providerUri=http://localhost:8080/tomee/ejb} org.apache.openejb.NoSuchApplicationException: /var/folders/xn/vptglx814hz78lb50y12sdcrgn/T/2/test.ear at org.apache.openejb.assembler.classic.Assembler.destroyApplication(Assembler.java:) at org.apache.openejb.assembler.DeployerEjb.undeploy(DeployerEjb.java:271) 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:597) at org.apache.openejb.core.interceptor.ReflectionInvocationContext$Invocation.invoke(ReflectionInvocationContext.java:181) at org.apache.openejb.core.interceptor.ReflectionInvocationContext.proceed(ReflectionInvocationContext.java:163) at org.apache.openejb.monitoring.StatsInterceptor.record(StatsInterceptor.java:176) at org.apache.openejb.monitoring.StatsInterceptor.invoke(StatsInterceptor.java:95) 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:597) at org.apache.openejb.core.interceptor.ReflectionInvocationContext$Invocation.invoke(ReflectionInvocationContext.java:181) at org.apache.openejb.core.interceptor.ReflectionInvocationContext.proceed(ReflectionInvocationContext.java:163) at org.apache.openejb.cdi.CdiInterceptor.invoke(CdiInterceptor.java:129) at org.apache.openejb.cdi.CdiInterceptor.access$000(CdiInterceptor.java:45) at org.apache.openejb.cdi.CdiInterceptor$1.call(CdiInterceptor.java:66) at org.apache.openejb.cdi.CdiInterceptor.aroundInvoke(CdiInterceptor.java:72) 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:597) at org.apache.openejb.core.interceptor.ReflectionInvocationContext$Invocation.invoke(ReflectionInvocationContext.java:181) at org.apache.openejb.core.interceptor.ReflectionInvocationContext.proceed(ReflectionInvocationContext.java:163) at org.apache.openejb.core.interceptor.InterceptorStack.invoke(InterceptorStack.java:138) at org.apache.openejb.core.stateless.StatelessContainer._invoke(StatelessContainer.java:226) at org.apache.openejb.core.stateless.StatelessContainer.invoke(StatelessContainer.java:178) at org.apache.openejb.core.stateless.StatelessContainer.invoke(StatelessContainer.java:142) at org.apache.openejb.server.ejbd.EjbRequestHandler.doEjbObject_BUSINESS_METHOD(EjbRequestHandler.java:286) at org.apache.openejb.server.ejbd.EjbRequestHandler.processRequest(EjbRequestHandler.java:143) at org.apache.openejb.server.ejbd.EjbDaemon.processEjbRequest(EjbDaemon.java:226) at org.apache.openejb.server.ejbd.EjbDaemon.service(EjbDaemon.java:167) at org.apache.openejb.server.ejbd.EjbServer.service(EjbServer.java:80) at org.apache.openejb.server.httpd.ServerServlet.service(ServerServlet.java:44) at javax.servlet.http.HttpServlet.service(HttpServlet.java:722) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:225) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:169) at org.apache.tomee.catalina.OpenEJBValve.invoke(OpenEJBValve.java:44) at org.apache.catalina.valves.RequestFilterValve.process(RequestFilterValve.java:305) at org.apache.catalina.valves.RemoteAddrValve.invoke(RemoteAddrValve.java:83) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98) at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:927) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407) at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Pro
Re: DuplicateDeploymentIdException when deploying ear with application.xml
Hi, Since I moved my EAR to apps/ folder everything was working great except hot deployment in that folder. I tried to: 1. simple EAR overwriting 2. using deploy tool bin/tomee.sh 3. googling a lot on some configuration options to add to the conf/tomee.conf Neither have given any satisfactory result ;). Unfortunately tomee.sh doesn't work on both Mac/Linux I tested on, every time it gives MBP-Almos:trunk alex$ /Volumes/Work/java/apache-tomee-plus-1.0.0/bin/tomee.sh deploy /Work/java/BMM-0.0.1-SNAPSHOT.ear deploying /Work/java/BMM-0.0.1-SNAPSHOT.ear Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/openejb/cli/Bootstrap Caused by: java.lang.ClassNotFoundException: org.apache.openejb.cli.Bootstrap at java.net.URLClassLoader$1.run(URLClassLoader.java:202) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:190) at java.lang.ClassLoader.loadClass(ClassLoader.java:306) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301) at java.lang.ClassLoader.loadClass(ClassLoader.java:247) I have TOMEE_HOME/JAVA_HOME properly initialized so that shouldn't be a reason. So how can I switch hot deployment for the EAR located in apps/ directory? Thanks, Alex -- View this message in context: http://openejb.979440.n4.nabble.com/DuplicateDeploymentIdException-when-deploying-ear-with-application-xml-tp4655362p4655544.html Sent from the OpenEJB User mailing list archive at Nabble.com.
Re: DuplicateDeploymentIdException when deploying ear with application.xml
Thanks for the support. Moving EAR to apps/ helped - everything works great and no exceptions are thrown. -- View this message in context: http://openejb.979440.n4.nabble.com/DuplicateDeploymentIdException-when-deploying-ear-with-application-xml-tp4655362p4655434.html Sent from the OpenEJB User mailing list archive at Nabble.com.
Re: DuplicateDeploymentIdException when deploying ear with application.xml
Hi, Thanks for your response. I've prepared test package with maven build script. Link to download: http://www.4shared.com/zip/TGDORA0u/testear.html To package ear firstly setup environment variable DEPLOY_PATH where ear will be created and then run "mvn package". It fails on Tomee 1.0 with the exceptions I described. I'll check on the latest TomEE version as well and let you know. Thanks, Alex -- View this message in context: http://openejb.979440.n4.nabble.com/DuplicateDeploymentIdException-when-deploying-ear-with-application-xml-tp4655362p4655430.html Sent from the OpenEJB User mailing list archive at Nabble.com.
DuplicateDeploymentIdException when deploying ear with application.xml
Hello, I am facing strange following problem when using application.xml in my EAR file. 1. I am using maven to build EAR which contains JAR with EJB components and one web application WAR 2. Maven automatically creates application.xml in the META-INF of my EAR 3. When deploying EAR on TomEE+ 1.0 deploy succeeds - web application and EJB's gets deployed and works fine but I get annoying exception in the log files: SEVERE: Unable to deploy collapsed ear in war /BMM-0.0.1-SNAPSHOT: Exception: Application cannot be deployed as it contains deployment-ids which are in use: app: /Volumes/Work/java/apache-tomee-plus-1.0.0/webapps/BMM-0.0.1-SNAPSHOT Bean1 Bean2 Bean3 org.apache.openejb.DuplicateDeploymentIdException: Application cannot be deployed as it contains deployment-ids which are in use: app: /Volumes/Work/java/apache-tomee-plus-1.0.0/webapps/BMM-0.0.1-SNAPSHOT Bean1 Bean2 Bean3 at org.apache.openejb.assembler.classic.Assembler.createApplication(Assembler.java:540) at org.apache.openejb.assembler.classic.Assembler.createApplication(Assembler.java:506) at org.apache.tomee.catalina.TomcatWebAppBuilder.startInternal(TomcatWebAppBuilder.java:634) at org.apache.tomee.catalina.TomcatWebAppBuilder.configureStart(TomcatWebAppBuilder.java:588) at org.apache.tomee.catalina.GlobalListenerSupport.lifecycleEvent(GlobalListenerSupport.java:117) at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119) at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90) at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5161) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:895) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:871) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:615) at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1099) at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1621) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303) at java.util.concurrent.FutureTask.run(FutureTask.java:138) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) at java.lang.Thread.run(Thread.java:680) 04.06.2012 18:18:25 org.apache.catalina.core.ContainerBase addChildInternal SEVERE: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/BMM-0.0.1-SNAPSHOT]] at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:154) at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:895) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:871) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:615) at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1099) at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1621) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303) at java.util.concurrent.FutureTask.run(FutureTask.java:138) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) at java.lang.Thread.run(Thread.java:680) Caused by: org.apache.tomee.catalina.TomEERuntimeException: org.apache.openejb.DuplicateDeploymentIdException: Application cannot be deployed as it contains deployment-ids which are in use: app: /Volumes/Work/java/apache-tomee-plus-1.0.0/webapps/BMM-0.0.1-SNAPSHOT Bean1 Bean2 Bean3 at org.apache.tomee.catalina.TomcatWebAppBuilder.startInternal(TomcatWebAppBuilder.java:641) at org.apache.tomee.catalina.TomcatWebAppBuilder.configureStart(TomcatWebAppBuilder.java:588) at org.apache.tomee.catalina.GlobalListenerSupport.lifecycleEvent(GlobalListenerSupport.java:117) at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119) at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90) at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5161) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) ... 11 more Caused by: org.apache.openejb.DuplicateDeploymentIdException: Application can