Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

error- I always get this error when I deploy the any spring+hibernate application in tomcat server

Tags:

spring

I have written the program for add, delete, edit and search using spring+hibernate+maven+Mysql.

I used only one table and the table name is Employee. See the table structure:

 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 (EMPID));

I have written controller, service interface, service Implementation, DAO Interface and DAO implementation and written the config file. There is no error in the code when I deploy the code and I am getting the below code.

When I deploy another application using spring+hibernate, that time I am also getting the same error.

Did I miss any jar file? Please let me know where I am doing wrong. If you want I will attach the .war file.

Oct 02, 2014 3:29:55 PM org.apache.catalina.core.ApplicationContext log
INFO: Initializing Spring FrameworkServlet 'sdnext'
Oct 02, 2014 3:29:55 PM org.apache.catalina.core.ApplicationContext log
SEVERE: StandardWrapper.Throwable java.lang.NoClassDefFoundError: org/springframework/core/OrderComparator$OrderSourceProvider
    at org.springframework.context.support.AbstractRefreshableApplicationContext.createBeanFactory(AbstractRefreshableApplicationContext.java:200)
    at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:126)
    at org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:540)
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:454)
    at org.springframework.web.servlet.FrameworkServlet.configureAndRefreshWebApplicationContext(FrameworkServlet.java:658)
    at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:624)
    at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:672)
    at org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:543)
    at org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:484)
    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:1284)
    at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1197)
    at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1087)
    at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:5229)
    at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5516)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1575)
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1565)
    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.lang.ClassNotFoundException: org.springframework.core.OrderComparator$OrderSourceProvider
    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1720)
    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1571)
    ... 23 more
like image 608
anand Avatar asked Dec 25 '22 03:12

anand


1 Answers

Indeed, I got this problem when running a sample from Spring Framework samples (x509-jc), and changing the version from 4.0.2-RC1 to 4.1.1.RELEASE fixed the problem, most importantly the spring-core.

<dependency>
  <groupId>org.springframework</groupId>
  <artifactId>spring-core</artifactId>
  <version>4.1.1.RELEASE</version>
  <scope>compile</scope>
  <exclusions>
    <exclusion>
      <artifactId>commons-logging</artifactId>
      <groupId>commons-logging</groupId>
    </exclusion>
  </exclusions>
</dependency>
like image 55
EpicPandaForce Avatar answered Apr 17 '23 12:04

EpicPandaForce