In this example show how to write a simple web-based application with CRUD operation using Spring MVC Framework with Hibernate using Annotation, which can handle CRUD inside its controllers. To start with it, let us have to work STS IDE in place and follow the following steps to develop a Dynamic Form-based Web Application using Spring Web Framework:
Spring 5 Design Pattern Book
Popular Tutorials
- Spring Tutorial
- Spring MVC Web Tutorial
- Spring Boot Tutorial
- Spring Security Tutorial
- Spring AOP Tutorial
- Spring JDBC Tutorial
- Spring HATEOAS
- Microservices with Spring Boot
- REST Webservice
- Core Java
- Hibernate Tutorial
- Spring Batch
Step 1: Create a Database DAVDB on MySql Database and also we create an Employee table in this database.
CREATE TABLE Employee( EMPID INT NOT NULL AUTO_INCREMENT, EMPNAME VARCHAR(20) NOT NULL, EMPAGE INT NOT NULL, SALARY BIGINT NOT NULL, ADDRESS VARCHAR(20) NOT NULL PRIMARY KEY (ID) );
Step 2: Create a database.properties for database configuration information in the resources folder under src folder in the created project.
database.driver=com.mysql.jdbc.Driver database.url=jdbc:mysql://localhost:3306/DAVDB database.user=root database.password=root hibernate.dialect=org.hibernate.dialect.MySQLDialect hibernate.show_sql=true hibernate.hbm2ddl.auto=update
Step 3: Create a Dynamic Web Project with a name Spring3HibernateApp and create packages com.dineshonjava.controller, com.dineshonjava.bean, com.dineshonjava.dao, com.dineshonjava.service, com.dineshonjava.model under the src folder in the created project.
Step 4: Add below mentioned Spring 3.0 and Hibernate 3.0 related libraries and other libraries into the folder WebRoot/WEB-INF/lib.
Step 5: Create a Java class EmployeeController, EmployeeBean, Employee, EmployeeDao, EmployeeDaoImpl, EmployeeService, EmployeeServiceImpl under the respective packages…
Step 6: Create Spring configuration files web.xml and sdnext-servlet.xml under the WebRoot/WEB-INF/ and WebRoot/WEB-INF/config folders.
Step 7: Create a sub-folder with a name views under the WebRoot/WEB-INF folder. Create a view file addEmployee.jsp, employeesList.jsp and index.jsp under this sub-folder.
Step 8: The final step is to create the content of all the source and configuration files name sdnext-servlet.xml under the sub-folder /WebRoot/WEB-INF/config and export the application as explained below.
Application Architecture
We will have a layered architecture for our demo application. The database will be accessed by a Data Access layer popularly called as DAO Layer. This layer will use Hibernate API to interact with a database. The DAO layer will be invoked by a service layer. In our application, we will have a Service interface called EmployeeService.
EmployeeBean.java
package com.dineshonjava.bean; /** * @author Dinesh Rajput * */ public class EmployeeBean { private Integer id; private String name; private Integer age; private Long salary; private String address; public Long getSalary() { return salary; } public void setSalary(Long salary) { this.salary = salary; } public Integer getId() { return id; } public void setId(Integer id) { this.id = id; } public String getName() { return name; } public void setName(String name) { this.name = name; } public Integer getAge() { return age; } public void setAge(Integer age) { this.age = age; } public String getAddress() { return address; } public void setAddress(String address) { this.address = address; } }
Employee.java
package com.dineshonjava.model; import java.io.Serializable; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; import javax.persistence.Table; /** * @author Dinesh Rajput * */ @Entity @Table(name="Employee") public class Employee implements Serializable{ private static final long serialVersionUID = -723583058586873479L; @Id @GeneratedValue(strategy=GenerationType.AUTO) @Column(name = "empid") private Integer empId; @Column(name="empname") private String empName; @Column(name="empaddress") private String empAddress; @Column(name="salary") private Long salary; @Column(name="empAge") private Integer empAge; public Integer getEmpId() { return empId; } public void setEmpId(Integer empId) { this.empId = empId; } public String getEmpName() { return empName; } public void setEmpName(String empName) { this.empName = empName; } public String getEmpAddress() { return empAddress; } public void setEmpAddress(String empAddress) { this.empAddress = empAddress; } public Long getSalary() { return salary; } public void setSalary(Long salary) { this.salary = salary; } public Integer getEmpAge() { return empAge; } public void setEmpAge(Integer empAge) { this.empAge = empAge; } }
EmployeeDao.java
package com.dineshonjava.dao; import java.util.List; import com.dineshonjava.model.Employee; /** * @author Dinesh Rajput * */ public interface EmployeeDao { public void addEmployee(Employee employee); public List<Employee> listEmployeess(); public Employee getEmployee(int empid); public void deleteEmployee(Employee employee); }
EmployeeDaoImpl.java
package com.dineshonjava.dao; import java.util.List; import org.hibernate.SessionFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Repository; import com.dineshonjava.model.Employee; /** * @author Dinesh Rajput * */ @Repository("employeeDao") public class EmployeeDaoImpl implements EmployeeDao { @Autowired private SessionFactory sessionFactory; public void addEmployee(Employee employee) { sessionFactory.getCurrentSession().saveOrUpdate(employee); } @SuppressWarnings("unchecked") public List<Employee> listEmployeess() { return (List<Employee>) sessionFactory.getCurrentSession().createCriteria(Employee.class).list(); } public Employee getEmployee(int empid) { return (Employee) sessionFactory.getCurrentSession().get(Employee.class, empid); } public void deleteEmployee(Employee employee) { sessionFactory.getCurrentSession().createQuery("DELETE FROM Employee WHERE empid = "+employee.getEmpId()).executeUpdate(); } }
EmployeeService.java
package com.dineshonjava.service; import java.util.List; import com.dineshonjava.model.Employee; /** * @author Dinesh Rajput * */ public interface EmployeeService { public void addEmployee(Employee employee); public List<Employee> listEmployeess(); public Employee getEmployee(int empid); public void deleteEmployee(Employee employee); }
EmployeeServiceImpl.java
package com.dineshonjava.service; import java.util.List; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Propagation; import org.springframework.transaction.annotation.Transactional; import com.dineshonjava.dao.EmployeeDao; import com.dineshonjava.model.Employee; /** * @author Dinesh Rajput * */ @Service("employeeService") @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) public class EmployeeServiceImpl implements EmployeeService { @Autowired private EmployeeDao employeeDao; @Transactional(propagation = Propagation.REQUIRED, readOnly = false) public void addEmployee(Employee employee) { employeeDao.addEmployee(employee); } public List<Employee> listEmployeess() { return employeeDao.listEmployeess(); } public Employee getEmployee(int empid) { return employeeDao.getEmployee(empid); } public void deleteEmployee(Employee employee) { employeeDao.deleteEmployee(employee); } }
EmployeeController.java
package com.dineshonjava.controller; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.validation.BindingResult; import org.springframework.web.bind.annotation.ModelAttribute; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.servlet.ModelAndView; import com.dineshonjava.bean.EmployeeBean; import com.dineshonjava.model.Employee; import com.dineshonjava.service.EmployeeService; /** * @author Dinesh Rajput * */ @Controller public class EmployeeController { @Autowired private EmployeeService employeeService; @RequestMapping(value = "/save", method = RequestMethod.POST) public ModelAndView saveEmployee(@ModelAttribute("command")EmployeeBean employeeBean, BindingResult result) { Employee employee = prepareModel(employeeBean); employeeService.addEmployee(employee); return new ModelAndView("redirect:/add.html"); } @RequestMapping(value="/employees", method = RequestMethod.GET) public ModelAndView listEmployees() { Map<String Object> model = new HashMap<String Object>(); model.put("employees", prepareListofBean(employeeService.listEmployeess())); return new ModelAndView("employeesList", model); } @RequestMapping(value = "/add", method = RequestMethod.GET) public ModelAndView addEmployee(@ModelAttribute("command")EmployeeBean employeeBean, BindingResult result) { Map<String, Object> model = new HashMap<String, Object>(); model.put("employees", prepareListofBean(employeeService.listEmployeess())); return new ModelAndView("addEmployee", model); } @RequestMapping(value = "/index", method = RequestMethod.GET) public ModelAndView welcome() { return new ModelAndView("index"); } @RequestMapping(value = "/delete", method = RequestMethod.GET) public ModelAndView editEmployee(@ModelAttribute("command")EmployeeBean employeeBean, BindingResult result) { employeeService.deleteEmployee(prepareModel(employeeBean)); Map<String, Object> model = new HashMap<String, Object>(); model.put("employee", null); model.put("employees", prepareListofBean(employeeService.listEmployeess())); return new ModelAndView("addEmployee", model); } @RequestMapping(value = "/edit", method = RequestMethod.GET) public ModelAndView deleteEmployee(@ModelAttribute("command")EmployeeBean employeeBean, BindingResult result) { Map<String, Object> model = new HashMap<String, Object>(); model.put("employee", prepareEmployeeBean(employeeService.getEmployee(employeeBean.getId()))); model.put("employees", prepareListofBean(employeeService.listEmployeess())); return new ModelAndView("addEmployee", model); } private Employee prepareModel(EmployeeBean employeeBean){ Employee employee = new Employee(); employee.setEmpAddress(employeeBean.getAddress()); employee.setEmpAge(employeeBean.getAge()); employee.setEmpName(employeeBean.getName()); employee.setSalary(employeeBean.getSalary()); employee.setEmpId(employeeBean.getId()); employeeBean.setId(null); return employee; } private List<EmployeeBean> prepareListofBean(List<Employee> employees){ List<employeebean> beans = null; if(employees != null && !employees.isEmpty()){ beans = new ArrayList<EmployeeBean>(); EmployeeBean bean = null; for(Employee employee : employees){ bean = new EmployeeBean(); bean.setName(employee.getEmpName()); bean.setId(employee.getEmpId()); bean.setAddress(employee.getEmpAddress()); bean.setSalary(employee.getSalary()); bean.setAge(employee.getEmpAge()); beans.add(bean); } } return beans; } private EmployeeBean prepareEmployeeBean(Employee employee){ EmployeeBean bean = new EmployeeBean(); bean.setAddress(employee.getEmpAddress()); bean.setAge(employee.getEmpAge()); bean.setName(employee.getEmpName()); bean.setSalary(employee.getSalary()); bean.setId(employee.getEmpId()); return bean; } }
Spring Web configuration file web.xml
<web-app version="2.5" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xsi:schemalocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"> <servlet> <servlet-name>sdnext</servlet-name> <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class> <init-param> <param-name>contextConfigLocation</param-name><param-value>/WEB-INF/config/sdnext-servlet.xml</param-value></init-param> <load-on-startup>1</load-on-startup> </servlet> <servlet-mapping> <servlet-name>sdnext</servlet-name> <url-pattern>*.html</url-pattern> </servlet-mapping> <welcome-file-list> <welcome-file>index.html</welcome-file> </welcome-file-list> </web-app>
Spring Web configuration file sdnext-servlet.xml
<beans xmlns:context="http://www.springframework.org/schema/context" xmlns:tx="http://www.springframework.org/schema/tx" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.springframework.org/schema/beans" xsi:schemalocation=" http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.0.xsd"> <context:property-placeholder location="classpath:resources/database.properties"> </context:property-placeholder> <context:component-scan base-package="com.dineshonjava"> </context:component-scan> <tx:annotation-driven transaction-manager="hibernateTransactionManager"> </tx:annotation-driven> <bean class="org.springframework.web.servlet.view.InternalResourceViewResolver" id="jspViewResolver"> <property name="viewClass" value="org.springframework.web.servlet.view.JstlView"></property> <property name="prefix" value="/WEB-INF/views/"></property> <property name="suffix" value=".jsp"></property> </bean> <bean class="org.springframework.jdbc.datasource.DriverManagerDataSource" id="dataSource"> <property name="driverClassName" value="${database.driver}"></property> <property name="url" value="${database.url}"></property> <property name="username" value="${database.user}"></property> <property name="password" value="${database.password}"></property> </bean> <bean class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean" id="sessionFactory"> <property name="dataSource" ref="dataSource"></property> <property name="annotatedClasses"> <list> <value>com.dineshonjava.model.Employee</value> </list> </property> <property name="hibernateProperties"> <props> <prop key="hibernate.dialect">${hibernate.dialect}</prop> <prop key="hibernate.show_sql">${hibernate.show_sql}</prop> <prop key="hibernate.hbm2ddl.auto">${hibernate.hbm2ddl.auto} </prop> </props> </property> </bean> <bean class="org.springframework.orm.hibernate3.HibernateTransactionManager" id="hibernateTransactionManager"> <property name="sessionFactory" ref="sessionFactory"></property> </bean> </beans>
addEmployee.jsp
<%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%> <%@taglib uri="http://www.springframework.org/tags/form" prefix="form"%> <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> <title>Spring MVC Form Handling</title> </head> <body> <h2>Add Employee Data</h2> <form:form method="POST" action="/sdnext/save.html"> <table> <tr> <td><form:label path="id">Employee ID:</form:label></td> <td><form:input path="id" value="${employee.id}" readonly="true"/></td> </tr> <tr> <td><form:label path="name">Employee Name:</form:label></td> <td><form:input path="name" value="${employee.name}"/></td> </tr> <tr> <td><form:label path="age">Employee Age:</form:label></td> <td><form:input path="age" value="${employee.age}"/></td> </tr> <tr> <td><form:label path="salary">Employee Salary:</form:label></td> <td><form:input path="salary" value="${employee.salary}"/></td> </tr> <tr> <td><form:label path="address">Employee Address:</form:label></td> <td><form:input path="address" value="${employee.address}"/></td> </tr> <tr> <td colspan="2"><input type="submit" value="Submit"/></td> </tr> </table> </form:form> <c:if test="${!empty employees}"> <h2>List Employees</h2> <table align="left" border="1"> <tr> <th>Employee ID</th> <th>Employee Name</th> <th>Employee Age</th> <th>Employee Salary</th> <th>Employee Address</th> <th>Actions on Row</th> </tr> <c:forEach items="${employees}" var="employee"> <tr> <td><c:out value="${employee.id}"/></td> <td><c:out value="${employee.name}"/></td> <td><c:out value="${employee.age}"/></td> <td><c:out value="${employee.salary}"/></td> <td><c:out value="${employee.address}"/></td> <td align="center"><a href="edit.html?id=${employee.id}">Edit</a> | <a href="delete.html?id=${employee.id}">Delete</a></td> </tr> </c:forEach> </table> </c:if> </body> </html>
employeesList.jsp
<%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%> <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <title>All Employees</title> </head> <body> <h1>List Employees</h1> <h3><a href="add.html">Add More Employee</a></h3> <c:if test="${!empty employees}"> <table align="left" border="1"> <tr> <th>Employee ID</th> <th>Employee Name</th> <th>Employee Age</th> <th>Employee Salary</th> <th>Employee Address</th> </tr> <c:forEach items="${employees}" var="employee"> <tr> <td><c:out value="${employee.id}"/></td> <td><c:out value="${employee.name}"/></td> <td><c:out value="${employee.age}"/></td> <td><c:out value="${employee.salary}"/></td> <td><c:out value="${employee.address}"/></td> </tr> </c:forEach> </table> </c:if> </body> </html>
index.jsp
<%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> <title>Spring3MVC with Hibernate3 CRUD Example using Annotations</title> </head> <body> <h2>Spring3MVC with Hibernate3 CRUD Example using Annotations</h2> <h2>1. <a href="employees.html">List of Employees</a></h2> <h2>2. <a href="add.html">Add Employee</a></h2> </body> </html>
Once you are done with creating source and configuration files, export your application. Right click on your application and use Export-> WAR File option and save your Spring3HibernateApp.war file in Tomcat’s webapps folder.
Now start your Tomcat server and make sure you are able to access other web pages from a webapps folder using a standard browser. Now try a URL http://localhost:8080/sdnext/ and you should see the following result if everything is fine with your Spring Web Application:
1. CREATE EMPLOYEE: Now click on the Add Employee link we get the following form for Create Employee.
Now click on the Submit button data are saved to the employee table on the database. And we get the following
2 READ EMPLOYEE: Now click on the List of Employee link we get the following employee list.
3.UPDATE EMPLOYEE: for an update, the employee form we have to click on the Edit link in the table of employees show on the browser.
we click Edit button for the fifth record of the table the >>
Now update the name field value from Sweety to Sweety Rajput and salary filed value 35000 to 36000 and submit the data after submit we get the following updated table against the fifth row of the table.
4. DELETE EMPLOYEE: Now we want to delete the one employee record from the table we click on the delete button. we want to delete fifth records of the above table now click on the delete button of the corresponding records and we get the final list as below.
Download Source code
Spring3HibernateApp.zip
Spring MVC Related Posts
- Spring MVC Web Tutorial
- Spring MVC Interview Questions
- MVC Design Pattern
- Spring MVC DispatcherServlet
- Spring MVC WebApplicationContext and Root Application Context
- Spring MVC @Controller Annotation
- Spring MVC @RequestMapping Annotation
- Spring MVC @RequestParam Annotation
- Spring MVC ContextLoaderListener
- Spring MVC @RequestParam and @PathVariable annotations
- Spring MVC Hello World Example
- Spring MVC Exception Handling Example
- Spring MVC with Hibernate CRUD Example
- Spring MVC Tiles Plugin with Example
- Spring MVC Interceptor with the example
- Spring MVC with MongoDB CRUD Example
- Spring MVC Internationalization & Localization with Example
Hi dinesh ..how to add one or more field in this application i tried but error is coming ..so pls add one or more fields in this application..
Hi .. Please tell me what error is coming.
If you want to add more fields on the Employee Data Form just likes Employee Mobile, Employee Dept etc. Then you have to do just add property to EmployeeBean.java as well as add to Employee.java class after that you have drop the previous schema of DB for this you have to some minor change in the database.properties file.
————————————-
hibernate.hbm2ddl.auto=create
———————————–
this line add instead of following line
———————————-
hibernate.hbm2ddl.auto=update
——————————–
then final you get..
database.driver=com.mysql.jdbc.Driver
database.url=jdbc:mysql://localhost:3306/DAVDB
database.user=root
database.password=root
hibernate.dialect=org.hibernate.dialect.MySQLDialect
hibernate.show_sql=true
hibernate.hbm2ddl.auto=create
hi Dinesh
i am getting error in following line..i dont know which jar file is missing…plz help me
——————————————–
Employee employee = prepareModel(employeeBean);
ERROR:The method prepareModel(EmployeeBean) is undefined for the type EmployeeController
hello… this problem is not due to you missing some jar files but it is because of you missing to define the method prepareModel(employeeBean) in the EmployeeController.java file, now You have to the define the above method please see EmployeeController.java file in the above code on this post.
Thanks
Thanks.now it's working.am beginner to spring framework..your tutorial helped me lot…
most welcome.. 🙂 If you have any problem then we definitely help you..
Thanks
Hi dinesh ..how to add one or more field in this application i tried but error is coming ..so pls add one or more fields in this application..
type Exception report
message An exception occurred processing JSP page /WEB-INF/views/addEmployee.jsp at line 55
description The server encountered an internal error that prevented it from fulfilling this request.
exception
org.apache.jasper.JasperException: An exception occurred processing JSP page
Stacktrace:
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:568)
note The full stack trace of the root cause is available in the Apache Tomcat/7.0.34 logs.
org.apache.jasper.JasperException: org.springframework.beans.NotReadablePropertyException: Invalid property 'mobile' of bean class [com.dineshonjava.bean.EmployeeBean]: Bean property 'mobile' is not readable or has an invalid getter method: Does the return type of the getter match the parameter type of the setter?
org.springframework.beans.NotReadablePropertyException: Invalid property 'mobile' of bean class [com.dineshonjava.bean.EmployeeBean]: Bean property 'mobile' is not readable or has an invalid getter method: Does the return type of the getter match the parameter type of the setter?
Hi Prathaban,
org.apache.jasper.JasperException: org.springframework.beans.NotReadablePropertyException is due to You have added one more field like mobile into Employee.java class but you are not adding to the EmployeeBean.java so please also adding same field on this class as well as Employee.java both.
Then try again we sure you get success to run the application.
Thanks,
Dinesh
Hi i Have already added both employee.java, and employeebean.java but exception is came.
Hi Prathaban,
As per as your exception "org.apache.jasper.JasperException: org.springframework.beans.NotReadablePropertyException" you are missing to adding the "mobile" field into the "EmployeeBean.java" please check the case of field of whatever are added.
Please provide me the source of the following file.
addEmployee.jsp
Employee.java
EmployeeBean.java
database.properties
on the comment field or mail me on the admin@dineshonjava.com
then We will able to help you.
Thanks,
Dinesh
Do one more thing please check the setter and getter methods of the fields which you added .
as follows.
*************************************
private String mobile;
public String getMobile(){
return this.mobile;
}
public void setMobile(String mobile){
this.mobile = mobile;
}
*******************************************
on the both classes.
Employee.java
EmployeeBean.java
i added but same error is came
Thanks
prathaban
input is not taking any value , all input type is disable
Hi,
Now your application is working or not after adding extra field.
Thanks,
Dinesh
which field is disabled?
Dinesh Rajput7 February 2013 11:29 pm
Hi,
Now your application is working or not after adding extra field.
Thanks,
Dinesh
reply:
i tried but did not working dinesh..
Thanks
prtthaban j
Are you deploying that code which I have been sent to you after adding one more field "mobile".
I am asking this code is not working or you are adding some more fields except "mobile".
You can touch with us any weekend any time.
HI Dinesh
i have adding some more fields.except mobile .i have seened same error.
thanks
prathaban j
hi dinesh !
when am running this program on eclipse and tomcat as server ! It is showing error
SEVERE: Unable to process Jar entry [com/ibm/icu/impl/data/LocaleElements_zh__PINYIN.class] from Jar [jar:file:/C:/Users/Deepak/Documents/negid/.metadata/.plugins/org.eclipse.wst.server.core/tmp5/wtpwebapps/Spring3HibernateApp/WEB-INF/lib/icu4j-2.6.1.jar!/] for annotations
org.apache.tomcat.util.bcel.classfile.ClassFormatException: Invalid byte tag in constant pool: 60
Hi Deepak,
Please let me know which server is used by you for this application. All application in this tutorial we are used Tomcat 7.0. So please use this server and try to run.
As per as your exception we found that you missing the jar file "icu4j-2.6.1.jar" please download it and add to the class path. then try.
Thanks,
Dinesh
i m getting error like: org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: Unable to locate Spring NamespaceHandler for XML schema namespace [http://www.springframework.org/schema/tx]
Offending resource: ServletContext resource [/WEB-INF/spring/appServlet/servlet-context.xml]
Hi Sagar,
May be you are missing jar file (spring-tx-3.0.2.RELEASE.jar) or you are using old version of this jar file. If you are using same code of the servlet-context.xml file as per as shown in this tutorial file sdnext-servlet.xml then you have to add the latest jar file(spring-tx-3.0.2.RELEASE.jar) and deploy.
And also you can download the attached zip associated with this tutorial have all required jars.
Thanks
Dinesh
Hi Dinesh! Great tutorial but i have a question with EmployeeBean and Employee classes, why you use the EmployeeBean in the controller class if you have the Employee class with the annotations?
Hi Friend,
First of all thanks for nice compliment.
In high level project in the enterprise it way of more modularize of capturing data from front end and after applying business need and set that data to the other object which communicate with the database.
In this example EmployeeBean used as a bean for display its may be have more fields than Employee class. Employee class using just purpose for DTO between DB & Application. Its have table structured data fields. Because of this reason we used EmployeeBean as separate from Employee Class.
I hope you will understand of big requirement in this small application. If you have any more questions you can meet me on same and admin@dineshonjava.com.
Thanks
Dinesh
In this particular tutorial is very good to read and having clear idea for us.
Thank you !!!
Welcome mr. muthu, stay tune..
Thanks
Dinesh
Hello Dinesh,
I followed the tutorial and used the same code which you provided, but i am not able to add or update the records. After clicking the submit i get the following errors:
HTTP Status 404 – /sdnext/save.html
——————————————————————————–
type Status report
message /sdnext/save.html
description The requested resource is not available.
Please help me soon.
Thanks,
Manish Kumar
Hi Manish,
Please update the "context root(sdnext)" as per as your application configuration in jsp files. Then your application is successfully running.
After that you are not getting success then mail me your code at admin@dineshonjava.com for better response.
Thanks,
Dinesh
Hello Dinesh,
I tried to fix the issue but did not succeed. So, I mailed you the code, please have a look at it and help me.
Thanks
Manish
Thanks Dinesh.. it got resolved.. Your tutorial helped me very much..!
Ok Manish,
If you got any problems or questions in the future then directly talk to me at same.
Thanks,
Dinesh
Very nice… content.
Sir,I am getting the same problem and am unable to fix it. Can u pls tell me what to change?
Hi Divya,
Please change the context root of your project in place of "sdnext".
Then you get successfully running project.
If you have still same problem then you can mail your project at admin@dineshonjava.com
Thanks,
Dinesh
Hi i had tried this example but im getting error like "The requested resource (/sdnext/) is not available".How could i resolve this.
Anybody there?Kindly reply to ma question as i deployed it perfectly but im not getting the output
Hi Harish,
Please replace the "sdnext" context path with your project name.
Please try it if not success then revert again or send your query at admin@dineshonjava.com.
Thanks
Dinesh
Hi Dinesh,
I got the output by replacing the context path.
Greate Harish,
Keep learning with dineshonjava.com and please like it on facebook as well.
Very Regards,
Dinesh
Hi Dinesh i am getting this error please help me to solve it
DispatcherSer E org.springframework.web.servlet.FrameworkServlet initServletBean Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'employeeController': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private com.dineshonjava.service.EmployeeService com.dineshonjava.controller.EmployeeController.employe
Dear Venky,
You are missing to autowired one property EmployeeService to EmployeeController please verify this file.
Regards
Dinesh
HI DINESH ,
PLEASE UPLOAD VIDEO ADD MORE FIELDS IN THIS APPLICATION I AM TRYING MORE THEN TIMES NOT able to add MORE FIELDS … PLEASE HELP ME ….UPLOAD VIEDO DOC Spring 3.0 MVC with Hibernate 3.0 CRUD Example
THANKS
PRATHABAN
why u add 2 classes EmployeeBean and Employee. can i used annotation on my model class only, without bean?. it just wasting time, and unefficient for me
Yes you can use only one class either EmployeeBean or Employee. Here I am just using both class whenever Bean class has extra properties than Model class.
Hi Dinesh,
While executing the project i faced below issue kindly help me in detail to resolve that error
HTTP Status 404 – /sdnext/
Hi Wasif,
Please update the "context root(sdnext)" as per as your application configuration.
or
Make new dynamic web application and paste all code files in your application. Its error due to application context root.
If not understand then you can touch with me at admin@dineshonjava.com with code
Thanks,
Dinesh
Hi Dinesh,
Can you elaborate me about @ModelAttribute and why to use command value in the ModelAttribute annoatation.
Hi Udaykiran,
An @ModelAttribute on a method argument indicates the argument should be retrieved from the model. If not present in the model, the argument should be instantiated first and then added to the model. Once present in the model, the argument's fields should be populated from all request parameters that have matching names. This is known as data binding in Spring MVC, a very useful mechanism that saves you from having to parse each form field individually.
For example- its populate model data fetching from JSP or another view templates..
public String saveEmployee(@ModelAttribute EmployeeBean bean) {
empDao.save(bean);
}
or we can also use ModelAttribute as on method like below.. it populate model after fetching from database.
@ModelAttribute
public String getEmployee(int empId) {
empDao.getEmployee(empId);
}
And another point about "command" value in model attribute. Its mean nothing but it fetching the name of model attribute from command attribute of JSTL's from tag.
Example-
<form:form name="empForm" commandName="emoployeeBean" action="saveEmployee/">
Here if you not give commandName attribute in JSTL form tag then by default name as model name starting with small letter.
Thanks,
Dinesh
Thanks Dinesh. Can you please tell me how to implement login page using Spring MVC and hibernate. In the above example how can i implement login form for an employee.
https://www.dineshonjava.com/2013/02/spring-security-form-based-login-example.html#.UkBfyoanos8
Hi Dinesh your help is much appreciated and I want to insert CSS sheet into the code u wrote but the style sheet is not inserting. I loaded the file in the WebRoot-> images directory .the name of the style sheet is style.css. When i am giving reference to link like href="/images/style.css the file is not loading. Can you please help me. does i need to add any servlet for the CSS files.
Hi Dinesh,
I have downloaded your sample code, while running the application I am getting exception as :
SEVERE: Unable to process Jar entry [com/ibm/icu/impl/data/LocaleElements_zh__PINYIN.class] from Jar [jar:file:/D:/PMS/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/Spring3HibernateApp/WEB-INF/lib/icu4j-2.6.1.jar!/] for annotations
org.apache.tomcat.util.bcel.classfile.ClassFormatException: Invalid byte tag in constant pool: 60
Inspite of this exception I am unable to see the first page of application but when I try to add record it gives me 505 exception:
HTTP Status 500 – Request processing failed; nested exception is org.hibernate.exception.GenericJDBCException: could not insert: [com.dineshonjava.model.Employee]
Please help me in getting this correct!!!
Sorry for the typo- I wanted to say "Inspite of this exception I am able to see the first page of application but when I try to add record it gives me 505 exception" instead of "unable to see"
Hi Sunayana,
Please create database before deploying application. Your application unable to save data into DB.
Try it after that you get same problem, touch with us on admin@dineshonjava.com and also like with facebook for regular update.
Thanks,
Dinesh
Hi Dinesh,
Thanks for your prompt reply!! The issue was: I created table before implementing the application, but mistakenly an extra field was created in table. Now that I have removed that extra field, I do no get any exception and the application is running fine!
Thanks,
Sunayana
Thanks you Dinesh.
Hi Sunayana,
Please like with facebook for regular update.
Thanks,
Dinesh
Hi dinesh,
i m new in spring.ad your demo shows mw following error.
Failed to read candidate component class: URL [jar:file:/Volumes/DATA/apache-tomcat-7.0.14/webapps/spring/WEB-INF/lib/icu4j-2.6.1.jar!/com/ibm/icu/impl/data/LocaleElements_zh__PINYIN.class]; nested exception is java.lang.ArrayIndexOutOfBoundsException: 48188
ad can u pls tell me the flow of this app
i hav download new jar file from jarfinder.
still i will nt work
pls help
Hi Ketul,
I think your application still not getting /icu4j-2.6.1.jar file. Please build class path again.
Thanks,
Dinesh
Hi Dinesh,
Tutorials provide by you are awesome.You have provided almost everything in java.Its very good for newbie like us to develop there skills in java.And you keep on responding on each and every comments.Thank You so much for all your efforts.
I am using oracle 11g database
I have made following changes in the code
In sdnext-servlet.xml
I have used ojdbc14.jar
When i click Add Employees I am getting this exception
org.springframework.web.util.NestedServletException: Request processing failed; nested exception is org.hibernate.exception.GenericJDBCException: Cannot open connection
org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:659)
org.hibernate.exception.GenericJDBCException: Cannot open connection
java.sql.SQLException: Io exception: Connection refused(DESCRIPTION=(TMP=)(VSNNUM=186646784)(ERR=12505)(ERROR_STACK=(ERROR=(CODE=12505)(EMFI=4))))
oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)
This are the changes which i made
In database properties
connection.driver_class=oracle.jdbc.driver.OracleDriver
connection.url=jdbc:oracle:thin:@localhost:1521:xe
connection.username=system
connection.password=Hanuman123
hibernate.dialect=org.hibernate.dialect.Oracle9Dialect
hibernate.show_sql=true
hibernate.hbm2ddl.auto=update
in sdnext-servlet.xml
Kindly help me in this regard
Thanks in advace
Hi dinesh,
You are doing great work. I tried your program and its working. Now i am using dropbox and checkbox in JSP and i need to access database from the jsp page using dropbox,checkbox. Can you show one example for the dropbox and checbox accessing the database. I am trying to enter values like employee location using dropbox, but this information is not entered in the database and it is showing empty column.
Hi Udaykiran,
Thanks for nice comment 🙂
If you want to use dropbox as field in jsp page you have to look the following example where I have used one dropdown from database,
https://www.dineshonjava.com/2013/05/spring-crud-example-using-one-to-one.html#.Ukzu5nxWZqc
If you will still have a problem creating the dropbox in JSP then you can touch with us.
Thanks,
Dinesh
Hi Friends,
Thanks for your encouraging and nice complementary comment.
First thing is please update one more thing in properties file.
hibernate.hbm2ddl.auto=create (only for you first time when you deploy the application for creating schema or you can manually create schema without changing this)
Second thing is make sure are you using oracle11g java-driver.
If you changing database then no need to change in sdnext-servlet.xml.
Please touch with us(admin@dineshonjava.com) If you will still facing these problems.
Could you please like this site at facebook for regular updates.
Thanks,
Dinesh
Hi Dinesh,
I have mailed you the full code,bout hadn't got any reply from your side.
Please help.I am awaiting your reply
Hi Dinesh,
I have mailed you the full code,bout hadn't got any reply from your side.
Please help.I am awaiting your reply
Hi Wasif,
I am sorry for delay in response.
Could please send again the full code at admin@dineshonjava.com.
In mail box I have not any code from your site. So please send again.
Thanks,
Anamika
Can u pls tell me the flow how this app work
means step by step flow
Hi Dinesh,
I tried it but not working. When i tried to add some user credentials i am getting some errors like this.
org.apache.jasper.JasperException: An exception occurred processing JSP page /WEB-INF/views/login.jsp at line 90
Stacktrace:
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:568)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:465)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
org.springframework.web.servlet.view.InternalResourceView.renderMergedOutputModel(InternalResourceView.java:238)
org.springframework.web.servlet.view.AbstractView.render(AbstractView.java:250)
org.springframework.web.servlet.DispatcherServlet.render(DispatcherServlet.java:1060)
org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:798)
org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:716)
org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:647)
org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:552)
javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
root cause
java.lang.IllegalStateException: Neither BindingResult nor plain target object for bean name 'command' available as request attribute
org.springframework.web.servlet.support.BindStatus.(BindStatus.java:141)
org.springframework.web.servlet.tags.form.AbstractDataBoundFormElementTag.getBindStatus(AbstractDataBoundFormElementTag.java:174)
org.springframework.web.servlet.tags.form.AbstractDataBoundFormElementTag.getPropertyPath(AbstractDataBoundFormElementTag.java:194)
org.springframework.web.servlet.tags.form.LabelTag.autogenerateFor(LabelTag.java:129)
org.springframework.web.servlet.tags.form.LabelTag.resolveFor(LabelTag.java:119)
org.springframework.web.servlet.tags.form.LabelTag.writeTagContent(LabelTag.java:89)
org.springframework.web.servlet.tags.form.AbstractFormTag.doStartTagInternal(AbstractFormTag.java:102)
org.springframework.web.servlet.tags.RequestContextAwareTag.doStartTag(RequestContextAwareTag.java:79)
org.apache.jsp.WEB_002dINF.views.login_jsp._jspx_meth_form_005flabel_005f0(login_jsp.java:267)
org.apache.jsp.WEB_002dINF.views.login_jsp._jspx_meth_form_005fform_005f0(login_jsp.java:215)
org.apache.jsp.WEB_002dINF.views.login_jsp._jspService(login_jsp.java:158)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:432)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
org.springframework.web.servlet.view.InternalResourceView.renderMergedOutputModel(InternalResourceView.java:238)
org.springframework.web.servlet.view.AbstractView.render(AbstractView.java:250)
org.springframework.web.servlet.DispatcherServlet.render(DispatcherServlet.java:1060)
org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:798)
org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:716)
org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:647)
org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:552)
javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
Can you please sort out this error.
Thanks in advance,
Uday.
I cant understand why it is showing this error
And also for drop box and radio button mine is not working. I am using date for drop box. The data i entered is showing null. If you want i will send my code to you mail.
Hi Uday,
Please send your application as a zip at admin@dineshonjava.com for resolving problem propery.
Thanks,
Dinesh
Hi Uday,
I have looked your code of JSP found some problem in jsp form tag where your using "commandName" attribute with value "command" as follows.
<form:form name="Login" action="/sdnext/register1.html" method="POST" commandName="command" onsubmit="return ValidateForm()">
here "command" should be bean so that all property using in form are associated with this bean. Please look following code where we are using "employeeBean" as commandName.
<form:form name="empForm" commandName="emoployeeBean" action="saveEmployee/">
here employeeBean is bean associate all property of bean class with form attributes like empName, empAge. empId etc.
Thanks,
Dinesh
Thanks Dinesh for helping me alot. I send my WAR file to your Email-id admin@dineshonjava.com
Hi Dinesh,
Thanks for helping me. But i need to submit my Web application by Oct 15th. Otherwise i will lose my degree. Its very urgent please solve the problem in my application. Please give me your phone number if you don't mind. I need it very urgently.
Thanks in advance,
Uday kiran chitturi
Hi Uday,
I have completed your application please find attached file.
And deploy.
In every mail signature i have mention my contact number.
Thanks,
Dinesh
Hi Anamika,
I have already send through hightail and waiting for your effective reply..
I am very grateful to you
Thanks,
Wasif
Hi Anamika,
Please help..
Thanks,
Wasif
Hi Dinesh! Very well explained. How can i create a form when a employee may upload a picture profile.
Thanks in advance.
can yo exaplain annotaion and ioc.
what is the difference model clas and bean class
employeebean and employee java
please explain all annotation and xml properties to understand all basic.
i implement this project but some basics are not clear.
Hi Nitin,
Thanks for comment.
model class and bean class both are same things but mostly we preferred to use bean class to rendering data to view file and fetching data from view file another model class we are used at back end flow like DB label.
Thanks,
Anamika Rajput
hi dinesh… i imported the whole project and tried executing… i am getting file not found error….
can u please help me out? 404 error????
Hi chandana,
You are missing to add jar files to your project.
Please use eclipse IDE or STS IDE and Import project after that go to build path option add the all jars.
After that you got successfully running.
Thanks,
Anamika
Please update build path and redeploy again.
Thanks,
Dinesh
Hi,
The Inversion of Control is the process by which application defines the dependency and these dependencies are then satisfied in runtime by the Spring Framework. The IoC container is the main component of the Spring framework. It provides the main IoC container and AOP framework. The core container of the Spring Framework provides important functionality including dependency injection and bean life cycle management.
We can say that The IoC or Inversion of Control is the core features of the Spring Framework. Developers uses the IoC container to manage the beans and its dependency in the application. Thus simplifies the implementation of business logic in the application.
for more detail have look on following.
https://www.dineshonjava.com/2012/06/spring-ioc-container.html
Thanks,
Dinesh Rajput
Hi,
Thanks for nice comment.
Please look following example where I have used file upload example.
https://www.dineshonjava.com/2013/07/struts-2-file-upload-example.html
Thanks,
Dinesh Rajput
hi Dinesh,
Your presentation is really good.
THanks for the infromation shared,
Im facing one issue while running this appl,when i click on save i get 404
message /sdnext/save.html
as per ur above replies i understand that we need to change context in jsp files
but im not clear what is the exact change can you please reply here so that it will be available to every one from next time.
thank you so much for this application dinesh:) u saved my life:)
thank you so much anamika
🙂 ur r8t…. now its working fine
is it necessary to write for every class a DAO interface,and its implementation,,,and Service interface and its implementaion.
hi dinesh ,i have to create a login page using spring MVC and hibernate plz help me out in doing this …
Hi Dinesh plz help me. I am getting the following exception: "org.springframework.beans.factory.BeanDefinitionStoreException: Unexpected exception parsing XML document from ServletContext resource [/WEB-INF/dispatcher-servlet.xml]; nested exception is java.lang.NoClassDefFoundError: org/aopalliance/intercept/MethodInterceptor"
Dinesh I am getting this error Access denied for user 'root'@'localhost' (using password: YES)
Hi Friends,
Please update database.properties file where we are using database username and password.
Use password whatever you used in your machine.
Thanks,
Dinesh Rajput
Hi Narendra,
You are missing to add some jars file like aopalliance-1.0.jar etc. Please add these files.
Thanks,
Dinesh Rajput
That is better:
CREATE TABLE Employee(
EMPID INT NOT NULL AUTO_INCREMENT,
EMPNAME VARCHAR(20) NOT NULL,
EMPAGE INT NOT NULL,
SALARY BIGINT NOT NULL,
EMPADDRESS VARCHAR(20) NOT NULL,
PRIMARY KEY (EMPID)
);
Hi Sir,
I am new for Spring. I used your code. I getting this error. Please help me
20:38:36,403 INFO [STDOUT] 20:38:36,402 INFO [DefaultListableBeanFactory] Destroying singletons in org.springframework.beans.factory.support.DefaultListableBe
anFactory@e545fa: defining beans [org.springframework.beans.factory.config.PropertyPlaceholderConfigurer#0,employeeController,employeeDao,employeeService,org.sp
ringframework.context.annotation.internalConfigurationAnnotationProcessor,org.springframework.context.annotation.internalAutowiredAnnotationProcessor,org.spring
framework.context.annotation.internalRequiredAnnotationProcessor,org.springframework.context.annotation.internalCommonAnnotationProcessor,org.springframework.co
ntext.annotation.internalPersistenceAnnotationProcessor,jspViewResolver,dataSource,sessionFactory,hibernateTransactionManager]; root of factory hierarchy
20:38:36,421 INFO [STDOUT] 20:38:36,417 ERROR [DispatcherServlet] Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'employeeController': Injection of autowired dependencies failed; nested
exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private com.dineshonjava.service.EmployeeService com.dineshonjav
a.controller.EmployeeController.employeeService; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'emp
loyeeService': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field
: private com.dineshonjava.dao.EmployeeDao com.dineshonjava.service.EmployeeServiceImpl.employeeDao; nested exception is org.springframework.beans.factory.BeanC
reationException: Error creating bean with name 'employeeDao': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory
.BeanCreationException: Could not autowire field: private org.hibernate.SessionFactory com.dineshonjava.dao.EmployeeDaoImpl.sessionFactory; nested exception is
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in ServletContext resource [/WEB-INF/config/sdne
xt-servlet.xml]: Invocation of init method failed; nested exception is org.hibernate.AnnotationException: java.lang.NoSuchMethodException: org.hibernate.validat
or.ClassValidator.(java.lang.Class, java.util.ResourceBundle, org.hibernate.validator.MessageInterpolator, java.util.Map, org.hibernate.annotations.common
.reflection.ReflectionManager)
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java
:286)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1055)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:511)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:450)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:290)
hi Dinesh,
i got following errror at the time server starting.
SEVERE: StandardWrapper.Throwable
org.springframework.beans.factory.BeanInitializationException: Could not load properties; nested exception is java.io.FileNotFoundException: class path resource [resources/database.properties] cannot be opened because it does not exist
at org.springframework.beans.factory.config.PropertyResourceConfigurer.postProcessBeanFactory(PropertyResourceConfigurer.java:78)
at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:640)
at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:615)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:405)
at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:443)
at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:459)
at org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:340)
I configured database.properties locataion correctly but still got same problem.
Yes ,
comma missed befors adding primary key in Dinish code
Thanks very much Dinesh. Your example is really simple and elegant.
Hi Dinesh,
When I am trying to save in database its saving but i am not able to get the list employees,again add employee fields are comming.
Please give me some feedback.
Thanks,
Rajendra
hi Anamika,
can u please tell me why I am not getting the list of employees though its saving in database.
Thanks
hi dinesh when i try to execute this example in my system i got the following error can u please tel me what changes totally i need to do after import this source code to eclipse
org.apache.tomcat.util.bcel.classfile.ClassFormatException: Invalid byte tag in constant pool: 60
at org.apache.tomcat.util.bcel.classfile.Constant.readConstant(Constant.java:133)
Hi Ramachandran Rathinam,
It is problem due to you are missing some jars or set up to class path of jars. So please remove all jars and add again and set to class path after that redeploy after that you will get successfully run this application with out any error.
For more help contact at admin@dineshonjava.com.
Thanks,
Anamika
sessionFactory
Hi friend,
you are missing to add "resources/database.properties" file to your application please add this and run server.
After that redeploy after that you will get successfully run this application with out any error.
Thanks,
Anamika
You have to add this file to classpath also.
Please check in code you missing some logic of display. Please match with tutorial.
Thanks,
Anamika
Your welcome Naval and thanks for learning with us.
Thanks,
Dinesh
Your welcome chandana.
good example for beginners
Hello Dinesh,
Thanks for your efforts in sharing your knowledge in Spring.
I ve downloaded your application and did all the necessary setup in my local machine.
Its working fine. But when i change the context root and spring xml name the code is not compiling.
The code always look for the classes you given.
I ve tried changing the context root, and other setting advised throughout the discussions.
But not able to succeed in running this code with different context root or different spring xml name.
Pls look into the code and help me to run the code.
Kind Regards,
Nathan
I ve sent my code to admin@dineshonjava.com from britoamal@gmail.com.
Tomcat log shows error like below but in the lib folder icu4j-2.6.1.jar is already there and i am using all the jars provided in your example. It seems this application is not compiling. Pls reply asap
Regards,
Nathan
——
Unable to process Jar entry [com/ibm/icu/impl/data/LocaleElements_zh__PINYIN.class] from Jar [jar:file:/F:/Eclipse%20Kepler/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/SpringHiberD/WEB-INF/lib/icu4j-2.6.1.jar!/] for annotations
—————–
Thanks Akash for nice comment.
Thanks,
Dinesh
Hi,
Which IDE you have used for this application?
Thanks for the prompt response. Much appreciated. PFB for details.
IDE:eclipse-EE-kepler-win32
JAVA:1.7
Apache Tomcat:7
I am using . I am sending the zip file pls check that and let me know why i am not able to compile whenever i make some changes.
Kind Regards,
Nathan.
HTTP Status 500 – Request processing failed; nested exception is org.hibernate.exception.GenericJDBCException: could not insert: [com.dineshonjava.model.Employee]
java.sql.SQLException: Field 'ADDRESS' doesn't have a default value
PLEASE help me on this
Hi Dinesh, when i am connecting from server .. i get the same problem Null Pointer Exception… so let me know which type of Excepton is coming…
Hi Dinesh i am new to spring . my doubt is in the above example link add.html we have given but add.html is not there then how it goes to addEmployee.jsp page
Hi Dinesh, u r using static here cannot we use delete operation dynamically with out a query.. if possible please let me know
public void deleteEmployee(Employee employee) {
sessionFactory.getCurrentSession().createQuery("DELETE FROM Employee WHERE empid = "+employee.getEmpId()).executeUpdate();
}
Hi dinesh,
org.apache.catalina.core.StandardContext listenerStart
SEVERE: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'employeeController': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private com.dineshonjava.service.EmployeeService com.dineshonjava.controller.EmployeeController.employeeService; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'employeeService': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private com.dineshonjava.dao.EmployeeDao com.dineshonjava.service.EmployeeServiceImpl.employeeDao; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'employeeDAO': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private org.hibernate.SessionFactory com.dineshonjava.dao.EmployeeDaoImpl.sessionFactory; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in ServletContext resource [/WEB-INF/config/sdnext-servlet.xml]: Initialization of bean failed; nested exception is java.lang.NoClassDefFoundError: org/apache/commons/pool/KeyedObjectPoolFactory
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:286)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1055)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:511)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:450)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:290)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:287)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:189)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:562)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:871)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:423)
at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:272)
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:196)
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:47)
at org.apache.catalina.core.StandardContext.listenerStart(Standar
And
Caused by: java.lang.NoClassDefFoundError: org/apache/commons/pool/KeyedObjectPoolFactory
at java.lang.Class.getDeclaredConstructors0(Native Method)
at java.lang.Class.privateGetDeclaredConstructors(Unknown Source)
at java.lang.Class.getDeclaredConstructors(Unknown Source)
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.determineCandidateConstructors(AutowiredAnnotationBeanPostProcessor.java:228)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.determineConstructorsFromBeanPostProcessors(AbstractAutowireCapableBeanFactory.java:911)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:884)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:479)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:450)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:290)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:287)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:189)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:322)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:106)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1308)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1067)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:511)
… 65 more
Caused by: java.lang.ClassNotFoundException: org.apache.commons.pool.KeyedObjectPoolFactory
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
… 82 more
Hi, may I know what exactly, I need to change / update the "context root(sdnext)" as per as my application configuration in jsp files. so that my application will be successfully running.
I have already change the – as per my package. but still i have the same error code of 404. (HTTP Status 404 – /sdnext/save.html). (My controller class is not getting invoked)
Hi dinesh,
can you please post the same application using JDBC instead Hibernate
Hi Dinesh,
I am getting following error when i am trying to add new employee.
message Request processing failed; nested exception is org.springframework.orm.hibernate3.HibernateOptimisticLockingFailureException: Batch update returned unexpected row count from update [0]; actual row count: 0; expected: 1; nested exception is org.hibernate.StaleStateException: Batch update returned unexpected row count from update [0]; actual row count: 0; expected: 1
root cause
org.hibernate.StaleStateException: Batch update returned unexpected row count from update [0]; actual row count: 0; expected: 1
org.hibernate.jdbc.Expectations$BasicExpectation.checkBatched(Expectations.java:61)
org.hibernate.jdbc.Expectations$BasicExpectation.verifyOutcome(Expectations.java:46)
org.hibernate.jdbc.BatchingBatcher.checkRowCounts(BatchingBatcher.java:68)
org.hibernate.jdbc.BatchingBatcher.doExecuteBatch(BatchingBatcher.java:48)
org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:246)
org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:266)
org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:168)
org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:298)
org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:27)
org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1000)
org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:338)
org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:106)
org.springframework.orm.hibernate3.HibernateTransactionManager.doCommit(HibernateTransactionManager.java:656)
org.springframework.transaction.support.AbstractPlatformTransactionManager.processCommit(AbstractPlatformTransactionManager.java:754)
org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:723)
org.springframework.transaction.interceptor.TransactionAspectSupport.commitTransactionAfterReturning(TransactionAspectSupport.java:412)
org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:118)
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)
com.sun.proxy.$Proxy31.addEmployee(Unknown Source)
com.dineshonjava.controller.EmployeeController.saveEmployee(EmployeeController.java:34)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
java.lang.reflect.Method.invoke(Method.java:606)
org.springframework.web.bind.annotation.support.HandlerMethodInvoker.doInvokeMethod(HandlerMethodInvoker.java:710)
org.springframework.web.bind.annotation.support.HandlerMethodInvoker.invokeHandlerMethod(HandlerMethodInvoker.java:167)
org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.invokeHandlerMethod(AnnotationMethodHandlerAdapter.java:414)
org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.handle(AnnotationMethodHandlerAdapter.java:402)
org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:771)
org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:716)
org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:647)
org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:563)
javax.servlet.http.HttpServlet.service(HttpServlet.java:647)
javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
ramework.beans.factory.BeanCreationException: Error creating bean with name 'mySessionFactory' defined in ServletContext resource [/WEB-INF/dispatcher-servlet.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean]: Constructor threw exception; nested exception is java.lang.NoClassDefFoundError: org/hibernate/annotations/Entity
at org.springframework.beans.factory.suppor
Servlet /springhibernate threw load() exception
java.lang.ClassNotFoundException: org.hibernate.annotations.Entity
hi dinesh
these much error came ,,,how solve this ,
please help me ,
Thank you so much Dinesh, your code just work..excellent job keep it up
Hi, dinesh.
I have import your project into my Eclipse Workspace,
I have change the database properties : without password :
===========================================
database.driver=com.mysql.jdbc.Driver
database.url=jdbc:mysql://localhost:3306/db_employee
database.user=root
database.password=
hibernate.dialect=org.hibernate.dialect.MySQLDialect
hibernate.show_sql=true
hibernate.hbm2ddl.auto=update
===========================================
But when I run the project into the server I have this problem:
HTTP Status 500 – Request processing failed; nested exception is org.hibernate.exception.GenericJDBCException: Cannot open connection
exception
org.springframework.web.util.NestedServletException: Request processing failed; nested exception is org.hibernate.exception.GenericJDBCException: Cannot open connection
org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:659)
org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:552)
javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
What's the problem ?
Could you give me the answer ?
Thanks
Hi,
Please use the following code in sdnext-servlet.xml
<bean id="sessionFactory" > class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean">
<property name="dataSource" ref="dataSource" />
<property name="hibernateProperties">
<props>
<prop key="hibernate.dialect"> org.hibernate.dialect.MySQLDialect</prop>
<prop key="hibernate.show_sql"> true</prop>
<prop key="hibernate.hbm2ddl.auto"> create</prop>
</props>
</property>
<property name="packagesToScan" value="com.entity"> </property>
<property name="annotatedClasses">
<list>
<value> entity.Student</value>
</list>
</property>
</bean>
Here we avoid to use database.properties file.
Please try this.
Thanks,
Dinesh
hello sir, I get error "add.html" is not found. Where is that file. Please tell me as soon as possible.
Thanks.
hi Dinesh
this is rajasekhar iam getting this error
Feb 21, 2014 3:34:38 PM org.apache.catalina.core.StandardWrapperValve invoke
SEVERE: Servlet.service() for servlet [sdnext] in context with path [/sdnext] threw exception [Request processing failed; nested exception is org.hibernate.exception.GenericJDBCException: Cannot open connection] with root cause
java.sql.SQLException: Access denied for user 'root'@'localhost' (using password: YES)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:946)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2941)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:868)
at com.mysql.jdbc.MysqlIO.secureAuth411(MysqlIO.java:3340)
tanks
rajasekar
9966445400
<bean id="sessionFactory" > class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean">
<property name="dataSource" ref="dataSource" />
<property name="hibernateProperties">
<props>
<prop key="hibernate.dialect"> org.hibernate.dialect.MySQLDialect</prop>
<prop key="hibernate.show_sql"> true</prop>
<prop key="hibernate.hbm2ddl.auto"> create</prop>
</props>
</property>
<property name="packagesToScan" value="com.entity"> </property>
<property name="annotatedClasses">
<list>
<value> entity.Student</value>
</list>
</property>
</bean>
Here we avoid to use database.properties file.
Please try this.
i have done it. by see the above code
thanks you so much
for further details i will contact
thanks
rajasekhar
Hi Dinesh , its a wonderful tutorial, can u tell me how to the same things when the employee table will have link with department table with a primary table, i mean how both the table values will be updated?
if i attach css my own
how to attach css in this example bcz i tried to attach css through tag but its not working
and css ,js ,img folder in resource folder which is in webcontent .
I m a beginner for spring boot and my problem is –
my project is on spring and my collegues project is on hibernate i have to merge both the projects ,both are on eclipse
hi ,dinesh garu very good example. when i excuted employee yes its done but i am trying with diff fields table name with (check)…..getting this error
HTTP Status 500 – Servlet.init() for servlet sdnext threw exception
type Exception report
message Servlet.init() for servlet sdnext threw exception
description The server encountered an internal error that prevented it from fulfilling this request.
exception
javax.servlet.ServletException: Servlet.init() for servlet sdnext threw exception
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502)
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:953)
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1023)
org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589)
org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:310)
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
java.lang.Thread.run(Thread.java:744)
main point:where i imported employee project in to my work space its worked and when i changed with diff package and diff class according to my project view its worked ..but i taken new dynamic project and follwed employee pattern its not working ….getting above error ..please help me anybody ……
cell:8985816683 this side balu pls help me…anybody
Hello Dinesh sir,
I am new to Spring and hibernate.
Could you tell me the need of two files like Employee and EmployeeBean,EmployeeDao and EmployeeDaoImpl,EmployeeService and EmployeeServiceImpl.
Is it neccessary?
Hai Dinesh,
Can you post this Application as video on the video?
If already posted… Kindly send me the link….
when i click on add more employees… it shows me http 404 error i.e ssave.html not found…
could you please update this application in youtube with explanation in english and send the link…..
if already updated kindly send the link…
Not necessary but required for if you want separate concern between the layers in the application.
Currently, it is not available . But it is in plan.
Please check context root of the application.
What is version of tomcat and java.
hii dinesh i ican able add employess buts its not saving the records i dnt knw whats happening there..can u please me suggest me..how to save the records.
error in Db script.
Correct one
CREATE TABLE Employee(
EMPID INT NOT NULL AUTO_INCREMENT,
EMPNAME VARCHAR(20) NOT NULL,
EMPGENDER VARCHAR(6) NOT NULL,
EMPAGE INT NOT NULL,
SALARY BIGINT NOT NULL,
ADDRESS VARCHAR(20) NOT NULL,
EMAIL VARCHAR(40),
PRIMARY KEY (EMPID)
);
I am getting error when clicking on links on the index page. I am using Tomcat 8, Spring 4, Hibernate 4 and jdk 1.8. The errors are as follows
I am getting errors as shown below. I am using Tomcat 8, Spring 4, Hibernate 4 and Jdk1.8. Please suggest.
Jul 19, 2018 12:06:10 PM org.apache.catalina.core.ApplicationContext log
INFO: No Spring WebApplicationInitializer types detected on classpath
Jul 19, 2018 12:06:11 PM org.apache.catalina.core.ApplicationContext log
INFO: Initializing Spring FrameworkServlet ‘sdnext’
Jul 19, 2018 12:06:11 PM org.springframework.web.servlet.FrameworkServlet initServletBean
INFO: FrameworkServlet ‘sdnext’: initialization started
Jul 19, 2018 12:06:11 PM org.springframework.context.support.AbstractApplicationContext prepareRefresh
INFO: Refreshing WebApplicationContext for namespace ‘sdnext-servlet’: startup date [Thu Jul 19 12:06:11 IST 2018]; root of context hierarchy
Jul 19, 2018 12:06:11 PM org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions
INFO: Loading XML bean definitions from ServletContext resource [/WEB-INF/config/sdnext-servlet.xml]
Jul 19, 2018 12:06:11 PM org.springframework.web.servlet.FrameworkServlet initServletBean
SEVERE: Context initialization failed
org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: Line 7 in XML document from ServletContext resource [/WEB-INF/config/sdnext-servlet.xml] is invalid; nested exception is org.xml.sax.SAXParseException; lineNumber: 7; columnNumber: 64; cvc-elt.1: Cannot find the declaration of element ‘beans’.
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:399)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:336)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:304)
at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:181)
at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:217)
at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:188)
at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:125)
at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:94)
at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:129)
at org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:537)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:452)
at org.springframework.web.servlet.FrameworkServlet.configureAndRefreshWebApplicationContext(FrameworkServlet.java:663)
at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:629)
at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:677)
at org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:548)
at org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:489)
at org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:136)
at javax.servlet.GenericServlet.init(GenericServlet.java:158)
at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1231)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1144)
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1031)
at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4997)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5289)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.StandardContext.reload(StandardContext.java:3831)
at org.apache.catalina.loader.WebappLoader.backgroundProcess(WebappLoader.java:292)
at org.apache.catalina.core.StandardContext.backgroundProcess(StandardContext.java:5616)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1377)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1381)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1381)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1349)
at java.lang.Thread.run(Unknown Source)
Caused by: org.xml.sax.SAXParseException; lineNumber: 7; columnNumber: 64; cvc-elt.1: Cannot find the declaration of element ‘beans’.
at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source)
at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.error(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.handleStartElement(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.startElement(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl$NSContentDriver.scanRootElementHook(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$PrologDriver.next(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(Unknown Source)
at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(Unknown Source)
at org.springframework.beans.factory.xml.DefaultDocumentLoader.loadDocument(DefaultDocumentLoader.java:76)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadDocument(XmlBeanDefinitionReader.java:429)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:391)
… 31 more
iam also getting same error when i run the application how i can i resolve this
Hi Sir
I am also facing same issue so sir I request you to kindly help me.
I am sending you war file of my code
Thanks,
Vikas Gupta
Hi Dinesh ,
I got this error
SEVERE: StandardWrapper.Throwable
org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: Line 13 in XML document from ServletContext resource [/WEB-INF/config/sdnext-servlet.xml] is invalid; nested exception is org.xml.sax.SAXParseException; lineNumber: 13; columnNumber: 62; cvc-elt.1: Cannot find the declaration of element ‘beans’.
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:396)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:334)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:302)
at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:143)
at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:178)
at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:149)
at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:124)
at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:93)
at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:130)
at org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:465)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:395)
at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:443)
at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:459)
at org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:340)
at org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:307)
at org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:127)
at javax.servlet.GenericServlet.init(GenericServlet.java:158)
at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1174)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1090)
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:980)
at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4819)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5129)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1425)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1415)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
at java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:134)
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:941)
at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:839)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1425)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1415)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
at java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:134)
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:941)
at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:258)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.core.StandardService.startInternal(StandardService.java:422)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:770)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.startup.Catalina.start(Catalina.java:657)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:355)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:495)
Caused by: org.xml.sax.SAXParseException; lineNumber: 13; columnNumber: 62; cvc-elt.1: Cannot find the declaration of element ‘beans’.
at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source)
at org.apache.xerces.util.ErrorHandlerWrapper.error(Unknown Source)
at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
at org.apache.xerces.impl.xs.XMLSchemaValidator.handleStartElement(Unknown Source)
at org.apache.xerces.impl.xs.XMLSchemaValidator.startElement(Unknown Source)
at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown Source)
at org.apache.xerces.impl.XMLNSDocumentScannerImpl$NSContentDispatcher.scanRootElementHook(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at org.apache.xerces.parsers.DOMParser.parse(Unknown Source)
at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown Source)
at org.springframework.beans.factory.xml.DefaultDocumentLoader.loadDocument(DefaultDocumentLoader.java:75)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:388)
… 49 more
Nov 06, 2018 12:38:31 PM org.apache.catalina.core.StandardContext loadOnStartup
SEVERE: Servlet [sdnext] in web application [/Spring3HibernateApp] threw load() exception
org.xml.sax.SAXParseException; lineNumber: 13; columnNumber: 62; cvc-elt.1: Cannot find the declaration of element ‘beans’.
at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source)
at org.apache.xerces.util.ErrorHandlerWrapper.error(Unknown Source)
at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
at org.apache.xerces.impl.xs.XMLSchemaValidator.handleStartElement(Unknown Source)
at org.apache.xerces.impl.xs.XMLSchemaValidator.startElement(Unknown Source)
at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown Source)
at org.apache.xerces.impl.XMLNSDocumentScannerImpl$NSContentDispatcher.scanRootElementHook(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at org.apache.xerces.parsers.DOMParser.parse(Unknown Source)
at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown Source)
at org.springframework.beans.factory.xml.DefaultDocumentLoader.loadDocument(DefaultDocumentLoader.java:75)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:388)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:334)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:302)
at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:143)
at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:178)
at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:149)
at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:124)
at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:93)
at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:130)
at org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:465)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:395)
at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:443)
at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:459)
at org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:340)
at org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:307)
at org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:127)
at javax.servlet.GenericServlet.init(GenericServlet.java:158)
at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1174)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1090)
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:980)
at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4819)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5129)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1425)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1415)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
at java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:134)
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:941)
at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:839)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1425)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1415)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
at java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:134)
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:941)
at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:258)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.core.StandardService.startInternal(StandardService.java:422)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:770)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.startup.Catalina.start(Catalina.java:657)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:355)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:495)
Nov 06, 2018 12:38:31 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler [“http-nio-8080”]
Nov 06, 2018 12:38:31 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler [“ajp-nio-8009”]
Nov 06, 2018 12:38:31 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 5330 ms
Nov 06, 2018 12:38:32 PM org.apache.catalina.core.ApplicationContext log
INFO: Initializing Spring FrameworkServlet ‘sdnext’
Nov 06, 2018 12:38:32 PM org.apache.catalina.core.ApplicationContext log
SEVERE: StandardWrapper.Throwable
org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: Line 13 in XML document from ServletContext resource [/WEB-INF/config/sdnext-servlet.xml] is invalid; nested exception is org.xml.sax.SAXParseException; lineNumber: 13; columnNumber: 62; cvc-elt.1: Cannot find the declaration of element ‘beans’.
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:396)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:334)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:302)
at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:143)
at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:178)
at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:149)
at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:124)
at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:93)
at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:130)
at org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:465)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:395)
at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:443)
at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:459)
at org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:340)
at org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:307)
at org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:127)
at javax.servlet.GenericServlet.init(GenericServlet.java:158)
at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1174)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1090)
at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:770)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:133)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:475)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:80)
at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:625)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:342)
at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:498)
at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:796)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1372)
at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Thread.java:748)
Caused by: org.xml.sax.SAXParseException; lineNumber: 13; columnNumber: 62; cvc-elt.1: Cannot find the declaration of element ‘beans’.
at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source)
at org.apache.xerces.util.ErrorHandlerWrapper.error(Unknown Source)
at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
at org.apache.xerces.impl.xs.XMLSchemaValidator.handleStartElement(Unknown Source)
at org.apache.xerces.impl.xs.XMLSchemaValidator.startElement(Unknown Source)
at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown Source)
at org.apache.xerces.impl.XMLNSDocumentScannerImpl$NSContentDispatcher.scanRootElementHook(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at org.apache.xerces.parsers.DOMParser.parse(Unknown Source)
at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown Source)
at org.springframework.beans.factory.xml.DefaultDocumentLoader.loadDocument(DefaultDocumentLoader.java:75)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:388)
… 36 more
Nov 06, 2018 12:38:32 PM org.apache.catalina.core.StandardWrapperValve invoke
SEVERE: Allocate exception for servlet [sdnext]
org.xml.sax.SAXParseException; lineNumber: 13; columnNumber: 62; cvc-elt.1: Cannot find the declaration of element ‘beans’.
at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source)
at org.apache.xerces.util.ErrorHandlerWrapper.error(Unknown Source)
at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
at org.apache.xerces.impl.xs.XMLSchemaValidator.handleStartElement(Unknown Source)
at org.apache.xerces.impl.xs.XMLSchemaValidator.startElement(Unknown Source)
at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown Source)
at org.apache.xerces.impl.XMLNSDocumentScannerImpl$NSContentDispatcher.scanRootElementHook(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at org.apache.xerces.parsers.DOMParser.parse(Unknown Source)
at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown Source)
at org.springframework.beans.factory.xml.DefaultDocumentLoader.loadDocument(DefaultDocumentLoader.java:75)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:388)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:334)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:302)
at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:143)
at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:178)
at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:149)
at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:124)
at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:93)
at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:130)
at org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:465)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:395)
at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:443)
at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:459)
at org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:340)
at org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:307)
at org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:127)
at javax.servlet.GenericServlet.init(GenericServlet.java:158)
at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1174)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1090)
at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:770)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:133)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:475)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:80)
at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:625)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:342)
at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:498)
at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:796)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1372)
at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Thread.java:748)
Nov 06, 2018 12:50:44 PM org.apache.catalina.core.ApplicationContext log
INFO: Initializing Spring FrameworkServlet ‘sdnext’
Nov 06, 2018 12:50:44 PM org.apache.catalina.core.ApplicationContext log
SEVERE: StandardWrapper.Throwable
org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: Line 13 in XML document from ServletContext resource [/WEB-INF/config/sdnext-servlet.xml] is invalid; nested exception is org.xml.sax.SAXParseException; lineNumber: 13; columnNumber: 62; cvc-elt.1: Cannot find the declaration of element ‘beans’.
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:396)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:334)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:302)
at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:143)
at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:178)
at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:149)
at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:124)
at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:93)
at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:130)
at org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:465)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:395)
at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:443)
at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:459)
at org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:340)
at org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:307)
at org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:127)
at javax.servlet.GenericServlet.init(GenericServlet.java:158)
at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1174)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1090)
at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:770)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:133)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:475)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:80)
at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:625)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:342)
at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:498)
at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:796)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1372)
at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Thread.java:748)
Caused by: org.xml.sax.SAXParseException; lineNumber: 13; columnNumber: 62; cvc-elt.1: Cannot find the declaration of element ‘beans’.
at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source)
at org.apache.xerces.util.ErrorHandlerWrapper.error(Unknown Source)
at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
at org.apache.xerces.impl.xs.XMLSchemaValidator.handleStartElement(Unknown Source)
at org.apache.xerces.impl.xs.XMLSchemaValidator.startElement(Unknown Source)
at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown Source)
at org.apache.xerces.impl.XMLNSDocumentScannerImpl$NSContentDispatcher.scanRootElementHook(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at org.apache.xerces.parsers.DOMParser.parse(Unknown Source)
at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown Source)
at org.springframework.beans.factory.xml.DefaultDocumentLoader.loadDocument(DefaultDocumentLoader.java:75)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:388)
… 36 more
Nov 06, 2018 12:50:44 PM org.apache.catalina.core.StandardWrapperValve invoke
SEVERE: Allocate exception for servlet [sdnext]
org.xml.sax.SAXParseException; lineNumber: 13; columnNumber: 62; cvc-elt.1: Cannot find the declaration of element ‘beans’.
at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source)
at org.apache.xerces.util.ErrorHandlerWrapper.error(Unknown Source)
at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
at org.apache.xerces.impl.xs.XMLSchemaValidator.handleStartElement(Unknown Source)
at org.apache.xerces.impl.xs.XMLSchemaValidator.startElement(Unknown Source)
at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown Source)
at org.apache.xerces.impl.XMLNSDocumentScannerImpl$NSContentDispatcher.scanRootElementHook(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at org.apache.xerces.parsers.DOMParser.parse(Unknown Source)
at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown Source)
at org.springframework.beans.factory.xml.DefaultDocumentLoader.loadDocument(DefaultDocumentLoader.java:75)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:388)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:334)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:302)
at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:143)
at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:178)
at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:149)
at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:124)
at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:93)
at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:130)
at org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:465)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:395)
at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:443)
at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:459)
at org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:340)
at org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:307)
at org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:127)
at javax.servlet.GenericServlet.init(GenericServlet.java:158)
at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1174)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1090)
at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:770)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:133)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:475)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:80)
at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:625)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:342)
at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:498)
at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:796)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1372)
at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Thread.java:748)
Im Getting below error while adding new employee. could you please guide me.
SEVERE: Servlet.service() for servlet [sdnext] in context with path [/sdnext] threw exception [Request processing failed; nested exception is org.springframework.orm.hibernate3.HibernateOptimisticLockingFailureException: Batch update returned unexpected row count from update [0]; actual row count: 0; expected: 1; nested exception is org.hibernate.StaleStateException: Batch update returned unexpected row count from update [0]; actual row count: 0; expected: 1] with root cause
org.hibernate.StaleStateException: Batch update returned unexpected row count from update [0]; actual row count: 0; expected: 1
at org.hibernate.jdbc.Expectations$BasicExpectation.checkBatched(Expectations.java:61)
at org.hibernate.jdbc.Expectations$BasicExpectation.verifyOutcome(Expectations.java:46)
at org.hibernate.jdbc.BatchingBatcher.checkRowCounts(BatchingBatcher.java:68)
at org.hibernate.jdbc.BatchingBatcher.doExecuteBatch(BatchingBatcher.java:48)
at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:246)
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:266)
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:168)
at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:298)
at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:27)
at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1000)
at org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:338)
at org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:106)
at org.springframework.orm.hibernate3.HibernateTransactionManager.doCommit(HibernateTransactionManager.java:656)
at org.springframework.transaction.support.AbstractPlatformTransactionManager.processCommit(AbstractPlatformTransactionManager.java:754)
at org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:723)
at org.springframework.transaction.interceptor.TransactionAspectSupport.commitTransactionAfterReturning(TransactionAspectSupport.java:412)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:118)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)
at com.sun.proxy.$Proxy18.addEmployee(Unknown Source)
at com.dineshonjava.controller.EmployeeController.saveEmployee(EmployeeController.java:35)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.springframework.web.bind.annotation.support.HandlerMethodInvoker.doInvokeMethod(HandlerMethodInvoker.java:710)
at org.springframework.web.bind.annotation.support.HandlerMethodInvoker.invokeHandlerMethod(HandlerMethodInvoker.java:167)
at org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.invokeHandlerMethod(AnnotationMethodHandlerAdapter.java:414)
at org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.handle(AnnotationMethodHandlerAdapter.java:402)
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:771)
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:716)
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:647)
at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:563)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:650)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:731)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:218)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:505)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:169)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:956)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:442)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1082)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:623)
at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.doRun(AprEndpoint.java:2517)
at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:2506)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Unknown Source)
I followed the tutorial and used the same code which you provided, but i am not able to add or update the records. After clicking the submit i get the following errors:
HTTP Status 404 – /sdnext/save.html
After clicking the submit i get the following errors:
HTTP Status 404 – /sdnext/save.html
Nov 21, 2018 12:13:00 PM org.apache.catalina.core.ApplicationContext log
SEVERE: StandardWrapper.Throwable
org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘sessionFactory’ defined in ServletContext resource [/WEB-INF/spring-servlet.xml]: Initialization of bean failed; nested exception is org.springframework.beans.TypeMismatchException: Failed to convert property value of type ‘java.util.ArrayList’ to required type ‘java.lang.Class[]’ for property ‘annotatedClasses’; nested exception is java.lang.IllegalArgumentException: Cannot find class [com.webmodule.springmvc.model.Admin]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:521)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:450)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:290)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:287)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:189)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:545)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:871)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:423)
at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:443)
at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:459)
at org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:340)
at org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:307)
at org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:127)
at javax.servlet.GenericServlet.init(GenericServlet.java:158)
at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1174)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1090)
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:980)
at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4819)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5129)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1425)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1415)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
at java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:134)
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:941)
at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:839)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1425)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1415)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
at java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:134)
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:941)
at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:258)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.core.StandardService.startInternal(StandardService.java:422)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:770)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.startup.Catalina.start(Catalina.java:657)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:355)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:495)
Caused by: org.springframework.beans.TypeMismatchException: Failed to convert property value of type ‘java.util.ArrayList’ to required type ‘java.lang.Class[]’ for property ‘annotatedClasses’; nested exception is java.lang.IllegalArgumentException: Cannot find class [com.webmodule.springmvc.model.Admin]
at org.springframework.beans.BeanWrapperImpl.convertForProperty(BeanWrapperImpl.java:457)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.convertForProperty(AbstractAutowireCapableBeanFactory.java:1354)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1313)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1067)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:511)
… 47 more
Caused by: java.lang.IllegalArgumentException: Cannot find class [com.webmodule.springmvc.model.Admin]
at org.springframework.util.ClassUtils.resolveClassName(ClassUtils.java:294)
at org.springframework.beans.propertyeditors.ClassEditor.setAsText(ClassEditor.java:64)
at org.springframework.beans.TypeConverterDelegate.doConvertTextValue(TypeConverterDelegate.java:474)
at org.springframework.beans.TypeConverterDelegate.doConvertValue(TypeConverterDelegate.java:446)
at org.springframework.beans.TypeConverterDelegate.convertIfNecessary(TypeConverterDelegate.java:215)
at org.springframework.beans.TypeConverterDelegate.convertIfNecessary(TypeConverterDelegate.java:122)
at org.springframework.beans.TypeConverterDelegate.convertToTypedArray(TypeConverterDelegate.java:485)
at org.springframework.beans.TypeConverterDelegate.convertIfNecessary(TypeConverterDelegate.java:227)
at org.springframework.beans.TypeConverterDelegate.convertIfNecessary(TypeConverterDelegate.java:154)
at org.springframework.beans.BeanWrapperImpl.convertForProperty(BeanWrapperImpl.java:452)
… 51 more
Caused by: java.lang.ClassNotFoundException: com.webmodule.springmvc.model.Admin
at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1269)
at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1104)
at org.springframework.util.ClassUtils.forName(ClassUtils.java:258)
at org.springframework.util.ClassUtils.resolveClassName(ClassUtils.java:291)
… 60 more
Nov 21, 2018 12:13:00 PM org.apache.catalina.core.StandardContext loadOnStartup
SEVERE: Servlet [spring] in web application [/SpringMvcApp] threw load() exception
java.lang.ClassNotFoundException: com.webmodule.springmvc.model.Admin
at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1269)
at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1104)
at org.springframework.util.ClassUtils.forName(ClassUtils.java:258)
at org.springframework.util.ClassUtils.resolveClassName(ClassUtils.java:291)
at org.springframework.beans.propertyeditors.ClassEditor.setAsText(ClassEditor.java:64)
at org.springframework.beans.TypeConverterDelegate.doConvertTextValue(TypeConverterDelegate.java:474)
at org.springframework.beans.TypeConverterDelegate.doConvertValue(TypeConverterDelegate.java:446)
at org.springframework.beans.TypeConverterDelegate.convertIfNecessary(TypeConverterDelegate.java:215)
at org.springframework.beans.TypeConverterDelegate.convertIfNecessary(TypeConverterDelegate.java:122)
at org.springframework.beans.TypeConverterDelegate.convertToTypedArray(TypeConverterDelegate.java:485)
at org.springframework.beans.TypeConverterDelegate.convertIfNecessary(TypeConverterDelegate.java:227)
at org.springframework.beans.TypeConverterDelegate.convertIfNecessary(TypeConverterDelegate.java:154)
at org.springframework.beans.BeanWrapperImpl.convertForProperty(BeanWrapperImpl.java:452)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.convertForProperty(AbstractAutowireCapableBeanFactory.java:1354)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1313)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1067)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:511)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:450)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:290)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:287)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:189)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:545)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:871)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:423)
at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:443)
at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:459)
at org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:340)
at org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:307)
at org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:127)
at javax.servlet.GenericServlet.init(GenericServlet.java:158)
at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1174)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1090)
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:980)
at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4819)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5129)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1425)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1415)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
at java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:134)
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:941)
at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:839)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1425)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1415)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
at java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:134)
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:941)
at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:258)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.core.StandardService.startInternal(StandardService.java:422)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:770)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.startup.Catalina.start(Catalina.java:657)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:355)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:495)
Nov 21, 2018 12:13:00 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler [“http-nio-8080”]
Nov 21, 2018 12:13:00 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler [“ajp-nio-8009”]
Nov 21, 2018 12:13:00 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 6749 ms
I’m facing a lot of issues on jar/Maven, from where exactly I get the required Jar for my Spring application? And also would like to know how to get correct xml dtd/xmlns schema to configure hibernate and spring configuration file. Your help will be much appiciated.
Hi sir i have one doubt can i use below type of code is possible?
@RequestMapping(value = “/save”, method = RequestMethod.POST)
public ModelAndView saveEmployee(@ModelAttribute(“command”)EmployeeBean employeeBean,
BindingResult result) {
Empolyee employee=new employee();
employee.setname(employeeBean.getName())
employee.setEmpAddress(employeeBean.getAddress());
employee.setEmpAge(employeeBean.getAge());
employee.setEmpName(employeeBean.getName());
employee.setSalary(employeeBean.getSalary());
employee.setEmpId(employeeBean.getId());
employeeBean.setId(null);
employeeService.addEmployee(employee);
return new ModelAndView(“redirect:/add.html”);
}
Hai Dinesh,
This much of errors i got while running the application please help me
SEVERE: Context initialization failed
org.springframework.beans.factory.BeanDefinitionStoreException: IOException parsing XML document from ServletContext resource [/WEB-INF/welcome-servlet.xml]; nested exception is java.io.FileNotFoundException: Could not open ServletContext resource [/WEB-INF/welcome-servlet.xml]
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:344)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:304)
at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:188)
at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:224)
at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:195)
at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:125)
at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:94)
at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:133)
at org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:624)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:520)
at org.springframework.web.servlet.FrameworkServlet.configureAndRefreshWebApplicationContext(FrameworkServlet.java:696)
at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:662)
at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:710)
at org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:587)
at org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:526)
at org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:169)
at javax.servlet.GenericServlet.init(GenericServlet.java:158)
at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1183)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1099)
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:989)
at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4903)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5213)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1419)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1409)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: java.io.FileNotFoundException: Could not open ServletContext resource [/WEB-INF/welcome-servlet.xml]
at org.springframework.web.context.support.ServletContextResource.getInputStream(ServletContextResource.java:158)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:330)
… 28 more
Mar 13, 2019 2:44:44 PM org.apache.catalina.core.ApplicationContext log
SEVERE: StandardWrapper.Throwable
org.springframework.beans.factory.BeanDefinitionStoreException: IOException parsing XML document from ServletContext resource [/WEB-INF/welcome-servlet.xml]; nested exception is java.io.FileNotFoundException: Could not open ServletContext resource [/WEB-INF/welcome-servlet.xml]
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:344)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:304)
at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:188)
at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:224)
at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:195)
at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:125)
at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:94)
at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:133)
at org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:624)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:520)
at org.springframework.web.servlet.FrameworkServlet.configureAndRefreshWebApplicationContext(FrameworkServlet.java:696)
at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:662)
at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:710)
at org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:587)
at org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:526)
at org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:169)
at javax.servlet.GenericServlet.init(GenericServlet.java:158)
at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1183)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1099)
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:989)
at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4903)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5213)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1419)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1409)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: java.io.FileNotFoundException: Could not open ServletContext resource [/WEB-INF/welcome-servlet.xml]
at org.springframework.web.context.support.ServletContextResource.getInputStream(ServletContextResource.java:158)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:330)
… 28 more
Mar 13, 2019 2:44:44 PM org.apache.catalina.core.StandardContext loadOnStartup
SEVERE: Servlet [welcome] in web application [/testMaven] threw load() exception
java.io.FileNotFoundException: Could not open ServletContext resource [/WEB-INF/welcome-servlet.xml]
at org.springframework.web.context.support.ServletContextResource.getInputStream(ServletContextResource.java:158)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:330)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:304)
at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:188)
at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:224)
at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:195)
at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:125)
at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:94)
at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:133)
at org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:624)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:520)
at org.springframework.web.servlet.FrameworkServlet.configureAndRefreshWebApplicationContext(FrameworkServlet.java:696)
at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:662)
at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:710)
at org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:587)
at org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:526)
at org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:169)
at javax.servlet.GenericServlet.init(GenericServlet.java:158)
at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1183)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1099)
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:989)
at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4903)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5213)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1419)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1409)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Mar 13, 2019 2:44:45 PM org.apache.jasper.servlet.TldScanner scanJars
INFO: At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
Mar 13, 2019 2:44:45 PM org.apache.catalina.core.ApplicationContext log
INFO: No Spring WebApplicationInitializer types detected on classpath
Mar 13, 2019 2:44:45 PM org.apache.catalina.core.ApplicationContext log
INFO: Initializing Spring DispatcherServlet ‘spring’
Mar 13, 2019 2:44:45 PM org.springframework.web.servlet.FrameworkServlet initServletBean
INFO: Initializing Servlet ‘spring’
Loading class `com.mysql.jdbc.Driver’. This is deprecated. The new driver class is `com.mysql.cj.jdbc.Driver’. The driver is automatically registered via the SPI and manual loading of the driver class is generally unnecessary.
Mar 13, 2019 2:44:46 PM org.springframework.web.servlet.FrameworkServlet initServletBean
INFO: Completed initialization in 1088 ms
Mar 13, 2019 2:44:46 PM org.apache.catalina.startup.ContextConfig processAnnotationsJar
SEVERE: Unable to process Jar entry [module-info.class] from Jar [file:/D:/HBSR/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/Spring2/WEB-INF/lib/jaxb-runtime-2.3.1.jar] for annotations
org.apache.tomcat.util.bcel.classfile.ClassFormatException: Invalid byte tag in constant pool: 19
at org.apache.tomcat.util.bcel.classfile.Constant.readConstant(Constant.java:97)
at org.apache.tomcat.util.bcel.classfile.ConstantPool.(ConstantPool.java:54)
at org.apache.tomcat.util.bcel.classfile.ClassParser.readConstantPool(ClassParser.java:174)
at org.apache.tomcat.util.bcel.classfile.ClassParser.parse(ClassParser.java:83)
at org.apache.catalina.startup.ContextConfig.processAnnotationsStream(ContextConfig.java:2053)
at org.apache.catalina.startup.ContextConfig.processAnnotationsJar(ContextConfig.java:2000)
at org.apache.catalina.startup.ContextConfig.processAnnotationsUrl(ContextConfig.java:1970)
at org.apache.catalina.startup.ContextConfig.processAnnotations(ContextConfig.java:1923)
at org.apache.catalina.startup.ContextConfig.webConfig(ContextConfig.java:1163)
at org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:775)
at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:299)
at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:123)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5077)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1419)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1409)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Mar 13, 2019 2:44:46 PM org.apache.catalina.startup.ContextConfig processAnnotationsJar
SEVERE: Unable to process Jar entry [module-info.class] from Jar [file:/D:/HBSR/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/Spring2/WEB-INF/lib/istack-commons-runtime-3.0.7.jar] for annotations
org.apache.tomcat.util.bcel.classfile.ClassFormatException: Invalid byte tag in constant pool: 19
at org.apache.tomcat.util.bcel.classfile.Constant.readConstant(Constant.java:97)
at org.apache.tomcat.util.bcel.classfile.ConstantPool.(ConstantPool.java:54)
at org.apache.tomcat.util.bcel.classfile.ClassParser.readConstantPool(ClassParser.java:174)
at org.apache.tomcat.util.bcel.classfile.ClassParser.parse(ClassParser.java:83)
at org.apache.catalina.startup.ContextConfig.processAnnotationsStream(ContextConfig.java:2053)
at org.apache.catalina.startup.ContextConfig.processAnnotationsJar(ContextConfig.java:2000)
at org.apache.catalina.startup.ContextConfig.processAnnotationsUrl(ContextConfig.java:1970)
at org.apache.catalina.startup.ContextConfig.processAnnotations(ContextConfig.java:1923)
at org.apache.catalina.startup.ContextConfig.webConfig(ContextConfig.java:1163)
at org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:775)
at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:299)
at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:123)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5077)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1419)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1409)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Mar 13, 2019 2:44:47 PM org.apache.catalina.startup.ContextConfig processAnnotationsJar
SEVERE: Unable to process Jar entry [module-info.class] from Jar [file:/D:/HBSR/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/Spring2/WEB-INF/lib/FastInfoset-1.2.15.jar] for annotations
org.apache.tomcat.util.bcel.classfile.ClassFormatException: Invalid byte tag in constant pool: 19
at org.apache.tomcat.util.bcel.classfile.Constant.readConstant(Constant.java:97)
at org.apache.tomcat.util.bcel.classfile.ConstantPool.(ConstantPool.java:54)
at org.apache.tomcat.util.bcel.classfile.ClassParser.readConstantPool(ClassParser.java:174)
at org.apache.tomcat.util.bcel.classfile.ClassParser.parse(ClassParser.java:83)
at org.apache.catalina.startup.ContextConfig.processAnnotationsStream(ContextConfig.java:2053)
at org.apache.catalina.startup.ContextConfig.processAnnotationsJar(ContextConfig.java:2000)
at org.apache.catalina.startup.ContextConfig.processAnnotationsUrl(ContextConfig.java:1970)
at org.apache.catalina.startup.ContextConfig.processAnnotations(ContextConfig.java:1923)
at org.apache.catalina.startup.ContextConfig.webConfig(ContextConfig.java:1163)
at org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:775)
at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:299)
at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:123)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5077)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1419)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1409)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Mar 13, 2019 2:44:47 PM org.apache.catalina.startup.ContextConfig processAnnotationsJar
SEVERE: Unable to process Jar entry [META-INF/versions/9/module-info.class] from Jar [file:/D:/HBSR/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/Spring2/WEB-INF/lib/byte-buddy-1.9.5.jar] for annotations
org.apache.tomcat.util.bcel.classfile.ClassFormatException: Invalid byte tag in constant pool: 19
at org.apache.tomcat.util.bcel.classfile.Constant.readConstant(Constant.java:97)
at org.apache.tomcat.util.bcel.classfile.ConstantPool.(ConstantPool.java:54)
at org.apache.tomcat.util.bcel.classfile.ClassParser.readConstantPool(ClassParser.java:174)
at org.apache.tomcat.util.bcel.classfile.ClassParser.parse(ClassParser.java:83)
at org.apache.catalina.startup.ContextConfig.processAnnotationsStream(ContextConfig.java:2053)
at org.apache.catalina.startup.ContextConfig.processAnnotationsJar(ContextConfig.java:2000)
at org.apache.catalina.startup.ContextConfig.processAnnotationsUrl(ContextConfig.java:1970)
at org.apache.catalina.startup.ContextConfig.processAnnotations(ContextConfig.java:1923)
at org.apache.catalina.startup.ContextConfig.webConfig(ContextConfig.java:1163)
at org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:775)
at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:299)
at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:123)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5077)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1419)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1409)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Mar 13, 2019 2:44:47 PM org.apache.catalina.startup.ContextConfig processAnnotationsJar
SEVERE: Unable to process Jar entry [module-info.class] from Jar [file:/D:/HBSR/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/Spring2/WEB-INF/lib/stax-ex-1.8.jar] for annotations
org.apache.tomcat.util.bcel.classfile.ClassFormatException: Invalid byte tag in constant pool: 19
at org.apache.tomcat.util.bcel.classfile.Constant.readConstant(Constant.java:97)
at org.apache.tomcat.util.bcel.classfile.ConstantPool.(ConstantPool.java:54)
at org.apache.tomcat.util.bcel.classfile.ClassParser.readConstantPool(ClassParser.java:174)
at org.apache.tomcat.util.bcel.classfile.ClassParser.parse(ClassParser.java:83)
at org.apache.catalina.startup.ContextConfig.processAnnotationsStream(ContextConfig.java:2053)
at org.apache.catalina.startup.ContextConfig.processAnnotationsJar(ContextConfig.java:2000)
at org.apache.catalina.startup.ContextConfig.processAnnotationsUrl(ContextConfig.java:1970)
at org.apache.catalina.startup.ContextConfig.processAnnotations(ContextConfig.java:1923)
at org.apache.catalina.startup.ContextConfig.webConfig(ContextConfig.java:1163)
at org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:775)
at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:299)
at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:123)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5077)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1419)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1409)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Mar 13, 2019 2:44:47 PM org.apache.catalina.startup.ContextConfig processAnnotationsJar
SEVERE: Unable to process Jar entry [module-info.class] from Jar [file:/D:/HBSR/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/Spring2/WEB-INF/lib/jaxb-api-2.3.1.jar] for annotations
org.apache.tomcat.util.bcel.classfile.ClassFormatException: Invalid byte tag in constant pool: 19
at org.apache.tomcat.util.bcel.classfile.Constant.readConstant(Constant.java:97)
at org.apache.tomcat.util.bcel.classfile.ConstantPool.(ConstantPool.java:54)
at org.apache.tomcat.util.bcel.classfile.ClassParser.readConstantPool(ClassParser.java:174)
at org.apache.tomcat.util.bcel.classfile.ClassParser.parse(ClassParser.java:83)
at org.apache.catalina.startup.ContextConfig.processAnnotationsStream(ContextConfig.java:2053)
at org.apache.catalina.startup.ContextConfig.processAnnotationsJar(ContextConfig.java:2000)
at org.apache.catalina.startup.ContextConfig.processAnnotationsUrl(ContextConfig.java:1970)
at org.apache.catalina.startup.ContextConfig.processAnnotations(ContextConfig.java:1923)
at org.apache.catalina.startup.ContextConfig.webConfig(ContextConfig.java:1163)
at org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:775)
at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:299)
at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:123)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5077)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1419)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1409)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Mar 13, 2019 2:44:47 PM org.apache.catalina.startup.ContextConfig processAnnotationsJar
SEVERE: Unable to process Jar entry [module-info.class] from Jar [file:/D:/HBSR/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/Spring2/WEB-INF/lib/txw2-2.3.1.jar] for annotations
org.apache.tomcat.util.bcel.classfile.ClassFormatException: Invalid byte tag in constant pool: 19
at org.apache.tomcat.util.bcel.classfile.Constant.readConstant(Constant.java:97)
at org.apache.tomcat.util.bcel.classfile.ConstantPool.(ConstantPool.java:54)
at org.apache.tomcat.util.bcel.classfile.ClassParser.readConstantPool(ClassParser.java:174)
at org.apache.tomcat.util.bcel.classfile.ClassParser.parse(ClassParser.java:83)
at org.apache.catalina.startup.ContextConfig.processAnnotationsStream(ContextConfig.java:2053)
at org.apache.catalina.startup.ContextConfig.processAnnotationsJar(ContextConfig.java:2000)
at org.apache.catalina.startup.ContextConfig.processAnnotationsUrl(ContextConfig.java:1970)
at org.apache.catalina.startup.ContextConfig.processAnnotations(ContextConfig.java:1923)
at org.apache.catalina.startup.ContextConfig.webConfig(ContextConfig.java:1163)
at org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:775)
at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:299)
at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:123)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5077)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1419)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1409)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Mar 13, 2019 2:44:47 PM org.apache.jasper.servlet.TldScanner scanJars
INFO: At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
Mar 13, 2019 2:44:47 PM org.apache.catalina.core.ApplicationContext log
INFO: Marking servlet sdnext as unavailable
Mar 13, 2019 2:44:47 PM org.apache.catalina.core.StandardContext loadOnStartup
SEVERE: Servlet [sdnext] in web application [/Spring2] threw load() exception
java.lang.ClassNotFoundException: org.springframework.web.servlet.DispatcherServlet
at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1275)
at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1109)
at org.apache.catalina.core.DefaultInstanceManager.loadClass(DefaultInstanceManager.java:520)
at org.apache.catalina.core.DefaultInstanceManager.loadClassMaybePrivileged(DefaultInstanceManager.java:501)
at org.apache.catalina.core.DefaultInstanceManager.newInstance(DefaultInstanceManager.java:118)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1050)
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:989)
at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4903)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5213)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1419)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1409)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Mar 13, 2019 2:44:50 PM org.apache.jasper.servlet.TldScanner scanJars
INFO: At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
Mar 13, 2019 2:44:50 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler [http-nio-8080]
Mar 13, 2019 2:44:50 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler [ajp-nio-8009]
Mar 13, 2019 2:44:50 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 7663 ms
Hello Sir,
i am using only one package i.e.com.ram
in it i have created bean +dao class
i just wanted to test the code first
but in the spring-servlet .xml
on the line
Im getting this error
The markup in the document following the root element must be well-formed.
Please explain what error you are facing.
Please explain your question.
Servlet.init() for servlet [sdnext] threw exception
Description The server encountered an unexpected condition that prevented it from fulfilling the request.
— i am getting this error
HTTP Status 500 – Internal Server Error
Type Exception Report
Message Request processing failed; nested exception is org.hibernate.exception.SQLGrammarException: Cannot open connection
Description The server encountered an unexpected condition that prevented it from fulfilling the request.
Exception
org.springframework.web.util.NestedServletException: Request processing failed; nested exception is org.hibernate.exception.SQLGrammarException: Cannot open connection
org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:659)
org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:552)
javax.servlet.http.HttpServlet.service(HttpServlet.java:635)
javax.servlet.http.HttpServlet.service(HttpServlet.java:742)
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
Root Cause
org.hibernate.exception.SQLGrammarException: Cannot open connection
org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:67)
org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
i am facing the same problem i did change context root still i am not able to solve this 404 error. What are the other suggestions
org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: Line 13 in XML document from ServletContext resource [/WEB-INF/config/sdnext-servlet.xml] is invalid; nested exception is org.xml.sax.SAXParseException; lineNumber: 13; columnNumber: 62; cvc-elt.1: Cannot find the declaration of element ‘beans’.
hii dinesh, I can add employees buts its not saving the records i dnt knw whats happening there..can u please suggest me..how to save the records.
hii dinesh, I can add employees buts its not saving the records i dnt knw whats happening there..can u please suggest me how to save the records. and maybe thats why list of employees also giving error…
saying..org.springframework.web.util.NestedServletException: Request processing failed; nested exception is java.lang.NullPointerException
Hi Dinesh,
I got a situation like converting one web application into hibernate and springs.Can you suggest me the steps to do that.
Regards,
Ram.
Hi Dinesh,
Your explanation is really helpful thanks alot.
I have one issue with springs i.e., i am unable to load images and themes in spring application from jsp pages.Can you please help me.
Regards,
Ram.
HTTP Status 500 – Servlet.init() for servlet sdnext threw exception
aHTTP Status 500 – Servlet.init() for servlet sdnext threw exception
type Exception report
message Servlet.init() for servlet sdnext threw exception
description The server encountered an internal error that prevented it from fulfilling this request.
exception
javax.servlet.ServletException: Servlet.init() for servlet sdnext threw exception
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502)
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100)
org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:953)
type Exception report
message Servlet.init() for servlet sdnext threw exception
description The server encountered an internal error that prevented it from fulfilling this request.
exception
can you send this projec on my email id
yashp497@gmail.com