How to remove 500 error during Hibernet session?

0 like 0 dislike
67 views
All welcome.

I wrote a small CRUD application based on Spring + Hibernate + MySQL.

Set up all the necessary dependencies (sort of), wrote a mapping, the controller, DAO and service.
But I have a problem with the database. The database I created using MySQL Workbench, connect it to your environment (I am using Intelij IDEA). Have written a couple of JSP pages.

Here they are:

Main
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> <%@ page contentType="text/html;charset=UTF-8" language="java" %> ProselyteProselyte presents
"target="_blank">Books list


A JSP that displays the result
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> <%@ taglib uri="http://www.springframework.org/tags" prefix="spring" %> <%@ taglib uri="http://www.springframework.org/tags/form" prefix="form" %> <%@ page session="false" %> BookData.tg {border-collapse: collapse;border-spacing: 0;border-color: #ccc;}.tg td {font-family: Arial, sans-serif;font-size: 14px;padding: 10px 5px;border-style: solid;border-width: 1px;overflow: hidden;word-break: normal;border-color: #ccc;color: #333;background-color: #fff;}.tg th {font-family: Arial, sans-serif;font-size: 14px;font-weight: normal;padding: 10px 5px;border-style: solid;border-width: 1px;overflow: hidden;word-break: normal;border-color: #ccc;color: #333;background-color: #f0f0f0;}.tg .tg-4eph {background-color: #f9f9f9}Book DetailsIDTitleAuthorPrice${book.id}${book.bookTitle}${book.bookAuthor}${book.price/100} to${book.price%100}


Adding a record in the database
(Just here and there is a problem)
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> <%@ taglib uri="http://www.springframework.org/tags" prefix="spring" %> <%@ taglib uri="http://www.springframework.org/tags/form" prefix="form" %> <%@ taglib prefix="from" uri="http://www.springframework.org/tags/form" %> <%@ page session="false" %> Books Page.tg {border-collapse: collapse;border-spacing: 0;border-color: #ccc;}.tg td {font-family: Arial, sans-serif;font-size: 14px;padding: 10px 5px;border-style: solid;border-width: 1px;overflow: hidden;word-break: normal;border-color: #ccc;color: #333;background-color: #fff;}.tg th {font-family: Arial, sans-serif;font-size: 14px;font-weight: normal;padding: 10px 5px;border-style: solid;border-width: 1px;overflow: hidden;word-break: normal;border-color: #ccc;color: #333;background-color: #f0f0f0;}.tg .tg-4eph {background-color: #f9f9f9}Back to main menu

Book ListIDTitleAuthorPriceEditDelete${book.id}${book.bookTitle}${book.bookAuthor}${book.price/100} to${book.price%100}EditDeleteAdd a Book"/> "/>


When you load this page you get a 500 error.

Here it is:
Type Exception Report Message Request processing failed; nested exception is org.springframework.transaction.CannotCreateTransactionException: Could not open Hibernate Session for transaction; nested exception is java.lang.NoClassDefFoundError: org/hibernate/engine/transaction/spi/TransactionContext Description The server encountered an unexpected condition that prevented it from fulfilling the request. Exception


And here's the log only:
Type Exception Report Message Request processing failed; nested exception is org.springframework.transaction.CannotCreateTransactionException: Could not open Hibernate Session for transaction; nested exception is java.lang.NoClassDefFoundError: org/hibernate/engine/transaction/spi/TransactionContext Description The server encountered an unexpected condition that prevented it from fulfilling the request. Exception


What am I doing wrong if the database is running, and hibernate refuses to connect (all dependencies)?
by | 67 views

1 Answer

0 like 0 dislike
Looks like a problem with dependencies. What builds the project? If Gradle/maven, then throw the config.
by

Related questions

0 like 0 dislike
1 answer
0 like 0 dislike
3 answers
0 like 0 dislike
1 answer
0 like 0 dislike
1 answer
110,608 questions
257,187 answers
0 comments
40,796 users