spring整合rabbitmq报错ListenerContainerFactoryBean初始化失败

错误信息如下:
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.amqp.rabbit.config.ListenerContainerFactoryBean#0': Invocation of init method failed; nested exception is java.lang.NullPointerException
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1630)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:555)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:483)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:312)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:308)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:742)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:867)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:543)
at org.springframework.web.servlet.FrameworkServlet.configureAndRefreshWebApplicationContext(FrameworkServlet.java:668)
at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:634)
at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:682)
at org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:553)
at org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:494)
at org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:171)
at javax.servlet.GenericServlet.init(GenericServlet.java:160)
at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1280)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1193)
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1088)
at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:5176)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5460)
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.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.NullPointerException
at org.springframework.amqp.rabbit.config.ListenerContainerFactoryBean.createContainer(ListenerContainerFactoryBean.java:533)
at org.springframework.amqp.rabbit.config.ListenerContainerFactoryBean.createInstance(ListenerContainerFactoryBean.java:411)
at org.springframework.amqp.rabbit.config.ListenerContainerFactoryBean.createInstance(ListenerContainerFactoryBean.java:61)
at org.springframework.beans.factory.config.AbstractFactoryBean.afterPropertiesSet(AbstractFactoryBean.java:134)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1688)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1626)
... 28 more

xml配置 如下:
<?xml version="1.0" encoding="UTF-8"?>

xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:rabbit="http://www.springframework.org/schema/rabbit"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-4.2.xsd
http://www.springframework.org/schema/rabbit
http://www.springframework.org/schema/rabbit/spring-rabbit-1.0.xsd"
default-lazy-init="false">

<!-- rabbitmq连接工厂 -->
<rabbit:connection-factory id="connectionFactory" username="${mq.username}" password="${mq.password}"
                           host="${mq.host}" port="${mq.port}" virtual-host="${mq.vhost}"/>

<rabbit:admin connection-factory="connectionFactory"/>

<!-- 定义rabbitmq服务 -->
<rabbit:template id="rabbitTemplate" connection-factory="connectionFactory" message-converter="jsonMessageConverter"/>
<!-- 使用fastjson进行类型转换 -->
<bean id="jsonMessageConverter" class="com.util.FastJsonMessageConverter"/>

<!-- 定义队列 -->
<rabbit:queue name="order.queue" durable="true" auto-delete="false" exclusive="false"/>

<!-- 定义路由并绑定队列 -->
<rabbit:direct-exchange name="order.exchange" auto-delete="false" durable="true">
    <rabbit:bindings>
        <rabbit:binding queue="order.queue" key="order"></rabbit:binding>
    </rabbit:bindings>
</rabbit:direct-exchange>

<!-- 定义监听器 ack为自动删除模式 -->
<rabbit:listener-container connection-factory="connectionFactory" acknowledge="auto" >
    <rabbit:listener ref="orderQueueListener" queues="order.queue"/>
</rabbit:listener-container>

<bean name="orderQueueListener" class="com.mq.OrderQueueListener"/>

我目前定位出是:OrderQueueListener这个类应该没有被初始化导致的。
但找不出解决办法

2个回答

spring命名空间配置版本不正确:
spring-beans-4.2.xsd --> spring-beans.xsd
spring-rabbit-1.0.xsd --> spring-rabbit.xsd

qq_31908291
qq_31908291 非常感谢,改了后好用了,这个问题困扰了我一下午,真的非常感谢
5 个月之前 回复
Loveme_CN
Loveme_CN 我的也是这个问题,非常感谢,特此评论
5 个月之前 回复
u011511756
逆光影者 很感谢, 找半天原因了
6 个月之前 回复
h996666
lemon_cake 真的非常谢谢你。这个问题困扰了我很久,后来都快遗忘了。谢谢,也给我提供了解决问题的方向
7 个月之前 回复
h996666
lemon_cake 回复王雪芬-Judy领袖: 看下面速客的回答,是命名空间有问题
7 个月之前 回复
dtttyc
王雪芬-Judy领袖 解决了吗?我也有这个问题
7 个月之前 回复
weixin_43505745
 powerlxc 你是纸张吗
10 个月之前 回复
Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
Spring整合RabbitMQ
Spring整合RabbitMQ  搭建购物车系统  利用MQ实现商品数据同步
RabbitMQ学习(三):Spring整合RabbitMQ
1、maven依赖 org.springframework.amqp spring-rabbit 1.4.6.RELEASE 2、spring-rabbit配置 2.1、配置rabbitMQ连接 (1)采用方式配置连接 <rabbit:connection-factory id="connectionFactory" host="${rabbitmq.h
RabbitMq与Spring整合实例
RabbitMq与Spring整合实例,整个工程采用maven,具体过程看博文: http://blog.csdn.net/evankaka/article/details/50495437
RabbitMQ 使用教程 与 spring整合
spring integration系列 之RabbitMQ and spring 文章中 很多人都不熟悉讲这个 大家云里雾里,我确实忽略了 这个问题,这一集 就是基础篇 基本的RabbitMQ 在实际工作中我们常常使用RabbitMQ发布以及监听消息 其实大多数时候 我用它来做大量的异步消息通讯 数据的临时存储 用途 下面第一步 添加相关依赖   1 &amp;lt;!--...
Spring整合RabbitMq之精品详解
RabbitMq基础大全详解 一、创建一个项目 首先创建一个maven项目 导入spring所依赖的jar包(略) 1.导入springAMQP所以来的jar包 &lt;dependency&gt; &lt;groupId&gt;com.rabbitmq&lt;/groupId&gt; &lt;artifactId&gt;amqp-client&lt;/artifactId&g...
spring整合rabbitmq(三)
springboot2.x使用rabbitmq,那么对于老旧得项目又如何使用呢?这边文章就来讲讲spring如何整合rabbitmq 如果大家是maven项目当然就方便很多 https://mvnrepository.com/artifact/org.springframework.amqp/spring-rabbit 到maven仓库直接找spring-rabbit包,我这边旧项目使用得是足...
Spring整合RabbitMQ简单示例
首先导入工程必须的依赖,基本的spring的包就不用说了,除了这些还需要导入一下2个,用于整合 org.springframework.amqp spring-rabbit 1.7.0.RELEASE com.rabbitmq amqp-client 4.0.0 导入完成之后,首先编写spring整合rabbitmq的xml文件 spring-rabbi
spring整合rabbitmq的实例
https://www.jianshu.com/p/3841059f7ca3 整合spring和rabbitmq
spring整合消息队列rabbitmq(转载)
spring大家太熟,就不多说了 rabbitmq一个amqp的队列服务实现,具体介绍请参考本文http://lynnkong.iteye.com/blog/1699684 本文侧重介绍如何将rabbitmq整合到项目中 ps:本文只是简单一个整合介绍,属于抛砖引玉,具体实现还需大家深入研究哈..   1.首先是生产者配置   ? 1 2 3 4 5 6...
spring整合消息队列rabbitmq
https://my.oschina.net/never/blog/140368 spring大家太熟,就不多说了 rabbitmq一个amqp的队列服务实现,具体介绍请参考本文http://lynnkong.iteye.com/blog/1699684 本文侧重介绍如何将rabbitmq整合到项目中 ps:本文只是简单一个整合介绍,属于抛砖引玉,具体实现还需大家深入研究哈...
spring整合rabbitmq的实现
RabbittMq的五种队列:简单队列 :P:消息的生产者C:消息的消费者红色:队列生产者将消息发送到队列,消费者从队列中获取消息。WORK模式:一个生产者、2个消费者。一个消息只能被一个消费者获取。订阅模式:解读:1、1个生产者,多个消费者2、每一个消费者都有自己的一个队列3、生产者没有将消息直接发送到队列,而是发送到了交换机4、每个队列都要绑定到交换机5、生产者发送的消息,经过交换机,到达队列...
【中间件】MQ Rabbitmq 和spring整合
例一、Xml配置文件定义连接、定义了队列或交换机、可以设置Key、定义了消费者及路径<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:rabbit="http://www.springframework.o
Spring整合RabbitMQ实战配置
Spring整合RabbitMQ实战配置配置通用配置生产端配置消费端配置其他代码生成端消费端 本文只讲述spring整合rabbitmq的配置与代码实现,没有安装rabbitmq的教程 配置 通用配置 rabbitmq 的地址配置,admin产生 一个mq的连接工厂 &amp;lt;!-- 这里配置rabbit的地址,用户,密码,和vhost 我这里是从properties中取参数 --&amp;gt; &amp;l...
【消息中间件】Spring整合RabbitMQ
一、搭建SpringBoot环境 我们选择基于Spring-Rabbit去操作RabbitMQ https://github.com/spring-projects/spring-amqp 使用spring-boot-starter-amqp会自动添加spring-rabbit依赖,如下: &lt;dependency&gt; &lt;groupId&gt;org.sp...
RabbitMQ的初始化
初始化RabbitMQ 设置开机启动 防火墙开放端口 创建用户并赋予管理员权限 设置开机启动 #设置开机启动 chkconfig rabbitmq-server on #查看服务状态 service rabbitmq-server status 防火墙开放端口 rabbitmq通常要开放两个端口:5672和15672;其中5672是默认的接口调用的端口,15672是WEB管理页面访问的端口...
Spring整合RabbitMQ项目(rabbitmq学习2)
管理界面中的功能: Overview:概览信息 Connections:连接 Channels:通道 Exchanges:交换机 Queues:队列 Admin:管理
Spring整合RabbitMQ(包含生产者和消费者)
生产者 创建一个MAVEN项目spring-exchange-producer作为消息队列的生产者 导入相关的依赖坐标 &lt;dependencies&gt; &lt;!-- https://mvnrepository.com/artifact/com.rabbitmq/amqp-client --&gt; &lt;dependency&gt; ...
Spring整合RabbitMQ(二)之注解实现
1、增加rabbitmq的依赖包&amp;lt;!-- ampq 依赖包 --&amp;gt; &amp;lt;dependency&amp;gt;             &amp;lt;groupId&amp;gt;com.rabbitmq&amp;lt;/groupId&amp;gt;             &amp;lt;artifactId&amp;gt;amqp-client&amp;lt;/artifactId&amp;gt;             &amp;lt;version&amp;
Spring整合RabbitMQ进行消息队列开发
Spring AMQP提供了org.springframework.amqp.core.AmqpTemplate来发送与接收消息。RabbitMQ是Spring AMQP官方示例中所用的默认AMQP实现。 在项目pom.xml文件中添加依赖: com.rabbitmq amqp-client 3.4.1 org.springframework.amqp spring-rab
RabbitMQ与Spring整合之消息生产方
RabbitMQ与Spring整合之消息生产方
消息队列-----生成者 Spring整合rabbitmq
最近做Spring结合Rabbitmq,然后往队列里面发送了一个消息,如何查看消息 打开:http://127.0.0.1:15672 输入用户名和密码:找到你的队列 我们可以找到自己的队列,并且发现里面有一个消息,我们点击这个队列,进入: 可以看到这个队列的这些基本的信息 ,首先是overview: Consumers: 当前队列没有消费者 GetMessage...
RabbitMQ学习(四)Spring整合Rabbit
这里有一篇功能点多一点的,包含消息确认机制的:https://blog.csdn.net/leixiaotao_java/article/details/78952930 一、搭建项目 1、pom.xml &amp;lt;properties&amp;gt; &amp;lt;!-- springframe版本号 --&amp;gt; &amp;lt;spring.version&amp;gt;4.3.9.RELEASE&amp;lt...
RabbitMQ与Spring整合之消息消费方
RabbitMQ与Spring整合之消息消费方
Spring整合RabbitMQ完整项目源码.rar
此源码是在前人Demo的基础上自己改造的,主要讲了spring和rabbitMQ的整合与使用。其中包含两个项目,一个Producer,一个Consumer,能够分别运行。Producer生产并发送消息到RabbitMQ,Consumer从RabbitMQ接收并处理消息。简单易懂。
Teamcenter报错:flexlm初始化失败。替换许可证
Teamcenter是Siemens公司开发的PDM/PLM软件,Teamcenter 在开放式PLM基础架构之上,为数字化生命周期管理提供了一整套完善的解决方案。当Teamcenter报错:flexlm初始化失败的时候,说明Teamcenter的License出现了问题,我们需要替换一个许可证。步骤: 同时按住Ctrl+Shift+Ese启动任务管理器,点击服务,找到Siemens PLM ...
RabbitMQ 安装及初始化
RabbitMQ 安装及初始化
spring整合hibernate时候报错
报错提示如下![图片说明](https://img-ask.csdn.net/upload/201612/07/1481046913_593729.png)nn我引入的夹包如下![图片说明](https://img-ask.csdn.net/upload/201612/07/1481046933_177379.png)nn我百度了好多,百度上都说是struts2夹包出了问题,但是现在我做的就是spring和hibernate的整合,还没涉及到struts呀~现在搞到了晚上快两点了,愁死我了,希望大神不啬吝教。谢谢谢谢~如果可以的话请加我QQ:243581579
mybatis和spring整合报错
三月 06, 2017 3:37:40 下午 org.springframework.context.support.ClassPathXmlApplicationContext prepareRefreshrn信息: Refreshing org.springframework.context.support.ClassPathXmlApplicationContext@e73f9ac: startup date [Mon Mar 06 15:37:40 CST 2017]; root of context hierarchyrn三月 06, 2017 3:37:41 下午 org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitionsrn信息: Loading XML bean definitions from class path resource [spring.xml]rn三月 06, 2017 3:37:41 下午 org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitionsrn信息: Loading XML bean definitions from class path resource [spring-mybatis.xml]rn三月 06, 2017 3:37:41 下午 org.springframework.context.support.ClassPathXmlApplicationContext refreshrn警告: Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'userService': Unsatisfied dependency expressed through method 'setUsermapper' parameter 0; nested exception is org.springframework.beans.factory.CannotLoadBeanClassException: Cannot find class [org.springframework.jdbc.datasource.DataSourceTransactionManager] for bean with name 'transactionManager' defined in class path resource [spring-mybatis.xml]; nested exception is java.lang.ClassNotFoundException: org.springframework.jdbc.datasource.DataSourceTransactionManagerrnRelated cause: org.springframework.beans.factory.CannotLoadBeanClassException: Cannot find class [org.springframework.jdbc.datasource.DataSourceTransactionManager] for bean with name 'transactionManager' defined in class path resource [spring-mybatis.xml]; nested exception is java.lang.ClassNotFoundException: org.springframework.jdbc.datasource.DataSourceTransactionManagerrn
spring整合hibernate报错
![图片说明](https://img-ask.csdn.net/upload/201612/07/1481112117_857176.jpg)n不加这一行好好的,加上这一行之后就报错了,报错如下![图片说明](https://img-ask.csdn.net/upload/201612/07/1481112157_324639.png)n百度一下有的说是少引用了aspectjweaver jar包 但是我引用之后还是这样报错,没有变化,引入夹包如下![图片说明](https://img-ask.csdn.net/upload/201612/07/1481112424_158810.png)n搞了好长时间了,求各位大神指教~n
spring整合webservice报错
下面是我错误的rndocument root element beans must match doctype root nullrn我在网上看了一下说是spring的1.x和2.x的包冲突了导致解析的时候报错1.x是doctype解析的而2.x是schema解析的rn可是我不知道怎么搞我想把xfire的corelib里面spring1.2.6的包除掉也不知道怎么去掉 他是myeclipse自动倒入的rn我也想用doctype来解析不知道怎么写 我加了aop里面了 不知道怎么写或者其他什么原因希望大家帮帮我急啊 rn睡觉之前结贴rn麻烦大家帮帮我下
Spring整合jdbcTemplate模板报错
org.springframework.beans.NotWritablePropertyException: Invalid property 'jt' of bean class
hibernate和spring整合报错
整合SSH框架报错,新手,无解,求救:::rn严重: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListenerrnorg.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Invocation of init method failed; nested exception is java.lang.NoSuchMethodError: org.objectweb.asm.ClassVisitor.visit(IILjava/lang/String;Ljava/lang/String;[Ljava/lang/String;Ljava/lang/String;)Vrn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1336)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:471)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)rn at java.security.AccessController.doPrivileged(Native Method)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380)rn at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264)rn at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:220)rn at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261)rn at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185)rn at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164)rn at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:423)rn at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:729)rn at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:381)rn at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:255)rn at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:199)rn at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:45)rn at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3827)rn at org.apache.catalina.core.StandardContext.start(StandardContext.java:4334)rn at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)rn at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)rn at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:525)rn at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:920)rn at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:883)rn at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:492)rn at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1138)rn at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)rn at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)rn at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)rn at org.apache.catalina.core.StandardHost.start(StandardHost.java:719)rn at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)rn at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)rn at org.apache.catalina.core.StandardService.start(StandardService.java:516)rn at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)rn at org.apache.catalina.startup.Catalina.start(Catalina.java:566)rn at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)rn at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)rn at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)rn at java.lang.reflect.Method.invoke(Unknown Source)rn at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)rn at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)rnCaused by: java.lang.NoSuchMethodError: org.objectweb.asm.ClassVisitor.visit(IILjava/lang/String;Ljava/lang/String;[Ljava/lang/String;Ljava/lang/String;)Vrn at net.sf.cglib.core.ClassEmitter.begin_class(ClassEmitter.java:77)rn at net.sf.cglib.core.KeyFactory$Generator.generateClass(KeyFactory.java:173)rn at net.sf.cglib.core.DefaultGeneratorStrategy.generate(DefaultGeneratorStrategy.java:25)rn at net.sf.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.java:216)rn at net.sf.cglib.core.KeyFactory$Generator.create(KeyFactory.java:145)rn at net.sf.cglib.core.KeyFactory.create(KeyFactory.java:117)rn at net.sf.cglib.core.KeyFactory.create(KeyFactory.java:108)rn at net.sf.cglib.core.KeyFactory.create(KeyFactory.java:104)rn at net.sf.cglib.proxy.Enhancer.(Enhancer.java:69)rn at org.hibernate.proxy.pojo.cglib.CGLIBLazyInitializer.getProxyFactory(CGLIBLazyInitializer.java:117)rn at org.hibernate.proxy.pojo.cglib.CGLIBProxyFactory.postInstantiate(CGLIBProxyFactory.java:43)rn at org.hibernate.tuple.entity.PojoEntityTuplizer.buildProxyFactory(PojoEntityTuplizer.java:162)rn at org.hibernate.tuple.entity.AbstractEntityTuplizer.(AbstractEntityTuplizer.java:135)rn at org.hibernate.tuple.entity.PojoEntityTuplizer.(PojoEntityTuplizer.java:55)rn at org.hibernate.tuple.entity.EntityEntityModeToTuplizerMapping.(EntityEntityModeToTuplizerMapping.java:56)rn at org.hibernate.tuple.entity.EntityMetamodel.(EntityMetamodel.java:295)rn at org.hibernate.persister.entity.AbstractEntityPersister.(AbstractEntityPersister.java:434)rn at org.hibernate.persister.entity.SingleTableEntityPersister.(SingleTableEntityPersister.java:109)rn at org.hibernate.persister.PersisterFactory.createClassPersister(PersisterFactory.java:55)rn at org.hibernate.impl.SessionFactoryImpl.(SessionFactoryImpl.java:226)rn at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1294)rn at org.springframework.orm.hibernate3.LocalSessionFactoryBean.newSessionFactory(LocalSessionFactoryBean.java:814)rn at org.springframework.orm.hibernate3.LocalSessionFactoryBean.buildSessionFactory(LocalSessionFactoryBean.java:732)rn at org.springframework.orm.hibernate3.AbstractSessionFactoryBean.afterPropertiesSet(AbstractSessionFactoryBean.java:211)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1367)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1333)rn ... 39 morern2009-3-9 16:05:52 org.apache.catalina.core.StandardContext startrn严重: Error listenerStart
spring整合mybatis报错!
spring配置文件rn[code=java]rnrnrn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rnrn[/code]rnrn[code=java]log4j:WARN No appenders could be found for logger (org.springframework.context.support.ClassPathXmlApplicationContext).rnlog4j:WARN Please initialize the log4j system properly.rnException in thread "main" org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlSessionFactory' defined in class path resource [applicationContext.xml]: Instantiation of bean failed; nested exception is java.lang.NoClassDefFoundError: org/apache/ibatis/transaction/TransactionFactoryrn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:946)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:892)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:479)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:450)rn at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:290)rn at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)rn at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:287)rn at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:189)rn at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:545)rn at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:871)rn at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:423)rn at org.springframework.context.support.ClassPathXmlApplicationContext.(ClassPathXmlApplicationContext.java:139)rn at org.springframework.context.support.ClassPathXmlApplicationContext.(ClassPathXmlApplicationContext.java:83)rn at test.TestMyBatis.main(TestMyBatis.java:13)rnCaused by: java.lang.NoClassDefFoundError: org/apache/ibatis/transaction/TransactionFactoryrn at java.lang.Class.getDeclaredConstructors0(Native Method)rn at java.lang.Class.privateGetDeclaredConstructors(Class.java:2389)rn at java.lang.Class.getConstructor0(Class.java:2699)rn at java.lang.Class.getDeclaredConstructor(Class.java:1985)rn at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:64)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:939)rn ... 13 morernCaused by: java.lang.ClassNotFoundException: org.apache.ibatis.transaction.TransactionFactoryrn at java.net.URLClassLoader$1.run(URLClassLoader.java:200)rn at java.security.AccessController.doPrivileged(Native Method)rn at java.net.URLClassLoader.findClass(URLClassLoader.java:188)rn at java.lang.ClassLoader.loadClass(ClassLoader.java:307)rn at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)rn at java.lang.ClassLoader.loadClass(ClassLoader.java:252)rn at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)rn ... 19 morern[/code]
Spring整合Struts报错
在struts-config.xml配置如下:rnrn rnrnrn可是运行时总是说Servlet action找不到rnSpring的Web包也已经加到classpath下了rnrn是什么原因这个错误的呢?
spring整合hibernate时报错
rnrnrn rn rn rn classpath:conf/jdbc.propertiesrn rn rn rn rn rn rn rn rn rnrn rn rn rn rn com.BeNnovo.EmployeesManagement.coreCode.entityrn rn rn rn rn rn org.hibernate.dialect.SQLServerDialectrn rn truern rn rn rn rn rn rn rn rn rnrn rn rn rn rnrn rn rn rn rn rn rnrnrnrn rn rn rn rn rn rn rn rn rn rn rn rn rnrnrnrnrnrnrnpublic class TestEmployeesServicernrn ApplicationContext context = new ClassPathXmlApplicationContext("applicationContext.xml");rn private EmployeesService employeesService = (EmployeesService) context.getBean("employeesService");rn rn private int page = 1;rn private int rows = 10;rn private long total;rn private long records;rnrn rn @Testrn public void createEmployees()rn rn EmployeesDTO employeesDTO = new EmployeesDTO();rn employeesDTO.setEmployeesName("admin");rn employeesDTO.setEmployeesPassword("admin");rn employeesDTO.setEmployeesIdentityCard("123434");rn employeesDTO.setEmpoyeesMaritalStatus(EmployeesMaritalStatus.MARRIED);rn employeesDTO.setEmployeesSex(EmployeesSex.MAN);rn for (int i = 0; i < 50; i++)rn rn employeesDTO.setEmployeesCode("B"+i);rn employeesService.createEmployees(employeesDTO);rn rn rn rn rn public EmployeesService getEmployeesService()rn rn return employeesService;rn rn @Resourcern public void setEmployeesService(EmployeesService employeesService)rn rn this.employeesService = employeesService;rn rnrnrnrnrnrnrnrnpublic class TemplateDAOImpl implements TemplateDAOrnrn private HibernateTemplate hibernateTemplate;rnrn public void save(T entity) throws DataAccessException rn hibernateTemplate.save(entity);rn rn rn rn public HibernateTemplate getHibernateTemplate()rn rn return hibernateTemplate;rn rn @Resourcern public void setHibernateTemplate(HibernateTemplate hibernateTemplate)rn rn this.hibernateTemplate = hibernateTemplate;rn rnrnrnrnrnorg.springframework.beans.factory.BeanCreationException: Error creating bean with name 'employeesDAO' defined in class path resource [applicationContext.xml]: Instantiation of bean failed; nested exception is java.lang.ExceptionInInitializerErrorrn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:883)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:839)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:440)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)rn at java.security.AccessController.doPrivileged(Native Method)rn at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)rn at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)rn at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)rn at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)rn at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)rn at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)rnCaused by: java.lang.ExceptionInInitializerErrorrn at com.BeNnovo.EmployeesManagement.coreCode.util.HibernateUtil.buildSessionFactory(HibernateUtil.java:21)rn at com.BeNnovo.EmployeesManagement.coreCode.util.HibernateUtil.(HibernateUtil.java:11)rn at com.BeNnovo.EmployeesManagement.coreCode.dao.employeesManagerment.impl.EmployeesDAO.(EmployeesDAO.java:21)rn at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)rn at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)rn at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)rn at java.lang.reflect.Constructor.newInstance(Constructor.java:525)rn at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:100)rn at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:61)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:877)rn ... 39 morernCaused by: org.hibernate.HibernateException: /hibernate.cfg.xml not foundrn at org.hibernate.util.ConfigHelper.getResourceAsStream(ConfigHelper.java:170)rn at org.hibernate.cfg.Configuration.getConfigurationInputStream(Configuration.java:1453)rn at org.hibernate.cfg.Configuration.configure(Configuration.java:1475)rn at org.hibernate.cfg.AnnotationConfiguration.configure(AnnotationConfiguration.java:1017)rn at org.hibernate.cfg.AnnotationConfiguration.configure(AnnotationConfiguration.java:64)rn at org.hibernate.cfg.Configuration.configure(Configuration.java:1462)rn at org.hibernate.cfg.AnnotationConfiguration.configure(AnnotationConfiguration.java:1011)rn at com.BeNnovo.EmployeesManagement.coreCode.util.HibernateUtil.buildSessionFactory(HibernateUtil.java:16)rn ... 48 morernrn整合后为什么还要去找那个/hibernate.cfg.xmlrn我使用的是xml方式,原来用的是annotation方式
glview初始化失败,opencv初始化失败
glview初始化失败,opencv初始化失败,glview是cocos2dx初始化中的,感觉这两个是一个问题。rn重装了os就出现这个问题了。rn驱动都是最新的,配置环境都是正确的rn[code=c]director->setOpenGLView(glview);[/code]glview为NULL;rnopencv是0x3E633E46 处有未经处理的异常(在 test.exe 中): 0xC0000005: 执行位置 0x3E633E46 时发生访问冲突。rn已运行就这样,连跟踪都进不去
rabbitmq添加用户失败
rabbitmq 添加用户时报如下错误 Error description:   {could_not_start,rabbit,       {notsup,           [{crypto,sha256,1,[{file,&quot;crypto.erl&quot;},{line,857}]},            {rabbit_password,hash,2,                [{...
JAVA连接RabbitMQ失败
Java连接RabbitMQ失败在windows中安装了RabbitMQ之后,在Spring中创建ConnectionFactory时发现总是超时,而且queue和exchange也没有正确routing。经排查,发现是创建ConnectionFactory时使用的guest用户,而guest用户只能用作本地登录的。需要新建一个用户,并赋予对应的权限。对应的命令为:rabbitmqctl add_u
rabbitmq消费失败处理
rabbitmq消费失败处理
rabbitmq重启失败
rabbitmq重启失败 原因: 如果你的瞬时主机名和其他主机重名了,也就是可以ping通其他主机,那么rabbitmq在启动的时候就回去启动远程主机的rabbitmq服务,可以从journal -xe错误日志中看到连接失败的报错 hostnamectl:可以看到静态主机名、瞬态主机名等 hostnamectl set-hostname &lt;YourHonstName&gt;来修改主机名,然...
相关热词 c#检测非法字符 c#双屏截图 c#中怎么关闭线程 c# 显示服务器上的图片 api嵌入窗口 c# c# 控制网页 c# encrypt c#微信网页版登录 c# login 居中 c# 考试软件