Not long ago, I read this article "hibernate + spring + struts2 + extjs crud development function" written by myloon. Some netizens commented on the issues they encountered, I am here to help the author make a supplement, please forgive me for the shortcomings.
First problem: Automatic database generation
1. Create an empty database myloon in MySQL;
2. Add the following content to the hibernate configuration file:
<Property name = "hibernate. hbm2ddl. Auto"> Update </property>
Second question:
Org. springframework. beans. factory. unsatisfieddependencyexception: Error creating bean with name 'levelservice' defined in servletcontext resource [/WEB-INF/spring/applicationcontext. XML]: unsatisfied dependency expressed through bean property 'postinterceptors ': No bean named' & levelservice' is defined
This problem is serious. After analyzing it for a long time, I finally found out that it was originally an applicationcontext. xml file header declaration problem. I changed <beans default-autowire = "autodetect"> to a common declaration, so that compilation will not fail. It may be related to the spring package. I use spring2.5, but I don't know what the original author uses. I am not very clear about the specific reasons. Please give more advice.
Third question:
(10 MS) [main] error: Org. springframework. web. context. contextloader # initwebapplicationcontext: context initialization failed <br/> (5177 MS) [main] error: Org. apache. catalina. core. containerbase. [Catalina]. [localhost]. [/crud] # listenerstart: exception sending context initialized event to listener instance of class Org. springframework. web. context. contextloaderlistener <br/> JAVA. lang. outofmemoryerror: Java heap space <br/> 2007-11-30 11:26:10 Org. apache. catalina. core. standardcontext start <br/> critical: Error listenerstart <br/> 11:26:10 Org. apache. catalina. core. standardcontext start <br/> severe: context [/crud] startup failed due to previous errors
A solution is provided online. I have tried to solve this problem. The specific solution is as follows:
Add the system environment variable java_opts.
Value:-xms32-xmx512
Fourth question:
Modify the annotation in the level class --
@ Table (name = "level ")
After other changes are made, it is no problem to deploy and run them.
For the package files required by the project, you can leave me an email address and I will forward it to you.
My operation is as follows: