java - Spring SEVERE Error : Listener Start? -


i error, using apache tomcat 6.0.51. use spring+ hibernate+ rest. can't find reason. can fix it? try many way no solution..

 connected server     [2017-04-06 03:05:57,259] artifact toyotaproject:war exploded: artifact being deployed, please wait...     nis 06, 2017 3:05:57 org.apache.catalina.core.standardcontext start     severe: error listenerstart     nis 06, 2017 3:05:57 org.apache.catalina.core.standardcontext start     severe: context [] startup failed due previous errors     [2017-04-06 03:05:57,665] artifact toyotaproject:war exploded: error during artifact deployment. see server log details.     nis 06, 2017 3:06:07 org.apache.catalina.startup.hostconfig deploydirectory     info: deploying web application directory manager     f:\apache-tomcat-6.0.51\bin\catalina.bat stop     using catalina_base:   "c:\users\yusufaslan\.intellijidea2016.3\system\tomcat\unnamed_toyotaproject_2"     using catalina_home:   "f:\apache-tomcat-6.0.51"     using catalina_tmpdir: "f:\apache-tomcat-6.0.51\temp"     using jre_home:        "c:\program files\java\jdk1.8.0_101"     using classpath:       "f:\apache-tomcat-6.0.51\bin\bootstrap.jar"     nis 06, 2017 3:07:13 org.apache.coyote.http11.http11aprprotocol pause     info: pausing coyote http/1.1 on http-8080     nis 06, 2017 3:07:13 org.apache.coyote.ajp.ajpaprprotocol pause     info: pausing coyote ajp/1.3 on ajp-8009     nis 06, 2017 3:07:14 org.apache.catalina.core.standardservice stop     info: stopping service catalina     nis 06, 2017 3:07:14 org.apache.coyote.http11.http11aprprotocol destroy     info: stopping coyote http/1.1 on http-8080     nis 06, 2017 3:07:14 org.apache.coyote.ajp.ajpaprprotocol destroy     info: stopping coyote ajp/1.3 on ajp-8009     disconnected server 

this pom.xml

<?xml version="1.0" encoding="utf-8"?> <project xmlns="http://maven.apache.org/pom/4.0.0"          xmlns:xsi="http://www.w3.org/2001/xmlschema-instance"          xsi:schemalocation="http://maven.apache.org/pom/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">     <modelversion>4.0.0</modelversion>      <groupid>toyotaproject</groupid>     <artifactid>toyotaproject</artifactid>     <version>1.0-snapshot</version>     <build>          <plugins>              <plugin>                 <groupid>org.apache.maven.plugins</groupid>                 <artifactid>maven-compiler-plugin</artifactid>                 <configuration>                     <source>1.6</source>                     <target>1.6</target>                 </configuration>             </plugin>         </plugins>     </build>     <dependencies>         <!-- cxf dependencies -->         <dependency>             <groupid>junit</groupid>             <artifactid>junit</artifactid>             <version>3.8.1</version>             <scope>test</scope>         </dependency>         <dependency>             <groupid>org.hibernate</groupid>             <artifactid>hibernate-entitymanager</artifactid>             <version>4.2.0.final</version>         </dependency>         <dependency>             <groupid>org.hibernate</groupid>             <artifactid>hibernate-validator</artifactid>             <version>4.2.0.final</version>         </dependency>          <dependency>             <groupid>org.springframework</groupid>             <artifactid>spring-core</artifactid>             <version>3.2.18.release</version>         </dependency>         <dependency>             <groupid>org.springframework</groupid>             <artifactid>spring-context</artifactid>             <version>3.2.18.release</version>         </dependency>         <dependency>             <groupid>org.springframework</groupid>             <artifactid>spring-orm</artifactid>             <version>3.2.18.release</version>         </dependency>         <dependency>             <groupid>org.springframework</groupid>             <artifactid>spring-web</artifactid>             <version>3.2.18.release</version>         </dependency>                 <!-- spring security -->          <dependency>             <groupid>org.springframework.security</groupid>             <artifactid>spring-security-web</artifactid>             <version>3.2.3.release</version>         </dependency>          <dependency>             <groupid>org.springframework.security</groupid>             <artifactid>spring-security-config</artifactid>             <version>3.2.3.release</version>         </dependency>          <!-- spring security -->          <dependency>             <groupid>org.apache.cxf</groupid>             <artifactid>cxf-rt-transports-http</artifactid>             <version>3.0.4</version>         </dependency>         <dependency>             <groupid>org.apache.cxf</groupid>             <artifactid>cxf-rt-transports-http-jetty</artifactid>             <version>3.0.4</version>         </dependency>         <dependency>             <groupid>org.apache.cxf</groupid>             <artifactid>cxf-rt-frontend-jaxrs</artifactid>             <version>3.0.4</version>         </dependency>          <dependency>             <groupid>javax.ws.rs</groupid>             <artifactid>jsr311-api</artifactid>             <version>1.1.1</version>         </dependency>          <dependency>             <groupid>org.codehaus.jackson</groupid>             <artifactid>jackson-mapper-asl</artifactid>             <version>1.7.1</version>         </dependency>         <dependency>             <groupid>org.codehaus.jackson</groupid>             <artifactid>jackson-jaxrs</artifactid>             <version>1.7.1</version>         </dependency>         <dependency>             <groupid>org.codehaus.jackson</groupid>             <artifactid>jackson-xc</artifactid>             <version>1.7.1</version>         </dependency>          <dependency>             <groupid>javax.servlet</groupid>             <artifactid>javax.servlet-api</artifactid>             <version>3.0.1</version>         </dependency>          <dependency>             <groupid>org.apache.poi</groupid>             <artifactid>poi</artifactid>             <version>3.8</version>         </dependency>         <dependency>             <groupid>org.apache.poi</groupid>             <artifactid>poi-ooxml</artifactid>             <version>3.9</version>         </dependency>         <dependency>             <groupid>org.json</groupid>             <artifactid>json</artifactid>             <version>20090211</version>         </dependency>     </dependencies>  </project> 

in server log:

nis 06, 2017 3:05:57 org.apache.catalina.core.standardcontext listenerstart severe: error configuring application listener of class org.springframework.web.context.contextloaderlistener java.lang.classnotfoundexception: org.springframework.web.context.contextloaderlistener @ org.apache.catalina.loader.webappclassloader.loadclass(webap‌​pclassloader.java:16‌​98)   @ org.apache.catalina.loader.webappclassloader.loadclass(webap‌​pclassloader.java:15‌​44) @ org.apache.catalina.core.standardcontext.listenerstart(stand‌​ardcontext.java:4219‌​)'  

why error ? ? use intellij idea , is....

    web.xml <?xml version="1.0" encoding="utf-8"?> <web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee"          xmlns:xsi="http://www.w3.org/2001/xmlschema-instance"          xsi:schemalocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"          version="3.1">      <context-param>         <param-name>contextconfiglocation</param-name>         <param-value>src/main/web/applicationcontext.xml,src/main/web/spring-security.xml</param-value>     </context-param>      <listener>         <listener-class>org.springframework.web.context.contextloaderlistener</listener-class>     </listener>      <!-- spring security start -->     <listener>         <listener-class>             org.springframework.web.context.request.requestcontextlistener         </listener-class>     </listener>      <filter>         <filter-name>springsecurityfilterchain</filter-name>         <filter-class>             org.springframework.web.filter.delegatingfilterproxy         </filter-class>     </filter>     <!-- projenin ana url'inden itibaren spring security aktif ediliyor -->     <filter-mapping>         <filter-name>springsecurityfilterchain</filter-name>         <url-pattern>/*</url-pattern>     </filter-mapping>     <!-- spring security end -->     <servlet>         <servlet-name>cxfservlet</servlet-name>         <servlet-class>org.apache.cxf.transport.servlet.cxfservlet</servlet-class>         <load-on-startup>1</load-on-startup>     </servlet>      <servlet-mapping>         <servlet-name>cxfservlet</servlet-name>         <url-pattern>/rest/*</url-pattern>     </servlet-mapping>    </web-app> 

this applicatiıncontext.xml

<?xml version="1.0" encoding="utf-8"?> <beans xmlns="http://www.springframework.org/schema/beans"        xmlns:xsi="http://www.w3.org/2001/xmlschema-instance"        xmlns:context="http://www.springframework.org/schema/context"        xmlns:tx="http://www.springframework.org/schema/tx"        xmlns:jaxrs="http://cxf.apache.org/jaxrs"        xsi:schemalocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd             http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-2.5.xsd             http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.5.xsd              http://cxf.apache.org/jaxrs http://cxf.apache.org/schemas/jaxrs.xsd">       <context:annotation-config />     <context:component-scan base-package="com.toyotaproject" />     <tx:annotation-driven />     <bean id="datasource"           class="org.springframework.jdbc.datasource.drivermanagerdatasource">         <property name="driverclassname" value="com.mysql.jdbc.driver" />         <property name="url" value="jdbc:mysql://localhost:3307/toyotadb" />         <property name="username" value="root" />         <property name="password" value="12345" />     </bean>      <bean id="entitymanagerfactory"           class="org.springframework.orm.jpa.localcontainerentitymanagerfactorybean">         <property name="datasource" ref="datasource" />         <property name="persistenceunitname" value="springjpa_pu"/>     </bean>      <bean id="transactionmanager" class="org.springframework.orm.jpa.jpatransactionmanager">         <property name="entitymanagerfactory" ref="entitymanagerfactory" />     </bean>     <bean id='jacksonprovider' class='org.codehaus.jackson.jaxrs.jacksonjaxbjsonprovider' />      <bean id="jpaadapter"           class="org.springframework.orm.jpa.vendor.hibernatejpavendoradapter">         <property name="database" value="mysql" />         <property name="showsql" value="true" />         <property name="generateddl" value="true" />     </bean>     <jaxrs:server id="restcontainer" address="/" >         <jaxrs:servicebeans>             <ref bean="customerwebservice"/>             <ref bean="reservationwebservice"/>             <ref bean="tripwebservice"/>         </jaxrs:servicebeans>         <jaxrs:providers>             <ref bean='jacksonprovider' />         </jaxrs:providers>     </jaxrs:server> </beans> 

ok going show use , works. let me give , example. in place of applicatiıncontext.xml rather use springrest-servlet.xml name optional has en whit -servlet.xml. need reference in web.xml

  <servlet>          <servlet-name>springrest</servlet-name>          <servlet-class> org.springframework.web.servlet.dispatcherservlet </servlet-class>          <load-on-startup>1</load-on-startup>      </servlet>      <servlet-mapping>          <servlet-name>springrest</servlet-name>          <url-pattern>/</url-pattern>      </servlet-mapping>  

here springrest-servlet.xml not different applicatiıncontext.xml

<?xml version="1.0" encoding="utf-8"?>  <beans xmlns="http://www.springframework.org/schema/beans"        xmlns:tx="http://www.springframework.org/schema/tx"        xmlns:context="http://www.springframework.org/schema/context"        xmlns:mvc="http://www.springframework.org/schema/mvc" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance"        xmlns:p="http://www.springframework.org/schema/p"        xsi:schemalocation="         http://www.springframework.org/schema/beans             http://www.springframework.org/schema/beans/spring-beans-4.0.xsd         http://www.springframework.org/schema/context         http://www.springframework.org/schema/context/spring-context-4.0.xsd         http://www.springframework.org/schema/mvc         http://www.springframework.org/schema/mvc/spring-mvc-4.0.xsd         http://www.springframework.org/schema/tx         http://www.springframework.org/schema/tx/spring-tx-4.0.xsd">       <context:component-scan base-package="com.mycompany.backendhibernatejpa.controller" />     <mvc:annotation-driven />       <bean id="iabonnedao" class="com.mycompany.backendhibernatejpa.daoimpl.abonnedaoimpl"/>      <bean id="iabonneservice" class="com.mycompany.backendhibernatejpa.serviceimpl.abonneserviceimpl"/>      <!-- couche de persistance jpa -->     <bean id="entitymanagerfactory"           class="org.springframework.orm.jpa.localcontainerentitymanagerfactorybean">         <property name="datasource" ref="datasource" />         <property name="jpavendoradapter">             <bean class="org.springframework.orm.jpa.vendor.hibernatejpavendoradapter">                             <property name="databaseplatform" value="org.hibernate.dialect.mysql5innodbdialect" />                 <property name="generateddl" value="true" />                 <property name="showsql" value="true" />             </bean>         </property>         <property name="loadtimeweaver">             <bean                 class="org.springframework.instrument.classloading.instrumentationloadtimeweaver" />         </property>     </bean>      <bean class="org.springframework.beans.factory.config.propertyplaceholderconfigurer">            <property name="locations" value="classpath:bd.properties"/>     </bean>      <!-- la source de donnéees dbcp -->     <bean id="datasource" class="org.apache.commons.dbcp.basicdatasource" destroy-method="close" >         <property name="driverclassname" value="${bd.driver}" />         <property name="url" value="${bd.url}" />         <property name="username" value="${bd.username}" />         <property name="password" value="${bd.password}" />     </bean>      <!-- le gestionnaire de transactions -->      <bean id="txmanager" class="org.springframework.orm.jpa.jpatransactionmanager">         <property name="entitymanagerfactory" ref="entitymanagerfactory" />     </bean>     <tx:annotation-driven transaction-manager="txmanager" />      <!-- traduction des exceptions -->     <bean class="org.springframework.dao.annotation.persistenceexceptiontranslationpostprocessor" />      <!-- annotations de persistance -->     <bean class="org.springframework.orm.jpa.support.persistenceannotationbeanpostprocessor" />      <!--    <bean id="springsecurityfilterchain" class="org.springframework.web.filter.delegatingfilterproxy"/>-->  </beans> 

Comments

Popular posts from this blog

commonjs - How to write a typescript definition file for a node module that exports a function? -

openid - Okta: Failed to get authorization code through API call -

ios - Change Storyboard View using Seague -