What is causing this NullPointerException on a Hibernate select? - spring

I'm using Hibernate 4.1.8.Final/Spring 3.1 and getting the following exception:
java.lang.NullPointerException
at org.hibernate.event.internal.AbstractFlushingEventListener.prepareEntityFlushes(AbstractFlushin$
at org.hibernate.event.internal.AbstractFlushingEventListener.flushEverythingToExecutions(Abstract$
at org.hibernate.event.internal.DefaultAutoFlushEventListener.onAutoFlush(DefaultAutoFlushEventLis$
at org.hibernate.internal.SessionImpl.autoFlushIfRequired(SessionImpl.java:1185)
at org.hibernate.internal.SessionImpl.list(SessionImpl.java:1240)

It may be an open bug in Hibernate 4.1.8 Core.
Here is a JIRA issue HHH-7821: https://hibernate.onjira.com/browse/HHH-7821.
It appears that the bug reporter began seeing it sporadically after upgrading from 4.1.6 to 4.1.8. The reporter mentioned that it is an involved application, and is trying to get an isolated recreatable scenario.
I don't know if this is the same scenario as yours (as all you posted was a Stacktrace), but you may wish to look at that (and other referenced JIRA HHH-7829) and if it is related, comment/monitor progress on those open JIRA Issues.

Related

Junit test case fails with Method threw 'org.hibernate.LazyInitializationException' exception

I am upgrading Hibernate from 5.1.17 to 5.4.11. I am getting org.hibernate.LazyInitializationException while running Junit on collection whose fetch type is LAZY. I am trying to find different ways to make it work and run it in transaction(still facing some issues). Before that I would like to know what is changed after 5.1.17 which is causing this issue because earlier Junit test cases were working perfectly fine.
So what are the things changed related to lazy loading after 5.1.17?
Many things changed, so it's hard to say. What I suggest is, start upgrading your hibernate by updating 1 minor version at a time (according to https://semver.org).
Once you pinpoint which minor version is causing a problem, check:
https://hibernate.org/orm/releases/
Hope that helps.

Spring boot application crashing on starting:Togglz: java.lang.IllegalStateException: Could not find the FeatureManager

i'm using toggle feature with toggle dependencies but when i tried to bring up the services some times application startup is failing saying could not find FeatureManger.
I followed server approaches but none of them worked well. in this post the issue been highlited by updating jar dependecy, even that also not working.
Please suggest if you have other fix available for this issue.
https://github.com/togglz/togglz/commit/22b20ef7c8758dc5deadf0a6c4726e8c8d73cf5c

Spring Roo NoClassDefFoundError

my primary attempt is to build a CRUD app using Roo, following the example here:
https://www.icts.uiowa.edu/confluence/display/ICTSit/Spring+Roo+Tutorial
I am using Roo 1.2.5, Maven 3.1.1, and Spring 3.2.6 on JRE7.
This has been the best tutorial I have found so far. If anyone has a better example, please share!
However, when I execute the project in my Tomcat environment things still break. The primary error from there is:
HTTP Status 500 -
type Exception report
message
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
java.lang.NoClassDefFoundError: org/springframework/util/MimeType
I have built multiple projects using Roo over the past few days, either from this tutorial or 10 others that all start with the reverse engineer command, and all give me the same type of a NoClassDefFoundError, either with this class or another. I understand this means that my pom.xml is more than likely incorrect, but I am hoping this is an issue with my configuration rather than something all Roo developers have simply accepted as manual maintenance.
Any advice would be tremendous... is it possible that the version of Roo combined with Spring and Maven I am using is simply buggy? I would love to use this framework/toolkit, but am nearing the point where manually writing the scaffolding by hand may be more straightforward.
.... UPDATE:
By adding the following dependency manually, I was able to run the project. However, I want to leave the question open to see if anyone further knows whether this missing jar is a known bug given the version of Spring Roo I am using, or otherwise:
<dependency>
<groupId>commons-fileupload</groupId>
<artifactId>commons-fileupload</artifactId>
<version>1.2.2</version>
</dependency>
Thanks!
The best examples are those included in Roo: clinic.roo, pizzashop.roo, etc
Just run Roo and execute any of them as follows:
/_/ |_|\____/\____/ 1.2.4.RELEASE [rev 75337cf]
Welcome to Spring Roo. For assistance press TAB or type "hint" then hit ENTER.
roo> script --file clinic.roo
On the other side, the reference doc is a good starting point: http://docs.spring.io/spring-roo/reference/html/
Finally, about java.lang.NoClassDefFoundError: org/springframework/util/MimeType note MimeType class was included in Spring 4 and Roo sets up your project for Spring 3, so you must customize the pom.xml as needed.

Cannot change org.springframework-version in STS

I just created a Spring MVC project in STS 3.3.0.RELEASE and just changed the default<org.springframework-version>3.1.1.RELEASE</org.springframework-version> to <org.springframework-version>3.2.1.RELEASE</org.springframework-version>, and Eclipse throws errors (see screenshot below). Any clue on how to remove these errors (perhaps the top one is the culprit)
Solved - http://www.captaindebug.com/2013/03/creating-spring-32-mvc-web-app.html#.Uf7V-WTbrus - quoting the author - Now, I could have used the fix outlined in my previous blog; however, the Guys at Spring have been busy and now the solution to this problem is to simply upgrade to Spring version 3.2.2-RELEASE

SpringIDE 2.6.0 failing to initialize with error under Helios

I'm running into an issue with the Spring IDE release 2.6.0 under Eclipse 3.6 SR 1
Error occured processing XML 'Could not instantiate bean class
[org.springframework.ide.eclipse.beans.core.internal.model.BeansConfig$ToolingFriendlyBeanDefinitionDocumentReader]:
Constructor threw exception; nested exception is
org.apache.commons.logging.LogConfigurationException: User-specified log class
'org.apache.commons.logging.impl.Log4JLogger' cannot be found or is not useable.'.
See Error Log for more details
I dumped my entire eclipse environment and re-installed to see if it would fix it and it didn't. Not sure if this is a classpath problem or something specifically related to the SpringIDE configuration.
Any help would be appreciated.
you're hitting a bug in Spring IDE. See the following JIRA for more details:
https://issuetracker.springsource.com/browse/STS-1691
We are going to publish a patch for this issue soon. Check the JIRA for when it is available. Alternatively install an upcoming nightly build.
Regards, Christian

Resources