java.lang.VerifyError: org/bouncycastle/asn1/x500/X500Name - java

I am trying to create a signature from a cer file. Below is the code that I have used. I get an error on X500Name initialization. In debug mode the code works but when I export the code as a jar file using ant build, it gives the error. I have used two libraries that I have zipped with the exported jar
a. bcprov-jdk15on-1.50.jar
b. bcpkix-jdk15on-1.50.jar
X509Certificate[] certs = (X509Certificate[]) request.getAttribute("javax.servlet.request.X509Certificate");
X500Name issuer = null;
try{
issuer = new X500Name(certs[0].getIssuerX500Principal().toString());
}catch(Throwable e){
e.printStackTrace();
}
Error:
07:50:43,095 ERROR [stderr] (http-/0.0.0.0:8443-1) java.lang.VerifyError: org/bouncycastle/asn1/x500/X500Name
07:50:43,095 ERROR [stderr] (http-/0.0.0.0:8443-1) at com.adobe.livecycle.usermanager.sslauthprovider.SSLMutualAuthProvider.authenticate(SSLMutualAuthProvider.java:139)
07:50:43,095 ERROR [stderr] (http-/0.0.0.0:8443-1) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
07:50:43,095 ERROR [stderr] (http-/0.0.0.0:8443-1) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
07:50:43,095 ERROR [stderr] (http-/0.0.0.0:8443-1) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
07:50:43,095 ERROR [stderr] (http-/0.0.0.0:8443-1) at java.lang.reflect.Method.invoke(Method.java:498)
07:50:43,095 ERROR [stderr] (http-/0.0.0.0:8443-1) at com.adobe.idp.dsc.component.impl.DefaultPOJOInvokerImpl.invoke(DefaultPOJOInvokerImpl.java:118)
07:50:43,095 ERROR [stderr] (http-/0.0.0.0:8443-1) at com.adobe.idp.dsc.interceptor.impl.InvocationInterceptor.intercept(InvocationInterceptor.java:140)
07:50:43,095 ERROR [stderr] (http-/0.0.0.0:8443-1) at com.adobe.idp.dsc.interceptor.impl.RequestInterceptorChainImpl.proceed(RequestInterceptorChainImpl.java:60)
07:50:43,095 ERROR [stderr] (http-/0.0.0.0:8443-1) at com.adobe.idp.dsc.interceptor.impl.DocumentPassivationInterceptor.intercept(DocumentPassivationInterceptor.java:53)
07:50:43,096 ERROR [stderr] (http-/0.0.0.0:8443-1) at com.adobe.idp.dsc.interceptor.impl.RequestInterceptorChainImpl.proceed(RequestInterceptorChainImpl.java:60)
07:50:43,096 ERROR [stderr] (http-/0.0.0.0:8443-1) at com.adobe.idp.dsc.transaction.interceptor.TransactionInterceptor$1.doInTransaction(TransactionInterceptor.java:74)
07:50:43,096 ERROR [stderr] (http-/0.0.0.0:8443-1) at com.adobe.idp.dsc.transaction.impl.ejb.adapter.EjbTransactionCMTAdapterBean.execute(EjbTransactionCMTAdapterBean.java:357)
07:50:43,099 ERROR [stderr] (http-/0.0.0.0:8443-1) at com.adobe.idp.dsc.transaction.impl.ejb.adapter.EjbTransactionCMTAdapterBean.doSupports(EjbTransactionCMTAdapterBean.java:227)
07:50:43,101 ERROR [stderr] (http-/0.0.0.0:8443-1) at sun.reflect.GeneratedMethodAccessor479.invoke(Unknown Source)
07:50:43,102 ERROR [stderr] (http-/0.0.0.0:8443-1) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
07:50:43,103 ERROR [stderr] (http-/0.0.0.0:8443-1) at java.lang.reflect.Method.invoke(Method.java:498)
07:50:43,104 ERROR [stderr] (http-/0.0.0.0:8443-1) at org.jboss.as.ee.component.ManagedReferenceMethodInterceptor.processInvocation(ManagedReferenceMethodInterceptor.java:52)
07:50:43,105 ERROR [stderr] (http-/0.0.0.0:8443-1) at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)
07:50:43,105 ERROR [stderr] (http-/0.0.0.0:8443-1) at org.jboss.invocation.WeavedInterceptor.processInvocation(WeavedInterceptor.java:53)
07:50:43,106 ERROR [stderr] (http-/0.0.0.0:8443-1) at org.jboss.as.ee.component.interceptors.UserInterceptorFactory$1.processInvocation(UserInterceptorFactory.java:63)
07:50:43,107 ERROR [stderr] (http-/0.0.0.0:8443-1) at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)
07:50:43,107 ERROR [stderr] (http-/0.0.0.0:8443-1) at org.jboss.invocation.WeavedInterceptor.processInvocation(WeavedInterceptor.java:53)
07:50:43,108 ERROR [stderr] (http-/0.0.0.0:8443-1) at org.jboss.as.ee.component.interceptors.UserInterceptorFactory$1.processInvocation(UserInterceptorFactory.java:63)
07:50:43,108 ERROR [stderr] (http-/0.0.0.0:8443-1) at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)
07:50:43,109 ERROR [stderr] (http-/0.0.0.0:8443-1) at org.jboss.as.ejb3.component.invocationmetrics.ExecutionTimeInterceptor.processInvocation(ExecutionTimeInterceptor.java:43)
07:50:43,110 ERROR [stderr] (http-/0.0.0.0:8443-1) at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)
07:50:43,111 ERROR [stderr] (http-/0.0.0.0:8443-1) at org.jboss.as.jpa.interceptor.SBInvocationInterceptor.processInvocation(SBInvocationInterceptor.java:47)
07:50:43,112 ERROR [stderr] (http-/0.0.0.0:8443-1) at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)

Related

I am getting an error of `java.lang.ClassNotFoundException` while working with EJB

I am getting an error of java.lang.ClassNotFoundException while working with EJB.
Tools and Technologies:
Eclipse Kepler
EJB 3.0
Oracle 11g
Jboss 7.1.0
I have came across some solutions that adding a ojdbc14.jar/ojdbc6.jar will work.
I have added jar files to the classpath but it is still giving the same exception "java.lang.ClassNotFoundException".
Jboss server log is as given below:
17:27:07,275 ERROR [stderr] (http-localhost-127.0.0.1-8081-1) java.lang.ClassNotFoundException: oracle.jdbc.driver.OracleDriver from [Module "deployment.NewEJB.jar:main" from Service Module Loader]
17:27:07,278 ERROR [stderr] (http-localhost-127.0.0.1-8081-1) at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:190)
17:27:07,279 ERROR [stderr] (http-localhost-127.0.0.1-8081-1) at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:468)
17:27:07,281 ERROR [stderr] (http-localhost-127.0.0.1-8081-1) at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:456)
17:27:07,282 ERROR [stderr] (http-localhost-127.0.0.1-8081-1) at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:398)
17:27:07,284 ERROR [stderr] (http-localhost-127.0.0.1-8081-1) at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:120)
17:27:07,286 ERROR [stderr] (http-localhost-127.0.0.1-8081-1) at java.lang.Class.forName0(Native Method)
17:27:07,287 ERROR [stderr] (http-localhost-127.0.0.1-8081-1) at java.lang.Class.forName(Class.java:190)
17:27:07,289 ERROR [stderr] (http-localhost-127.0.0.1-8081-1) at com.session.LibraryPersistentBean.getList(LibraryPersistentBean.java:39)
17:27:07,291 ERROR [stderr] (http-localhost-127.0.0.1-8081-1) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
17:27:07,293 ERROR [stderr] (http-localhost-127.0.0.1-8081-1) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
17:27:07,295 ERROR [stderr] (http-localhost-127.0.0.1-8081-1) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
17:27:07,298 ERROR [stderr] (http-localhost-127.0.0.1-8081-1) at java.lang.reflect.Method.invoke(Method.java:606)
17:27:07,300 ERROR [stderr] (http-localhost-127.0.0.1-8081-1) at org.jboss.as.ee.component.ManagedReferenceMethodInterceptorFactory$ManagedReferenceMethodInterceptor.processInvocation(ManagedReferenceMethodInterceptorFactory.java:72)
17:27:07,304 ERROR [stderr] (http-localhost-127.0.0.1-8081-1) at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)
17:27:07,307 ERROR [stderr] (http-localhost-127.0.0.1-8081-1) at org.jboss.invocation.WeavedInterceptor.processInvocation(WeavedInterceptor.java:53)
17:27:07,311 ERROR [stderr] (http-localhost-127.0.0.1-8081-1) at org.jboss.as.ee.component.interceptors.UserInterceptorFactory$1.processInvocation(UserInterceptorFactory.java:36)
17:27:07,313 ERROR [stderr] (http-localhost-127.0.0.1-8081-1) at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)
17:27:07,314 ERROR [stderr] (http-localhost-127.0.0.1-8081-1) at org.jboss.as.jpa.interceptor.SBInvocationInterceptor.processInvocation(SBInvocationInterceptor.java:47)
17:27:07,316 ERROR [stderr] (http-localhost-127.0.0.1-8081-1) at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)
17:27:07,317 ERROR [stderr] (http-localhost-127.0.0.1-8081-1) at org.jboss.invocation.InitialInterceptor.processInvocation(InitialInterceptor.java:21)
17:27:07,319 ERROR [stderr] (http-localhost-127.0.0.1-8081-1) at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)
17:27:07,320 ERROR [stderr] (http-localhost-127.0.0.1-8081-1) at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61)
17:27:07,322 ERROR [stderr] (http-localhost-127.0.0.1-8081-1) at org.jboss.as.ee.component.interceptors.ComponentDispatcherInterceptor.processInvocation(ComponentDispatcherInterceptor.java:53)
17:27:07,324 ERROR [stderr] (http-localhost-127.0.0.1-8081-1) at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)
17:27:07,327 ERROR [stderr] (http-localhost-127.0.0.1-8081-1) at org.jboss.as.ejb3.component.pool.PooledInstanceInterceptor.processInvocation(PooledInstanceInterceptor.java:51)
17:27:07,330 ERROR [stderr] (http-localhost-127.0.0.1-8081-1) at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)
17:27:07,333 ERROR [stderr] (http-localhost-127.0.0.1-8081-1) at org.jboss.as.ejb3.tx.CMTTxInterceptor.invokeInOurTx(CMTTxInterceptor.java:228)
17:27:07,336 ERROR [stderr] (http-localhost-127.0.0.1-8081-1) at org.jboss.as.ejb3.tx.CMTTxInterceptor.required(CMTTxInterceptor.java:304)
17:27:07,338 ERROR [stderr] (http-localhost-127.0.0.1-8081-1) at org.jboss.as.ejb3.tx.CMTTxInterceptor.processInvocation(CMTTxInterceptor.java:190)
17:27:07,340 ERROR [stderr] (http-localhost-127.0.0.1-8081-1) at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)
17:27:07,342 ERROR [stderr] (http-localhost-127.0.0.1-8081-1) at org.jboss.as.ejb3.remote.EJBRemoteTransactionPropogatingInterceptor.processInvocation(EJBRemoteTransactionPropogatingInterceptor.java:80)
17:27:07,344 ERROR [stderr] (http-localhost-127.0.0.1-8081-1) at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)
17:27:07,345 ERROR [stderr] (http-localhost-127.0.0.1-8081-1) at org.jboss.as.ejb3.component.interceptors.CurrentInvocationContextInterceptor.processInvocation(CurrentInvocationContextInterceptor.java:41)
17:27:07,347 ERROR [stderr] (http-localhost-127.0.0.1-8081-1) at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)
17:27:07,349 ERROR [stderr] (http-localhost-127.0.0.1-8081-1) at org.jboss.as.ejb3.component.interceptors.LoggingInterceptor.processInvocation(LoggingInterceptor.java:59)
17:27:07,350 ERROR [stderr] (http-localhost-127.0.0.1-8081-1) at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)
17:27:07,353 ERROR [stderr] (http-localhost-127.0.0.1-8081-1) at org.jboss.as.ee.component.NamespaceContextInterceptor.processInvocation(NamespaceContextInterceptor.java:50)
17:27:07,355 ERROR [stderr] (http-localhost-127.0.0.1-8081-1) at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)
17:27:07,357 ERROR [stderr] (http-localhost-127.0.0.1-8081-1) at org.jboss.as.ee.component.TCCLInterceptor.processInvocation(TCCLInterceptor.java:45)
17:27:07,359 ERROR [stderr] (http-localhost-127.0.0.1-8081-1) at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)
17:27:07,361 ERROR [stderr] (http-localhost-127.0.0.1-8081-1) at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61)
17:27:07,364 ERROR [stderr] (http-localhost-127.0.0.1-8081-1) at org.jboss.as.ee.component.ViewService$View.invoke(ViewService.java:165)
17:27:07,365 ERROR [stderr] (http-localhost-127.0.0.1-8081-1) at org.jboss.as.ejb3.remote.LocalEjbReceiver.processInvocation(LocalEjbReceiver.java:179)
17:27:07,367 ERROR [stderr] (http-localhost-127.0.0.1-8081-1) at org.jboss.ejb.client.EJBClientInvocationContext.sendRequest(EJBClientInvocationContext.java:173)
17:27:07,369 ERROR [stderr] (http-localhost-127.0.0.1-8081-1) at org.jboss.ejb.client.TransactionInterceptor.handleInvocation(TransactionInterceptor.java:43)
17:27:07,371 ERROR [stderr] (http-localhost-127.0.0.1-8081-1) at org.jboss.ejb.client.EJBClientInvocationContext.sendRequest(EJBClientInvocationContext.java:175)
17:27:07,372 ERROR [stderr] (http-localhost-127.0.0.1-8081-1) at org.jboss.ejb.client.ReceiverInterceptor.handleInvocation(ReceiverInterceptor.java:92)
17:27:07,374 ERROR [stderr] (http-localhost-127.0.0.1-8081-1) at org.jboss.ejb.client.EJBClientInvocationContext.sendRequest(EJBClientInvocationContext.java:175)
17:27:07,375 ERROR [stderr] (http-localhost-127.0.0.1-8081-1) at org.jboss.ejb.client.EJBInvocationHandler.doInvoke(EJBInvocationHandler.java:136)
17:27:07,377 ERROR [stderr] (http-localhost-127.0.0.1-8081-1) at org.jboss.ejb.client.EJBInvocationHandler.doInvoke(EJBInvocationHandler.java:121)
17:27:07,379 ERROR [stderr] (http-localhost-127.0.0.1-8081-1) at org.jboss.ejb.client.EJBInvocationHandler.invoke(EJBInvocationHandler.java:104)
17:27:07,380 ERROR [stderr] (http-localhost-127.0.0.1-8081-1) at com.sun.proxy.$Proxy12.getList(Unknown Source)
17:27:07,381 ERROR [stderr] (http-localhost-127.0.0.1-8081-1) at com.login.action.LoginAction.execute(LoginAction.java:48)
17:27:07,383 ERROR [stderr] (http-localhost-127.0.0.1-8081-1) at org.apache.struts.chain.commands.servlet.ExecuteAction.execute(ExecuteAction.java:58)
17:27:07,384 ERROR [stderr] (http-localhost-127.0.0.1-8081-1) at org.apache.struts.chain.commands.AbstractExecuteAction.execute(AbstractExecuteAction.java:67)
17:27:07,386 ERROR [stderr] (http-localhost-127.0.0.1-8081-1) at org.apache.struts.chain.commands.ActionCommandBase.execute(ActionCommandBase.java:51)
17:27:07,387 ERROR [stderr] (http-localhost-127.0.0.1-8081-1) at org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:191)
17:27:07,388 ERROR [stderr] (http-localhost-127.0.0.1-8081-1) at org.apache.commons.chain.generic.LookupCommand.execute(LookupCommand.java:305)
17:27:07,390 ERROR [stderr] (http-localhost-127.0.0.1-8081-1) at org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:191)
17:27:07,391 ERROR [stderr] (http-localhost-127.0.0.1-8081-1) at org.apache.struts.chain.ComposableRequestProcessor.process(ComposableRequestProcessor.java:283)
17:27:07,393 ERROR [stderr] (http-localhost-127.0.0.1-8081-1) at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1913)
17:27:07,394 ERROR [stderr] (http-localhost-127.0.0.1-8081-1) at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:462)
17:27:07,395 ERROR [stderr] (http-localhost-127.0.0.1-8081-1) at javax.servlet.http.HttpServlet.service(HttpServlet.java:754)
17:27:07,398 ERROR [stderr] (http-localhost-127.0.0.1-8081-1) at javax.servlet.http.HttpServlet.service(HttpServlet.java:847)
17:27:07,400 ERROR [stderr] (http-localhost-127.0.0.1-8081-1) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:329)
17:27:07,402 ERROR [stderr] (http-localhost-127.0.0.1-8081-1) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248)
17:27:07,404 ERROR [stderr] (http-localhost-127.0.0.1-8081-1) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:275)
17:27:07,405 ERROR [stderr] (http-localhost-127.0.0.1-8081-1) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:161)
17:27:07,407 ERROR [stderr] (http-localhost-127.0.0.1-8081-1) at org.jboss.as.web.security.SecurityContextAssociationValve.invoke(SecurityContextAssociationValve.java:154)
17:27:07,410 ERROR [stderr] (http-localhost-127.0.0.1-8081-1) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:155)
17:27:07,416 ERROR [stderr] (http-localhost-127.0.0.1-8081-1) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
17:27:07,418 ERROR [stderr] (http-localhost-127.0.0.1-8081-1) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
17:27:07,419 ERROR [stderr] (http-localhost-127.0.0.1-8081-1) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:368)
17:27:07,421 ERROR [stderr] (http-localhost-127.0.0.1-8081-1) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:877)
17:27:07,424 ERROR [stderr] (http-localhost-127.0.0.1-8081-1) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:671)
17:27:07,427 ERROR [stderr] (http-localhost-127.0.0.1-8081-1) at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:930)
17:27:07,430 ERROR [stderr] (http-localhost-127.0.0.1-8081-1) at java.lang.Thread.run(Thread.java:724)
This is my code:
package com.session;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.ArrayList;
import java.util.List;
import javax.ejb.Stateless;
import com.entity.Book;
/**
* Session Bean implementation class LibraryPersistentBean
*/
#Stateless
public class LibraryPersistentBean implements LibraryPersistentBeanRemote {
/**
* Default constructor.
*/
public LibraryPersistentBean() {
// TODO Auto-generated constructor stub
}
#Override
public List<Book> getList() {
Connection con = null;
String url = "jdbc:oracle:thin:#localhost:1521:XE";
String driver = "oracle.jdbc.driver.OracleDriver";
String userName = "NL";
String password = "NL";
List<Book> books = new ArrayList<Book>();
try {
Class.forName(driver);
con = DriverManager.getConnection(url , userName, password);
Statement st = con.createStatement();
ResultSet rs = st.executeQuery("SELECT * FROM LOGIN");
Book book;
while (rs.next()) {
book = new Book();
book.setId(rs.getInt(1));
book.setUsername(rs.getString(2));
books.add(book);
}
} catch (SQLException ex) {
ex.printStackTrace();
} catch (ClassNotFoundException ex) {
ex.printStackTrace();
}
return books;
}
}
Thanks in advance...!
You should create a new module, for your Oracle datasource, into your JBoss 7.1.0. application server.
In order to do that, you need to do the following:
Create a new folder structure: <JBOSS_HOME>/modules/com/oracle/db/main
Copy your OJDBC JAR into your newly created directory mentioned above
Create a file named module.xml, in the directory mentioned in 1.:
<module xmlns="urn:jboss:module:1.0" name="com.oracle.db">
<resources>
<resource-root path="ojdbc.jar"/>
</resources>
<dependencies>
<module name="javax.api"/>
<module name="javax.transaction.api"/>
</dependencies>
</module>
Modify your standalone.xml file in order to accommodate the newly created module:
<subsystem xmlns="urn:jboss:domain:datasources:1.2">
<datasources>
(...)
</datasources>
<drivers>
<driver name="oracle" module="com.oracle.db">
<driver-class>oracle.jdbc.driver.OracleDriver</driver-class>
</driver>
</drivers>
</subsystem>
Finally, you just need to configure your datasource according to your needs.
Further information can be found in the following links:
Create a module for Oracle datasource in JBoss 7.1.1.Final
Installing Oracle JDBC Driver on WildFly / JBoss

unlock() never invoked but using try..finally

I'm using a servlets (atmosphere framework and a custom one) which both use the same ReentrantLock to synchronize some operations. I got the confusing behavior, that a single thread enters the lock again and again without ever calling unlock() matching its previous lock().
For debugging purposes I've added a dump of the stacktrace right after the lock() invokation and it always shows the very same output. Doesn't this mean, that my method is invoked again and again but the succeeding try...finally is never executed?
IManagerLock batchLock = _lockManager.getManagerLock(true);
try {
// ...do something - in this case the code won't try to lock() again
}
finally {
batchLock.unlock();
}
The getManagerLock() will aquire the lock and return some wrapper object around the lock which allows me to perform some debugging etc. It will e.g. assign an UUID to the wrapper object which is printed to the log on lock() and unlock().
Here is an example of the wired stacktrace. It is repeated seven times. As you can see, there is only the Locked: xxx but not Unlocked: xxx message.
17:25:18,550 INFO [stdout] (http-/0.0.0.0:8080-13) Locked: 1a59d9ea-841f-4024-9043-67c8e649c342
17:25:18,551 ERROR [stderr] (http-/0.0.0.0:8080-13) java.lang.Exception
17:25:18,551 ERROR [stderr] (http-/0.0.0.0:8080-13) at xxx.jee.pagelock.DefaultLockManager$LockManagerBatch.<init>(DefaultLockManager.java:377)
17:25:18,552 ERROR [stderr] (http-/0.0.0.0:8080-13) at xxx.jee.pagelock.DefaultLockManager.getManagerLock(DefaultLockManager.java:246)
17:25:18,553 ERROR [stderr] (http-/0.0.0.0:8080-13) at xxx.jee.pagelock.DefaultLockManager$Proxy$_$$_WeldClientProxy.getManagerLock(DefaultLockManager$Proxy$_$$_WeldClientProxy.java)
17:25:18,553 ERROR [stderr] (http-/0.0.0.0:8080-13) at xxx.jee.pagelock.channel.LockChannel.onClose(LockChannel.java:128)
17:25:18,554 ERROR [stderr] (http-/0.0.0.0:8080-13) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
17:25:18,554 ERROR [stderr] (http-/0.0.0.0:8080-13) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
17:25:18,555 ERROR [stderr] (http-/0.0.0.0:8080-13) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
17:25:18,556 ERROR [stderr] (http-/0.0.0.0:8080-13) at java.lang.reflect.Method.invoke(Method.java:606)
17:25:18,556 ERROR [stderr] (http-/0.0.0.0:8080-13) at org.atmosphere.util.Utils.invoke(Utils.java:209)
17:25:18,556 ERROR [stderr] (http-/0.0.0.0:8080-13) at org.atmosphere.config.managed.ManagedAtmosphereHandler.invoke(ManagedAtmosphereHandler.java:335)
17:25:18,557 ERROR [stderr] (http-/0.0.0.0:8080-13) at org.atmosphere.config.managed.ManagedAtmosphereHandler.onStateChange(ManagedAtmosphereHandler.java:209)
17:25:18,557 ERROR [stderr] (http-/0.0.0.0:8080-13) at org.atmosphere.cpr.AsynchronousProcessor.invokeAtmosphereHandler(AsynchronousProcessor.java:544)
17:25:18,558 ERROR [stderr] (http-/0.0.0.0:8080-13) at org.atmosphere.cpr.AsynchronousProcessor.completeLifecycle(AsynchronousProcessor.java:486)
17:25:18,558 ERROR [stderr] (http-/0.0.0.0:8080-13) at org.atmosphere.interceptor.OnDisconnectInterceptor.inspect(OnDisconnectInterceptor.java:77)
17:25:18,558 ERROR [stderr] (http-/0.0.0.0:8080-13) at org.atmosphere.cpr.AsynchronousProcessor.invokeInterceptors(AsynchronousProcessor.java:340)
17:25:18,559 ERROR [stderr] (http-/0.0.0.0:8080-13) at org.atmosphere.cpr.AsynchronousProcessor.action(AsynchronousProcessor.java:199)
17:25:18,559 ERROR [stderr] (http-/0.0.0.0:8080-13) at org.atmosphere.cpr.AsynchronousProcessor.suspended(AsynchronousProcessor.java:115)
17:25:18,560 ERROR [stderr] (http-/0.0.0.0:8080-13) at org.atmosphere.container.JBossWebCometSupport.service(JBossWebCometSupport.java:93)
17:25:18,560 ERROR [stderr] (http-/0.0.0.0:8080-13) at org.atmosphere.cpr.AtmosphereFramework.doCometSupport(AtmosphereFramework.java:2281)
17:25:18,560 ERROR [stderr] (http-/0.0.0.0:8080-13) at org.atmosphere.cpr.AtmosphereServlet.event(AtmosphereServlet.java:326)
17:25:18,560 ERROR [stderr] (http-/0.0.0.0:8080-13) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilterEvent(ApplicationFilterChain.java:494)
17:25:18,560 ERROR [stderr] (http-/0.0.0.0:8080-13) at org.apache.catalina.core.ApplicationFilterChain.doFilterEvent(ApplicationFilterChain.java:399)
17:25:18,561 ERROR [stderr] (http-/0.0.0.0:8080-13) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:273)
17:25:18,561 ERROR [stderr] (http-/0.0.0.0:8080-13) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:161)
17:25:18,561 ERROR [stderr] (http-/0.0.0.0:8080-13) at org.jboss.as.jpa.interceptor.WebNonTxEmCloserValve.invoke(WebNonTxEmCloserValve.java:50)
17:25:18,561 ERROR [stderr] (http-/0.0.0.0:8080-13) at org.jboss.as.web.security.SecurityContextAssociationValve.invoke(SecurityContextAssociationValve.java:165)
17:25:18,562 ERROR [stderr] (http-/0.0.0.0:8080-13) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:155)
17:25:18,562 ERROR [stderr] (http-/0.0.0.0:8080-13) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
17:25:18,562 ERROR [stderr] (http-/0.0.0.0:8080-13) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
17:25:18,562 ERROR [stderr] (http-/0.0.0.0:8080-13) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:372)
17:25:18,562 ERROR [stderr] (http-/0.0.0.0:8080-13) at org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:897)
17:25:18,563 ERROR [stderr] (http-/0.0.0.0:8080-13) at org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:634)
17:25:18,563 ERROR [stderr] (http-/0.0.0.0:8080-13) at org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:2039)
17:25:18,563 ERROR [stderr] (http-/0.0.0.0:8080-13) at java.lang.Thread.run(Thread.java:745)
17:25:18,567 INFO [stdout] (http-/0.0.0.0:8080-13) Locked: 56fe9bc2-6c52-4fe4-8011-858221db4318
17:25:18,568 ERROR [stderr] (http-/0.0.0.0:8080-13) java.lang.Exception
17:25:18,568 ERROR [stderr] (http-/0.0.0.0:8080-13) at xxx.jee.pagelock.DefaultLockManager$LockManagerBatch.<init>(DefaultLockManager.java:377)
17:25:18,568 ERROR [stderr] (http-/0.0.0.0:8080-13) at xxx.jee.pagelock.DefaultLockManager.getManagerLock(DefaultLockManager.java:246)
17:25:18,568 ERROR [stderr] (http-/0.0.0.0:8080-13) at xxx.jee.pagelock.DefaultLockManager$Proxy$_$$_WeldClientProxy.getManagerLock(DefaultLockManager$Proxy$_$$_WeldClientProxy.java)
17:25:18,568 ERROR [stderr] (http-/0.0.0.0:8080-13) at xxx.jee.pagelock.channel.LockChannel.onClose(LockChannel.java:128)
17:25:18,569 ERROR [stderr] (http-/0.0.0.0:8080-13) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
17:25:18,569 ERROR [stderr] (http-/0.0.0.0:8080-13) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
17:25:18,569 ERROR [stderr] (http-/0.0.0.0:8080-13) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
17:25:18,569 ERROR [stderr] (http-/0.0.0.0:8080-13) at java.lang.reflect.Method.invoke(Method.java:606)
17:25:18,569 ERROR [stderr] (http-/0.0.0.0:8080-13) at org.atmosphere.util.Utils.invoke(Utils.java:209)
17:25:18,569 ERROR [stderr] (http-/0.0.0.0:8080-13) at org.atmosphere.config.managed.ManagedAtmosphereHandler.invoke(ManagedAtmosphereHandler.java:335)
17:25:18,569 ERROR [stderr] (http-/0.0.0.0:8080-13) at org.atmosphere.config.managed.ManagedAtmosphereHandler.onStateChange(ManagedAtmosphereHandler.java:209)
17:25:18,570 ERROR [stderr] (http-/0.0.0.0:8080-13) at org.atmosphere.cpr.AsynchronousProcessor.invokeAtmosphereHandler(AsynchronousProcessor.java:544)
17:25:18,570 ERROR [stderr] (http-/0.0.0.0:8080-13) at org.atmosphere.cpr.AsynchronousProcessor.completeLifecycle(AsynchronousProcessor.java:486)
17:25:18,570 ERROR [stderr] (http-/0.0.0.0:8080-13) at org.atmosphere.interceptor.OnDisconnectInterceptor.inspect(OnDisconnectInterceptor.java:77)
17:25:18,572 ERROR [stderr] (http-/0.0.0.0:8080-13) at org.atmosphere.cpr.AsynchronousProcessor.invokeInterceptors(AsynchronousProcessor.java:340)
17:25:18,572 ERROR [stderr] (http-/0.0.0.0:8080-13) at org.atmosphere.cpr.AsynchronousProcessor.action(AsynchronousProcessor.java:199)
17:25:18,572 ERROR [stderr] (http-/0.0.0.0:8080-13) at org.atmosphere.cpr.AsynchronousProcessor.suspended(AsynchronousProcessor.java:115)
17:25:18,572 ERROR [stderr] (http-/0.0.0.0:8080-13) at org.atmosphere.container.JBossWebCometSupport.service(JBossWebCometSupport.java:93)
17:25:18,575 ERROR [stderr] (http-/0.0.0.0:8080-13) at org.atmosphere.cpr.AtmosphereFramework.doCometSupport(AtmosphereFramework.java:2281)
17:25:18,575 ERROR [stderr] (http-/0.0.0.0:8080-13) at org.atmosphere.cpr.AtmosphereServlet.event(AtmosphereServlet.java:326)
17:25:18,575 ERROR [stderr] (http-/0.0.0.0:8080-13) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilterEvent(ApplicationFilterChain.java:494)
17:25:18,575 ERROR [stderr] (http-/0.0.0.0:8080-13) at org.apache.catalina.core.ApplicationFilterChain.doFilterEvent(ApplicationFilterChain.java:399)
17:25:18,576 ERROR [stderr] (http-/0.0.0.0:8080-13) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:273)
17:25:18,576 ERROR [stderr] (http-/0.0.0.0:8080-13) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:161)
17:25:18,576 ERROR [stderr] (http-/0.0.0.0:8080-13) at org.jboss.as.jpa.interceptor.WebNonTxEmCloserValve.invoke(WebNonTxEmCloserValve.java:50)
17:25:18,576 ERROR [stderr] (http-/0.0.0.0:8080-13) at org.jboss.as.web.security.SecurityContextAssociationValve.invoke(SecurityContextAssociationValve.java:165)
17:25:18,577 ERROR [stderr] (http-/0.0.0.0:8080-13) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:155)
17:25:18,577 ERROR [stderr] (http-/0.0.0.0:8080-13) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
17:25:18,577 ERROR [stderr] (http-/0.0.0.0:8080-13) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
17:25:18,577 ERROR [stderr] (http-/0.0.0.0:8080-13) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:372)
17:25:18,579 ERROR [stderr] (http-/0.0.0.0:8080-13) at org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:897)
17:25:18,579 ERROR [stderr] (http-/0.0.0.0:8080-13) at org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:634)
17:25:18,579 ERROR [stderr] (http-/0.0.0.0:8080-13) at org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:2039)
17:25:18,579 ERROR [stderr] (http-/0.0.0.0:8080-13) at java.lang.Thread.run(Thread.java:745)
17:25:18,584 INFO [stdout] (http-/0.0.0.0:8080-13) Locked: 0f2d436a-7e80-4a56-97e2-42187ac56a8b
17:25:18,584 ERROR [stderr] (http-/0.0.0.0:8080-13) java.lang.Exception
17:25:18,584 ERROR [stderr] (http-/0.0.0.0:8080-13) at xxx.jee.pagelock.DefaultLockManager$LockManagerBatch.<init>(DefaultLockManager.java:377)
17:25:18,585 ERROR [stderr] (http-/0.0.0.0:8080-13) at xxx.jee.pagelock.DefaultLockManager.getManagerLock(DefaultLockManager.java:246)
17:25:18,585 ERROR [stderr] (http-/0.0.0.0:8080-13) at xxx.jee.pagelock.DefaultLockManager$Proxy$_$$_WeldClientProxy.getManagerLock(DefaultLockManager$Proxy$_$$_WeldClientProxy.java)
17:25:18,585 ERROR [stderr] (http-/0.0.0.0:8080-13) at xxx.jee.pagelock.channel.LockChannel.onClose(LockChannel.java:128)
17:25:18,586 ERROR [stderr] (http-/0.0.0.0:8080-13) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
17:25:18,586 ERROR [stderr] (http-/0.0.0.0:8080-13) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
17:25:18,586 ERROR [stderr] (http-/0.0.0.0:8080-13) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
17:25:18,586 ERROR [stderr] (http-/0.0.0.0:8080-13) at java.lang.reflect.Method.invoke(Method.java:606)
17:25:18,586 ERROR [stderr] (http-/0.0.0.0:8080-13) at org.atmosphere.util.Utils.invoke(Utils.java:209)
17:25:18,586 ERROR [stderr] (http-/0.0.0.0:8080-13) at org.atmosphere.config.managed.ManagedAtmosphereHandler.invoke(ManagedAtmosphereHandler.java:335)
17:25:18,589 ERROR [stderr] (http-/0.0.0.0:8080-13) at org.atmosphere.config.managed.ManagedAtmosphereHandler.onStateChange(ManagedAtmosphereHandler.java:209)
17:25:18,589 ERROR [stderr] (http-/0.0.0.0:8080-13) at org.atmosphere.cpr.AsynchronousProcessor.invokeAtmosphereHandler(AsynchronousProcessor.java:544)
17:25:18,589 ERROR [stderr] (http-/0.0.0.0:8080-13) at org.atmosphere.cpr.AsynchronousProcessor.completeLifecycle(AsynchronousProcessor.java:486)
17:25:18,589 ERROR [stderr] (http-/0.0.0.0:8080-13) at org.atmosphere.interceptor.OnDisconnectInterceptor.inspect(OnDisconnectInterceptor.java:77)
17:25:18,591 ERROR [stderr] (http-/0.0.0.0:8080-13) at org.atmosphere.cpr.AsynchronousProcessor.invokeInterceptors(AsynchronousProcessor.java:340)
17:25:18,591 ERROR [stderr] (http-/0.0.0.0:8080-13) at org.atmosphere.cpr.AsynchronousProcessor.action(AsynchronousProcessor.java:199)
17:25:18,591 ERROR [stderr] (http-/0.0.0.0:8080-13) at org.atmosphere.cpr.AsynchronousProcessor.suspended(AsynchronousProcessor.java:115)
17:25:18,591 ERROR [stderr] (http-/0.0.0.0:8080-13) at org.atmosphere.container.JBossWebCometSupport.service(JBossWebCometSupport.java:93)
17:25:18,593 ERROR [stderr] (http-/0.0.0.0:8080-13) at org.atmosphere.cpr.AtmosphereFramework.doCometSupport(AtmosphereFramework.java:2281)
17:25:18,593 ERROR [stderr] (http-/0.0.0.0:8080-13) at org.atmosphere.cpr.AtmosphereServlet.event(AtmosphereServlet.java:326)
17:25:18,593 ERROR [stderr] (http-/0.0.0.0:8080-13) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilterEvent(ApplicationFilterChain.java:494)
17:25:18,593 ERROR [stderr] (http-/0.0.0.0:8080-13) at org.apache.catalina.core.ApplicationFilterChain.doFilterEvent(ApplicationFilterChain.java:399)
17:25:18,595 ERROR [stderr] (http-/0.0.0.0:8080-13) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:273)
17:25:18,595 ERROR [stderr] (http-/0.0.0.0:8080-13) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:161)
17:25:18,595 ERROR [stderr] (http-/0.0.0.0:8080-13) at org.jboss.as.jpa.interceptor.WebNonTxEmCloserValve.invoke(WebNonTxEmCloserValve.java:50)
17:25:18,595 ERROR [stderr] (http-/0.0.0.0:8080-13) at org.jboss.as.web.security.SecurityContextAssociationValve.invoke(SecurityContextAssociationValve.java:165)
17:25:18,596 ERROR [stderr] (http-/0.0.0.0:8080-13) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:155)
17:25:18,597 ERROR [stderr] (http-/0.0.0.0:8080-13) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
17:25:18,597 ERROR [stderr] (http-/0.0.0.0:8080-13) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
17:25:18,597 ERROR [stderr] (http-/0.0.0.0:8080-13) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:372)
17:25:18,598 ERROR [stderr] (http-/0.0.0.0:8080-13) at org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:897)
17:25:18,598 ERROR [stderr] (http-/0.0.0.0:8080-13) at org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:634)
17:25:18,599 ERROR [stderr] (http-/0.0.0.0:8080-13) at org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:2039)
17:25:18,599 ERROR [stderr] (http-/0.0.0.0:8080-13) at java.lang.Thread.run(Thread.java:745)
Some seconds later the same thread handles more HTTP requests and all returned successfully, This time with the correct Locked: xxx and Unlocked: xxx messages:
17:25:23,891 INFO [stdout] (http-/0.0.0.0:8080-13) Locked: 351e7416-c74b-4974-b2a6-a2ba0a0ad87d
17:25:23,892 ERROR [stderr] (http-/0.0.0.0:8080-13) java.lang.Exception
17:25:23,893 ERROR [stderr] (http-/0.0.0.0:8080-13) at xxx.jee.pagelock.DefaultLockManager$LockManagerBatch.<init>(DefaultLockManager.java:377)
17:25:23,894 ERROR [stderr] (http-/0.0.0.0:8080-13) at xxx.jee.pagelock.DefaultLockManager.getManagerLock(DefaultLockManager.java:246)
17:25:23,896 ERROR [stderr] (http-/0.0.0.0:8080-13) at xxx.jee.pagelock.DefaultLockManager$Proxy$_$$_WeldClientProxy.getManagerLock(DefaultLockManager$Proxy$_$$_WeldClientProxy.java)
17:25:23,897 ERROR [stderr] (http-/0.0.0.0:8080-13) at xxx.jee.pagelock.command.LockCommand.invoke(LockCommand.java:33)
17:25:23,898 ERROR [stderr] (http-/0.0.0.0:8080-13) at xxx.jee.pagelock.PageLockCommandServlet._executeCommand(PageLockCommandServlet.java:90)
17:25:23,899 ERROR [stderr] (http-/0.0.0.0:8080-13) at xxx.jee.pagelock.PageLockCommandServlet.doPost(PageLockCommandServlet.java:61)
17:25:23,900 ERROR [stderr] (http-/0.0.0.0:8080-13) at javax.servlet.http.HttpServlet.service(HttpServlet.java:754)
17:25:23,900 ERROR [stderr] (http-/0.0.0.0:8080-13) at javax.servlet.http.HttpServlet.service(HttpServlet.java:847)
17:25:23,901 ERROR [stderr] (http-/0.0.0.0:8080-13) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:329)
17:25:23,901 ERROR [stderr] (http-/0.0.0.0:8080-13) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248)
17:25:23,901 ERROR [stderr] (http-/0.0.0.0:8080-13) at xxx.webapp.servlet.filter.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:51)
17:25:23,902 ERROR [stderr] (http-/0.0.0.0:8080-13) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:280)
17:25:23,902 ERROR [stderr] (http-/0.0.0.0:8080-13) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248)
17:25:23,903 ERROR [stderr] (http-/0.0.0.0:8080-13) at org.jboss.weld.servlet.ConversationPropagationFilter.doFilter(ConversationPropagationFilter.java:62)
17:25:23,903 ERROR [stderr] (http-/0.0.0.0:8080-13) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:280)
17:25:23,903 ERROR [stderr] (http-/0.0.0.0:8080-13) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248)
17:25:23,904 ERROR [stderr] (http-/0.0.0.0:8080-13) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:275)
17:25:23,904 ERROR [stderr] (http-/0.0.0.0:8080-13) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:161)
17:25:23,904 ERROR [stderr] (http-/0.0.0.0:8080-13) at org.jboss.as.jpa.interceptor.WebNonTxEmCloserValve.invoke(WebNonTxEmCloserValve.java:50)
17:25:23,905 ERROR [stderr] (http-/0.0.0.0:8080-13) at org.jboss.as.web.security.SecurityContextAssociationValve.invoke(SecurityContextAssociationValve.java:165)
17:25:23,905 ERROR [stderr] (http-/0.0.0.0:8080-13) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:155)
17:25:23,905 ERROR [stderr] (http-/0.0.0.0:8080-13) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
17:25:23,906 ERROR [stderr] (http-/0.0.0.0:8080-13) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
17:25:23,906 ERROR [stderr] (http-/0.0.0.0:8080-13) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:372)
17:25:23,906 ERROR [stderr] (http-/0.0.0.0:8080-13) at org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:897)
17:25:23,907 ERROR [stderr] (http-/0.0.0.0:8080-13) at org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:634)
17:25:23,907 ERROR [stderr] (http-/0.0.0.0:8080-13) at org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:2039)
17:25:23,907 ERROR [stderr] (http-/0.0.0.0:8080-13) at java.lang.Thread.run(Thread.java:745)
17:25:23,908 INFO [stdout] (http-/0.0.0.0:8080-13) Unlocked: 351e7416-c74b-4974-b2a6-a2ba0a0ad87d
Any idea what is going on? Can you explain to me how the very same thread can be executed again and again without fully executing the function body? Without releasing the lock?
Edit 12.11.2015 19:56: As mentioned in the comments: http-/0.0.0.0:8080-13 is the name of the thread. So I'm sure that it is the same thread that is executed again.
Edit 13.11.2015 09:38: As mentioned in the comments: I'm using JBoss 7.1.3.Final with JBossWeb 7.0.17.Final. The AtmosphereServlet uses asyncSupported=true while the custom one doesn't.
I found the solution for this behavior: A (CDI) bean was involved which couldn't be created for some reason. An exception was thrown after my log messages and before the try-block. But it was not visible in the log as the atmosphere framework caught it. The framework itself will only print it to the log if it is set to debug level (which is not set on the production server).
A really stupid self-caused bug!

Hibernate and c3p0: unexplained why client is unable to communicate after some time

Running the following code...
Session session;
try {
session = sessionFactory.openSession();;
// Query the DB for a list of sms to be sent
Query query = session.createQuery("from Sdnchurch");
list = query.list();
}
catch(Exception e) {
// Manage exception
}
finally {
if (session != null)
session.close();
}
...after some time I get the following exception:
failureorg.hibernate.exception.JDBCConnectionException: could not prepare statement
This exception starts being generated after I use my client for a time longer than the WAIT_TIMEOUT configured in mySql.
This is my C3p0 configuration for Hibernate in the hibernate.cfg.xml:
<property name="connection.pool_size">1</property>
<property name="dialect">org.hibernate.dialect.MySQLDialect</property>
<property name="cache.provider_class">org.hibernate.connection.C3P0ConnectionProvider</property>
<property name="show_sql">true</property>
<property name="hbm2ddl.auto">update</property>
<property name="hibernate.c3p0.min_size">50</property>
<property name="hibernate.c3p0.max_size">200</property>
<property name="hibernate.c3p0.acquire_increment">1</property>
<property name="hibernate.c3p0.idle_test_period">3000</property>
<property name="hibernate.c3p0.max_statements">50</property>
<property name="hibernate.c3p0.timeout">7200</property>
<property name="hibernate.c3p0.acquireRetryAttempts">0</property>
<property name="hibernate.c3p0.maxStatementsPerConnection">10</property>
<property name="hibernate.c3p0.numHelperThreads">10</property>
<property name="hibernate.c3p0.idleConnectionTestPeriod">3600</property>
<property name="hibernate.c3p0.preferredTestQuery">select 1</property>
<property name="hibernate.c3p0.testConnectionOnCheckout">true</property>
<property name="hibernate.c3p0.testConnectionOnCheckin">true</property>
As you can see, I'm also testing the connection. So I can't really see what's going wrong.
How can I fix this? Here's the stack trace:
11:20:59,547 INFO [stdout] (ajp--0.0.0.0-8009-1) Hibernate: select sdnchurc0_.CHURCH_ID as CHURCH1_0_, sdnchurc0_.CHURCH_NAME as CHURCH2_0_ from Msdchurch sdnchurc0_
11:20:59,549 WARN [org.hibernate.engine.jdbc.spi.SqlExceptionHelper] (ajp--0.0.0.0-8009-1) SQL Error: 0, SQLState: 08003
11:20:59,549 ERROR [org.hibernate.engine.jdbc.spi.SqlExceptionHelper] (ajp--0.0.0.0-8009-1) No operations allowed after connection closed.Connection was implicitly closed by the driver.
11:20:59,549 INFO [uk.co.nisma.sdn.dao.MsdchurchDaoImpl] (ajp--0.0.0.0-8009-1) Rolling back...
11:20:59,549 ERROR [stderr] (ajp--0.0.0.0-8009-1) uk.co.nisma.sdn.exception.MsdwardException: org.hibernate.exception.JDBCConnectionException: could not prepare statement
11:20:59,550 ERROR [stderr] (ajp--0.0.0.0-8009-1) at uk.co.nisma.sdn.dao.MsdchurchDaoImpl.getListHospitals(MsdchurchDaoImpl.java:53)
11:20:59,550 ERROR [stderr] (ajp--0.0.0.0-8009-1) at uk.co.nisma.sdn.WardDetailsImpl.getWardDetails(WardDetailsImpl.java:25)
11:20:59,551 ERROR [stderr] (ajp--0.0.0.0-8009-1) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
11:20:59,551 ERROR [stderr] (ajp--0.0.0.0-8009-1) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
11:20:59,551 ERROR [stderr] (ajp--0.0.0.0-8009-1) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
11:20:59,551 ERROR [stderr] (ajp--0.0.0.0-8009-1) at java.lang.reflect.Method.invoke(Method.java:606)
11:20:59,551 ERROR [stderr] (ajp--0.0.0.0-8009-1) at org.jboss.ws.common.invocation.AbstractInvocationHandlerJSE.invoke(AbstractInvocationHandlerJSE.java:111)
11:20:59,552 ERROR [stderr] (ajp--0.0.0.0-8009-1) at org.jboss.wsf.stack.cxf.JBossWSInvoker._invokeInternal(JBossWSInvoker.java:181)
11:20:59,552 ERROR [stderr] (ajp--0.0.0.0-8009-1) at org.jboss.wsf.stack.cxf.JBossWSInvoker.invoke(JBossWSInvoker.java:127)
11:20:59,552 ERROR [stderr] (ajp--0.0.0.0-8009-1) at org.apache.cxf.interceptor.ServiceInvokerInterceptor$1.run(ServiceInvokerInterceptor.java:58)
11:20:59,552 ERROR [stderr] (ajp--0.0.0.0-8009-1) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
11:20:59,553 ERROR [stderr] (ajp--0.0.0.0-8009-1) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
11:20:59,553 ERROR [stderr] (ajp--0.0.0.0-8009-1) at java.util.concurrent.FutureTask.run(FutureTask.java:166)
11:20:59,553 ERROR [stderr] (ajp--0.0.0.0-8009-1) at org.apache.cxf.workqueue.SynchronousExecutor.execute(SynchronousExecutor.java:37)
11:20:59,553 ERROR [stderr] (ajp--0.0.0.0-8009-1) at org.apache.cxf.interceptor.ServiceInvokerInterceptor.handleMessage(ServiceInvokerInterceptor.java:106)
11:20:59,553 ERROR [stderr] (ajp--0.0.0.0-8009-1) at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:263)
11:20:59,554 ERROR [stderr] (ajp--0.0.0.0-8009-1) at org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:121)
11:20:59,554 ERROR [stderr] (ajp--0.0.0.0-8009-1) at org.apache.cxf.transport.http.AbstractHTTPDestination.invoke(AbstractHTTPDestination.java:207)
11:20:59,554 ERROR [stderr] (ajp--0.0.0.0-8009-1) at org.jboss.wsf.stack.cxf.RequestHandlerImpl.handleHttpRequest(RequestHandlerImpl.java:91)
11:20:59,554 ERROR [stderr] (ajp--0.0.0.0-8009-1) at org.jboss.wsf.stack.cxf.transport.ServletHelper.callRequestHandler(ServletHelper.java:169)
11:20:59,555 ERROR [stderr] (ajp--0.0.0.0-8009-1) at org.jboss.wsf.stack.cxf.CXFServletExt.invoke(CXFServletExt.java:87)
11:20:59,555 ERROR [stderr] (ajp--0.0.0.0-8009-1) at org.apache.cxf.transport.servlet.AbstractHTTPServlet.handleRequest(AbstractHTTPServlet.java:185)
11:20:59,555 ERROR [stderr] (ajp--0.0.0.0-8009-1) at org.apache.cxf.transport.servlet.AbstractHTTPServlet.doPost(AbstractHTTPServlet.java:108)
11:20:59,555 ERROR [stderr] (ajp--0.0.0.0-8009-1) at javax.servlet.http.HttpServlet.service(HttpServlet.java:754)
11:20:59,556 ERROR [stderr] (ajp--0.0.0.0-8009-1) at org.jboss.wsf.stack.cxf.CXFServletExt.service(CXFServletExt.java:135)
11:20:59,556 ERROR [stderr] (ajp--0.0.0.0-8009-1) at org.jboss.wsf.spi.deployment.WSFServlet.service(WSFServlet.java:140)
11:20:59,556 ERROR [stderr] (ajp--0.0.0.0-8009-1) at javax.servlet.http.HttpServlet.service(HttpServlet.java:847)
11:20:59,556 ERROR [stderr] (ajp--0.0.0.0-8009-1) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:329)
11:20:59,556 ERROR [stderr] (ajp--0.0.0.0-8009-1) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248)
11:20:59,557 ERROR [stderr] (ajp--0.0.0.0-8009-1) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:275)
11:20:59,557 ERROR [stderr] (ajp--0.0.0.0-8009-1) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:161)
11:20:59,557 ERROR [stderr] (ajp--0.0.0.0-8009-1) at org.jboss.as.web.security.SecurityContextAssociationValve.invoke(SecurityContextAssociationValve.java:153)
11:20:59,557 ERROR [stderr] (ajp--0.0.0.0-8009-1) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:155)
11:20:59,558 ERROR [stderr] (ajp--0.0.0.0-8009-1) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
11:20:59,558 ERROR [stderr] (ajp--0.0.0.0-8009-1) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
11:20:59,558 ERROR [stderr] (ajp--0.0.0.0-8009-1) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:368)
11:20:59,558 ERROR [stderr] (ajp--0.0.0.0-8009-1) at org.apache.coyote.ajp.AjpProcessor.process(AjpProcessor.java:505)
11:20:59,559 ERROR [stderr] (ajp--0.0.0.0-8009-1) at org.apache.coyote.ajp.AjpProtocol$AjpConnectionHandler.process(AjpProtocol.java:445)
11:20:59,559 ERROR [stderr] (ajp--0.0.0.0-8009-1) at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:930)
11:20:59,559 ERROR [stderr] (ajp--0.0.0.0-8009-1) at java.lang.Thread.run(Thread.java:724)
11:20:59,560 ERROR [stderr] (ajp--0.0.0.0-8009-1) Caused by: org.hibernate.exception.JDBCConnectionException: could not prepare statement
11:20:59,560 ERROR [stderr] (ajp--0.0.0.0-8009-1) at org.hibernate.exception.internal.SQLExceptionTypeDelegate.convert(SQLExceptionTypeDelegate.java:67)
11:20:59,560 ERROR [stderr] (ajp--0.0.0.0-8009-1) at org.hibernate.exception.internal.StandardSQLExceptionConverter.convert(StandardSQLExceptionConverter.java:49)
11:20:59,560 ERROR [stderr] (ajp--0.0.0.0-8009-1) at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:125)
11:20:59,561 ERROR [stderr] (ajp--0.0.0.0-8009-1) at org.hibernate.engine.jdbc.internal.StatementPreparerImpl$StatementPreparationTemplate.prepareStatement(StatementPreparerImpl.java:188)
11:20:59,561 ERROR [stderr] (ajp--0.0.0.0-8009-1) at org.hibernate.engine.jdbc.internal.StatementPreparerImpl.prepareQueryStatement(StatementPreparerImpl.java:159)
11:20:59,561 ERROR [stderr] (ajp--0.0.0.0-8009-1) at org.hibernate.loader.Loader.prepareQueryStatement(Loader.java:1859)
11:20:59,561 ERROR [stderr] (ajp--0.0.0.0-8009-1) at org.hibernate.loader.Loader.executeQueryStatement(Loader.java:1836)
11:20:59,562 ERROR [stderr] (ajp--0.0.0.0-8009-1) at org.hibernate.loader.Loader.executeQueryStatement(Loader.java:1816)
11:20:59,562 ERROR [stderr] (ajp--0.0.0.0-8009-1) at org.hibernate.loader.Loader.doQuery(Loader.java:900)
11:20:59,562 ERROR [stderr] (ajp--0.0.0.0-8009-1) at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:342)
11:20:59,562 ERROR [stderr] (ajp--0.0.0.0-8009-1) at org.hibernate.loader.Loader.doList(Loader.java:2526)
11:20:59,562 ERROR [stderr] (ajp--0.0.0.0-8009-1) at org.hibernate.loader.Loader.doList(Loader.java:2512)
11:20:59,563 ERROR [stderr] (ajp--0.0.0.0-8009-1) at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2342)
11:20:59,563 ERROR [stderr] (ajp--0.0.0.0-8009-1) at org.hibernate.loader.Loader.list(Loader.java:2337)
11:20:59,563 ERROR [stderr] (ajp--0.0.0.0-8009-1) at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:495)
11:20:59,563 ERROR [stderr] (ajp--0.0.0.0-8009-1) at org.hibernate.hql.internal.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:356)
11:20:59,570 ERROR [stderr] (ajp--0.0.0.0-8009-1) at org.hibernate.engine.query.spi.HQLQueryPlan.performList(HQLQueryPlan.java:195)
11:20:59,570 ERROR [stderr] (ajp--0.0.0.0-8009-1) at org.hibernate.internal.SessionImpl.list(SessionImpl.java:1269)
11:20:59,570 ERROR [stderr] (ajp--0.0.0.0-8009-1) at org.hibernate.internal.QueryImpl.list(QueryImpl.java:101)
11:20:59,570 ERROR [stderr] (ajp--0.0.0.0-8009-1) at uk.co.nisma.sdn.dao.MsdchurchDaoImpl.getListHospitals(MsdchurchDaoImpl.java:47)
11:20:59,570 ERROR [stderr] (ajp--0.0.0.0-8009-1) ... 39 more
11:20:59,571 ERROR [stderr] (ajp--0.0.0.0-8009-1) Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: No operations allowed after connection closed.Connection was implicitly closed by the driver.
11:20:59,571 ERROR [stderr] (ajp--0.0.0.0-8009-1) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
11:20:59,571 ERROR [stderr] (ajp--0.0.0.0-8009-1) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
11:20:59,572 ERROR [stderr] (ajp--0.0.0.0-8009-1) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
11:20:59,572 ERROR [stderr] (ajp--0.0.0.0-8009-1) at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
11:20:59,572 ERROR [stderr] (ajp--0.0.0.0-8009-1) at com.mysql.jdbc.Util.handleNewInstance(Util.java:406)
11:20:59,572 ERROR [stderr] (ajp--0.0.0.0-8009-1) at com.mysql.jdbc.Util.getInstance(Util.java:381)
11:20:59,573 ERROR [stderr] (ajp--0.0.0.0-8009-1) at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:984)
11:20:59,573 ERROR [stderr] (ajp--0.0.0.0-8009-1) at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:956)
11:20:59,573 ERROR [stderr] (ajp--0.0.0.0-8009-1) at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:926)
11:20:59,573 ERROR [stderr] (ajp--0.0.0.0-8009-1) at com.mysql.jdbc.ConnectionImpl.throwConnectionClosedException(ConnectionImpl.java:1160)
11:20:59,573 ERROR [stderr] (ajp--0.0.0.0-8009-1) at com.mysql.jdbc.ConnectionImpl.checkClosed(ConnectionImpl.java:1147)
11:20:59,574 ERROR [stderr] (ajp--0.0.0.0-8009-1) at com.mysql.jdbc.ConnectionImpl.prepareStatement(ConnectionImpl.java:4224)
11:20:59,574 ERROR [stderr] (ajp--0.0.0.0-8009-1) at com.mysql.jdbc.ConnectionImpl.prepareStatement(ConnectionImpl.java:4190)
11:20:59,574 ERROR [stderr] (ajp--0.0.0.0-8009-1) at org.hibernate.engine.jdbc.internal.StatementPreparerImpl$5.doPrepare(StatementPreparerImpl.java:161)
11:20:59,574 ERROR [stderr] (ajp--0.0.0.0-8009-1) at org.hibernate.engine.jdbc.internal.StatementPreparerImpl$StatementPreparationTemplate.prepareStatement(StatementPreparerImpl.java:182)
11:20:59,575 ERROR [stderr] (ajp--0.0.0.0-8009-1) ... 55 more
11:20:59,575 ERROR [stderr] (ajp--0.0.0.0-8009-1) Caused by: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure
11:20:59,575 ERROR [stderr] (ajp--0.0.0.0-8009-1)
11:20:59,575 ERROR [stderr] (ajp--0.0.0.0-8009-1) The last packet successfully received from the server was 70,060 milliseconds ago. The last packet sent successfully to the server was 0 milliseconds ago.
11:20:59,575 ERROR [stderr] (ajp--0.0.0.0-8009-1) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
11:20:59,576 ERROR [stderr] (ajp--0.0.0.0-8009-1) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
11:20:59,576 ERROR [stderr] (ajp--0.0.0.0-8009-1) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
11:20:59,576 ERROR [stderr] (ajp--0.0.0.0-8009-1) at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
11:20:59,576 ERROR [stderr] (ajp--0.0.0.0-8009-1) at com.mysql.jdbc.Util.handleNewInstance(Util.java:406)
11:20:59,576 ERROR [stderr] (ajp--0.0.0.0-8009-1) at com.mysql.jdbc.SQLError.createCommunicationsException(SQLError.java:1074)
11:20:59,577 ERROR [stderr] (ajp--0.0.0.0-8009-1) at com.mysql.jdbc.MysqlIO.reuseAndReadPacket(MysqlIO.java:3052)
11:20:59,577 ERROR [stderr] (ajp--0.0.0.0-8009-1) at com.mysql.jdbc.MysqlIO.reuseAndReadPacket(MysqlIO.java:2938)
11:20:59,577 ERROR [stderr] (ajp--0.0.0.0-8009-1) at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3481)
11:20:59,577 ERROR [stderr] (ajp--0.0.0.0-8009-1) at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1959)
11:20:59,577 ERROR [stderr] (ajp--0.0.0.0-8009-1) at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2109)
11:20:59,578 ERROR [stderr] (ajp--0.0.0.0-8009-1) at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2648)
11:20:59,578 ERROR [stderr] (ajp--0.0.0.0-8009-1) at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:2077)
11:20:59,578 ERROR [stderr] (ajp--0.0.0.0-8009-1) at com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:2228)
11:20:59,578 ERROR [stderr] (ajp--0.0.0.0-8009-1) at org.hibernate.engine.jdbc.internal.ResultSetReturnImpl.extract(ResultSetReturnImpl.java:56)
11:20:59,580 ERROR [stderr] (ajp--0.0.0.0-8009-1) at org.hibernate.loader.Loader.getResultSet(Loader.java:2040)
11:20:59,580 ERROR [stderr] (ajp--0.0.0.0-8009-1) at org.hibernate.loader.Loader.executeQueryStatement(Loader.java:1837)
11:20:59,580 ERROR [stderr] (ajp--0.0.0.0-8009-1) ... 52 more
11:20:59,580 ERROR [stderr] (ajp--0.0.0.0-8009-1) Caused by: java.net.SocketException: Software caused connection abort: recv failed
11:20:59,581 ERROR [stderr] (ajp--0.0.0.0-8009-1) at java.net.SocketInputStream.socketRead0(Native Method)
11:20:59,581 ERROR [stderr] (ajp--0.0.0.0-8009-1) at java.net.SocketInputStream.read(SocketInputStream.java:150)
11:20:59,581 ERROR [stderr] (ajp--0.0.0.0-8009-1) at java.net.SocketInputStream.read(SocketInputStream.java:121)
11:20:59,589 ERROR [stderr] (ajp--0.0.0.0-8009-1) at com.mysql.jdbc.util.ReadAheadInputStream.fill(ReadAheadInputStream.java:113)
11:20:59,589 ERROR [stderr] (ajp--0.0.0.0-8009-1) at com.mysql.jdbc.util.ReadAheadInputStream.readFromUnderlyingStreamIfNecessary(ReadAheadInputStream.java:160)
11:20:59,589 ERROR [stderr] (ajp--0.0.0.0-8009-1) at com.mysql.jdbc.util.ReadAheadInputStream.read(ReadAheadInputStream.java:188)
11:20:59,589 ERROR [stderr] (ajp--0.0.0.0-8009-1) at com.mysql.jdbc.MysqlIO.readFully(MysqlIO.java:2494)
11:20:59,590 ERROR [stderr] (ajp--0.0.0.0-8009-1) at com.mysql.jdbc.MysqlIO.reuseAndReadPacket(MysqlIO.java:2949)
11:20:59,590 ERROR [stderr] (ajp--0.0.0.0-8009-1) ... 62 more

ERROR: Class does not expose a management interface

I am installing our ERP Solution developed in Java onto my IBM System X3750 M4 Server. I have downloaded and installed the JRE from IBM; the package name is: ibm-java-x86_64-jre-7.0-5.0.x86_64.
My Application Server is JBoss 6.0 and Client Server is Apache Tomcat 7.0.14 and Database is MYSQL 5.1.69.
While starting the JBoss Server I am getting an error as given in the bottom of my Question.
Any idea on how can it be resolved?
18:03:29,265 INFO [AbstractServer] Starting: JBossAS [6.0.0.Final "Neo"]
18:03:30,482 ERROR [STDERR] javax.management.NotCompliantMBeanException: Class does not expose a management interface: java.lang.Object
18:03:30,483 ERROR [STDERR] at org.jboss.mx.metadata.MBeanCapability.of(MBeanCapability.java:101)
18:03:30,483 ERROR [STDERR] at org.jboss.mx.metadata.MBeanCapability.of(MBeanCapability.java:99)
18:03:30,483 ERROR [STDERR] at org.jboss.mx.server.registry.BasicMBeanRegistry.registerMBean(BasicMBeanRegistry.java:200)
18:03:30,483 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
18:03:30,483 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:76)
18:03:30,484 ERROR [STDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
18:03:30,484 ERROR [STDERR] at java.lang.reflect.Method.invoke(Method.java:607)
18:03:30,484 ERROR [STDERR] at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:157)
18:03:30,484 ERROR [STDERR] at org.jboss.mx.server.Invocation.dispatch(Invocation.java:96)
18:03:30,484 ERROR [STDERR] at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:138)
18:03:30,484 ERROR [STDERR] at org.jboss.mx.server.Invocation.invoke(Invocation.java:90)
18:03:30,485 ERROR [STDERR] at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:140)
18:03:30,485 ERROR [STDERR] at org.jboss.mx.server.Invocation.invoke(Invocation.java:90)
18:03:30,485 ERROR [STDERR] at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:271)
18:03:30,485 ERROR [STDERR] at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:670)
18:03:30,485 ERROR [STDERR] at org.jboss.mx.server.MBeanServerImpl$3.run(MBeanServerImpl.java:1443)
18:03:30,485 ERROR [STDERR] at java.security.AccessController.doPrivileged(AccessController.java:330)
18:03:30,486 ERROR [STDERR] at org.jboss.mx.server.MBeanServerImpl.registerMBean(MBeanServerImpl.java:1438)
18:03:30,486 ERROR [STDERR] at org.jboss.mx.server.MBeanServerImpl.registerMBean(MBeanServerImpl.java:378)
18:03:30,486 ERROR [STDERR] at java.lang.management.ManagementFactory.registerPlatformBeans(ManagementFactory.java:786)
18:03:30,486 ERROR [STDERR] at java.lang.management.ManagementFactory.access$100(ManagementFactory.java:42)
18:03:30,486 ERROR [STDERR] at java.lang.management.ManagementFactory$1.run(ManagementFactory.java:373)
18:03:30,486 ERROR [STDERR] at java.security.AccessController.doPrivileged(AccessController.java:274)
18:03:30,487 ERROR [STDERR] at java.lang.management.ManagementFactory.getPlatformMBeanServer(ManagementFactory.java:371)
18:03:30,487 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
18:03:30,487 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:76)
18:03:30,487 ERROR [STDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
18:03:30,487 ERROR [STDERR] at java.lang.reflect.Method.invoke(Method.java:607)
18:03:30,487 ERROR [STDERR] at org.jboss.system.server.jmx.JMXKernel.start(JMXKernel.java:182)
18:03:30,488 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
18:03:30,488 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:76)
18:03:30,488 ERROR [STDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
18:03:30,488 ERROR [STDERR] at java.lang.reflect.Method.invoke(Method.java:607)
18:03:30,488 ERROR [STDERR] at org.jboss.reflect.plugins.introspection.ReflectionUtils.invoke(ReflectionUtils.java:60)
18:03:30,488 ERROR [STDERR] at org.jboss.reflect.plugins.introspection.ReflectMethodInfoImpl.invoke(ReflectMethodInfoImpl.java:168)
18:03:30,489 ERROR [STDERR] at org.jboss.joinpoint.plugins.BasicMethodJoinPoint.dispatch(BasicMethodJoinPoint.java:66)
18:03:30,489 ERROR [STDERR] at org.jboss.kernel.plugins.dependency.KernelControllerContextAction$JoinpointDispatchWrapper.execute(KernelControllerContextAction.java:257)
18:03:30,489 ERROR [STDERR] at org.jboss.kernel.plugins.dependency.ExecutionWrapper.execute(ExecutionWrapper.java:47)
18:03:30,489 ERROR [STDERR] at org.jboss.kernel.plugins.dependency.KernelControllerContextAction.dispatchExecutionWrapper(KernelControllerContextAction.java:125)
18:03:30,489 ERROR [STDERR] at org.jboss.kernel.plugins.dependency.KernelControllerContextAction.dispatchJoinPoint(KernelControllerContextAction.java:72)
18:03:30,490 ERROR [STDERR] at org.jboss.kernel.plugins.dependency.LifecycleAction.installActionInternal(LifecycleAction.java:202)
18:03:30,490 ERROR [STDERR] at org.jboss.kernel.plugins.dependency.InstallsAwareAction.installAction(InstallsAwareAction.java:54)
18:03:30,490 ERROR [STDERR] at org.jboss.kernel.plugins.dependency.InstallsAwareAction.installAction(InstallsAwareAction.java:42)
18:03:30,490 ERROR [STDERR] at org.jboss.dependency.plugins.action.SimpleControllerContextAction.simpleInstallAction(SimpleControllerContextAction.java:62)
18:03:30,490 ERROR [STDERR] at org.jboss.dependency.plugins.action.AccessControllerContextAction.install(AccessControllerContextAction.java:71)
18:03:30,490 ERROR [STDERR] at org.jboss.dependency.plugins.AbstractControllerContextActions.install(AbstractControllerContextActions.java:51)
18:03:30,491 ERROR [STDERR] at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:379)
18:03:30,491 ERROR [STDERR] at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:2044)
18:03:30,491 ERROR [STDERR] at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:1083)
18:03:30,491 ERROR [STDERR] at org.jboss.dependency.plugins.AbstractController.executeOrIncrementStateDirectly(AbstractController.java:1322)
18:03:30,491 ERROR [STDERR] at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1246)
18:03:30,491 ERROR [STDERR] at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1139)
18:03:30,492 ERROR [STDERR] at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:894)
18:03:30,492 ERROR [STDERR] at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:641)
18:03:30,492 ERROR [STDERR] at org.jboss.kernel.plugins.deployment.AbstractKernelDeployer.deployBean(AbstractKernelDeployer.java:319)
18:03:30,492 ERROR [STDERR] at org.jboss.kernel.plugins.deployment.AbstractKernelDeployer.deployBeans(AbstractKernelDeployer.java:297)
18:03:30,492 ERROR [STDERR] at org.jboss.kernel.plugins.deployment.AbstractKernelDeployer.deploy(AbstractKernelDeployer.java:130)
18:03:30,493 ERROR [STDERR] at org.jboss.kernel.plugins.deployment.BasicKernelDeployer.deploy(BasicKernelDeployer.java:76)
18:03:30,493 ERROR [STDERR] at org.jboss.bootstrap.impl.mc.deployer.TempBasicXMLDeployer.deploy(TempBasicXMLDeployer.java:92)
18:03:30,493 ERROR [STDERR] at org.jboss.bootstrap.impl.mc.deployer.TempBasicXMLDeployer.deploy(TempBasicXMLDeployer.java:193)
18:03:30,493 ERROR [STDERR] at org.jboss.bootstrap.impl.mc.server.AbstractMCServerBase.bootstrapMcAndDescriptors(AbstractMCServerBase.java:310)
18:03:30,493 ERROR [STDERR] at org.jboss.bootstrap.impl.mc.server.AbstractMCServerBase.doStart(AbstractMCServerBase.java:257)
18:03:30,493 ERROR [STDERR] at org.jboss.bootstrap.impl.as.server.AbstractJBossASServerBase.doStart(AbstractJBossASServerBase.java:381)
18:03:30,494 ERROR [STDERR] at org.jboss.bootstrap.impl.base.server.AbstractServer$StartServerTask.run(AbstractServer.java:413)
18:03:30,494 ERROR [STDERR] at java.lang.Thread.run(Thread.java:781)
I was actually missing some libraries in jboss that caused the error. Because it was actually happened when I tried to make jboss light by removing unused jars. Any way restoring the jboss libraries took away this error.

SMTP mail sending fail

I am sending mail from my local machine and got following error
ERROR [STDERR] javax.mail.SendFailedException: Invalid Addresses;
nested exception is:
class javax.mail.SendFailedException: 553 sorry, relaying denied from your location [10.105.1.186] (#5.7.1)
19:10:50,885 ERROR [STDERR] at com.sun.mail.smtp.SMTPTransport.rcptTo(SMTPTransport.java:848)
19:10:50,885 ERROR [STDERR] at com.sun.mail.smtp.SMTPTransport.sendMessage(SMTPTransport.java:323)
19:10:50,885 ERROR [STDERR] at com.elitecore.billing.utils.MailClient.send(MailClient.java:191)
19:10:50,885 ERROR [STDERR] at com.elitecore.billing.ejb.base.BillingSessionBase.sendMailToErrorAdmin(BillingSessionBase.java:935)
19:10:50,885 ERROR [STDERR] at com.elitecore.billing.ejb.base.BillingSessionBase.sendMail(BillingSessionBase.java:827)
19:10:50,885 ERROR [STDERR] at com.elitecore.billing.ejb.system.audit.session.SentEventNotificationSessionFacade.sendNotificationTo
Recepient(SentEventNotificationSessionFacade.java:1378)
19:10:50,885 ERROR [STDERR] at com.elitecore.billing.ejb.system.audit.session.SentEventNotificationSessionFacade.sentNotification(S
entEventNotificationSessionFacade.java:809)
19:10:50,901 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
19:10:50,901 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
19:10:50,901 ERROR [STDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
19:10:50,901 ERROR [STDERR] at java.lang.reflect.Method.invoke(Method.java:585)
19:10:50,901 ERROR [STDERR] at org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.invoke(StatelessSessionContainer.java:6
83)
19:10:50,901 ERROR [STDERR] at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.
java:186)
19:10:50,901 ERROR [STDERR] at org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(StatelessSessionInstanceInterceptor
.java:72)
19:10:50,916 ERROR [STDERR] at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:84)
19:10:50,916 ERROR [STDERR] at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:341)
19:10:50,916 ERROR [STDERR] at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:148)
19:10:50,916 ERROR [STDERR] at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:111)
19:10:50,916 ERROR [STDERR] at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:191)
19:10:50,916 ERROR [STDERR] at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor.java:122)
19:10:50,916 ERROR [STDERR] at org.jboss.ejb.StatelessSessionContainer.internalInvoke(StatelessSessionContainer.java:331)
19:10:50,916 ERROR [STDERR] at org.jboss.ejb.Container.invoke(Container.java:709)
19:10:50,916 ERROR [STDERR] at sun.reflect.GeneratedMethodAccessor39.invoke(Unknown Source)
19:10:50,916 ERROR [STDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
19:10:50,932 ERROR [STDERR] at java.lang.reflect.Method.invoke(Method.java:585)
19:10:50,932 ERROR [STDERR] at org.jboss.mx.server.ReflectedDispatcher.dispatch(ReflectedDispatcher.java:60)
19:10:50,932 ERROR [STDERR] at org.jboss.mx.server.Invocation.dispatch(Invocation.java:62)
19:10:50,932 ERROR [STDERR] at org.jboss.mx.server.Invocation.dispatch(Invocation.java:54)
19:10:50,932 ERROR [STDERR] at org.jboss.mx.server.Invocation.invoke(Invocation.java:82)
19:10:50,932 ERROR [STDERR] at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:197)
19:10:50,932 ERROR [STDERR] at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:473)
19:10:50,948 ERROR [STDERR] at org.jboss.invocation.jrmp.server.JRMPInvoker.invoke(JRMPInvoker.java:360)
19:10:50,948 ERROR [STDERR] at sun.reflect.GeneratedMethodAccessor51.invoke(Unknown Source)
19:10:50,963 ERROR [STDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
19:10:50,963 ERROR [STDERR] at java.lang.reflect.Method.invoke(Method.java:585)
19:10:50,963 ERROR [STDERR] at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:294)
19:10:50,963 ERROR [STDERR] at sun.rmi.transport.Transport$1.run(Transport.java:153)
19:10:50,963 ERROR [STDERR] at java.security.AccessController.doPrivileged(Native Method)
19:10:50,963 ERROR [STDERR] at sun.rmi.transport.Transport.serviceCall(Transport.java:149)
19:10:50,963 ERROR [STDERR] at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:466)
19:10:50,963 ERROR [STDERR] at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:707)
19:10:50,963 ERROR [STDERR] at java.lang.Thread.run(Thread.java:595)
Can anybody explain me why this error comes ?
The email server is configured to send (relay) messages delivered only from certain IPs. It seems that the IP 10.105.1.186 is not accepted.

Categories