tangchao_johnny
唐潮_小五
2015-03-17 07:34

springMVC 和 cxf 整合的 启动时自动关闭SessionFactoryImpl的问题

  • spring
  • cxf

信息: Not binding factory to JNDI, no JNDI name configured
2015-3-17 15:24:00 org.hibernate.impl.SessionFactoryImpl close
信息: closing
2015-3-17 15:24:00 org.apache.catalina.core.StandardContext listenerStart
严重: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'reportService': Invocation of init method failed; nested exception is java.lang.NoSuchMethodError: org.springframework.util.ClassUtils.isCglibProxyClass(Ljava/lang/Class;)Z
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1420)
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:295)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:225)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:292)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:580)
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:377)
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:278)
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:111)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4206)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4705)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:799)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:779)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:601)
at org.apache.catalina.startup.HostConfig.manageApp(HostConfig.java:1429)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:297)
at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:836)
at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:761)
at org.apache.catalina.mbeans.MBeanFactory.createStandardContext(MBeanFactory.java:631)
at org.apache.catalina.mbeans.MBeanFactory.createStandardContext(MBeanFactory.java:568)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:295)
at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:836)
at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:761)
at javax.management.remote.rmi.RMIConnectionImpl.doOperation(RMIConnectionImpl.java:1427)
at javax.management.remote.rmi.RMIConnectionImpl.access$200(RMIConnectionImpl.java:72)
at javax.management.remote.rmi.RMIConnectionImpl$PrivilegedOperation.run(RMIConnectionImpl.java:1265)
at javax.management.remote.rmi.RMIConnectionImpl.doPrivilegedOperation(RMIConnectionImpl.java:1360)
at javax.management.remote.rmi.RMIConnectionImpl.invoke(RMIConnectionImpl.java:788)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:303)
at sun.rmi.transport.Transport$1.run(Transport.java:159)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.Transport.serviceCall(Transport.java:155)
at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:535)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:790)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:649)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:662)
Caused by: java.lang.NoSuchMethodError: org.springframework.util.ClassUtils.isCglibProxyClass(Ljava/lang/Class;)Z
at org.apache.cxf.common.util.SpringAopClassHelper.getRealClassInternal(SpringAopClassHelper.java:86)
at org.apache.cxf.common.util.ClassHelper.getRealClass(ClassHelper.java:55)
at org.apache.cxf.jaxws.EndpointImpl.getImplementorClass(EndpointImpl.java:215)
at org.apache.cxf.jaxws.EndpointImpl.getServer(EndpointImpl.java:399)
at org.apache.cxf.jaxws.EndpointImpl.doPublish(EndpointImpl.java:334)
at org.apache.cxf.jaxws.EndpointImpl.publish(EndpointImpl.java:251)
at org.apache.cxf.jaxws.EndpointImpl.publish(EndpointImpl.java:539)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeCustomInitMethod(AbstractAutowireCapableBeanFactory.java:1546)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1487)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1417)
... 53 more
2015-3-17 15:24:00 org.apache.catalina.core.StandardContext start
严重: Error listenerStart
2015-3-17 15:24:00 org.apache.catalina.core.StandardContext start
严重: Context [/hse] startup failed due to previous errors
2015-3-17 15:24:00 org.apache.catalina.core.ApplicationContext log
信息: Closing Spring root WebApplicationContext
2015-3-17 15:24:00 org.apache.catalina.loader.WebappClassLoader clearReferencesJdbc
严重: The web application [/hse] registered the JDBC driver [com.microsoft.sqlserver.jdbc.SQLServerDriver] but failed to unregister it when the web application was stopped. To prevent a memory leak, the JDBC Driver has been forcibly unregistered.
2015-3-17 15:24:02 org.apache.catalina.startup.HostConfig deployDirectory

beans.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:jaxws="http://cxf.apache.org/jaxws"
       xsi:schemaLocation="
        http://www.springframework.org/schema/beans
        http://www.springframework.org/schema/beans/spring-beans.xsd
        http://cxf.apache.org/jaxws
        http://cxf.apache.org/schemas/jaxws.xsd">
    <import resource="classpath:META-INF/cxf/cxf.xml" />
    <import resource="classpath:META-INF/cxf/cxf-servlet.xml" />

    <jaxws:endpoint id="reportService" implementor="com.boke.webservice.impl.ReportServiceImpl" address="/ReportService" />
</beans>

接口实现类

 @WebService(endpointInterface = "com.boke.webservice.ReportService", serviceName = "reportService")
public class ReportServiceImpl implements ReportService {
// 检查与整改统计  按周
    @Override
    public List getReaderCheckList(Date startTime, Date endTime) {
        return null;
    }

    // 安全人工时统计  按周
    @Override
    public List getReaderWorkHourList(Date startTime, Date endTime) {
        return null;
    }

    // 入场培训统计  按周
    @Override
    public List getReaderTrainingEntranceList(Date startTime, Date endTime) {
        return null;
    }

    // 特殊工种培训统计  按周
    @Override
    public List getReaderTrainingMajorList(Date startTime, Date endTime) {
        return null;
    }

    // 设备施工机具统计  按周
    @Override
    public List getReaderEquipmentConstructList(Date startTime, Date endTime) {
        return null;
    }
}

接口

 @WebService
public interface ReportService {
    // 检查与整改统计  按周
    public List getReaderCheckList(@WebParam(name="startTime") Date startTime,@WebParam(name="endTime") Date endTime);

    // 安全人工时统计  按周
    public List getReaderWorkHourList(@WebParam(name="startTime") Date startTime,@WebParam(name="endTime") Date endTime);

    // 入场培训统计  按周
    public List getReaderTrainingEntranceList(@WebParam(name="startTime") Date startTime,@WebParam(name="endTime") Date endTime);

    // 特殊工程培训统计  按周
    public List getReaderTrainingMajorList(@WebParam(name="startTime") Date startTime,@WebParam(name="endTime") Date endTime);

    // 设备施工机具统计  按周
    public List getReaderEquipmentConstructList(@WebParam(name="startTime") Date startTime,@WebParam(name="endTime") Date endTime);

    // 设备大型机具统计  按周
    public List getReaderEquipmentLargeList();
}

启动到最后的时候,报错。
请大家帮忙看看。

  • 点赞
  • 回答
  • 收藏
  • 复制链接分享

0条回答

为你推荐