Issue
I have a problem with Eclipse debug mode which I've never encountered, and I haven't found any information on it searching the web.
I'm developing a Maven web app which is deployed on a Tomcat Server. It uses Hibernate. When running it normally, it works fine, but, when debugging, it stops at this point:
org.hibernate.dialect.Dialect -
Using dialect: org.hibernate.dialect.SQLServerDialect
Given the deploy stops here, I suppose it has to do with the connection with the DB which I think it shouldn't work any differently between "normal" running mode and debug.
I've tried switching the debug configurations, skipping all breakpoints (even not marking any breakpoints at all), and a few more things.
I also tried running the debug mode remotely from the console command, which didn't work, but even if it did it would be a pain to have to run it that way.
I'm not sure if I'm missing a configuration, I've tried to debug it from other Eclipse instances and I have the same problem, so I suppose it depends on some particular configuration.
If you need more info to have a wider overview, lmk.
Thanks for any help!
Adding more log info:
[main] INFO org.hibernate.cfg.Configuration - configuring from resource: /hibernate.cfg.xml
[main] INFO org.hibernate.cfg.Configuration - Configuration resource: /hibernate.cfg.xml
[main] WARN org.hibernate.util.DTDEntityResolver - recognized obsolete hibernate namespace http://hibernate.sourceforge.net/. Use namespace http://www.hibernate.org/dtd/ instead. Refer to Hibernate 3.6 Migration Guide!
[main] INFO org.hibernate.cfg.Configuration - Configured SessionFactory: HibernateSessionFactory
[main] INFO org.hibernate.cfg.HbmBinder - Mapping class: * -> *
[main] INFO org.hibernate.cfg.HbmBinder - Mapping collection: * -> *
[main] INFO org.hibernate.cfg.Configuration - Hibernate Validator not found: ignoring
[main] INFO org.hibernate.cfg.search.HibernateSearchEventListenerRegister - Unable to find org.hibernate.search.event.FullTextIndexEventListener on the classpath. Hibernate Search is not enabled.
[main] WARN org.hibernate.mapping.RootClass - composite-id class does not override equals(): *
[main] WARN org.hibernate.mapping.RootClass - composite-id class does not override hashCode(): *
[main] INFO org.hibernate.connection.ConnectionProviderFactory - Initializing connection provider: org.hibernate.connection.C3P0ConnectionProvider
[main] INFO org.hibernate.connection.C3P0ConnectionProvider - C3P0 using driver: com.microsoft.sqlserver.jdbc.SQLServerDriver at URL: ******
[main] INFO org.hibernate.connection.C3P0ConnectionProvider - Connection properties: {password=****, user=****}
[main] INFO org.hibernate.connection.C3P0ConnectionProvider - autocommit mode: false
[main] INFO org.hibernate.dialect.Dialect - Using dialect: org.hibernate.dialect.SQLServerDialect
It just stops right there.
The continuation I'm expecting (taken from the normal run mode) would be something like this:
[main] INFO org.hibernate.engine.jdbc.JdbcSupportLoader - Disabling contextual LOB creation as createClob() method threw error : java.lang.reflect.InvocationTargetException
[main] INFO org.hibernate.cfg.SettingsFactory - Database ->
***
[main] INFO org.hibernate.cfg.SettingsFactory - Driver ->
***
[main] INFO org.hibernate.transaction.TransactionFactoryFactory - Using default transaction strategy (direct JDBC transactions)
[main] INFO org.hibernate.transaction.TransactionManagerLookupFactory - No TransactionManagerLookup configured (in JTA environment, use of read-write or transactional second-level cache is not recommended)
...
(Basically it connects to the database and starts querying).
Solution
I managed to solve it with the help of a colleague. As we weren't able to find the answer to the problem online, I'm posting it here to help anyone who may be experiencing the same problem. We found that the deployed Tomcat server (9.0) was using the default JRE configuration from Eclipse, which in my case would be 17 (using Eclipse 2023-06 (4.28.0)).
Whenever I set up a new workspace, I changed the build level to 1.8, but it seems that the server was using the default Eclipse 2023 compilation level, which is 17.
Creating a new server from scratch and forcing it to use an external JRE (1.8) did the trick.
I think it has something to do with Hibernate, as I have not encountered a similar problem in other projects, which I can certainly run in debug without any problems.
If anyone knows why it worked, feel free to provide more info.
Thanks in advance!
Answered By - pmart
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.