I using Tomcat 6 as the App Server for my web application which uses the AOP to inject DAO into servlet.
Dec 31, 2012 5:21:01 PM org.apache.catalina.core.AprLifecycleListener init
INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: C:\Program Files (x86)\Java\jre6\bin;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;C:/Program Files (x86)/Java/jre7/bin/client;C:/Program Files (x86)/Java/jre7/bin;C:/Program Files (x86)/Java/jre7/lib/i386;C:\Program Files\Common Files\Microsoft Shared\Windows Live;C:\Program Files (x86)\Common Files\Microsoft Shared\Windows Live;C:\Program Files (x86)\Intel\iCLS Client\;C:\Program Files\Intel\iCLS Client\;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Program Files (x86)\Intel\OpenCL SDK\2.0\bin\x86;C:\Program Files (x86)\Intel\OpenCL SDK\2.0\bin\x64;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files (x86)\Common Files\Acronis\SnapAPI\;C:\Program Files (x86)\Windows Live\Shared;C:\Program Files (x86)\Microsoft SQL Server\100\Tools\Binn\;C:\Program Files\Microsoft SQL Server\100\Tools\Binn\;C:\Program Files\Microsoft SQL Server\100\DTS\Binn\;C:\Program Files\TortoiseSVN\bin;C:\Program Files (x86)\MySQL\MySQL Server 5.5\bin;C:\Program Files (x86)\Java\jdk1.6.0_26\bin;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\eclipse-jee-indigo-SR2-win32\eclipse;;.
Dec 31, 2012 5:21:02 PM org.apache.tomcat.util.digester.SetPropertiesRule begin
WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:BISDAO' did not find a matching property.
Dec 31, 2012 5:21:02 PM org.apache.tomcat.util.digester.SetPropertiesRule begin
WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context/Loader} Setting property 'useSystemClassLoaderAsParent' to 'false' did not find a matching property.
Dec 31, 2012 5:21:02 PM org.apache.coyote.http11.Http11Protocol init
INFO: Initializing Coyote HTTP/1.1 on http-8080
Dec 31, 2012 5:21:02 PM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 288 ms
Dec 31, 2012 5:21:02 PM org.apache.catalina.core.StandardService start
INFO: Starting service Catalina
Dec 31, 2012 5:21:02 PM org.apache.catalina.core.StandardEngine start
INFO: Starting Servlet Engine: Apache Tomcat/6.0.35
Dec 31, 2012 5:21:02 PM org.apache.catalina.core.ApplicationContext log
INFO: Initializing Spring root WebApplicationContext
17:21:02,477 INFO ContextLoader:272 - Root WebApplicationContext: initialization started
17:21:02,571 INFO XmlWebApplicationContext:510 - Refreshing Root WebApplicationContext: startup date [Mon Dec 31 17:21:02 SGT 2012]; root of context hierarchy
17:21:02,635 INFO XmlBeanDefinitionReader:315 - Loading XML bean definitions from ServletContext resource [/WEB-INF/applicationContext.xml]
17:21:02,967 INFO DefaultContextLoadTimeWeaver:89 - Using a reflective load-time weaver for class loader: org.springframework.instrument.classloading.tomcat.TomcatInstrumentableClassLoader
17:21:03,614 INFO DefaultListableBeanFactory:577 - Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory#188c838: defining beans [org.springframework.context.config.internalBeanConfigurerAspect,org.springframework.context.annotation.internalConfigurationAnnotationProcessor,org.springframework.context.annotation.internalAutowiredAnnotationProcessor,org.springframework.context.annotation.internalRequiredAnnotationProcessor,org.springframework.context.annotation.internalCommonAnnotationProcessor,genericDAOImpl,org.springframework.context.weaving.AspectJWeavingEnabler#0,loadTimeWeaver,org.springframework.aop.config.internalAutoProxyCreator,org.springframework.transaction.annotation.AnnotationTransactionAttributeSource#0,org.springframework.transaction.interceptor.TransactionInterceptor#0,org.springframework.transaction.config.internalTransactionAdvisor,org.springframework.cache.annotation.AnnotationCacheOperationSource#0,org.springframework.cache.interceptor.CacheInterceptor#0,org.springframework.cache.config.internalCacheAdvisor,org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor#0,dataSource,jdbcTemplate,genericDaoImpl,transactionManager,ehcache,cacheManager,org.springframework.context.annotation.ConfigurationClassPostProcessor.importAwareProcessor]; root of factory hierarchy
17:21:03,944 INFO EhCacheManagerFactoryBean:100 - Initializing EHCache CacheManager
17:21:04,263 INFO MLog:80 - MLog clients using log4j logging.
17:21:04,330 INFO C3P0Registry:204 - Initializing c3p0-0.9.1.2 [built 21-May-2007 15:04:56; debug? true; trace: 10]
17:21:04,471 INFO ContextLoader:301 - Root WebApplicationContext: initialization completed in 1993 ms
Dec 31, 2012 5:21:04 PM org.apache.coyote.http11.Http11Protocol start
INFO: Starting Coyote HTTP/1.1 on http-8080
Dec 31, 2012 5:21:04 PM org.apache.jk.common.ChannelSocket init
INFO: JK: ajp13 listening on /0.0.0.0:8009
Dec 31, 2012 5:21:04 PM org.apache.jk.server.JkMain start
INFO: Jk running ID=0 time=0/11 config=null
Dec 31, 2012 5:21:04 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 2354 ms
Dec 31, 2012 5:21:08 PM org.apache.catalina.core.ApplicationContext log
INFO: Marking servlet GenericServlet as unavailable
Dec 31, 2012 5:21:08 PM org.apache.catalina.core.ApplicationContext log
SEVERE: Error loading org.springframework.instrument.classloading.tomcat.TomcatInstrumentableClassLoader
WebappClassLoader
context: /BISDAO
delegate: false
repositories:
/WEB-INF/classes/
----------> Parent Classloader:
org.apache.catalina.loader.StandardClassLoader#3c0007
GenericServlet
java.lang.ClassNotFoundException: GenericServlet
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1680)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1526)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1128)
at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:827)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:129)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:859)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:602)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
at java.lang.Thread.run(Unknown Source)
Dec 31, 2012 5:21:08 PM org.apache.catalina.core.StandardWrapperValve invoke
SEVERE: Allocate exception for servlet GenericServlet
java.lang.ClassNotFoundException: GenericServlet
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1680)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1526)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1128)
at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:827)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:129)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:859)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:602)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
at java.lang.Thread.run(Unknown Source)
Below is my configuration:
I have put spring-instrument-tomcat-3.1.2.RELEASE.jar into $CATALINA_HOME\lib and have context.xml inside my META-INF folder.
<?xml version='1.0' encoding='utf-8'?>
<Context path="/BISDAO">
<Loader loaderClass="org.springframework.instrument.classloading.tomcat.TomcatInstrumentableClassLoader" />
</Context>
applicationContext.xml
<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"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.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">
<!-- Enable #Required #Autowired #PreDestroy #PostConstruct #Resource -->
<context:annotation-config />
<!-- Scan class file in class path for annotated component -> #Component, #Repository, #Service, and #Controller -->
<context:component-scan base-package="com.breeze.bis.core.service.jdbcTemplate" />
<!-- Enable load time weaving for #Configurable -->
<context:load-time-weaver aspectj-weaving="autodetect" />
<!-- -->
<tx:annotation-driven proxy-target-class="false" transaction-manager="transactionManager"/>
<!-- ==================================================================================================== -->
<!-- Alternate method to enable #Autowired -->
<bean class="org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor"/>
<bean id="dataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource" destroy-method="close">
<property name="jdbcUrl" value="jdbc:mysql://localhost:3306/vbossdb" />
<property name="driverClass" value="com.mysql.jdbc.Driver" />
<property name="user" value="root" />
<property name="password" value="root" />
</bean>
<bean id="jdbcTemplate" class="org.springframework.jdbc.core.JdbcTemplate">
<constructor-arg type="javax.sql.DataSource" ref="dataSource"></constructor-arg>
</bean>
<bean id="genericDaoImpl" class="com.breeze.bis.core.service.jdbcTemplate.GenericDAOImpl">
<property name="jdbcDao" ref="jdbcTemplate"></property>
</bean>
<bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
<property name="dataSource" ref="dataSource"></property>
</bean>
</beans>
Servlet.java
#Configurable
public class GenericServlet extends HttpServlet {
private static final long serialVersionUID = 1L;
#Autowired
GenericDAO dao;
}
Please help.
Thanks.
Your servlet shouldn't be in the default package. Move it into a proper package, and it'll probably work.
Define servlet class using custom package in web.xml
Related
I am working with Customer application using Spring MVC with REstful webservice using Hibernate. I have created this application as a Dynamic web project in Eclipse because if i am using Maven i am getting few dependencies error.
As i am new to these technologies I don’t know where I have done mistake in configuring these files
I have configured as follows in configuration files.
web.xml
<?xml version="1.0" encoding="UTF-8"?>
<web-app 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_3_0.xsd" id="WebApp_ID" version="3.0">
<display-name>SpringWithRestCaseStudy</display-name>
<context-param>
<param-name>root-context</param-name>
<param-value>\WEB-INF\spring\appServlet\root- context.xml</paramvalue>
</context-param>
<servlet>
<servlet-name>servlet-context</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet- class>
<init-param>
<param-name>contextConfigLocation</param-name>
<param-value>\WEB-INF\spring\appServlet\servlet-context.xml</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>servlet-context</servlet-name>
<url-pattern>/</url-pattern>
</servlet-mapping>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<listener>
<listener-class>org.springframework.web.context.RequestContextListener</listener-class>
</listener>
servlet-context.xml
<?xml version="1.0" encoding="UTF-8"?>
<beans:beans xmlns="http://www.springframework.org/schema/mvc"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:beans="http://www.springframework.org/schema/beans"
xmlns:task="http://www.springframework.org/schema/task"
xmlns:context="http://www.springframework.org/schema /context"
xsi:schemaLocation="http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc.xsd
http://www.springframework.org/schema/task http://www.springframework.org/schema/task/spring-task.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd">
<!-- DispatcherServlet Context: defines this servlet's request-processing infrastructure -->
<!-- Enables the Spring MVC #Controller programming model -->
<annotation-driven />
<resources location="/resources/" mapping="/resources/**"></resources>
<beans:bean class="org.springframework.web.servlet.view.InternalResourceViewResolver">
<beans:property name="prefix" value="/WEB-INF/views/" />
<beans:property name="suffix" value=".jsp" />
</beans:bean>
<context:component-scan base-package="com.crud.rest.controllers" />
</beans:beans>
root-context.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:c="htpp://www.springframework.org/schema/c"
xmlns:p="htpp://www.springframework.org/schema/p"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-4.0.xsd">
<!-- Root Context: defines shared resources visible to all other web components -->
<bean id="dataSource"
class="org.springframework.jdbc.datasource.DriverManagerDataSource">
<property name="driverClassName" value="oracle.jdbc.driver.OracleDriver">
</property>
<property name="url" value="jdbc:oracle:thin:#172.16.156.152:1521:orcl">
</property>
<property name="username" value="scott"></property>
<property name="password" value="tiger"></property>
</bean>
<bean id="sessionFactory"
class="org.springframework.orm.hibernate4.LocalSessionFactoryBean">
<property name="dataSource" ref="dataSource"></property>
<property name="hibernateProperties">
<props>
<prop key="hibernate.show_sql">true</prop>
<prop key="hibernate.dialect">org.hibernate.dialect.Oracle10gDialect</prop>
<prop key="hibernate.hbm2ddl.auto">update</prop>
</props>
</property>
<property name="annotatedClasses">
<list>
<value>com.crud.rest.beans.MyCustomer</value>
</list>
</property>
</bean>
<bean id="transactionManager"
class="org.springframework.orm.hibernate4.HibernateTransactionManager">
<property name="sessionFactory" ref="sessionFactory"></property>
</bean>
<bean id="customerDao" class="com.crud.rest.dao.CustomerDaoImpl">
<property name="sessionFactory" ref="sessionFactory"></property>
</bean>
<bean id="customerService" class="com.crud.rest.dao.CustomerServiceImpl">
<property name="CustomerDao" ref="CustomerDao"></property>
</bean>
</beans>
I am getting the error as follows.
Sep 12, 2017 12:52:55 PM org.apache.tomcat.util.digester.SetPropertiesRule begin
WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:ShoppingDemo' did not find a matching property.
Sep 12, 2017 12:52:55 PM org.apache.tomcat.util.digester.SetPropertiesRule begin
WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:SpringWithRestCaseStudy' did not find a matching property.
Sep 12, 2017 12:52:55 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Server version: Apache Tomcat/8.0.37
Sep 12, 2017 12:52:55 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Server built: Sep 1 2016 10:01:52 UTC
Sep 12, 2017 12:52:55 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Server number: 8.0.37.0
Sep 12, 2017 12:52:55 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: OS Name: Windows 7
Sep 12, 2017 12:52:55 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: OS Version: 6.1
Sep 12, 2017 12:52:55 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Architecture: amd64
Sep 12, 2017 12:52:55 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Java Home: C:\Program Files\Java\jre1.8.0_66
Sep 12, 2017 12:52:55 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: JVM Version: 1.8.0_66-b18
Sep 12, 2017 12:52:55 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: JVM Vendor: Oracle Corporation
Sep 12, 2017 12:52:55 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: CATALINA_BASE: D:\Narmatha Workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp2
Sep 12, 2017 12:52:55 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: CATALINA_HOME: D:\apache-tomcat-8.0.37
Sep 12, 2017 12:52:55 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Dcatalina.base=D:\Narmatha Workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp2
Sep 12, 2017 12:52:55 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Dcatalina.home=D:\apache-tomcat-8.0.37
Sep 12, 2017 12:52:55 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Dwtp.deploy=D:\Narmatha Workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp2\wtpwebapps
Sep 12, 2017 12:52:55 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Djava.endorsed.dirs=D:\apache-tomcat-8.0.37\endorsed
Sep 12, 2017 12:52:55 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Dfile.encoding=Cp1252
Sep 12, 2017 12:52:55 PM org.apache.catalina.core.AprLifecycleListener lifecycleEvent
INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: C:\Program Files\Java\jre1.8.0_66\bin;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;C:/Program Files/Java/jre1.8.0_66/bin/server;C:/Program Files/Java/jre1.8.0_66/bin;C:/Program Files/Java/jre1.8.0_66/lib/amd64;C:\ProgramData\Oracle\Java\javapath;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\PROGRA~2\CA\SC\CAM\bin;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\ORACLEXE\app\oracle\product\10.2.0\server\bin;C:\Tcl\bin;C:\Windows\SysWOW64\;C:\Windows\SysWOW64\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;D:\eclipse-jee-luna-SR2-win32-x86_64\eclipse;;.
Sep 12, 2017 12:52:55 PM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["http-nio-8080"]
Sep 12, 2017 12:52:55 PM org.apache.tomcat.util.net.NioSelectorPool getSharedSelector
INFO: Using a shared selector for servlet write/read
Sep 12, 2017 12:52:55 PM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["ajp-nio-8009"]
Sep 12, 2017 12:52:55 PM org.apache.tomcat.util.net.NioSelectorPool getSharedSelector
INFO: Using a shared selector for servlet write/read
Sep 12, 2017 12:52:55 PM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 1524 ms
Sep 12, 2017 12:52:55 PM org.apache.catalina.core.StandardService startInternal
INFO: Starting service Catalina
Sep 12, 2017 12:52:55 PM org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: Apache Tomcat/8.0.37
Sep 12, 2017 12:53:00 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.
Sep 12, 2017 12:53:00 PM org.apache.catalina.core.ApplicationContext log
INFO: Marking servlet dispatcher as unavailable
Sep 12, 2017 12:53:00 PM org.apache.catalina.core.StandardContext loadOnStartup
SEVERE: Servlet [dispatcher] in web application [/ShoppingDemo] threw load() exception
java.lang.ClassNotFoundException: org.springframework.web.servlet.DisptacherServlet
at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderB ase.java:1333)
at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderB ase.java:1167)
at org.apache.catalina.core.DefaultInstanceManager.loadClass(DefaultInstanceMana ger.java:518)
at org.apache.catalina.core.DefaultInstanceManager.loadClassMaybePrivileged(Defa ultInstanceManager.java:499)
at org.apache.catalina.core.DefaultInstanceManager.newInstance(DefaultInstanceMa nager.java:118)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:109 1)
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1027)
at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:5 038)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5 348)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:140 7)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:139 7)
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)
Sep 12, 2017 12:53:00 PM 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 at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderB ase.java:1333)
at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderB ase.java:1167) at org.apache.catalina.core.DefaultInstanceManager.loadClass(DefaultInstanceManager.java:518) at org.apache.catalina.core.DefaultInstanceManager.loadClassMaybePrivileged(DefaultInstanceManager.java:499)
at org.apache.catalina.core.DefaultInstanceManager.newInstance(DefaultInstanceMa nager.java:118)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4 775)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5 314)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1407) at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:130 9) 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)
Sep 12, 2017 12:53:00 PM org.apache.catalina.core.StandardContext listenerStart
SEVERE: Error configuring application listener of class org.springframework.web.context.RequestContextListener
java.lang.ClassNotFoundException: org.springframework.web.context.RequestContextListener
at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderB ase.java:1333)
at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderB ase.java:1167)
at org.apache.catalina.core.DefaultInstanceManager.loadClass(DefaultInstanceMana ger.java:518)
at org.apache.catalina.core.DefaultInstanceManager.loadClassMaybePrivileged(Defa ultInstanceManager.java:499)
at org.apache.catalina.core.DefaultInstanceManager.newInstance(DefaultInstanceMa nager.java:118)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4 775)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5 314)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1407)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1397)
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)
Sep 12, 2017 12:53:00 PM org.apache.catalina.core.StandardContext listenerStart
SEVERE: Skipped installing application listeners due to previous error(s)
Sep 12, 2017 12:53:00 PM org.apache.catalina.core.StandardContext startInternal
SEVERE: One or more listeners failed to start. Full details will be found in the appropriate container log file
Sep 12, 2017 12:53:00 PM org.apache.catalina.core.StandardContext startInternal
SEVERE: Context [/SpringWithRestCaseStudy] startup failed due to previous errors
Sep 12, 2017 12:53:01 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["http-nio-8080"]
Sep 12, 2017 12:53:01 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["ajp-nio-8009"]
Sep 12, 2017 12:53:01 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 5154 ms
Kindly someone help me to solve this issue.
And it would be more helpful if someone can provide a details of how to configure these 3 files.
Might this is solution.
The solution to this problem is very simple. Double click on your tomcat server. It will open the server configuration. Under server options check ‘Publish module contents to separate XML files’ checkbox. Restart your server. This time your page will come without any issues.
enter image description here
IN SPRING MVC
in spring mvc. i am unable to get required page,it is not showing error in console also, but it is giving 404 error in browser..
CONSOLE-->Aug 01, 2016 10:26:09 AM
org.apache.catalina.core.AprLifecycleListener init INFO: The APR based
Apache Tomcat Native library which allows optimal performance in
production environments was not found on the java.library.path:
C:\Program
Files\Java\jre1.8.0_101\bin;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;C:\ProgramData\Oracle\Java\javapath;C:\Program
Files\Dell\DW WLAN Card;;;C:\PROGRAM FILES (X86)\INTEL\ICLS
CLIENT\;C:\PROGRAM FILES\INTEL\ICLS
CLIENT\;C:\Windows\SYSTEM32;C:\Windows;C:\Windows\SYSTEM32\WBEM;C:\Windows\SYSTEM32\WINDOWSPOWERSHELL\V1.0\;C:\PROGRAM
FILES (X86)\INTEL\OPENCL SDK\2.0\BIN\X86;C:\PROGRAM FILES
(X86)\INTEL\OPENCL SDK\2.0\BIN\X64;C:\PROGRAM FILES\INTEL\INTEL(R)
MANAGEMENT ENGINE COMPONENTS\DAL;C:\PROGRAM FILES\INTEL\INTEL(R)
MANAGEMENT ENGINE COMPONENTS\IPT;C:\PROGRAM FILES (X86)\INTEL\INTEL(R)
MANAGEMENT ENGINE COMPONENTS\DAL;C:\PROGRAM FILES (X86)\INTEL\INTEL(R)
MANAGEMENT ENGINE COMPONENTS\IPT;C:\Program Files\WIDCOMM\Bluetooth
Software\;C:\Program Files\WIDCOMM\Bluetooth
Software\syswow64;C:\Program Files (x86)\Brackets\command;C:\Program
Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program
Files\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files
(x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files
(x86)\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files
(x86)\MySQL\MySQL Fabric 1.5 & MySQL Utilities 1.5\;C:\Program Files
(x86)\MySQL\MySQL Fabric 1.5 & MySQL Utilities 1.5\Doctrine extensions
for PHP\;C:\Program Files\Java\jdk1.8.0_101\bin;. Aug 01, 2016
10:26:09 AM org.apache.coyote.AbstractProtocol init INFO: Initializing
ProtocolHandler ["http-bio-8080"] Aug 01, 2016 10:26:09 AM
org.apache.coyote.AbstractProtocol init INFO: Initializing
ProtocolHandler ["ajp-bio-8009"] Aug 01, 2016 10:26:09 AM
org.apache.catalina.startup.Catalina load INFO: Initialization
processed in 838 ms Aug 01, 2016 10:26:09 AM
org.apache.catalina.core.StandardService startInternal INFO: Starting
service Catalina Aug 01, 2016 10:26:09 AM
org.apache.catalina.core.StandardEngine startInternal INFO: Starting
Servlet Engine: Apache Tomcat/7.0.47 Aug 01, 2016 10:26:10 AM
org.apache.catalina.startup.HostConfig deployDescriptor INFO:
Deploying configuration descriptor
D:\Springs\WORK_SPACE.metadata.plugins\org.eclipse.wst.server.core\tmp0\conf\Catalina\localhost\demoMVC.xml
Aug 01, 2016 10:26:10 AM
org.apache.catalina.startup.SetContextPropertiesRule begin WARNING:
[SetContextPropertiesRule]{Context} Setting property 'source' to
'org.eclipse.jst.j2ee.server:demoMVC' did not find a matching
property. Aug 01, 2016 10:26:11 AM
org.apache.catalina.core.ApplicationContext log INFO: No Spring
WebApplicationInitializer types detected on classpath Aug 01, 2016
10:26:12 AM org.apache.catalina.core.ApplicationContext log INFO:
Initializing Spring FrameworkServlet 'dispatcher' Aug 01, 2016
10:26:12 AM org.springframework.web.servlet.DispatcherServlet
initServletBean INFO: FrameworkServlet 'dispatcher': initialization
started Aug 01, 2016 10:26:12 AM
org.springframework.web.context.support.XmlWebApplicationContext
prepareRefresh INFO: Refreshing WebApplicationContext for namespace
'dispatcher-servlet': startup date [Mon Aug 01 10:26:12 IST 2016];
root of context hierarchy Aug 01, 2016 10:26:12 AM
org.springframework.beans.factory.xml.XmlBeanDefinitionReader
loadBeanDefinitions INFO: Loading XML bean definitions from
ServletContext resource [/WEB-INF/kool-servlet.xml] Aug 01, 2016
10:26:13 AM
org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter
initControllerAdviceCache INFO: Looking for #ControllerAdvice:
WebApplicationContext for namespace 'dispatcher-servlet': startup date
[Mon Aug 01 10:26:12 IST 2016]; root of context hierarchy Aug 01, 2016
10:26:13 AM
org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter
initControllerAdviceCache INFO: Looking for #ControllerAdvice:
WebApplicationContext for namespace 'dispatcher-servlet': startup date
[Mon Aug 01 10:26:12 IST 2016]; root of context hierarchy Aug 01, 2016
10:26:13 AM org.springframework.web.servlet.DispatcherServlet
initServletBean INFO: FrameworkServlet 'dispatcher': initialization
completed in 1599 ms Aug 01, 2016 10:26:13 AM
org.apache.coyote.AbstractProtocol start INFO: Starting
ProtocolHandler ["http-bio-8080"] Aug 01, 2016 10:26:13 AM
org.apache.coyote.AbstractProtocol start INFO: Starting
ProtocolHandler ["ajp-bio-8009"] Aug 01, 2016 10:26:13 AM
org.apache.catalina.startup.Catalina start INFO: Server startup in
4303 ms
index.jsp
<html>
<body>
<form action="add" method="post">
<input type="text" name="t1">
<input type="text" name="t2">
<input type="submit">
</form>
</body>
</html>
controller.java
package com.test;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
#Controller
public class addController {
#RequestMapping("/add")
#ResponseBody
public String add()
{
return "display.jsp";
}
}
web.xml
<?xml version="1.0" encoding="UTF-8"?>
<!-- webapp/WEB-INF/web.xml -->
<web-app xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
version="3.0">
<display-name>Archetype Created Web Application</display-name>
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
<servlet>
<servlet-name>dispatcher</servlet-name>
<servlet-class> org.springframework.web.servlet.DispatcherServlet</servlet-class>
<init-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/kool-servlet.xml</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>dispatcher</servlet-name>
<url-pattern>/</url-pattern>
</servlet-mapping>
</web-app>
test-servlet.xml
<beans xmlns="http://www.springframework.org/schema/beans"
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"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-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/context http://www.springframework.org/schema/context/spring-context-4.0.xsd">
<context:component-scan base-package="com.test" />
<mvc:annotation-driven />
</beans>
Looks like you are calling a page display.jsp which does not exists. change display.jsp to index.jsp in your controller and it should work, or change the view name index.jsp to display.jsp.
I am new to spring web services.I am doing an interceptor on the sage.xml (otherwse, known as spring-ws-servlet.xml) in my project by using eclipse.
Without the interceptors and it's handler. The web services work fine, but once added the interceptor the error was prompt.
I have no idea why it is prompting errors.I suspected the libraries problem. I can't figure it out can anyone help me with this?
The following is the error message.
Apr 30, 2014 2:27:47 PM org.apache.catalina.core.AprLifecycleListener init
INFO: Loaded APR based Apache Tomcat Native library 1.1.29 using APR version 1.4.8.
Apr 30, 2014 2:27:47 PM org.apache.catalina.core.AprLifecycleListener init
INFO: APR capabilities: IPv6 [true], sendfile [true], accept filters [false], random [true].
Apr 30, 2014 2:27:48 PM org.apache.catalina.core.AprLifecycleListener initializeSSL
INFO: OpenSSL successfully initialized (OpenSSL 1.0.1e 11 Feb 2013)
Apr 30, 2014 2:27:48 PM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["http-apr-8080"]
Apr 30, 2014 2:27:48 PM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["ajp-apr-8009"]
Apr 30, 2014 2:27:48 PM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 1173 ms
Apr 30, 2014 2:27:48 PM org.apache.catalina.core.StandardService startInternal
INFO: Starting service Catalina
Apr 30, 2014 2:27:48 PM org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: Apache Tomcat/7.0.52
Apr 30, 2014 2:27:48 PM org.apache.catalina.startup.HostConfig deployDescriptor
INFO: Deploying configuration descriptor C:\Java\apache-tomcat-7.0.52\conf\Catalina\localhost\task4.xml
Apr 30, 2014 2:27:51 PM org.springframework.web.context.ContextLoader initWebApplicationContext
INFO: Root WebApplicationContext: initialization started
Apr 30, 2014 2:27:51 PM org.springframework.context.support.AbstractApplicationContext prepareRefresh
INFO: Refreshing Root WebApplicationContext: startup date [Wed Apr 30 14:27:51 SGT 2014]; root of context hierarchy
Apr 30, 2014 2:27:51 PM org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions
INFO: Loading XML bean definitions from ServletContext resource [/WEB-INF/config/sage.xml]
Apr 30, 2014 2:27:51 PM org.springframework.context.annotation.ClassPathScanningCandidateComponentProvider registerDefaultFilters
INFO: JSR-250 'javax.annotation.ManagedBean' found and supported for component scanning
Apr 30, 2014 2:27:51 PM org.springframework.beans.factory.support.DefaultListableBeanFactory preInstantiateSingletons
INFO: Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory#1655d7e: defining beans [govUserEndpoint,govUserInterfaceImplementation,org.springframework.context.annotation.internalConfigurationAnnotationProcessor,org.springframework.context.annotation.internalAutowiredAnnotationProcessor,org.springframework.context.annotation.internalRequiredAnnotationProcessor,org.springframework.context.annotation.internalCommonAnnotationProcessor,final,org.springframework.ws.soap.server.endpoint.interceptor.DelegatingSmartSoapEndpointInterceptor#0,org.springframework.ws.soap.server.endpoint.interceptor.DelegatingSmartSoapEndpointInterceptor#1,callbackHandler,org.springframework.context.annotation.ConfigurationClassPostProcessor$ImportAwareBeanPostProcessor#0]; root of factory hierarchy
Apr 30, 2014 2:27:52 PM org.springframework.beans.factory.support.DefaultSingletonBeanRegistry destroySingletons
INFO: Destroying singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory#1655d7e: defining beans [govUserEndpoint,govUserInterfaceImplementation,org.springframework.context.annotation.internalConfigurationAnnotationProcessor,org.springframework.context.annotation.internalAutowiredAnnotationProcessor,org.springframework.context.annotation.internalRequiredAnnotationProcessor,org.springframework.context.annotation.internalCommonAnnotationProcessor,final,org.springframework.ws.soap.server.endpoint.interceptor.DelegatingSmartSoapEndpointInterceptor#0,org.springframework.ws.soap.server.endpoint.interceptor.DelegatingSmartSoapEndpointInterceptor#1,callbackHandler,org.springframework.context.annotation.ConfigurationClassPostProcessor$ImportAwareBeanPostProcessor#0]; root of factory hierarchy
Apr 30, 2014 2:27:52 PM org.springframework.web.context.ContextLoader initWebApplicationContext
SEVERE: Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.ws.soap.server.endpoint.interceptor.DelegatingSmartSoapEndpointInterceptor#1': Cannot create inner bean 'wss4jSecurityInterceptor' of type [org.springframework.ws.soap.security.wss4j.Wss4jSecurityInterceptor] while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'wss4jSecurityInterceptor' defined in ServletContext resource [/WEB-INF/config/sage.xml]: Invocation of init method failed; nested exception is java.lang.NoClassDefFoundError: org/apache/xml/security/Init
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveInnerBean(BeanDefinitionValueResolver.java:281)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:120)
at org.springframework.beans.factory.support.ConstructorResolver.resolveConstructorArguments(ConstructorResolver.java:616)
at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:148)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1035)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:939)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:485)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:294)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:225)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:291)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:585)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:913)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:464)
at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:276)
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:197)
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:47)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4973)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5467)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:632)
at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:670)
at org.apache.catalina.startup.HostConfig$DeployDescriptor.run(HostConfig.java:1839)
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
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: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'wss4jSecurityInterceptor' defined in ServletContext resource [/WEB-INF/config/sage.xml]: Invocation of init method failed; nested exception is java.lang.NoClassDefFoundError: org/apache/xml/security/Init
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1455)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveInnerBean(BeanDefinitionValueResolver.java:270)
... 30 more
Caused by: java.lang.NoClassDefFoundError: org/apache/xml/security/Init
at org.apache.ws.security.WSSConfig.setXmlSecIgnoreLineBreak(WSSConfig.java:400)
at org.apache.ws.security.WSSConfig.init(WSSConfig.java:420)
at org.apache.ws.security.WSSConfig.getNewInstance(WSSConfig.java:455)
at org.apache.ws.security.WSSecurityEngine.getWssConfig(WSSecurityEngine.java:142)
at org.springframework.ws.soap.security.wss4j.Wss4jSecurityInterceptor.afterPropertiesSet(Wss4jSecurityInterceptor.java:496)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1514)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1452)
... 33 more
Caused by: java.lang.ClassNotFoundException: org.apache.xml.security.Init
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1718)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1569)
... 40 more
Apr 30, 2014 2:27:52 PM org.apache.catalina.core.StandardContext startInternal
SEVERE: Error listenerStart
Apr 30, 2014 2:27:52 PM org.apache.catalina.core.StandardContext startInternal
SEVERE: Context [/task4] startup failed due to previous errors
Apr 30, 2014 2:27:52 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory C:\Java\apache-tomcat-7.0.52\webapps\docs
Apr 30, 2014 2:27:52 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory C:\Java\apache-tomcat-7.0.52\webapps\examples
Apr 30, 2014 2:27:54 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory C:\Java\apache-tomcat-7.0.52\webapps\host-manager
Apr 30, 2014 2:27:55 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory C:\Java\apache-tomcat-7.0.52\webapps\manager
Apr 30, 2014 2:27:56 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory C:\Java\apache-tomcat-7.0.52\webapps\ROOT
Apr 30, 2014 2:27:56 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["http-apr-8080"]
Apr 30, 2014 2:27:56 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["ajp-apr-8009"]
Apr 30, 2014 2:27:56 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 8494 ms
Apr 30, 2014 2:39:57 PM org.apache.coyote.AbstractProtocol pause
INFO: Pausing ProtocolHandler ["http-apr-8080"]
Apr 30, 2014 2:39:57 PM org.apache.coyote.AbstractProtocol pause
INFO: Pausing ProtocolHandler ["ajp-apr-8009"]
Apr 30, 2014 2:39:57 PM org.apache.catalina.core.StandardService stopInternal
INFO: Stopping service Catalina
Apr 30, 2014 2:39:57 PM org.apache.coyote.AbstractProtocol stop
INFO: Stopping ProtocolHandler ["http-apr-8080"]
Apr 30, 2014 2:39:57 PM org.apache.coyote.AbstractProtocol stop
INFO: Stopping ProtocolHandler ["ajp-apr-8009"]
Apr 30, 2014 2:39:57 PM org.apache.coyote.AbstractProtocol destroy
INFO: Destroying ProtocolHandler ["http-apr-8080"]
Apr 30, 2014 2:39:57 PM org.apache.coyote.AbstractProtocol destroy
INFO: Destroying ProtocolHandler ["ajp-apr-8009"]
The libraries I have are,
aopalliance-1.0.jar
commons-collections-3.2.jar
commons-lang-2.5.jar
commons-logging-1.1.1.jar
spring-aop-3.1.1.RELEASE.jar
spring-asm-3.1.1.RELEASE.jar
spring-aspects-3.1.1.RELEASE.jar
spring-beans-3.1.1.RELEASE.jar
spring-context-3.1.1.RELEASE.jar
spring-context-support-3.1.1.RELEASE.jar
spring-core-3.1.1.RELEASE.jar
spring-expression-3.1.1.RELEASE.jar
spring-oxm-3.1.1.RELEASE.jar
spring-web-3.0.5.RELEASE.jar
spring-webmvc-3.0.5.RELEASE.jar
spring-ws-core-2.0.0.RELEASE.jar
spring-ws-security-2.1.4.RELEASE .jar
spring-xml-2.0.0.RELEASE.jar
stax-api-1.0-2.jar
wsdl4j-1.6.1.jar
wss4j-1.6.13.jar
XmlSchema-1.4.3.jar
My web.xml
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
id="WebApp_ID"
version="2.5">
<!--
Spring-ws-configuraion file.
-->
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>
/WEB-INF/config/sage.xml
</param-value>
</context-param>
<!--
Loads the Spring web application context, using the files defined above.
-->
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<!--
Define the Spring WS Servlet. The 'transformWsldLocations' param means
that any WSDLs generated are context-aware and contain the correct
path to their exposed port types. The 'contextConfigLocation' param
with an empty value means that the Spring context won't try to load
a file called webservices-servlet.xml
-->
<servlet>
<servlet-name>webservices</servlet-name>
<servlet-class>org.springframework.ws.transport.http.MessageDispatcherServlet</servlet-class>
<init-param>
<param-name>transformWsdlLocations</param-name>
<param-value>true</param-value>
</init-param>
<init-param>
<param-name>contextConfigLocation</param-name>
<param-value></param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>webservices</servlet-name>
<url-pattern>*.wsdl</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>webservices</servlet-name>
<url-pattern>/endpoints/*</url-pattern>
</servlet-mapping>
</web-app>
My sage.xml (spring-ws-servlet.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:sws="http://www.springframework.org/schema/web-services"
xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/web-services
http://www.springframework.org/schema/web-services/web-services-2.0.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-3.0.xsd ">
<!-- Here point to your interface and implementation package -->
<context:component-scan base-package="org.example.service" />
<!-- Here is the name for the web address -->
<bean id="final"
class="org.springframework.ws.wsdl.wsdl11.DefaultWsdl11Definition"
lazy-init="true">
<property name="schemaCollection">
<bean
class="org.springframework.xml.xsd.commons.CommonsXsdSchemaCollection">
<property name="inline" value="true" />
<property name="xsds">
<list>
<!-- Here point to schemas folder of the operation service XSD!! -->
<value>schema/GovUserOperationService.xsd</value>
</list>
</property>
</bean>
</property>
<property name="portTypeName" value="GovUserServices" />
<property name="serviceName" value="GovUserService" />
<property name="locationUri" value="/endpoints" />
</bean>
<sws:interceptors>
<bean
class="org.springframework.ws.soap.server.endpoint.interceptor.SoapEnvelopeLoggingInterceptor" />
<bean id="wss4jSecurityInterceptor"
class="org.springframework.ws.soap.security.wss4j.Wss4jSecurityInterceptor">
<property name="validationCallbackHandler" ref="callbackHandler" />
<property name="validationActions" value="UsernameToken" />
</bean>
</sws:interceptors>
<bean id="callbackHandler"
class="org.springframework.ws.soap.security.wss4j.callback.SimplePasswordValidationCallbackHandler">
<property name="users">
<props>
<prop key="admin">password</prop>
</props>
</property>
</bean>
</beans>
I'm trying to create a struts2 application which uses Spring3 for the DI and hibernate4 to handle the persistence.
I'm stock on the following error when i start the server Tomcat7 and don't know how to proceed:
juin 23, 2013 2:13:15 PM org.apache.catalina.core.AprLifecycleListener init
INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: C:\Program Files\Java\jre7\bin;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;C:\Program Files (x86)\PC Connectivity Solution\;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files\Dell\DW WLAN Card;;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\Dell\Dell Data Protection\Access\Advanced\Wave\Gemalto\Access Client\v5\;C:\Program Files (x86)\NTRU Cryptosystems\NTRU TCG Software Stack\bin\;C:\Program Files\NTRU Cryptosystems\NTRU TCG Software Stack\bin\;E:\Subversion\bin;C:\Program Files\Broadcom\Broadcom 802.11 Network Adapter\Driver;E:\Program Files (x86)\QuickTime\QTSystem\;E:\Program Files (x86)\Cracklock\Bin;.
juin 23, 2013 2:13:15 PM org.apache.tomcat.util.digester.SetPropertiesRule begin
WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.j2ee.server:IPS_ada' did not find a matching property.
juin 23, 2013 2:13:15 PM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["http-bio-8080"]
juin 23, 2013 2:13:15 PM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["ajp-bio-8009"]
juin 23, 2013 2:13:15 PM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 1063 ms
juin 23, 2013 2:13:15 PM org.apache.catalina.core.StandardService startInternal
INFO: Démarrage du service Catalina
juin 23, 2013 2:13:15 PM org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: Apache Tomcat/7.0.37
juin 23, 2013 2:13:16 PM org.apache.catalina.util.SessionIdGenerator createSecureRandom
INFO: Creation of SecureRandom instance for session ID generation using [SHA1PRNG] took [176] milliseconds.
juin 23, 2013 2:13:17 PM org.apache.catalina.loader.WebappClassLoader validateJarFile
INFO: validateJarFile(E:\Stage PFE ADA\Outils\ADA eclipse-jee-juno-SR2-win32-x86_64\eclipse\workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\IPS_ada\WEB-INF\lib\javax.el_2.2.0.v201108011116.jar) - jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class: javax/el/Expression.class
juin 23, 2013 2:13:17 PM org.apache.catalina.loader.WebappClassLoader validateJarFile
INFO: validateJarFile(E:\Stage PFE ADA\Outils\ADA eclipse-jee-juno-SR2-win32-x86_64\eclipse\workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\IPS_ada\WEB-INF\lib\javax.servlet_3.0.0.v201112011016.jar) - jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class: javax/servlet/Servlet.class
juin 23, 2013 2:13:59 PM org.apache.catalina.core.ApplicationContext log
INFO: No Spring WebApplicationInitializer types detected on classpath
juin 23, 2013 2:14:01 PM org.apache.catalina.core.ApplicationContext log
INFO: Initializing Spring root WebApplicationContext
14:14:01,375 INFO [localhost-startStop-1] ContextLoader:272 - Root WebApplicationContext: initialization started
14:14:01,690 INFO [localhost-startStop-1] XmlWebApplicationContext:503 - Refreshing Root WebApplicationContext: startup date [Sun Jun 23 14:14:01 WEST 2013]; root of context hierarchy
14:14:01,882 INFO [localhost-startStop-1] XmlBeanDefinitionReader:315 - Loading XML bean definitions from ServletContext resource [/WEB-INF/SpringBeans.xml]
14:14:04,431 INFO [localhost-startStop-1] PropertyPlaceholderConfigurer:177 - Loading properties file from ServletContext resource [/WEB-INF/database/hibernate.properties]
14:14:04,494 INFO [localhost-startStop-1] DefaultListableBeanFactory:577 - Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory#3b1b8c1b: defining beans [org.springframework.beans.factory.config.PropertyPlaceholderConfigurer#0,dataSource,sessionFactory,baftierDAO,action]; root of factory hierarchy
14:14:04,523 INFO [localhost-startStop-1] DriverManagerDataSource:153 - Loaded JDBC driver: com.mysql.jdbc.Driver
14:14:04,938 INFO [localhost-startStop-1] Version:37 - HCANN000001: Hibernate Commons Annotations {4.0.1.Final}
14:14:04,948 INFO [localhost-startStop-1] Version:41 - HHH000412: Hibernate Core {4.2.0.Final}
14:14:04,954 INFO [localhost-startStop-1] Environment:224 - HHH000205: Loaded properties from resource hibernate.properties: {hibernate.connection.driver_class=org.h2.Driver, hibernate.dialect=org.hibernate.dialect.H2Dialect, hibernate.max_fetch_depth=5, hibernate.format_sql=true, hibernate.generate_statistics=true, hibernate.connection.username=sa, hibernate.connection.url=jdbc:h2:mem:db1;DB_CLOSE_DELAY=-1;MVCC=TRUE, hibernate.bytecode.use_reflection_optimizer=false, hibernate.jdbc.batch_versioned_data=true, hibernate.connection.pool_size=5}
14:14:04,955 INFO [localhost-startStop-1] Environment:342 - HHH000021: Bytecode provider name : javassist
14:14:05,086 WARN [localhost-startStop-1] DTDEntityResolver:74 - HHH000223: Recognized obsolete hibernate namespace http://hibernate.sourceforge.net/. Use namespace http://www.hibernate.org/dtd/ instead. Refer to Hibernate 3.6 Migration Guide!
14:14:05,166 WARN [localhost-startStop-1] DTDEntityResolver:74 - HHH000223: Recognized obsolete hibernate namespace http://hibernate.sourceforge.net/. Use namespace http://www.hibernate.org/dtd/ instead. Refer to Hibernate 3.6 Migration Guide!
14:14:05,207 WARN [localhost-startStop-1] DTDEntityResolver:74 - HHH000223: Recognized obsolete hibernate namespace http://hibernate.sourceforge.net/. Use namespace http://www.hibernate.org/dtd/ instead. Refer to Hibernate 3.6 Migration Guide!
14:14:05,244 WARN [localhost-startStop-1] DTDEntityResolver:74 - HHH000223: Recognized obsolete hibernate namespace http://hibernate.sourceforge.net/. Use namespace http://www.hibernate.org/dtd/ instead. Refer to Hibernate 3.6 Migration Guide!
14:14:05,288 WARN [localhost-startStop-1] DTDEntityResolver:74 - HHH000223: Recognized obsolete hibernate namespace http://hibernate.sourceforge.net/. Use namespace http://www.hibernate.org/dtd/ instead. Refer to Hibernate 3.6 Migration Guide!
14:14:05,336 WARN [localhost-startStop-1] DTDEntityResolver:74 - HHH000223: Recognized obsolete hibernate namespace http://hibernate.sourceforge.net/. Use namespace http://www.hibernate.org/dtd/ instead. Refer to Hibernate 3.6 Migration Guide!
14:14:05,387 WARN [localhost-startStop-1] DTDEntityResolver:74 - HHH000223: Recognized obsolete hibernate namespace http://hibernate.sourceforge.net/. Use namespace http://www.hibernate.org/dtd/ instead. Refer to Hibernate 3.6 Migration Guide!
14:14:05,450 WARN [localhost-startStop-1] DTDEntityResolver:74 - HHH000223: Recognized obsolete hibernate namespace http://hibernate.sourceforge.net/. Use namespace http://www.hibernate.org/dtd/ instead. Refer to Hibernate 3.6 Migration Guide!
14:14:05,498 WARN [localhost-startStop-1] DTDEntityResolver:74 - HHH000223: Recognized obsolete hibernate namespace http://hibernate.sourceforge.net/. Use namespace http://www.hibernate.org/dtd/ instead. Refer to Hibernate 3.6 Migration Guide!
14:14:05,547 WARN [localhost-startStop-1] DTDEntityResolver:74 - HHH000223: Recognized obsolete hibernate namespace http://hibernate.sourceforge.net/. Use namespace http://www.hibernate.org/dtd/ instead. Refer to Hibernate 3.6 Migration Guide!
14:14:05,585 WARN [localhost-startStop-1] DTDEntityResolver:74 - HHH000223: Recognized obsolete hibernate namespace http://hibernate.sourceforge.net/. Use namespace http://www.hibernate.org/dtd/ instead. Refer to Hibernate 3.6 Migration Guide!
14:14:05,626 WARN [localhost-startStop-1] DTDEntityResolver:74 - HHH000223: Recognized obsolete hibernate namespace http://hibernate.sourceforge.net/. Use namespace http://www.hibernate.org/dtd/ instead. Refer to Hibernate 3.6 Migration Guide!
14:14:05,666 WARN [localhost-startStop-1] DTDEntityResolver:74 - HHH000223: Recognized obsolete hibernate namespace http://hibernate.sourceforge.net/. Use namespace http://www.hibernate.org/dtd/ instead. Refer to Hibernate 3.6 Migration Guide!
14:14:05,700 WARN [localhost-startStop-1] DTDEntityResolver:74 - HHH000223: Recognized obsolete hibernate namespace http://hibernate.sourceforge.net/. Use namespace http://www.hibernate.org/dtd/ instead. Refer to Hibernate 3.6 Migration Guide!
14:14:06,120 WARN [localhost-startStop-1] JdbcServicesImpl:169 - HHH000342: Could not obtain connection to query metadata : Access denied for user 'sa'#'localhost' (using password: NO)
14:14:06,130 INFO [localhost-startStop-1] Dialect:128 - HHH000400: Using dialect: org.hibernate.dialect.MySQLDialect
14:14:06,143 INFO [localhost-startStop-1] LobCreatorBuilder:85 - HHH000422: Disabling contextual LOB creation as connection was null
14:14:06,159 INFO [localhost-startStop-1] TransactionFactoryInitiator:68 - HHH000399: Using default transaction strategy (direct JDBC transactions)
14:14:06,166 INFO [localhost-startStop-1] ASTQueryTranslatorFactory:48 - HHH000397: Using ASTQueryTranslatorFactory
14:14:06,672 INFO [localhost-startStop-1] SchemaExport:343 - HHH000227: Running hbm2ddl schema export
14:14:06,679 ERROR [localhost-startStop-1] SchemaExport:385 - HHH000231: Schema export unsuccessful
java.sql.SQLException: Access denied for user 'sa'#'localhost' (using password: NO)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1078)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4120)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4052)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:925)
at com.mysql.jdbc.MysqlIO.proceedHandshakeWithPluggableAuthentication(MysqlIO.java:1704)
at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:1250)
at com.mysql.jdbc.ConnectionImpl.coreConnect(ConnectionImpl.java:2483)
at com.mysql.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:2516)
at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2301)
at com.mysql.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:834)
at com.mysql.jdbc.JDBC4Connection.<init>(JDBC4Connection.java:47)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at com.mysql.jdbc.Util.handleNewInstance(Util.java:411)
at com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:416)
at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:317)
at java.sql.DriverManager.getConnection(Unknown Source)
at java.sql.DriverManager.getConnection(Unknown Source)
at org.springframework.jdbc.datasource.DriverManagerDataSource.getConnectionFromDriverManager(DriverManagerDataSource.java:173)
at org.springframework.jdbc.datasource.DriverManagerDataSource.getConnectionFromDriver(DriverManagerDataSource.java:164)
at org.springframework.jdbc.datasource.AbstractDriverBasedDataSource.getConnectionFromDriver(AbstractDriverBasedDataSource.java:153)
at org.springframework.jdbc.datasource.AbstractDriverBasedDataSource.getConnection(AbstractDriverBasedDataSource.java:128)
at org.hibernate.service.jdbc.connections.internal.DatasourceConnectionProviderImpl.getConnection(DatasourceConnectionProviderImpl.java:141)
at org.hibernate.tool.hbm2ddl.SuppliedConnectionProviderConnectionHelper.prepare(SuppliedConnectionProviderConnectionHelper.java:51)
at org.hibernate.tool.hbm2ddl.DatabaseExporter.<init>(DatabaseExporter.java:52)
at org.hibernate.tool.hbm2ddl.SchemaExport.execute(SchemaExport.java:367)
at org.hibernate.tool.hbm2ddl.SchemaExport.create(SchemaExport.java:304)
at org.hibernate.tool.hbm2ddl.SchemaExport.create(SchemaExport.java:293)
at org.hibernate.internal.SessionFactoryImpl.<init>(SessionFactoryImpl.java:500)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1750)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1788)
at org.springframework.orm.hibernate4.LocalSessionFactoryBuilder.buildSessionFactory(LocalSessionFactoryBuilder.java:251)
at org.springframework.orm.hibernate4.LocalSessionFactoryBean.buildSessionFactory(LocalSessionFactoryBean.java:372)
at org.springframework.orm.hibernate4.LocalSessionFactoryBean.afterPropertiesSet(LocalSessionFactoryBean.java:357)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1514)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1452)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:294)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:225)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:291)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:589)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:925)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:472)
at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:388)
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:293)
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:111)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4797)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5291)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549)
at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
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)
14:14:06,681 INFO [localhost-startStop-1] SchemaExport:405 - HHH000230: Schema export complete
14:14:06,893 INFO [localhost-startStop-1] DefaultListableBeanFactory:434 - Destroying singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory#3b1b8c1b: defining beans [org.springframework.beans.factory.config.PropertyPlaceholderConfigurer#0,dataSource,sessionFactory,baftierDAO,action]; root of factory hierarchy
14:14:06,894 ERROR [localhost-startStop-1] ContextLoader:318 - Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'action' defined in ServletContext resource [/WEB-INF/SpringBeans.xml]: Error setting property values; nested exception is org.springframework.beans.NotWritablePropertyException: Invalid property 'baftierDAO' of bean class [ma.ada.presta.actions.Action]: Bean property 'baftierDAO' is not writable or has an invalid setter method. Does the parameter type of the setter match the return type of the getter?
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1396)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1118)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:517)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:294)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:225)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:291)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:607)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:925)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:472)
at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:388)
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:293)
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:111)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4797)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5291)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549)
at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
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: org.springframework.beans.NotWritablePropertyException: Invalid property 'baftierDAO' of bean class [ma.ada.presta.actions.Action]: Bean property 'baftierDAO' is not writable or has an invalid setter method. Does the parameter type of the setter match the return type of the getter?
at org.springframework.beans.BeanWrapperImpl.setPropertyValue(BeanWrapperImpl.java:1064)
at org.springframework.beans.BeanWrapperImpl.setPropertyValue(BeanWrapperImpl.java:924)
at org.springframework.beans.AbstractPropertyAccessor.setPropertyValues(AbstractPropertyAccessor.java:76)
at org.springframework.beans.AbstractPropertyAccessor.setPropertyValues(AbstractPropertyAccessor.java:58)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1393)
... 23 more
juin 23, 2013 2:14:06 PM org.apache.catalina.core.StandardContext listenerStart
SEVERE: Exception lors de l'envoi de l'évènement contexte initialisé (context initialized) à l'instance de classe d'écoute (listener) org.springframework.web.context.ContextLoaderListener
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'action' defined in ServletContext resource [/WEB-INF/SpringBeans.xml]: Error setting property values; nested exception is org.springframework.beans.NotWritablePropertyException: Invalid property 'baftierDAO' of bean class [ma.ada.presta.actions.Action]: Bean property 'baftierDAO' is not writable or has an invalid setter method. Does the parameter type of the setter match the return type of the getter?
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1396)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1118)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:517)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:294)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:225)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:291)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:607)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:925)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:472)
at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:388)
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:293)
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:111)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4797)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5291)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549)
at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
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: org.springframework.beans.NotWritablePropertyException: Invalid property 'baftierDAO' of bean class [ma.ada.presta.actions.Action]: Bean property 'baftierDAO' is not writable or has an invalid setter method. Does the parameter type of the setter match the return type of the getter?
at org.springframework.beans.BeanWrapperImpl.setPropertyValue(BeanWrapperImpl.java:1064)
at org.springframework.beans.BeanWrapperImpl.setPropertyValue(BeanWrapperImpl.java:924)
at org.springframework.beans.AbstractPropertyAccessor.setPropertyValues(AbstractPropertyAccessor.java:76)
at org.springframework.beans.AbstractPropertyAccessor.setPropertyValues(AbstractPropertyAccessor.java:58)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1393)
... 23 more
juin 23, 2013 2:14:06 PM org.apache.catalina.core.StandardContext startInternal
SEVERE: Error listenerStart
juin 23, 2013 2:14:06 PM org.apache.catalina.core.StandardContext startInternal
SEVERE: Erreur de démarrage du contexte [/IPS_ada] suite aux erreurs précédentes
juin 23, 2013 2:14:06 PM org.apache.catalina.core.ApplicationContext log
INFO: Closing Spring root WebApplicationContext
juin 23, 2013 2:14:07 PM org.apache.catalina.loader.WebappClassLoader clearReferencesJdbc
SEVERE: The web application [/IPS_ada] registered the JDBC driver [com.mysql.jdbc.Driver] but failed to unregister it when the web application was stopped. To prevent a memory leak, the JDBC Driver has been forcibly unregistered.
juin 23, 2013 2:14:07 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["http-bio-8080"]
juin 23, 2013 2:14:07 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["ajp-bio-8009"]
juin 23, 2013 2:14:07 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 51577 ms
My applicationContexte.xml
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.2.xsd">
<bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="location">
<value>/WEB-INF/database/hibernate.properties</value>
</property>
</bean>
<bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource">
<property name="username" value="${jdbc.username}" />
<property name="password" value="${jdbc.password}" />
<property name="driverClassName" value="${jdbc.driverClassName}" />
<property name="url" value="${jdbc.url}" />
</bean>
<bean id="sessionFactory" class="org.springframework.orm.hibernate4.LocalSessionFactoryBean">
<property name="dataSource"><ref bean="dataSource"/></property>
<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="mappingResources">
<list>
<value>/ma/ada/presta/model/hbm/Baftier.hbm.xml</value>
</list>
</property>
</bean>
<!--<bean id="transactionManager" class="org.springframework.orm.hibernate4.HibernateTransactionManager" >
<property name="sessionFactory" ref="sessionFactory" />
</bean>-->
<bean id="baftierDAO" class="ma.ada.presta.DAO.BaftierDAO" >
<property name="sessionFactory" ref="sessionFactory" />
</bean>
<bean id="action" class="ma.ada.presta.actions.Action">
<property name="baftierDAO" ref="baftierDAO" />
</bean>
</beans>
My hibernate.properties is :
jdbc.driverClassName=com.mysql.jdbc.Driver
jdbc.url=jdbc:mysql://localhost:3306/base
jdbc.username=root
jdbc.password=root
My web.xml
<?xml version="1.0" encoding="UTF-8"?>
<web-app id="WebApp_9" version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
<display-name>ada_ips</display-name>
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/applicationContexte.xml</param-value>
</context-param>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<filter>
<filter-name>openSessionInViewFilter</filter-name>
<filter-class>org.springframework.orm.hibernate4.support.OpenSessionInViewFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>openSessionInViewFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<filter>
<filter-name>struts2</filter-name>
<filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>struts2</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<welcome-file-list>
<welcome-file>/view/index.jsp</welcome-file>
</welcome-file-list>
</web-app>
I need your help
try to add the following code in hibernate property
<property name="hibernateProperties">
<props>
<prop key="hibernate.dialect">org.hibernate.dialect.MySQLDialect</prop>
<prop key="hibernate.show_sql">true</prop>
<prop key="hibernate.connection.username">root</prop>
<prop key="hibernate.connection.password">root</prop>
<prop key="hibernate.hbm2ddl.auto">create</prop>
</props>
</property>
I have found similar questions on StackOverflow, but not quite the same as mine:
I've configured a Spring bean 'ontologyClient' that is a POJO that I have imported from a library which is added to my Maven dependencies. I have checked and double checked that the produced WAR file contains the org.erasmusmc.ontology.OntologyClient class. However, when Spring wants to instantiate the bean, Tomcat's classloader throws a ClassNotFoundException. I am out of ideas, hopefully somebody can help me out!
applicationContext.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:aop="http://www.springframework.org/schema/aop"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:jee="http://www.springframework.org/schema/jee"
xmlns:tx="http://www.springframework.org/schema/tx"
xmlns:p="http://www.springframework.org/schema/p"
xmlns:task="http://www.springframework.org/schema/task"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.1.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.1.xsd
http://www.springframework.org/schema/jee http://www.springframework.org/schema/jee/spring-jee-3.1.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.1.xsd
http://www.springframework.org/schema/task http://www.springframework.org/schema/task/spring-task-3.1.xsd">
<context:component-scan base-package="nl.lumc.conceptrecognizer" />
<context:component-scan base-package="org.nbic.interop.conceptlinker.service.impl" />
<bean class="org.springframework.remoting.jaxws.SimpleJaxWsServiceExporter">
<property name="baseAddress" value="http://localhost:8080/" />
</bean>
<bean id="ontologyClient" class="org.erasmusmc.ontology.OntologyClient">
<constructor-arg index="0" value="localhost" />
<constructor-arg index="1" value="abcde"/>
<constructor-arg index="2" value="abcde" />
<constructor-arg index="3" value="Anni2_1_june2009" />
</bean>
<bean id="conceptRecognizerService"
class="nl.lumc.conceptrecognizer.services.ConceptRecognizerService"
p:ontologyClient-ref="ontologyClient"
/>
</beans>
Tomcat log:
Using CATALINA_BASE: /usr/local/apache-tomcat-7.0.22
Using CATALINA_HOME: /usr/local/apache-tomcat-7.0.22
Using CATALINA_TMPDIR: /usr/local/apache-tomcat-7.0.22/temp
Using JRE_HOME: /usr/java/jdk1.7.0
Using CLASSPATH: /usr/local/apache-tomcat-7.0.22/bin/bootstrap.jar:/usr/local/apache-tomcat-7.0.22/bin/tomcat-juli.jar
feb 20, 2012 7:56:13 PM org.apache.catalina.core.AprLifecycleListener init
INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: /usr/java/packages/lib/amd64:/usr/lib64:/lib64:/lib:/usr/lib
feb 20, 2012 7:56:13 PM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["http-bio-7080"]
feb 20, 2012 7:56:13 PM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["ajp-bio-8009"]
feb 20, 2012 7:56:13 PM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 673 ms
feb 20, 2012 7:56:14 PM org.apache.catalina.core.StandardService startInternal
INFO: Starting service Catalina
feb 20, 2012 7:56:14 PM org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: Apache Tomcat/7.0.22
feb 20, 2012 7:56:14 PM org.apache.catalina.startup.HostConfig deployDescriptor
INFO: Deploying configuration descriptor ROOT.xml from /usr/local/apache-tomcat-7.0.22/conf/Catalina/localhost
feb 20, 2012 7:56:14 PM org.springframework.web.context.ContextLoader initWebApplicationContext
INFO: Root WebApplicationContext: initialization started
feb 20, 2012 7:56:14 PM org.springframework.context.support.AbstractApplicationContext prepareRefresh
INFO: Refreshing Root WebApplicationContext: startup date [Mon Feb 20 19:56:14 CET 2012]; root of context hierarchy
feb 20, 2012 7:56:14 PM org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions
INFO: Loading XML bean definitions from ServletContext resource [/WEB-INF/applicationContext.xml]
feb 20, 2012 7:56:15 PM org.springframework.beans.factory.support.DefaultListableBeanFactory preInstantiateSingletons
INFO: Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory#7b6d63d5: defining beans [org.springframework.context.annotation.internalConfigurationAnnotationProcessor,org.springframework.context.annotation.internalAutowiredAnnotationProcessor,org.springframework.context.annotation.internalRequiredAnnotationProcessor,org.springframework.context.annotation.internalCommonAnnotationProcessor,ontologyClient,groundhogManager,conceptProfilesGroundhog,org.springframework.context.annotation.ConfigurationClassPostProcessor$ImportAwareBeanPostProcessor#0]; root of factory hierarchy
feb 20, 2012 7:56:15 PM org.springframework.beans.factory.support.DefaultSingletonBeanRegistry destroySingletons
INFO: Destroying singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory#7b6d63d5: defining beans [org.springframework.context.annotation.internalConfigurationAnnotationProcessor,org.springframework.context.annotation.internalAutowiredAnnotationProcessor,org.springframework.context.annotation.internalRequiredAnnotationProcessor,org.springframework.context.annotation.internalCommonAnnotationProcessor,ontologyClient,groundhogManager,conceptProfilesGroundhog,org.springframework.context.annotation.ConfigurationClassPostProcessor$ImportAwareBeanPostProcessor#0]; root of factory hierarchy
feb 20, 2012 7:56:15 PM org.springframework.web.context.ContextLoader initWebApplicationContext
SEVERE: Context initialization failed
org.springframework.beans.factory.CannotLoadBeanClassException: Cannot find class [org.erasmusmc.ontology.OntologyClient] for bean with name 'ontologyClient' defined in ServletContext resource [/WEB-INF/applicationContext.xml]; nested exception is java.lang.ClassNotFoundException: org.erasmusmc.ontology.OntologyClient
at org.springframework.beans.factory.support.AbstractBeanFactory.resolveBeanClass(AbstractBeanFactory.java:1262)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.predictBeanType(AbstractAutowireCapableBeanFactory.java:576)
at org.springframework.beans.factory.support.AbstractBeanFactory.isFactoryBean(AbstractBeanFactory.java:1331)
at org.springframework.beans.factory.support.AbstractBeanFactory.isFactoryBean(AbstractBeanFactory.java:897)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:566)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:913)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:464)
at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:384)
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:283)
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:111)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4723)
at org.apache.catalina.core.StandardContext$1.call(StandardContext.java:5226)
at org.apache.catalina.core.StandardContext$1.call(StandardContext.java:5221)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
at java.util.concurrent.FutureTask.run(FutureTask.java:166)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
at java.lang.Thread.run(Thread.java:722)
Caused by: java.lang.ClassNotFoundException: org.erasmusmc.ontology.OntologyClient
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1678)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1523)
at org.springframework.util.ClassUtils.forName(ClassUtils.java:257)
at org.springframework.beans.factory.support.AbstractBeanDefinition.resolveBeanClass(AbstractBeanDefinition.java:417)
at org.springframework.beans.factory.support.AbstractBeanFactory.doResolveBeanClass(AbstractBeanFactory.java:1283)
at org.springframework.beans.factory.support.AbstractBeanFactory.resolveBeanClass(AbstractBeanFactory.java:1254)
... 17 more
One thing to note is that the ontology dependency is a locally installed Maven artifact. However I don't see how this could be the cause, because the required Jar file is copied to WEB-INF/lib like it should.
UPDATE: It turns out that Tomcat was launching the wrong codebase. I had renamed my webapp because I started a new branch, but context.xml still pointed to the old context.
This is maybe a stupid answer, but did you remove the unzipped war before you copied the new one? Maybe the previous version of your was did not have the OntologyClient class.
I have checked and double checked that the produced WAR file contains the org.erasmusmc.ontology.OntologyClient class
Is the class inside a .jar file? if so, what is the location relative to the WAR.
Are there any other .class or .jar files inside the same directory?