Method getSource from an older version of the Hibernate Core is referenced. jar libraries, to enable the use of spring-test.jar to provide access to the helper methods. The problem started when I updated some (but not all) of my hibernate. This occurred when attempting to run a test on one of my Hibernate DAO entities. : .getSource()Lorg/hibernate/engine/SessionImplementor
![vba script outlook rebuild index vba script outlook rebuild index](https://i.stack.imgur.com/U5UQW.png)
Surely it shouldn't be THAT hard to configure my Junit test runs (that extend AbstractTransactionalDataSourceSprignContextTests) so that they search for the log4j.properties in the web-inf directory rather than on the classpath?!?!?!? Any ideas? (By the way, trying to add web-inf to the classpath doesn't work, as I'm using MyEclipse and it doesn't allow this!) It could be confusing having two files named log4j.properites in the one project. This is fine - and some might even say the best of both worlds - because I can have different default logging for my tests and my web-app. One is in WebRoot/WEB-INF and defines logging levels for the webapp. One is in test-src and defines the logging levels etc for the debug running. So, in the end, I've now got two versions of log4j.properties. The only way I've been able to avoid those warnings is by placing log4j.properties into the classpath. I can manually configure log4j in my test class - but that's after the warnings are already shown. So… the question is, how do I get Junit to initialize using this log4j.properties, rather than looking into src (on the classpath) and finding it missing. I want log4j.properties to be located in this directory for my web-app and configured just so. Sure, I could change this to point somewhere else, but I don't want to do that. What's more, that's exactly where I want my log4j.properties to be. When running my web-app (not the tests, but the web app itself), hibernate knows to look for it there because web.xml has: However, the problem is that I already have log4j.properties in the WebRoot/WEB-INF folder. Well that's fine, and doing so does fix the problem - I just put log4j.properties into my src folder (or, in this case, specifically my test-src folder). So, I need to put log4j.properties into the classpath. That's because hibernate needs it to be in the class path. Why not? Well, It can't find my log4j.properties file. This shouldn't be surprising, it's saying that Log4j hasn't been initialized properly. log4j:WARN Please initialize the log4j system properly. Log4j:WARN No appenders could be found for logger (.GenericDaoImplTest). However, I'm using annotations, so my preferred mapping for booleans = "tinyint", nullable = false)Īn alternative is to Boolean exampleBooleanValue īut I prefer to work with primitives rather than boxed primitives wherever possible.Īnyway, the first solution above works wonderfully.Īnnoyingly, when I run a junit test that is testing my Hibernate DAO objects, I get the following warnings: Well the article I mention above suggests mapping the field using That's causing my tests to fail… so what to do? Caused by: : Data too long for column 'my_field' at row 1 at.
![vba script outlook rebuild index vba script outlook rebuild index](https://www.slipstick.com/images/2011/07/vba-editor.png)
The problem is, by default, it generates a MqSQL field of type "bit(1)" - which causes Hibernate to throw:Ĭould not insert: : could not insert: at .convert(SQLStateConverter.java:77) at .convert(JDBCExceptionHelper.java:43).
![vba script outlook rebuild index vba script outlook rebuild index](https://windows101tricks.com/wp-content/uploads/2020/05/rebuild-search-index-options.jpg)
"There's a problem persisting boolean fields using Hibernate 3.2.2 to MySQL 5.0, if you allow Hibernate to generate your schema and you leave Hibernate to generate the schema in the default way". As the following helpful article ( ) points out: