-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 11 posts ] 
Author Message
 Post subject: TOMCAT BLOCK WITH HIBERNATE
PostPosted: Fri Feb 03, 2012 6:51 am 
Newbie

Joined: Mon Dec 21, 2009 4:23 am
Posts: 13
Hello,
Tomcat block with Hibernate on:

sessionFactory_ = new AnnotationConfiguration().configure().buildSessionFactory();

this is the log

Feb 3, 2012 10:25:57 AM org.apache.coyote.http11.Http11BaseProtocol init
INFO: Initializing Coyote HTTP/1.1 on http-8080
Feb 3, 2012 10:25:57 AM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 858 ms
Feb 3, 2012 10:25:57 AM org.apache.catalina.core.StandardService start
INFO: Starting service Catalina
Feb 3, 2012 10:25:57 AM org.apache.catalina.core.StandardEngine start
INFO: Starting Servlet Engine: Apache Tomcat/5.5.32
Feb 3, 2012 10:25:57 AM org.apache.catalina.core.StandardHost start
INFO: XML validation disabled
10:26:01,155 INFO HbnDatasourceManager:24 - [CPM] - Initializing Hibernate.
--- HERE IT BLOCK , TIME OUT SET UP TO 500 SECONDS, BUT NOTHING !

why is it possible ?

My Best Regards

Fabio


Top
 Profile  
 
 Post subject: Re: TOMCAT BLOCK WITH HIBERNATE
PostPosted: Fri Feb 03, 2012 7:32 am 
Expert
Expert

Joined: Tue Jun 16, 2009 3:36 am
Posts: 990
Hi,

please report the stacktraces of the blocked java process, so we can see exactly where the thread hangs.
The stacktraces of all java-threads can be extracted either by using the jstack utility, JConsole or send a kill -quit signal (on a Posix operating system).


Top
 Profile  
 
 Post subject: Re: TOMCAT BLOCK WITH HIBERNATE
PostPosted: Fri Feb 03, 2012 9:43 am 
Newbie

Joined: Mon Dec 21, 2009 4:23 am
Posts: 13
Hy Thanks

I think it is blocking on the missing class (don't know why) AnnotationConfiguration
yet I added to the class path all the hibernate jars

Image


Top
 Profile  
 
 Post subject: Re: TOMCAT BLOCK WITH HIBERNATE
PostPosted: Fri Feb 03, 2012 9:45 am 
Newbie

Joined: Mon Dec 21, 2009 4:23 am
Posts: 13
sorry for the pics to the bottom of my image
but it is an advertising of its provider


Top
 Profile  
 
 Post subject: Re: TOMCAT BLOCK WITH HIBERNATE
PostPosted: Fri Feb 03, 2012 9:48 am 
Newbie

Joined: Mon Dec 21, 2009 4:23 am
Posts: 13
Thread [main] (Suspended)
ClassNotFoundException(Throwable).<init>(String, Throwable) line: 217
ClassNotFoundException(Exception).<init>(String, Throwable) line: not available
ClassNotFoundException.<init>(String) line: not available
URLClassLoader$1.run() line: not available
AccessController.doPrivileged(PrivilegedExceptionAction<T>, AccessControlContext) line: not available [native method]
Launcher$ExtClassLoader(URLClassLoader).findClass(String) line: not available
Launcher$ExtClassLoader.findClass(String) line: not available
Launcher$ExtClassLoader(ClassLoader).loadClass(String, boolean) line: not available
Launcher$AppClassLoader(ClassLoader).loadClass(String, boolean) line: not available
Launcher$AppClassLoader.loadClass(String, boolean) line: not available
Launcher$AppClassLoader(ClassLoader).loadClass(String) line: not available
WebappClassLoader.loadClass(String, boolean) line: 1353
WebappClassLoader.loadClass(String) line: 1284
HbnDatasourceManager.<init>() line: 26
HbnDatasourceManager.getInstance() line: 77
InitialUserPopulation.init(ServletConfig) line: 36
StandardWrapper.loadServlet() line: 1139
StandardWrapper.load() line: 966
StandardContext.loadOnStartup(Container[]) line: 3996
StandardContext.start() line: 4266
StandardHost(ContainerBase).start() line: 1014
StandardHost.start() line: 736
StandardEngine(ContainerBase).start() line: 1014
StandardEngine.start() line: 443
StandardService.start() line: 448
StandardServer.start() line: 700
Catalina.start() line: 552
NativeMethodAccessorImpl.invoke0(Method, Object, Object[]) line: not available [native method]
NativeMethodAccessorImpl.invoke(Object, Object[]) line: not available
DelegatingMethodAccessorImpl.invoke(Object, Object[]) line: not available
Method.invoke(Object, Object...) line: not available
Bootstrap.start() line: 295
Bootstrap.main(String[]) line: 433


found the TEXT way


Top
 Profile  
 
 Post subject: Re: TOMCAT BLOCK WITH HIBERNATE
PostPosted: Fri Feb 03, 2012 10:11 am 
Expert
Expert

Joined: Tue Jun 16, 2009 3:36 am
Posts: 990
So now I understand not anymore what's exactly your problem.
The ClassNotFoundException or the blocking thread?
Usually an Exception does not block a thread so this 2 things have nothing in common.
Also usually a ClassNotFoundException reports in the message which class was not found.

Please look also in the log files of tomcat, maybe there is the ClassNotFoundException wyith full stack-trace.


Top
 Profile  
 
 Post subject: Re: TOMCAT BLOCK WITH HIBERNATE
PostPosted: Fri Feb 03, 2012 10:49 am 
Newbie

Joined: Mon Dec 21, 2009 4:23 am
Posts: 13
Sorry
it block this is the stack, hope usefull

Full thread dump Java HotSpot(TM) Client VM (20.4-b02 mixed mode):

"Low Memory Detector" daemon prio=6 tid=0x024ffc00 nid=0x14d8 runnable [0x00000000]
java.lang.Thread.State: RUNNABLE

"C1 CompilerThread0" daemon prio=10 tid=0x024fb800 nid=0xae4 waiting on condition [0x00000000]
java.lang.Thread.State: RUNNABLE

"JDWP Command Reader" daemon prio=6 tid=0x024f1c00 nid=0xdd0 runnable [0x00000000]
java.lang.Thread.State: RUNNABLE

"JDWP Event Helper Thread" daemon prio=6 tid=0x024eac00 nid=0xdb4 runnable [0x00000000]
java.lang.Thread.State: RUNNABLE

"JDWP Transport Listener: dt_socket" daemon prio=6 tid=0x024e9000 nid=0x1794 runnable [0x00000000]
java.lang.Thread.State: RUNNABLE

"Attach Listener" daemon prio=10 tid=0x024df000 nid=0x3f0 runnable [0x00000000]
java.lang.Thread.State: RUNNABLE

"Signal Dispatcher" daemon prio=10 tid=0x024dc000 nid=0x1354 waiting on condition [0x00000000]
java.lang.Thread.State: RUNNABLE

"Finalizer" daemon prio=8 tid=0x024b2000 nid=0xd8c in Object.wait() [0x187df000]
java.lang.Thread.State: WAITING (on object monitor)
at java.lang.Object.wait(Native Method)
- waiting on <0x09a85fc0> (a java.lang.ref.ReferenceQueue$Lock)
at java.lang.ref.ReferenceQueue.remove(Unknown Source)
- locked <0x09a85fc0> (a java.lang.ref.ReferenceQueue$Lock)
at java.lang.ref.ReferenceQueue.remove(Unknown Source)
at java.lang.ref.Finalizer$FinalizerThread.run(Unknown Source)

"Reference Handler" daemon prio=10 tid=0x024ad400 nid=0x1570 in Object.wait() [0x1874f000]
java.lang.Thread.State: WAITING (on object monitor)
at java.lang.Object.wait(Native Method)
- waiting on <0x09a85fe0> (a java.lang.ref.Reference$Lock)
at java.lang.Object.wait(Object.java:485)
at java.lang.ref.Reference$ReferenceHandler.run(Unknown Source)
- locked <0x09a85fe0> (a java.lang.ref.Reference$Lock)

"main" prio=6 tid=0x003ba400 nid=0xd48 runnable [0x0027e000]
java.lang.Thread.State: RUNNABLE
at java.net.SocketInputStream.socketRead0(Native Method)
at java.net.SocketInputStream.read(Unknown Source)
at com.microsoft.sqlserver.jdbc.TDSChannel.read(Unknown Source)
at com.microsoft.sqlserver.jdbc.TDSReader.readPacket(Unknown Source)
at com.microsoft.sqlserver.jdbc.TDSReader.readPacket(Unknown Source)
at com.microsoft.sqlserver.jdbc.TDSCommand.startResponse(Unknown Source)
at com.microsoft.sqlserver.jdbc.TDSCommand.startResponse(Unknown Source)
at com.microsoft.sqlserver.jdbc.SQLServerConnection$1ConnectionCommand.doExecute(Unknown Source)
at com.microsoft.sqlserver.jdbc.TDSCommand.execute(Unknown Source)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.executeCommand(Unknown Source)
- locked <0x049724b0> (a com.microsoft.sqlserver.jdbc.SQLServerConnection)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.connectionCommand(Unknown Source)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.logon(Unknown Source)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.access$000(Unknown Source)
at com.microsoft.sqlserver.jdbc.SQLServerConnection$LogonCommand.doExecute(Unknown Source)
at com.microsoft.sqlserver.jdbc.TDSCommand.execute(Unknown Source)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.executeCommand(Unknown Source)
- locked <0x049724b0> (a com.microsoft.sqlserver.jdbc.SQLServerConnection)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.connectHelper(Unknown Source)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.loginWithoutFailover(Unknown Source)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.connect(Unknown Source)
at com.microsoft.sqlserver.jdbc.SQLServerDriver.connect(Unknown Source)
at org.apache.tomcat.dbcp.dbcp.DriverConnectionFactory.createConnection(DriverConnectionFactory.java:38)
at org.apache.tomcat.dbcp.dbcp.PoolableConnectionFactory.makeObject(PoolableConnectionFactory.java:582)
at org.apache.tomcat.dbcp.dbcp.BasicDataSource.validateConnectionFactory(BasicDataSource.java:1556)
at org.apache.tomcat.dbcp.dbcp.BasicDataSource.createPoolableConnectionFactory(BasicDataSource.java:1545)
at org.apache.tomcat.dbcp.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1388)
- locked <0x09cd2450> (a org.apache.tomcat.dbcp.dbcp.BasicDataSource)
at org.apache.tomcat.dbcp.dbcp.BasicDataSource.getConnection(BasicDataSource.java:1044)
at org.hibernate.connection.DatasourceConnectionProvider.getConnection(DatasourceConnectionProvider.java:92)
at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:111)
at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:2101)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1325)
at org.hibernate.cfg.AnnotationConfiguration.buildSessionFactory(AnnotationConfiguration.java:867)
at com.citi.cpm.util.hibernate.HbnDatasourceManager.<init>(HbnDatasourceManager.java:31)
at com.citi.cpm.util.hibernate.HbnDatasourceManager.getInstance(HbnDatasourceManager.java:82)
at com.citi.cpm.servlets.InitialUserPopulation.init(InitialUserPopulation.java:36)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1139)
- locked <0x09c82620> (a org.apache.catalina.core.StandardWrapper)
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:966)
- locked <0x09c82620> (a org.apache.catalina.core.StandardWrapper)
at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:3996)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4266)
- locked <0x09b02478> (a org.apache.catalina.core.StandardContext)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1014)
- locked <0x09afdbe8> (a org.apache.catalina.core.StandardHost)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:736)
- locked <0x09afdbe8> (a org.apache.catalina.core.StandardHost)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1014)
- locked <0x09afdc78> (a org.apache.catalina.core.StandardEngine)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
at org.apache.catalina.core.StandardService.start(StandardService.java:448)
- locked <0x09afdc78> (a org.apache.catalina.core.StandardEngine)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:700)
- locked <0x09afdd00> (a [Lorg.apache.catalina.Service;)
at org.apache.catalina.startup.Catalina.start(Catalina.java:552)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:295)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:433)

"VM Thread" prio=10 tid=0x024a9400 nid=0x634 runnable

"VM Periodic Task Thread" prio=10 tid=0x02513000 nid=0x1670 waiting on condition

JNI global references: 3780

Heap
def new generation total 4928K, used 3688K [0x04520000, 0x04a70000, 0x09a70000)
eden space 4416K, 75% used [0x04520000, 0x048627b8, 0x04970000)
from space 512K, 68% used [0x04970000, 0x049c7b60, 0x049f0000)
to space 512K, 0% used [0x049f0000, 0x049f0000, 0x04a70000)
tenured generation total 10944K, used 4153K [0x09a70000, 0x0a520000, 0x14520000)
the space 10944K, 37% used [0x09a70000, 0x09e7e5d0, 0x09e7e600, 0x0a520000)
compacting perm gen total 14080K, used 13879K [0x14520000, 0x152e0000, 0x18520000)
the space 14080K, 98% used [0x14520000, 0x152add90, 0x152ade00, 0x152e0000)
No shared spaces configured.


Top
 Profile  
 
 Post subject: Re: TOMCAT BLOCK WITH HIBERNATE
PostPosted: Mon Feb 06, 2012 9:20 am 
Newbie

Joined: Mon Dec 21, 2009 4:23 am
Posts: 13
HI
it seems it blocks on the connection !

We actually moved from XP to Windows 7 and using Tomcat 6
previuosly we used tomcat 5 and win Xp

and it from XP it is still working


best


Top
 Profile  
 
 Post subject: Re: TOMCAT BLOCK WITH HIBERNATE
PostPosted: Mon Feb 06, 2012 9:22 am 
Newbie

Joined: Mon Dec 21, 2009 4:23 am
Posts: 13
I also update the jdbc to jdbc4


Top
 Profile  
 
 Post subject: Re: TOMCAT BLOCK WITH HIBERNATE
PostPosted: Mon Feb 06, 2012 9:26 am 
Newbie

Joined: Mon Dec 21, 2009 4:23 am
Posts: 13
Infact I don't think it is the db, but the libraries
Even we the db down it blocks


Top
 Profile  
 
 Post subject: Re: TOMCAT BLOCK WITH HIBERNATE
PostPosted: Thu Feb 09, 2012 5:54 am 
Expert
Expert

Joined: Tue Jun 16, 2009 3:36 am
Posts: 990
Hi Fabio,

I think the problem stays in the JDBC parameters you use to connect to your MS-SQLDB.
As I understand you define the datasource in tomcat, which parameters do you use there?


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 11 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.