Win a copy of Node.js Design Patterns: Design and implement production-grade Node.js applications using proven patterns and techniques this week in the Server-Side JavaScript and NodeJS forum!

moreno Misonsan

Greenhorn
+ Follow
since Nov 30, 2018
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
1
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by moreno Misonsan

I can not explain you; I'm new to java and I'm following a video course where they talk about hibernate and relationships between tables. I only followed the teacher's instructions, but now I have this problem.
If this can help you with your evaluation, I can possibly send you the project and the database.
Use sql server express.
Thank you

Moreno
2 years ago
I am attaching the hibernateconfig




thanks for the help you are giving me.
Hello
Moreno


if it can help you I can send you the project.
probably in private mail.
let me know.
Hello

Moreno

2 years ago
Thanks, Paul

here is my pom.XML file




I put the hibernateconfig.
I hope it was what you wanted


[code=java]

2 years ago

moreno Misonsan wrote:

Beeimbolo Paul wrote:What is the compilation error you get?




I thank you Paul for your kind attention to my problem

the error reported is:
Error creating bean with name 'entityManagerFactory' defined in class path resource [com / sif / webapp / config / HibernateConfig.class]: Invocation of init method failed; nested exception is javax.persistence.PersistenceException: [PersistenceUnit: default] Unable to build Hibernate SessionFactory


I am attaching the stacktrace of the compilation of the problem that highlights the error


I hope they are enough to make you understand the problem.
Thank you so much for your kindness.
I am a beginner with Hibernate and would like to understand the exact functioning of the bidirectional OneToMany and ManytoOne relationships.
Good day

Moreno




It seems to me that the .docx annex has not been implemented.
I'm attaching to you the stacktrace code.
sorry for the inconvenience.
Hello
Moreno




HTTP Status 500 – Internal Server Error
HTTP Status 500 – Internal Server Error
________________________________________
Type Exception Report
Message Servlet.init() for servlet [dispatcher] threw exception
Description The server encountered an unexpected condition that prevented it from fulfilling the request.
Exception
javax.servlet.ServletException: Servlet.init() for servlet [dispatcher] threw exception org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:493) org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:81) org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:650) org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:342) org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:800) org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66) org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:806) org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1498) org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) java.lang.Thread.run(Unknown Source)
Root Cause
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class path resource [com/sif/webapp/config/HibernateConfig.class]: Invocation of init method failed; nested exception is javax.persistence.PersistenceException: [PersistenceUnit: default] Unable to build Hibernate SessionFactory org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1745) org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:576) org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:498) org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:320) org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:318) org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199) org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1083) org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:853) org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:546) org.springframework.web.servlet.FrameworkServlet.configureAndRefreshWebApplicationContext(FrameworkServlet.java:696) org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:574) org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:526) org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:169) javax.servlet.GenericServlet.init(GenericServlet.java:158) org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:493) org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:81) org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:650) org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:342) org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:800) org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66) org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:806) org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1498) org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) java.lang.Thread.run(Unknown Source)
Root Cause
javax.persistence.PersistenceException: [PersistenceUnit: default] Unable to build Hibernate SessionFactory org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.persistenceException(EntityManagerFactoryBuilderImpl.java:1016) org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.build(EntityManagerFactoryBuilderImpl.java:942) org.springframework.orm.jpa.vendor.SpringHibernateJpaPersistenceProvider.createContainerEntityManagerFactory(SpringHibernateJpaPersistenceProvider.java:57) org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.createNativeEntityManagerFactory(LocalContainerEntityManagerFactoryBean.java:365) org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.buildNativeEntityManagerFactory(AbstractEntityManagerFactoryBean.java:388) org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.afterPropertiesSet(AbstractEntityManagerFactoryBean.java:377) org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.afterPropertiesSet(LocalContainerEntityManagerFactoryBean.java:341) org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1804) org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1741) org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:576) org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:498) org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:320) org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:318) org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199) org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1083) org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:853) org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:546) org.springframework.web.servlet.FrameworkServlet.configureAndRefreshWebApplicationContext(FrameworkServlet.java:696) org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:574) org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:526) org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:169) javax.servlet.GenericServlet.init(GenericServlet.java:158) org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:493) org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:81) org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:650) org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:342) org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:800) org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66) org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:806) org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1498) org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) java.lang.Thread.run(Unknown Source)
2 years ago

Beeimbolo Paul wrote:What is the compilation error you get?




I thank you Paul for your kind attention to my problem

the error reported is:
Error creating bean with name 'entityManagerFactory' defined in class path resource [com / sif / webapp / config / HibernateConfig.class]: Invocation of init method failed; nested exception is javax.persistence.PersistenceException: [PersistenceUnit: default] Unable to build Hibernate SessionFactory


I am attaching the stacktrace of the compilation of the problem that highlights the error


I hope they are enough to make you understand the problem.
Thank you so much for your kindness.
I am a beginner with Hibernate and would like to understand the exact functioning of the bidirectional OneToMany and ManytoOne relationships.
Good day

Moreno

2 years ago
My name is Moreno 65 years passionate about Java.
I'm trying to create a web application to use for non-profit association.
I do not know English very well using google traslator to fill out this support request.
I am new to the world of Hibernate and I find myself managing the entity classes that go wrong. I have a problem with a relationship between tables with Hibernate.

I use SQL Server Express as a database.

The related tables are Products Report many to one with the table t_Stato_Prodotto and T_Stato_Prodotto One to many relationship with the Products table. In the screenshot I highlight the situation of the tables with their respective relationships.



I created table entity classes with Hibernate notations. I use Spring STS as a framework. It seems to me that the reports are consistent, but an error is reported to me and the compilation does not work. Below you will find the entity class code:

Class T_State_product - OneToMany report




Product Class - ManyToOne report





I still apologize if the completion of the request for assistance may turn out to be non-compliant with the standard, but I am new.
This error in the compilation of the reports in Hibernate totally blocks me in the development of the web application.
I repeat that my work is not for profit, but for a non-profit association.
thanks to those who want to help me.
Thank you

Moreno
2 years ago