UniversalConnectionPoolManagerMBean Already exists after application "re"start - java

When I deploy an application.war that contains a servlet to my weblogic server it runs fine. The servlet uses an instance of UniversalConnectionPoolManagerMBean and starts up without any problems.
In the administration console I use the "stop when work completes" command and in my destroy() method it calls:
UniversalConnectionPoolManagerImpl.getUniversalConnectionPoolManager()
.startConnectionPool(mConnectionPoolName);
When I then click on "start servicing requests" command in the administration console I get this exception:
java.sql.SQLException: Unable to start the Universal Connection Pool: java.sql.SQLException: Unable to start the Universal Connection Pool: oracle.ucp.UniversalConnectionPoolException: MBean exception occurred while registering or unregistering the MBean
at com.exzac.dal.jdbc.Database.getConnection(Database.java:134)
at com.exzac.dal.jdbc.Database.executeQuery(Database.java:161)
at com.exzac.profilesystem.ProfileSystemConfiguration.retrieveConfigurationTable(ProfileSystemConfiguration.java:214)
... 49 more
Caused by: java.sql.SQLException: Unable to start the Universal Connection Pool: java.sql.SQLException: Unable to start the Universal Connection Pool: oracle.ucp.UniversalConnectionPoolException: MBean exception occurred while registering or unregistering the MBean
at oracle.ucp.util.UCPErrorHandler.newSQLException(UCPErrorHandler.java:541)
at oracle.ucp.jdbc.PoolDataSourceImpl.throwSQLException(PoolDataSourceImpl.java:587)
at oracle.ucp.jdbc.PoolDataSourceImpl.startPool(PoolDataSourceImpl.java:276)
at oracle.ucp.jdbc.PoolDataSourceImpl.getConnection(PoolDataSourceImpl.java:646)
at oracle.ucp.jdbc.PoolDataSourceImpl.getConnection(PoolDataSourceImpl.java:613)
at oracle.ucp.jdbc.PoolDataSourceImpl.getConnection(PoolDataSourceImpl.java:607)
at com.exzac.dal.jdbc.Database.getConnection(Database.java:132)
... 51 more
Caused by: java.sql.SQLException: Unable to start the Universal Connection Pool: oracle.ucp.UniversalConnectionPoolException: MBean exception occurred while registering or unregistering the MBean
at oracle.ucp.util.UCPErrorHandler.newSQLException(UCPErrorHandler.java:541)
at oracle.ucp.jdbc.PoolDataSourceImpl.throwSQLException(PoolDataSourceImpl.java:587)
at oracle.ucp.jdbc.PoolDataSourceImpl.startPool(PoolDataSourceImpl.java:247)
... 55 more
Caused by: oracle.ucp.UniversalConnectionPoolException: MBean exception occurred while registering or unregistering the MBean
at oracle.ucp.util.UCPErrorHandler.newUniversalConnectionPoolException(UCPErrorHandler.java:421)
at oracle.ucp.util.UCPErrorHandler.newUniversalConnectionPoolException(UCPErrorHandler.java:389)
at oracle.ucp.admin.UniversalConnectionPoolManagerMBeanImpl.getUniversalConnectionPoolManagerMBean(UniversalConnectionPoolManagerMBeanImpl.java:149)
at oracle.ucp.jdbc.PoolDataSourceImpl.startPool(PoolDataSourceImpl.java:242)
... 55 more
Caused by: java.security.PrivilegedActionException: javax.management.InstanceAlreadyExistsException: oracle.ucp.admin:name=UniversalConnectionPoolManagerMBean
at java.security.AccessController.doPrivileged(Native Method)
at oracle.ucp.admin.UniversalConnectionPoolManagerMBeanImpl.getUniversalConnectionPoolManagerMBean(UniversalConnectionPoolManagerMBeanImpl.java:136)
... 56 more
Caused by: javax.management.InstanceAlreadyExistsException: oracle.ucp.admin:name=UniversalConnectionPoolManagerMBean
at com.sun.jmx.mbeanserver.Repository.addMBean(Repository.java:453)
at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.internal_addObject(DefaultMBeanServerInterceptor.java:1484)
at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.registerDynamicMBean(DefaultMBeanServerInterceptor.java:963)
at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.registerObject(DefaultMBeanServerInterceptor.java:917)
at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.registerMBean(DefaultMBeanServerInterceptor.java:312)
at com.sun.jmx.mbeanserver.JmxMBeanServer.registerMBean(JmxMBeanServer.java:482)
at weblogic.management.jmx.mbeanserver.WLSMBeanServerInterceptorBase$27.run(WLSMBeanServerInterceptorBase.java:714)
at java.security.AccessController.doPrivileged(Native Method)
at weblogic.management.jmx.mbeanserver.WLSMBeanServerInterceptorBase.registerMBean(WLSMBeanServerInterceptorBase.java:709)
at weblogic.management.mbeanservers.internal.JMXContextInterceptor.registerMBean(JMXContextInterceptor.java:448)
at weblogic.management.jmx.mbeanserver.WLSMBeanServerInterceptorBase$27.run(WLSMBeanServerInterceptorBase.java:712)
at java.security.AccessController.doPrivileged(Native Method)
at weblogic.management.jmx.mbeanserver.WLSMBeanServerInterceptorBase.registerMBean(WLSMBeanServerInterceptorBase.java:709)
at weblogic.management.jmx.mbeanserver.WLSMBeanServer.registerMBean(WLSMBeanServer.java:462)
at oracle.ucp.admin.UniversalConnectionPoolManagerMBeanImpl$2.run(UniversalConnectionPoolManagerMBeanImpl.java:142)
... 58 more
From then on I hit this exception, even when I stop the server and restart and try to deploy. Only cleaning all published resources seems to clear the exception. I understand that a published resource was not properly cleaned in the destroy method, and I am thinking that the resource is the UniversalConnectionPoolManagerMBean instance, but I thought it would be clean up by the destroyConnectionPool method:
http://docs.oracle.com/cd/B28359_01/java.111/e11990/oracle/ucp/admin/UniversalConnectionPoolManagerMBean.html#destroyConnectionPool_java_lang_String_
How do I avoid hitting this exception?
Just as an interesting (yet unsafe) workaround: For some reason when I insert this into the initialization:
try {
UniversalConnectionPoolManagerImpl.getUniversalConnectionPoolManager().destroyConnectionPool(mConnectionPoolName);
} catch (final Exception e1) {
LOGGER.error(e1);
}
the exception is thrown and caught saying that it could not find a connectionPool with this name to destroy, but the original problem is gone. javax.management.InstanceAlreadyExistsException: oracle.ucp.admin:name=UniversalConnectionPoolManagerMBean is not thrown

This bug seems to have been fixed in versions 11.2.0.4 and 12.1.0.2. I couldn't find any documentation about it, but for me the error disappeared with the above mentioned versions.
JDBC/UCP Download Page:
http://www.oracle.com/technetwork/database/features/jdbc/index-091264.html

This is from Oracle's 11.2.0.4 UCP.jar README.txt.
Fixes in 11.2.0.4
16805157 The name of the UniversalConnectionPoolManagerMBean is made
unique per classloader and hence unique to every UCP instance
even within the same JVM
This fixes the javax.management.InstanceAlreadyExistsException described in the original question. Every connection pool created with have a unique name and will not result in InstanceAlreadyExistsException. However, since you are restarting, you should look into figuring out how to close the connection pool MBean cleanly so you won't run into this problem.

Related

WFLYEJB0467: The request was rejected as the container is suspended

When I am starting/restarting Wildfly 21 server, I am getting the following error
05:18:12,412 ERROR [stderr] (ServerService Thread Pool -- 96) javax.naming.NamingException: WFLYNAM0062: Failed to lookup mss-3.3.0-SNAPSHOT/ejbModule-3.3.0-SNAPSHOT/CompleteCallSessionBean!com.xim.mss.ejb.sessionbeans.completecall.CompleteCallRemoteInterface [Root exception is java.lang.RuntimeException: **org.jboss.as.ejb3.component.EJBComponentUnavailableException: WFLYEJB0467: The request was rejected as the container is suspended**]
But I am not getting this error when I am deploying the EAR ?
Can anyone tell me why this is happening?
Is this expected error or does this need to be resolved ?
This is an expected error, you are performing an EJB call before the EJB container is started and it is in suspended state (I reproduced the issue with a similar situation).
I have found a similar explanation for the error when the server is in shutdown (when the EJB container is also suspended).
https://issues.redhat.com/browse/JBEAP-444
The best solution is to delay this ejb call with a timer to wait the application to be fully started.

Wildfly 18 - How to see stack trace in server.log on WFLYEE0042 - Failed to construct component instance, java.lang.NullPointerException

I am getting the following error message when I try to deploy my application on WF18.
This is in the .failed file as well as the server.log file.
What do I need to do to get more information, stacktrace, etc. so I can see what is null?
WFLYEE0042: Failed to construct component instance
Caused by: java.lang.IllegalStateException: WFLYEE0042: Failed to construct component instance
Caused by: javax.ejb.EJBException: java.lang.NullPointerException
Caused by: java.lang.NullPointerException\",
\"jboss.deployment.subunit.\\"policy-ear.ear\\".\\"policy-beans.jar\\".component.ProbeSipFlowRuleEngineHolder.START\" => \"java.lang.IllegalStateException: WFLYEE0042: Failed to construct component instance
Caused by: java.lang.IllegalStateException: WFLYEE0042: Failed to construct component instance
Caused by: javax.ejb.EJBException: java.lang.NullPointerException
Caused by: java.lang.NullPointerException\"
I believe there is not much else than to increase debug output. Configure the root logger to be extremely verbose - this will actually give you tremendous amount of logging. Then mute categories you are not interested in.
This often already helped me figure out the trouble. However if Wildfly does not send a stack trace to the logs you still do not have it.
If you still want to find the call stack, you may want to run Wildfly in debug mode. Create the appropriate JVM parameters so it opens a port for debugging, then use an IDE like Eclipse or Netbeans or IntelliJ to connect and set breakpoints. (I think on Windows this could be even easier if the debugger is running on the same machine as Wildfly) The code breakpoint you want could be the constructor of the NullPointerException class.
Once the breakpoint is reached the debugger can show you the call stack directly.

How to fix java.lang.NoClassDefFoundError in tomcat

I'm getting below error message often and due to this error I'm suspecting my application creating outofMemory Error in permGen space.
Can someone help how to fix the below exception.
I'm using pure servlet and tomcat 7.
INFO: Illegal access: this web application instance has been stopped already. Could not load com.mchange.v2.resourcepool.BasicResourcePool$AsyncTestIdleResourceTask. The eventual following stack trace is caused by an error thrown for debugging purposes as well as to attempt to terminate the thread which caused the illegal access, and has no functional impact.
java.lang.IllegalStateException
at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1745)
at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1703)
at com.mchange.v2.resourcepool.BasicResourcePool.checkIdleResources(BasicResourcePool.java:1481)
at com.mchange.v2.resourcepool.BasicResourcePool.access$2000(BasicResourcePool.java:32)
at com.mchange.v2.resourcepool.BasicResourcePool$CheckIdleResourcesTask.run(BasicResourcePool.java:1964)
at java.util.TimerThread.mainLoop(Timer.java:555)
at java.util.TimerThread.run(Timer.java:505)
Exception in thread "Timer-0" java.lang.NoClassDefFoundError: com/mchange/v2/resourcepool/BasicResourcePool$AsyncTestIdleResourceTask
at com.mchange.v2.resourcepool.BasicResourcePool.checkIdleResources(BasicResourcePool.java:1481)
at com.mchange.v2.resourcepool.BasicResourcePool.access$2000(BasicResourcePool.java:32)
at com.mchange.v2.resourcepool.BasicResourcePool$CheckIdleResourcesTask.run(BasicResourcePool.java:1964)
at java.util.TimerThread.mainLoop(Timer.java:555)
at java.util.TimerThread.run(Timer.java:505)
Caused by: java.lang.ClassNotFoundException: com.mchange.v2.resourcepool.BasicResourcePool$AsyncTestIdleResourceTask
at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1854)
at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1703)
... 5 more
That message just occurs because the web application is still trying to load things after you have shut it down.
As such, it should not have "business impact" (you don't care about errors in an app that you shut down), especially if it happens in the process of shutting down the whole app server.
You may want to figure out why it does not shutdown more cleanly (maybe some background processing that needs to be stopped when the webapp is asked to terminate). If there is stuff still going on in there, that might cause problems for any other web apps still running.
If you did not intend to shut down the webapp, then there is probably another error earlier in the log.

wso2 ESB - websphere MQ JMS lost connection

WSO2 ESB sometimes lost JMS connection to Websphere MQ. Establishing new connection last at least 1-2 seconds. This cause timeouts in proxy service using this connection.
WSO2 ESB 4.8.1, IBM Webpshere MQ 7.0.1.12
Strange stacktrace:
2014-12-18 06:47:51,183 [-] [JMSCCThreadPoolWorker-7] ERROR ServiceTaskManager JMS Connection failed : JMSWMQ1107: A problem with this connection has occurred. - shutting down worker tasks
2014-12-18 06:47:52,212 [-] [JMSCCThreadPoolWorker-7] ERROR ServiceTaskManager Error closing shared Connection
com.ibm.msg.client.jms.DetailedJMSException: JMSWMQ0019: Failed to disconnect from queue manager 'name' using connection mode '1' and host name 'host(1441)'. Please see the linked exception for more information.
at com.ibm.msg.client.wmq.common.internal.Reason.reasonToException(Reason.java:608)
at com.ibm.msg.client.wmq.common.internal.Reason.createException(Reason.java:236)
at com.ibm.msg.client.wmq.internal.WMQConnection.close(WMQConnection.java:742)
at com.ibm.msg.client.jms.internal.JmsConnectionImpl.close(JmsConnectionImpl.java:352)
at com.ibm.mq.jms.MQConnection.close(MQConnection.java:93)
at org.apache.axis2.transport.jms.ServiceTaskManager.stop(ServiceTaskManager.java:237)
at org.apache.axis2.transport.jms.ServiceTaskManager.start(ServiceTaskManager.java:166)
at org.apache.axis2.transport.jms.ServiceTaskManager$MessageListenerTask.onException(ServiceTaskManager.java:631)
at com.ibm.msg.client.jms.internal.JmsProviderExceptionListener.run(JmsProviderExceptionListener.java:429)
at com.ibm.msg.client.commonservices.workqueue.WorkQueueItem.runTask(WorkQueueItem.java:209)
at com.ibm.msg.client.commonservices.workqueue.SimpleWorkQueueItem.runItem(SimpleWorkQueueItem.java:100)
at com.ibm.msg.client.commonservices.workqueue.WorkQueueItem.run(WorkQueueItem.java:224)
at com.ibm.msg.client.commonservices.workqueue.WorkQueueManager.runWorkQueueItem(WorkQueueManager.java:298)
at com.ibm.msg.client.commonservices.j2se.workqueue.WorkQueueManagerImplementation$ThreadPoolWorker.run(WorkQueueManagerImplementation.java:1220)
Caused by: com.ibm.mq.MQException: JMSCMQ0001: WebSphere MQ call failed with compcode '2' ('MQCC_FAILED') reason '2009' ('MQRC_CONNECTION_BROKEN').
at com.ibm.msg.client.wmq.common.internal.Reason.createException(Reason.java:223)
... 12 more
Caused by: com.ibm.mq.jmqi.JmqiException: CC=2;RC=2009
at com.ibm.mq.jmqi.remote.internal.RemoteHconn.enterCall(RemoteHconn.java:428)
at com.ibm.mq.jmqi.remote.internal.RemoteHconn.enterCall(RemoteHconn.java:350)
at com.ibm.mq.jmqi.remote.internal.RemoteHconn.enterCall(RemoteHconn.java:325)
at com.ibm.mq.jmqi.remote.internal.RemoteFAP.MQDISC(RemoteFAP.java:2541)
at com.ibm.msg.client.wmq.internal.WMQConnection.close(WMQConnection.java:724)
... 11 more
Caused by: com.ibm.mq.jmqi.JmqiException: CC=2;RC=2009;AMQ9213: A communications error for 'TCP' occurred. [1=java.net.SocketException[Unrecognized Windows Sockets error: 0: recv failed],4=TCP,5=sockInStream.read]
at com.ibm.mq.jmqi.remote.internal.RemoteTCPConnection.receive(RemoteTCPConnection.java:1418)
at com.ibm.mq.jmqi.remote.internal.RemoteRcvThread.receiveBuffer(RemoteRcvThread.java:737)
at com.ibm.mq.jmqi.remote.internal.RemoteRcvThread.receiveOneTSH(RemoteRcvThread.java:701)
at com.ibm.mq.jmqi.remote.internal.RemoteRcvThread.run(RemoteRcvThread.java:146)
... 5 more
Caused by: java.net.SocketException: Unrecognized Windows Sockets error: 0: recv failed
at java.net.SocketInputStream.socketRead0(Native Method)
at java.net.SocketInputStream.read(SocketInputStream.java:152)
at java.net.SocketInputStream.read(SocketInputStream.java:122)
at sun.security.ssl.InputRecord.readFully(InputRecord.java:442)
at sun.security.ssl.InputRecord.read(InputRecord.java:480)
at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:927)
at sun.security.ssl.SSLSocketImpl.readDataRecord(SSLSocketImpl.java:884)
at sun.security.ssl.AppInputStream.read(AppInputStream.java:102)
at com.ibm.mq.jmqi.remote.internal.RemoteTCPConnection.receive(RemoteTCPConnection.java:1409)
... 8 more
2014-12-18 06:49:53,302 [-] [DefaultQuartzScheduler_Worker-1] ERROR MessageInjector Proxy Service: monitoring_Service not found
2014-12-18 06:49:53,302 [-] [DefaultQuartzScheduler_Worker-1] ERROR JobRunShell Job synapse.simple.quartz.monitoring_Task threw an unhandled Exception:
org.apache.synapse.SynapseException: Proxy Service: monitoring_Service not found
at org.apache.synapse.startup.tasks.MessageInjector.handleError(MessageInjector.java:333)
at org.apache.synapse.startup.tasks.MessageInjector.execute(MessageInjector.java:217)
at org.apache.synapse.startup.quartz.SimpleQuartzJob.execute(SimpleQuartzJob.java:88)
at org.quartz.core.JobRunShell.run(JobRunShell.java:213)
at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:557)
2014-12-18 06:49:53,302 [-] [DefaultQuartzScheduler_Worker-1] ERROR ErrorLogger Job (synapse.simple.quartz.monitoring_Task threw an exception.
org.quartz.SchedulerException: Job threw an unhandled exception. [See nested exception: org.apache.synapse.SynapseException: Proxy Service: monitoring_Service not found]
at org.quartz.core.JobRunShell.run(JobRunShell.java:224)
at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:557)
Caused by: org.apache.synapse.SynapseException: Proxy Service: monitoring_Service not found
at org.apache.synapse.startup.tasks.MessageInjector.handleError(MessageInjector.java:333)
at org.apache.synapse.startup.tasks.MessageInjector.execute(MessageInjector.java:217)
at org.apache.synapse.startup.quartz.SimpleQuartzJob.execute(SimpleQuartzJob.java:88)
at org.quartz.core.JobRunShell.run(JobRunShell.java:213)
... 1 more
The key error you're seeing within the stacktrace is:
Caused by: java.net.SocketException: Unrecognized Windows Sockets error: 0: recv failed
at java.net.SocketInputStream.socketRead0(Native Method)
at java.net.SocketInputStream.read(SocketInputStream.java:152)
at java.net.SocketInputStream.read(SocketInputStream.java:122)
Which indicates that the JVM received something it wasn't expecting over a Windows socket. It looks like you're using an Oracle JVM rather than the IBM one shipped with MQ.
I'd suggest you try upgrading to a newer JVM if one is available. Note that the MQ 7.0.1 client you're using supports Java 5 and Java 6. If you want to use Java 7 you'll need to use an MQ client of 7.1 or later. All IBM MQ clients are available free of charge via the MQC support packs:
MQ 7.1 clients: http://www-01.ibm.com/support/docview.wss?uid=swg24031412
MQ 7.5 clients: http://www-01.ibm.com/support/docview.wss?uid=swg24032744
MQ 8.0 clients: http://www-01.ibm.com/support/docview.wss?uid=swg24037500
If a newer JVM isn't available from Oracle, I'd suggest opening a support ticket with them so they can investigate.

Hibernate: org.hibernate.service.spi.ServiceException: Unable to create requested service [org.hibernate.engine.spi.CacheImplementor]

I am attempting to deploy an application on a glassfish 4 server on my local machine. When I copy the .war file into the autodeploy directory, the glassfish log returns exceptions and the application does not appear in the list of applications, on the server's admin console. I've consulted with a local colleague on this and based on comparisons to working instances, we believe the traces from the Glassfish server, shown below, may have something to do with the cause:
Server Trace:
Caused by: org.hibernate.service.spi.ServiceException: Unable to create requested service [org.hibernate.engine.spi.CacheImplementor]
at org.hibernate.service.internal.AbstractServiceRegistryImpl.createService(AbstractServiceRegistryImpl.java:186)
at org.hibernate.service.internal.AbstractServiceRegistryImpl.initializeService(AbstractServiceRegistryImpl.java:150)
at org.hibernate.service.internal.AbstractServiceRegistryImpl.getService(AbstractServiceRegistryImpl.java:131)
at org.hibernate.internal.SessionFactoryImpl.<init>(SessionFactoryImpl.java:264)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1760)
at org.hibernate.ejb.EntityManagerFactoryImpl.<init>(EntityManagerFactoryImpl.java:96)
at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:913)
... 60 more
Caused by: org.hibernate.cache.CacheException: net.sf.ehcache.CacheException: Error configuring from null. Initial cause was null
at org.hibernate.cache.ehcache.EhCacheRegionFactory.start(EhCacheRegionFactory.java:110)
at org.hibernate.internal.CacheImpl.<init>(CacheImpl.java:70)
at org.hibernate.engine.spi.CacheInitiator.initiateService(CacheInitiator.java:40)
at org.hibernate.engine.spi.CacheInitiator.initiateService(CacheInitiator.java:35)
at org.hibernate.service.internal.SessionFactoryServiceRegistryImpl.initiateService(SessionFactoryServiceRegistryImpl.java:91)
at org.hibernate.service.internal.AbstractServiceRegistryImpl.createService(AbstractServiceRegistryImpl.java:176)
... 66 more
Caused by: net.sf.ehcache.CacheException: Error configuring from null. Initial cause was null
at net.sf.ehcache.config.ConfigurationFactory.parseConfiguration(ConfigurationFactory.java:105)
at org.hibernate.cache.ehcache.internal.util.HibernateUtil.loadAndCorrectConfiguration(HibernateUtil.java:63)
at org.hibernate.cache.ehcache.EhCacheRegionFactory.start(EhCacheRegionFactory.java:93)
... 71 more
Caused by: java.lang.NullPointerException
at net.sf.ehcache.config.ConfigurationFactory.parseConfiguration(ConfigurationFactory.java:102)
... 73 more
If a full stack trace is needed or any further info or edits are needed, let me know. Otherwise, I will await response.
Problem solved:
I mispelled the ehcache property, in the Glassfish server.
Lesson Learned. :)

Categories

Resources