springboot Bean '' of type [] is not eligible for getting processed by all [问题点数:20分]

Bbs1
本版专家分:6
结帖率 62.5%
Bbs3
本版专家分:641
JSF in bean of type null
rn严重: Servlet.service() for servlet Faces Servlet threw exceptionrnjavax.faces.el.PropertyNotFoundException: Error testing property 'userName' in <em>bean</em> of <em>type</em> nullrn at com.sun.faces.el.PropertyResolverImpl.getType(PropertyResolverImpl.java:342)rn at com.sun.faces.el.impl.ArraySuffix.getType(ArraySuffix.java:240)rn at com.sun.faces.el.impl.ComplexValue.getType(ComplexValue.java:208)rn at com.sun.faces.el.ValueBindingImpl.getType(ValueBindingImpl.java:338)rn at com.sun.faces.renderkit.html_basic.HtmlBasicInputRenderer.getConvertedValue(HtmlBasicInputRenderer.java:111)rnrn我的face-config.xml文件rnrnrnrnrn rn UserBeanrn rn com.jsfdemo.<em>bean</em>.UserBeanrn rn sessionrn rn userNamern java.lang.Stringrn rn rn rn passwordrn java.lang.Stringrn rn rn rn rn /userLogin.jsprn rn successrn /userLoginSuccess.jsprn rn rn failurern /userLogin.jsprn rn rn /userLoginSuccess.jsprn rn rn rn zh_CNrn enrn jarn rnrn rn rnrnrn我的userLogin.jsprnrn rnrnrnrnrnrnrnrnrn rnrn My JSF 'userLogin.jsp' starting pagern rn rn rn rn rn rn rnrnrn rnrn rn rn rn rn rn rn rn rn rn rn rn rnrn
SpringMVC---NoSuchBeanDefinitionException: No qualifying bean of type
org.springframework.<em>bean</em>s.factory.BeanCreationException: Error creating <em>bean</em> with name 'outsourcePriceController': Injection of resource dependencies failed; nested exception is org.springframework.<em>bean</em>s.factory.NoSuchBeanDefinitionException: No qualifying <em>bean</em> of <em>type</em> [com.zsq.ems.service.purchase.PurchaseSupPriceBaseService] found for dependency: expected at least 1 <em>bean</em> which qualifies as autowire candidate for this dependency. Dependency annotations: @javax.annotation.Resource(shareable=true, mappedName=, description=, name=, <em>type</em>=class java.lang.Object, authenticationType=CONTAINER)rn at org.springframework.context.annotation.CommonAnnotationBeanPostProcessor.postProcessPropertyValues(CommonAnnotationBeanPostProcessor.java:306)rn at org.springframework.<em>bean</em>s.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1116)rn at org.springframework.<em>bean</em>s.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)rn at org.springframework.<em>bean</em>s.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:458)rn at org.springframework.<em>bean</em>s.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:295)rn at org.springframework.<em>bean</em>s.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:223)rn at org.springframework.<em>bean</em>s.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:292)rn at org.springframework.<em>bean</em>s.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)rn at org.springframework.<em>bean</em>s.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:628)rn at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:932)rn at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:479)rn at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:389)rn at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:294)rn at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:112)rn at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4939)rn at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5434)rn at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)rn at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901)rn at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)rn at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:633)rn at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1113)rn at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1671)rn at java.util.concurrent.Executors$RunnableAdapter.c<em>all</em>(Executors.java:441)rn at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)rn at java.util.concurrent.FutureTask.run(FutureTask.java:138)rn at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)rn at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)rn at java.lang.Thread.run(Thread.java:619)rnCaused by: org.springframework.<em>bean</em>s.factory.NoSuchBeanDefinitionException: No qualifying <em>bean</em> of <em>type</em> [com.zsq.ems.service.purchase.PurchaseSupPriceBaseService] found for dependency: expected at least 1 <em>bean</em> which qualifies as autowire candidate for this dependency. Dependency annotations: @javax.annotation.Resource(shareable=true, mappedName=, description=, name=, <em>type</em>=class java.lang.Object, authenticationType=CONTAINER)rn at org.springframework.<em>bean</em>s.factory.support.DefaultListableBeanFactory.raiseNoSuchBeanDefinitionException(DefaultListableBeanFactory.java:988)rn at org.springframework.<em>bean</em>s.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:858)rn at org.springframework.<em>bean</em>s.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:770)rn at org.springframework.context.annotation.CommonAnnotationBeanPostProcessor.autowireResource(CommonAnnotationBeanPostProcessor.java:438)rn at org.springframework.context.annotation.CommonAnnotationBeanPostProcessor.getResource(CommonAnnotationBeanPostProcessor.java:416)rn at org.springframework.context.annotation.CommonAnnotationBeanPostProcessor$ResourceElement.getResourceToInject(CommonAnnotationBeanPostProcessor.java:550)rn at org.springframework.<em>bean</em>s.factory.annotation.InjectionMetadata$InjectedElement.inject(InjectionMetadata.java:150)rn at org.springframework.<em>bean</em>s.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:87)rn at org.springframework.context.annotation.CommonAnnotationBeanPostProcessor.postProcessPropertyValues(CommonAnnotationBeanPostProcessor.java:303)rn ... 27 morernorg.springframework.<em>bean</em>s.factory.BeanCreationException: Error creating <em>bean</em> with name 'outsourcePriceController': Injection of resource dependencies failed; nested exception is org.springframework.<em>bean</em>s.factory.NoSuchBeanDefinitionException: No qualifying <em>bean</em> of <em>type</em> [com.zsq.ems.service.purchase.PurchaseSupPriceBaseService] found for dependency: expected at least 1 <em>bean</em> which qualifies as autowire candidate for this dependency. Dependency annotations: @javax.annotation.Resource(shareable=true, mappedName=, description=, name=, <em>type</em>=class java.lang.Object, authenticationType=CONTAINER)rn at org.springframework.context.annotation.CommonAnnotationBeanPostProcessor.postProcessPropertyValues(CommonAnnotationBeanPostProcessor.java:306)rn at org.springframework.<em>bean</em>s.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1116)rn at org.springframework.<em>bean</em>s.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)rn at org.springframework.<em>bean</em>s.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:458)rn at org.springframework.<em>bean</em>s.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:295)rn at org.springframework.<em>bean</em>s.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:223)rn at org.springframework.<em>bean</em>s.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:292)rn at org.springframework.<em>bean</em>s.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)rn at org.springframework.<em>bean</em>s.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:628)rn at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:932)rn at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:479)rn at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:389)rn at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:294)rn at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:112)rn at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4939)rn at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5434)rn at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)rn at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901)rn at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)rn at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:633)rn at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1113)rn at org.apache.catalina.starturnp.HostConfig$DeployDirectory.run(HostConfig.java:1671)rn at java.util.concurrent.Executors$RunnableAdapter.c<em>all</em>(Executors.java:441)rn at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)rn at java.util.concurrent.FutureTask.run(FutureTask.java:138)rn at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)rn at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)rn at java.lang.Thread.run(Thread.java:619)rnCaused by: org.springframework.<em>bean</em>s.factory.NoSuchBeanDefinitionException: No qualifying <em>bean</em> of <em>type</em> [com.zsq.ems.service.purchase.PurchaseSupPriceBaseService] found for dependency: expected at least 1 <em>bean</em> which qualifies as autowire candidate for this dependency. Dependency annotations: @javax.annotation.Resource(shareable=true, mappedName=, description=, name=, <em>type</em>=class java.lang.Object, authenticationType=CONTAINER)rn at org.springframework.<em>bean</em>s.factory.support.DefaultListableBeanFactory.raiseNoSuchBeanDefinitionException(DefaultListableBeanFactory.java:988)rnrn at org.springframework.<em>bean</em>s.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:858)rn at org.springframework.context.annotation.CommonAnnotationBeanPostProcessor.autowireResource(CommonAnnotationBeanPostProcessor.java:438)rn at org.springframework.context.annotation.CommonAnnotationBeanPostProcessor.getResource(CommonAnnotationBeanPostProcessor.java:416)rnrn ... 27 morern2014-8-6 11:30:52 org.apache.catalina.core.StandardContext listenerStartrn严重: Exception sending context initialized event to listener instance of class com.zsq.ems.common.timer.DataBackUpTaskListenerrnjava.lang.NullPointerExceptionrn at com.zsq.ems.common.util.ContextUtil.getRealPath(ContextUtil.java:20)rn at com.zsq.ems.common.timer.TimerManager.(TimerManager.java:20)rn at com.zsq.ems.common.timer.DataBackUpTaskListener.contextInitialized(DataBackUpTaskListener.java:9)rn查了说是jar问题。annotation不会扫描jar。。。。。。怎么解决啊~~~实在没办法才来求救了rn
【SSM】No qualifying bean of type
异常:rnorg.springframework.<em>bean</em>s.factory.BeanCreationException: Error creating <em>bean</em> with name 'testController': Injection of autowired dependencies failed; nested exception is org.springframework.<em>bean</em>s.factory.BeanCreationException: Could not autowire field: com.how2java.service.CsHomeworkService com.how2java.controller.TestController.csHomeworkService; nested exception is org.springframework.<em>bean</em>s.factory.NoSuchBeanDefinitionException: No qualifying <em>bean</em> of <em>type</em> [com.how2java.service.CsHomeworkService] found for dependency: expected at least 1 <em>bean</em> which qualifies as autowire candidate for this dependency. Dependency annotations: @org.springframework.<em>bean</em>s.factory.annotation.Autowired(required=true)rn代码:rn[code=java]rnpackage com.how2java.controller;rnrnimport java.util.List;rnrnimport org.springframework.<em>bean</em>s.factory.annotation.Autowired;rnimport org.springframework.stereo<em>type</em>.Controller;rnimport org.springframework.web.bind.annotation.RequestMapping;rnimport org.springframework.web.servlet.ModelAndView;rnrnrnimport com.how2java.pojo.CsHomework;rnimport com.how2java.service.CsHomeworkService;rnrn@Controllerrn@RequestMapping("")rnpublic class TestController rn rn @Autowiredrn CsHomeworkService csHomeworkService;rn rn @RequestMapping("dachuang")rn public ModelAndView show()rn ModelAndView mav = new ModelAndView();rn List cs= csHomeworkService.list();rn rn // 鏀惧叆杞彂鍙傛暟rn mav.addObject("cs", cs);rn // 鏀惧叆jsp璺緞rn mav.setViewName("listCsHomework");rn return mav;rn rn rnrn[/code]rnapplicationContext.xmlrn[code=java]rnrnrn rn rn rn rn rn rn rn com.mysql.jdbc.Driver rn rn rn jdbc:mysql://localhost:3306/python?characterEncoding=UTF-8 rn rn rn rn root rn rn rn *********** rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rnrn rn[/code]rnspringMVC.xmlrn[code=java]rnrnrn rn rn rnrn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rnrn[/code]rnrnweb.xmlrn[code=java]rnrnrnrnrn rn rn contextConfigLocationrn classpath:applicationContext.xmlrn rn rn org.springframework.web.context.ContextLoaderListenerrn rn rn rn rn mvc-dispatcherrn org.springframework.web.servlet.DispatcherServletrn rn rn contextConfigLocationrn classpath:springMVC.xmlrn rn 1rn rn rn mvc-dispatcherrn /rn rn rn[/code]rn[code=java]rnrn@Servicernpublic class CsHomeworkServiceImpl implements CsHomeworkServicernrn @Autowiredrn CsHomeworkMapper cs;rn rn @Overridern public List list() rn return cs.list();rn rnrnrn[/code]rn[code=java]rn@Controllerrn@RequestMapping("")rnpublic class TestController rn rn @Autowiredrn CsHomeworkService csHomeworkService;rn rn @RequestMapping("dachuang")rn public ModelAndView show()rn ModelAndView mav = new ModelAndView();rn List cs= csHomeworkService.list();rn rn // 鏀惧叆杞彂鍙傛暟rn mav.addObject("cs", cs);rn // 鏀惧叆jsp璺緞rn mav.setViewName("listCsHomework");rn return mav;rn rn rnrnrn[/code]rn
数据的序列化(all Type to Byte[])
数据的序列化(<em>all</em> Type to Byte[]) 一 因为我们用的socket是stream类型的  mySocket = new Socket( AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);   序列化的作用: 方便数据的持久化存储(必须说,文件形式存储到硬盘上)和网络传输。     二 数
Getting Started With MachineLearning (all in one)_V0.91
Getting Started With MachineLearning (<em>all</em> in one)_V0.91
No unique bean of type [...] is defined: Unsatisfied dependency of type
11-10-13 16:49:09 (严) StandardContext.listenerStart : Exception sending context initializernd event to listener instance of class org.springframework.web.context.ContextLoaderListenernrrnorg.springframework.<em>bean</em>s.factory.BeanCreationException: Error creating <em>bean</em> with name 'avrnService': Autowiring of fields failed; nested exception is org.springframework.<em>bean</em>s.factornry.BeanCreationException: Could not autowire field: private com.cares.fare.factory.FareCacrnulateFactory com.cares.av.AvServiceImpl.agentFareCaculateFactory; nested exception is org.rnspringframework.<em>bean</em>s.factory.NoSuchBeanDefinitionException: No unique <em>bean</em> of <em>type</em> [com.crnares.fare.factory.FareCaculateFactory] is defined: Unsatisfied dependency of <em>type</em> [interfarnce com.cares.fare.factory.FareCaculateFactory]: expected at least 1 matching <em>bean</em>rn at org.springframework.<em>bean</em>s.factory.annotation.AutowiredAnnotationBeanPostProcessor.postrnProcessAfterInstantiation(AutowiredAnnotationBeanPostProcessor.java:243)rn at org.springframework.<em>bean</em>s.factory.support.AbstractAutowireCapableBeanFactory.populateBrnean(AbstractAutowireCapableBeanFactory.java:959)rn at org.springframework.<em>bean</em>s.factory.support.AbstractAutowireCapableBeanFactory.doCreateBrnean(AbstractAutowireCapableBeanFactory.java:472)rn at org.springframework.<em>bean</em>s.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbsrntractAutowireCapableBeanFactory.java:409)rn at java.security.AccessController.doPrivileged(Native Method)rn at org.springframework.<em>bean</em>s.factory.support.AbstractAutowireCapableBeanFactory.createBearnn(AbstractAutowireCapableBeanFactory.java:380)rn at org.springframework.<em>bean</em>s.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanrnFactory.java:264)rn at org.springframework.<em>bean</em>s.factory.support.DefaultSingletonBeanRegistry.getSingleton(DernfaultSingletonBeanRegistry.java:222)rn at org.springframework.<em>bean</em>s.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFarnctory.java:261)rn at org.springframework.<em>bean</em>s.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactrnory.java:185)rn at org.springframework.<em>bean</em>s.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactrnory.java:164)rn at org.springframework.<em>bean</em>s.factory.support.DefaultListableBeanFactory.preInstantiateSinrngletons(DefaultListableBeanFactory.java:429)rn at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitiarnlization(AbstractApplicationContext.java:728)rn at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicarntionContext.java:380)rn at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoadernr.java:255)rn at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.rnjava:199)rn at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderrnListener.java:45)rn at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4205)rn at org.apache.catalina.core.StandardContext.start(StandardContext.java:4704)rn at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:799)rn at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:779)rn at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:601)rn at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1079)rn at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:1002)rn at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:506)rn at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1315)rn at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:324)rn at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:142rn)rn at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1061)rn at org.apache.catalina.core.StandardHost.start(StandardHost.java:840)rn at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)rn at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:463)rn at org.apache.catalina.core.StandardService.start(StandardService.java:525)rn at org.apache.catalina.core.StandardServer.start(StandardServer.java:754)rn at org.apache.catalina.startup.Catalina.start(Catalina.java:595)rn at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)rn at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)rn at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)rn at java.lang.reflect.Method.invoke(Method.java:597)rn at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)rn at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)rnCaused by: org.springframework.<em>bean</em>s.factory.BeanCreationException: Could not autowire fiernld: private com.cares.fare.factory.FareCaculateFactory com.cares.av.AvServiceImpl.agentFarrneCaculateFactory; nested exception is org.springframework.<em>bean</em>s.factory.NoSuchBeanDefinitirnonException: No unique <em>bean</em> of <em>type</em> [com.cares.fare.factory.FareCaculateFactory] is definernd: Unsatisfied dependency of <em>type</em> [interface com.cares.fare.factory.FareCaculateFactory]: rnexpected at least 1 matching <em>bean</em>rn at org.springframework.<em>bean</em>s.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutornwiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:435)rn at org.springframework.<em>bean</em>s.factory.annotation.InjectionMetadata.injectFields(InjectionMrnetadata.java:105)rn at org.springframework.<em>bean</em>s.factory.annotation.AutowiredAnnotationBeanPostProcessor.postrnProcessAfterInstantiation(AutowiredAnnotationBeanPostProcessor.java:240)rn ... 40 morernCaused by: org.springframework.<em>bean</em>s.factory.NoSuchBeanDefinitionException: No unique <em>bean</em>rn of <em>type</em> [com.cares.fare.factory.FareCaculateFactory] is defined: Unsatisfied dependency ornf <em>type</em> [interface com.cares.fare.factory.FareCaculateFactory]: expected at least 1 matchinrng <em>bean</em>rn at org.springframework.<em>bean</em>s.factory.support.DefaultListableBeanFactory.resolveDependencyrn(DefaultListableBeanFactory.java:613)rn at org.springframework.<em>bean</em>s.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutornwiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:412)rn ... 42 more
BeanPostProcessor加载次序及其对Bean造成的影响分析
前言 BeanPostProcessor是一个工厂钩子,允许在新创建Bean实例时对其进行定制化修改。例如:检查其标注的接口或者使用代理对其进行包裹。应用上下文会从Bean定义中自动检测出BeanPostProcessor并将它们应用到随后创建的任何Bean上。 普通Bean对象的工厂允许在程序中注册post-processors,应用到在本工厂中创建的所有Bean上。 典型的,post-p
spirngmvc 项目启动错误
[code=&quot;java&quot;]四月 11, 2013 5:08:41 下午 org.apache.catalina.core.AprLifecycleListener init INFO: The APR based Apache Tomcat Native library which <em>all</em>ows optimal performance in production environments was...
Unable to load bean: type: class:com.opensymphony.xwork2.ObjectFactory - bean -
Unable to load <em>bean</em>: <em>type</em>: class:com.opensymphony.xwork2.ObjectFactory - <em>bean</em> - jar:file:/D:/Program%20Files/Apache%20Software%20Foundation/Tomcat%206.0/webapps/upload/WEB-INF/lib/struts2-core-2.1.8.jar!/struts-default.xml:29:72rnrn??实在搞不定了,试了很多方法都不行,请高手帮忙。
springboot启动时获取Bean
在<em>springboot</em>中我们通过配置类来加载配置信息,而在配置类中是无法加载Bean的。我们有时候需要在项目启动时加载数据库数据,这就造成无法使用配置的数据源,而spring给我们提供了一个方法,就是实现CommandLineRunner。@Component @Order(value = 2) public class DroolsAutoDbRule implements CommandLin...
SpringBoot定制自己的bean
<em>springboot</em>每次使用都是直接autowire注入进去的,然后注入进去并不能set &amp; get 来修改属性,这高度封装就产生了一个问题。像之前用Spring,在xml文件配置一下即可,但SpringBoot呢? 方法一: 以最常见的DataSource数据库为例。一般注入DataSource直接在application.properties配置一下数据源即可以使用,返回的为Spr...
springboot注入bean的问题
[code=java]@ServerEndpoint(value = "/websocket")rn@Componentrnpublic class WebSocketrnrn @Autowiredrn private IntegralDao integralDao; rn rn @OnOpen rn public void onOpen() rn System.out.println("连接已完成"); rn rn rn @OnMessage rn public void say(String message, Session session) rn try rn Integral integral = integralDao.findIntegralByUserName(message);rn session.getBasicRemote().sendText(String.valueOf(integral.getState())); rn catch (IOException e) rn e.printStackTrace(); rn rn [/code]rnrn
springboot初始化bean扫描
这里主要是扫描自定义注解 public class AnnotationScan implements ApplicationListener{ @Autowired RedisTemplate redisTemplate; private final static Logger logger = LoggerFactory.getLogger(Annotation
bean of type"">Junit Spring "No unique bean of type"
我在用Junit对一个集成了SSH的项目进行做测试。rn但在调用<em>bean</em>时(applicationContext.getBean()时)出现了异常:”No unique <em>bean</em> of <em>type</em>“rnrn上网查了一下,说是Spring默认按<em>type</em>加载。所以我在applicationContext.xml里这样写:rn[code=XML]rnrnrnrnrnrnrnrn...rnrn[/code]rnrn但这样做还是不行,报同样的错误。rnrn我在单个<em>bean</em>(测试类中用到的<em>bean</em>)上加[color=#FF0000]autowire="byName"[/color],也不行rnrn请问这样的问题怎么解决?rnrn附异常信息:rnrn说明:我在<em>bean</em>的配置文件里确实有两个transactionManager——rn其一,transactionManager(类型:org.springframework.orm.hibernate3.HibernateTransactionManager),rn其二,jdbcTransactionManager(类型:org.springframework.jdbc.datasource.DataSourceTransactionManager)rn我想,他们都是org.springframework.transaction.PlatformTransactionManager的子类,而spring又是按类型装载,所以就找到了两个实例。rnrn[code=Java]rnorg.springframework.<em>bean</em>s.factory.UnsatisfiedDependencyException: Error creating <em>bean</em> with name 'com.dayee.test168.manage.user.web.logic.WebUserLogicTest': Unsatisfied dependency expressed through <em>bean</em> property 'transactionManager': : [color=#FF00FF]No unique <em>bean</em> of <em>type</em>[/color] [color=#FF0000][org.springframework.transaction.PlatformTransactionManager][/color] is defined: [color=#FF0000]expected single matching <em>bean</em> but found 2: [transactionManager, jdbcTransactionManager][/color]; nested exception is org.springframework.<em>bean</em>s.factory.NoSuchBeanDefinitionException: No unique <em>bean</em> of <em>type</em> [org.springframework.transaction.PlatformTransactionManager] is defined: expected single matching <em>bean</em> but found 2: [transactionManager, jdbcTransactionManager]rn at org.springframework.<em>bean</em>s.factory.support.AbstractAutowireCapableBeanFactory.autowireByType(AbstractAutowireCapableBeanFactory.java:1091)rn at org.springframework.<em>bean</em>s.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:982)rn at org.springframework.<em>bean</em>s.factory.support.AbstractAutowireCapableBeanFactory.autowireBeanProperties(AbstractAutowireCapableBeanFactory.java:329)rn at org.springframework.test.AbstractDependencyInjectionSpringContextTests.injectDependencies(AbstractDependencyInjectionSpringContextTests.java:179)rn at org.springframework.test.AbstractDependencyInjectionSpringContextTests.prepareTestInstance(AbstractDependencyInjectionSpringContextTests.java:158)rn at org.springframework.test.AbstractSingleSpringContextTests.setUp(AbstractSingleSpringContextTests.java:88)rn at junit.framework.TestCase.runBare(TestCase.java:132)rn at org.springframework.test.ConditionalTestCase.runBare(ConditionalTestCase.java:69)rn at junit.framework.TestResult$1.protect(TestResult.java:110)rn at junit.framework.TestResult.runProtected(TestResult.java:128)rn at junit.framework.TestResult.run(TestResult.java:113)rn at junit.framework.TestCase.run(TestCase.java:124)rn at junit.framework.TestSuite.runTest(TestSuite.java:243)rn at junit.framework.TestSuite.run(TestSuite.java:238)rn at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:83)rn at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:45)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:460)rn at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)rn at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)rn at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)rnCaused by: org.springframework.<em>bean</em>s.factory.NoSuchBeanDefinitionException: No unique <em>bean</em> of <em>type</em> [org.springframework.transaction.PlatformTransactionManager] is defined: expected single matching <em>bean</em> but found 2: [transactionManager, jdbcTransactionManager]rn at org.springframework.<em>bean</em>s.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:621)rn at org.springframework.<em>bean</em>s.factory.support.AbstractAutowireCapableBeanFactory.autowireByType(AbstractAutowireCapableBeanFactory.java:1076)rn ... 20 morernrnrn[/code]
NoSuchBeanDefinitionException: No qualifying bean of type [UserRepository.UserRe
在尝试使用Spring Data时出现了如下错误:rnrnorg.springframework.<em>bean</em>s.factory.NoSuchBeanDefinitionException: No qualifying <em>bean</em> of <em>type</em> [UserRepository.UserRepository] is definedrn at org.springframework.<em>bean</em>s.factory.support.DefaultListableBeanFactory.getBean(DefaultListableBeanFactory.java:371)rn at org.springframework.<em>bean</em>s.factory.support.DefaultListableBeanFactory.getBean(DefaultListableBeanFactory.java:331)rn at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:968)rn at Test.SpringDataTest.getByLastName(SpringDataTest.java:34)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.junit.internal.runners.TestMethod.invoke(TestMethod.java:59)rn at org.junit.internal.runners.MethodRoadie.runTestMethod(MethodRoadie.java:98)rn at org.junit.internal.runners.MethodRoadie$2.run(MethodRoadie.java:79)rn at org.junit.internal.runners.MethodRoadie.runBeforesThenTestThenAfters(MethodRoadie.java:87)rn at org.junit.internal.runners.MethodRoadie.runTest(MethodRoadie.java:77)rn at org.junit.internal.runners.MethodRoadie.run(MethodRoadie.java:42)rn at org.junit.internal.runners.JUnit4ClassRunner.invokeTestMethod(JUnit4ClassRunner.java:88)rn at org.junit.internal.runners.JUnit4ClassRunner.runMethods(JUnit4ClassRunner.java:51)rn at org.junit.internal.runners.JUnit4ClassRunner$1.run(JUnit4ClassRunner.java:44)rn at org.junit.internal.runners.ClassRoadie.runUnprotected(ClassRoadie.java:27)rn at org.junit.internal.runners.ClassRoadie.runProtected(ClassRoadie.java:37)rn at org.junit.internal.runners.JUnit4ClassRunner.run(JUnit4ClassRunner.java:42)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)rnrn另外该项目是在maven中建立的,麻烦大神帮我看一下哪儿有问题,自己找了很久都没有找到,rnrnapplicationContext.xml中的代码:rn[code=html]rn rn rn rn rn rn rnrn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn org.hibernate.cfg.ImprovedNamingStrategyrn rn org.hibernate.dialect.MySQL5InnoDBDialectrn truern truern updatern rn rn rnrn rn rn rn rnrn rn rnrn rn rn rn rnrn[/code]rnrnUser.Java文件:rn[code=java]rnimport java.util.Date;rnimport javax.persistence.*;rn@Table(name="user")rn@Entityrnrnpublic class User rn private Integer id;rn private String username;rn private Date birthday;rn private String sex;rn private String address;rn rn @GeneratedValuern @Idrn public Integer getId() rn return id;rn rn public void setId(Integer id) rn this.id = id;rn rn public String getUsername() rn return username;rn rn public void setUsername(String username) rn this.username = username;rn rn public Date getBirthday() rn return birthday;rn rn public void setBirthday(Date birthday) rn this.birthday = birthday;rn rn public String getSex() rn return sex;rn rn public void setSex(String sex) rn this.sex = sex;rn rn public String getAddress() rn return address;rn rn public void setAddress(String address) rn this.address = address;rn rn rnrnrn[/code]rnrnrnUserRepository .Java文件:rn[code=java]rnimport org.springframework.data.repository.Repository;rnrnimport User.User;rnpublic interface UserRepository extends Repositoryrn User getByLastName(String name);rnrnrn[/code]rnrnTest.Java文件:rn[code=java]rnpublic class SpringDataTest rnrn private ApplicationContext applicationContext;rn rn rn applicationContext=new ClassPathXmlApplicationContext("applicationContext.xml");rn rn rn @Testrn public void getByLastName()rn System.out.println("++++++++++++");rn UserRepository userRepository= applicationContext.getBean(UserRepository.class);rn User user=userRepository.getByLastName("big");rn System.out.println(user);rn rnrnrn[/code]rnrnmaven项目目录rn[img=https://img-bbs.csdn.net/upload/201611/07/1478487023_769558.png][/img]
spring boot No qualifying bean of type
这是报错:rnorg.springframework.<em>bean</em>s.factory.UnsatisfiedDependencyException: Error creating <em>bean</em> with name 'com.example.demo.UserRepositoryTests': Unsatisfied dependency expressed through field 'userIface'; nested exception is org.springframework.<em>bean</em>s.factory.NoSuchBeanDefinitionException: No qualifying <em>bean</em> of <em>type</em> 'com.example.demo.domain.UserRepository' available: expected at least 1 <em>bean</em> which qualifies as autowire candidate. Dependency annotations: @org.springframework.<em>bean</em>s.factory.annotation.Autowired(required=true)rn这是我的代码:rn[img=https://img-bbs.csdn.net/upload/201712/02/1512186082_167393.png][/img]rnrn[img=https://img-bbs.csdn.net/upload/201712/02/1512186092_47450.png][/img]rnrn[img=https://img-bbs.csdn.net/upload/201712/02/1512186106_119157.png][/img]rnrn[img=https://img-bbs.csdn.net/upload/201712/02/1512186116_354226.png][/img]
Springboot学习-bean的定义
Springboot以其强大的功能而广受开发者的喜爱,其中非常优秀的一个功能就是注解非常智能化,本文探讨<em>springboot</em>的自动发现功能。spring框架中用来定义<em>bean</em>的注解有@Repository,@Component,@Bean(@Configuration注解的类中),@Controller,@Service,等注解。这些注解用来标记对应的类是一个<em>bean</em>,然而,如何在spring容器...
为什么这句explain出来的typeall
explain SELECT u.id FROM user AS u, user_friend AS uf WHERE rn(uf.user_id = 1 AND uf.friend_id = u.id) OR rn(uf.friend_id = 1 AND uf.user_id = u.id) ;rnrn改成select xx union select xx就快很多rnrn
010 Editor v3.2.2 All License Type Kemaker
目前网上仅有的一款 010 Editor v3.2.2 所有授权类型的注册机,随机生成 4组或5组注册码。
SpringBoot 第一个项目
1.构建项目: 构建SpringBoot项目一般采用两种方式:gradle、maven;官网的所有示例都是使用gradle;工作中一直使用maven,故下面的示例使用maven。 创建一个maven项目,对应的pom.xml 文件为: org.springframework.boot <artifact
mysql外键关联查询type为ALL
有一张表有两个外键,如下如所示rn[img=https://img-bbs.csdn.net/upload/201804/19/1524109918_393754.png][/img]rn[img=https://img-bbs.csdn.net/upload/201804/19/1524109927_987113.png][/img]rnrn用explain分析时,连接customer_source_id相关联这张表查询时,<em>type</em>为eq_ref,是正常的,如图:rn[img=https://img-bbs.csdn.net/upload/201804/19/1524109937_252018.png][/img]rnrn但在查询customer_<em>type</em>_id关联的这张表时,<em>type</em>却是ALL,如图:rn[img=https://img-bbs.csdn.net/upload/201804/19/1524109946_841107.png][/img]rnrn如果仅查询lc_customer_<em>type</em>的主键,则会正常使用index,如图:rn[img=https://img-bbs.csdn.net/upload/201804/19/1524109957_5167.png][/img]rnrn这是什么原因呢?是lc_customer这张表有问题还是lc_customer_<em>type</em>有问题呢?
mysql 执行计划存在Using filesort type=ALL
mysql 执行计划存在Using filesort <em>type</em>=ALL,请问如何优化rn[img=https://img-bbs.csdn.net/upload/201702/16/1487240520_65100.png][/img]rn索引贴图rn[img=https://img-bbs.csdn.net/upload/201702/16/1487240766_608848.png][/img]
JSF的UIData问题Error getting property 'id' from bean of type java.lang.String
一个jsf测试UIData的小程序,出了问题。搞了一天都没出来。用的是tomcat mysql。报错:rnjavax.servlet.ServletException: javax.servlet.jsp.JspException: javax.faces.el.PropertyNotFoundException: Error <em>getting</em> property 'id' from <em>bean</em> of <em>type</em> java.lang.Stringrn org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:858)rn org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:791)rn org.apache.jsp.admin_jsp._jspService(admin_jsp.java:101)rn org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)rn javax.servlet.http.HttpServlet.service(HttpServlet.java:717)rn org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:377)rn org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)rn org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)rn javax.servlet.http.HttpServlet.service(HttpServlet.java:717)rn com.sun.faces.context.ExternalContextImpl.dispatch(ExternalContextImpl.java:322)rn com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:147)rn com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:87)rn com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:200)rn com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:117)rn javax.faces.webapp.FacesServlet.service(FacesServlet.java:198)rnrn。。项目下有两个jsf程序,一个读取student表数据可以获取数据并显示,一个读取另一个表不能,报错,而且在管理<em>bean</em>中增加System语句测试,根本没有调用其中的get方法rn。public class ShowUsers rn /*ResultSet users;rn rn public void setUsers(ResultSet users) rn this.users = users;rn */rnrn public ResultSet getUsers() throws SQLExceptionrn rn System.out.println("c<em>all</em> getUsers at Myshopping.showusers");rn rn /*String sql = "select *from user";rn ResultSet rs = null;rn rn try rn DataBaseUtil dataBaseUtil = DataBaseUtil.getDateBaseUtil();rn Connection conn = dataBaseUtil.getConnection();rn Statement stmt = dataBaseUtil.createStmt(conn);rn rs = dataBaseUtil.executeQuery(stmt, sql);rn ResultSetMetaData rsmd=rs.getMetaData();rn int j=0;rn j=rsmd.getColumnCount();rn for(int k=0;krn showUsersrn admin.ShowUsersrn sessionrn rn rn studentsrn data.Studentsrn sessionrn rn报错jsf页面的部分代码:rn rn rn rn rn 。。省略rn而且在管理<em>bean</em>总增加System语句测试,根本没有调用其中的get方法rn两个页面很相似的。搞不明白为什么一个可以。一个找不到属性
collection was not processed by flush() org.hibernate.AssertionFailure:
[dtss] 2012-03-15 12:30:58,515 ERROR [btpool0-3] org.hibernate.AssertionFailure.-22 | an assertion failure occured (this may indicate a bug in Hibernate, but is more likely due to unsafe use of the session)rnorg.hibernate.AssertionFailure: collection [gov.sdta.dtss.domain.info.destination.Destination.distCenterList] was not <em>processed</em> by flush()rn at org.hibernate.engine.CollectionEntry.postFlush(CollectionEntry.java:205)rn at org.hibernate.event.def.AbstractFlushingEventListener.postFlush(AbstractFlushingEventListener.java:333)rn at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:28)rn at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1001)rn at org.hibernate.ejb.AbstractEntityManagerImpl.flush(AbstractEntityManagerImpl.java:304)rn at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)rn at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)rn at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)rn at java.lang.reflect.Method.invoke(Method.java:597)rn at org.springframework.orm.jpa.ExtendedEntityManagerCreator$ExtendedEntityManagerInvocationHandler.invoke(ExtendedEntityManagerCreator.java:358)rn at $Proxy68.flush(Unknown Source)rn at org.springframework.orm.jpa.JpaTemplate$8.doInJpa(JpaTemplate.java:295)rn at org.springframework.orm.jpa.JpaTemplate.execute(JpaTemplate.java:184)rn at org.springframework.orm.jpa.JpaTemplate.flush(JpaTemplate.java:293)rn在程序中打上断点无法跟踪到错误源头,希望各位大虾帮帮忙,不胜感激!!!
mnist数据资源processed
mnist数据资源<em>processed</em>,即为用于mnist中的<em>processed</em>文件夹
springboot启动类加载xml文件-bean
众所周知,<em>springboot</em>为了简化配置,极大多数的配置都简化到application.properties中了,不过对于某些入门难,属性配置复杂的框架,仍然需要xml配置,如何正确加载,请看下面代码: /** * 启动类,程序入口 */ @EnableWebMvc @SpringBootApplication @ImportResource(&quot;classpath:spring-conf...
SpringBoot手动获取Bean类
一般在多线程的环境中,<em>bean</em>类的获取不能通过自动装载来获取到,spring会认为其不安全,也就是不能用@Autowired注解来获取<em>bean</em>类。 这时候需要来在Spring中来手动获取<em>bean</em>类。 需要继承实现ApplicationContextAware接口 @Component public class BeanFactoryTest implements ApplicationCont...
SpringBoot基础篇Bean之自动加载
更多Spring文章,欢迎点击 一灰灰Blog-Spring专题 前面一篇介绍了Bean的常用姿势,在一个项目中,可能不会出现什么问题,可如果你提供了一个Jar包供第三方用户使用,那么你这个jar包中的Bean,能被第三方加载么? 本篇博文将主要介绍AutoConfig相关的内容,即如果我想提供一个jar包供第三方在Spring的环境下使用时,可以怎么做 I. AutoConfigurati...
springBoot 创建bean失败问题分析
今天在工作的时候遇到一个巨坑的bug, 日志提示是这样的。 Caused by: org.springframework.<em>bean</em>s.factory.BeanCreationException: Error creating <em>bean</em> with name 'userService': Injection of resource dependencies failed; nested excep...
Springboot加载bean查找父类
Springboot加载<em>bean</em>的时候,有时候有些类不再spring.factory文件中,但是声明的@Bean方法却能加载<em>bean</em>,spring是怎么处理的呢,我们以spring-webflux包中的WebFluxConfigurationSupport类为例说明,这个类有许多的@<em>bean</em>方法,其中之一: @Bean public DispatcherHandler webHandler...
springboot 使用@Bean 好处与坏处
相信使用过<em>springboot</em> 的人都有用过@Configuration加上@Bean去注册一个<em>bean</em> 对象,这样我们就不用再去写xml文件去注册<em>bean</em>对象。 而@Configuration标注在类上,相当于把该类作为spring的xml配置文件中的&amp;lt; <em>bean</em>s&amp;gt;,作用为:配置spring容器(应用上下文), @Bean标注在方法上(返回某个实例的方法),等价于spring的...
springbootbean的手动注入
<em>springboot</em>中<em>bean</em>的手动注入 前一段时间学习<em>springboot</em>,遇到<em>bean</em>手动注入的问题,搞了很久终于弄出来了,废话不多说直接上代码: 1.下面示例为实现ApplicationContextAware 的工具类,可以通过其它类引用它以操作spring容器及其中的Bean实例。 package com.<em>springboot</em>Mybatis.common.tool; import org...
Springboot的bean注册机制(一)
我们在写<em>springboot</em>项目时,@Controller、@Service、@Configuration、@Component注解的类是如何被扫描到的呢?本文将逐步揭开<em>springboot</em>组件扫描机制的面纱。 示例项目 先以一个demo展示一个普通的<em>springboot</em>项目在启动的过程中,注册了哪些<em>bean</em>。项目示例图如下: 代码github地址 主要看下自定义的<em>bean</em>工厂后置处理器类 @...
Springboot的bean注册机制(二)
上一篇文章介绍了PostProcessorRegistrationDelegate这个委托类在高层次上对于<em>bean</em>工厂后置处理器的调用分析,得到了一个基本结论,自定义的<em>bean</em>组件都是在ConfigurationClassPostProcessor这个类处理的,我们这次来看看这个类是如何处理<em>bean</em>的扫描、解析与注册的。 ConfigurationClassPostProcessor类分析 /*...
打印所有SpringBoot载入的bean
@SpringBootApplication public class Application { private static final Logger logger = LoggerFactory.getLogger(Application.class); public static void main(String[] args) { ApplicationC...
Springboot 测试类无法找Bean
原因是测试类的package不应当比controller类更高,否则就找不到。具体的原因估计是annotation之间的依赖关系,暂时不深究了。java.lang.IllegalStateException: Unable to find a @SpringBootConfiguration, you need to use @ContextConfiguration or @SpringBoo...
SpringBoot基础篇Bean之动态注册
更多Spring文章,欢迎点击 一灰灰Blog-Spring专题 Spring中的Bean除了前面提到的几种JavaConfig或者@Component等注解标识之外,也是可以动态的向Spring容器注册的,本篇博文将主要介绍 如何向Spring容器注册Bean 如何引用主动注册的Bean 注册的Bean中,如果依赖其他的Bean,怎么操作 I. 手动注册Bean方式 1. 核心实现类 ...
springboot启动时注册bean流程
注册<em>bean</em>是在refreshContext(context)方法中 一步步点进去,最终进入到AbstracApplicationContext.java中的refresh()中。spring注册<em>bean</em>有两个时机, 1:getBean的时候 2:初始化是的lazy-init设置的false。 finishBeanFactoryInitialization()点进去,可以...
springbootbean的实例化顺序
![图片说明](https://img-ask.csdn.net/upload/201801/09/1515467668_233554.png)rn![图片说明](https://img-ask.csdn.net/upload/201801/09/1515467678_580944.png)rn有什么方法让ZookeeperServiceRegister实例化完了,再到ThriftServiceRegister
springboot打印扫描到的的bean
/** * @author jingke */ @SpringBootApplication @ComponentScan(basePackages = {&quot;com.ancun.common.service&quot;, &quot;com.ancun.common.controller&quot;, &quot;com.ancun.common.repository&quot;, &quot;com.a...
springboot实现bean手动注入
1.<em>springboot</em>启动类实现接口ApplicationListener&amp;lt;ContextRefreshedEvent&amp;gt;,实现方法onApplicationEvent,初始化上下文 package test.projectTest; import org.mybatis.spring.boot.autoconfigure.MybatisAutoConfiguration; imp...
SpringBoot bean无法注入的问题!
整个项目通过Maven构建,大致结构: 核心Spring框架一个module spring-boot-base service和dao一个module server-core 提供系统后台数据管理一个module server-platform-app 给移动端提供rest数据接口一个module server-mobile-api 其中server-platform-app 与server-mo...
SpringBoot bean注入的三种方式
搜索maven依赖 https://search.maven.org/   spring <em>bean</em>注入的三种方式: 方式一: @Controller(value = &quot;my_userController&quot;) @Repository(value = &quot;userDao&quot;) @Service @Repository(value = &quot;userDao&quot;) package com.edu.s...
springboot实现个别bean懒加载
懒加载---就是我们在spring容器启动的是先不把所有的<em>bean</em>都加载到spring的容器中去,而是在当需要用的时候,才把这个对象实例化到容器中。@Lazy在需要懒加载的<em>bean</em>上加上@Lazy就可以了...
SpringBoot中工具类注入Bean
1.问题 由于Util工具类中需要读取配置信息,需要注入Bean,但是如果将方法设置为静态方法,就无法读取到注入Bean。在springframework里,我们不能@Autowire一个静态变量,使之成为一个spring <em>bean</em>,例如: @Autowired private static LogConfig logConfig; 这样做,启动时还正常,但是调用方法是就会出现空指针异常。因...
Getting Started With MachineLearning (all in one)part2(包含正本的链接)
来自SAP(全球第一大商业软件公司)的梁劲(Jim Liang)公开了自己所写的一份 520 页的学习教程(英文版),详细、明了地介绍了机器学习中的相关概念、数学知识和各种经典算法。
Getting Started With MachineLearning (all in one)part1(包含正本的链接)
来自SAP(全球第一大商业软件公司)的梁劲(Jim Liang)公开了自己所写的一份 520 页的学习教程(英文版),详细、明了地介绍了机器学习中的相关概念、数学知识和各种经典算法。
all in all
编程 <em>all</em> in <em>all</em>的源代码,欢迎大家一起纠正,寻求最简单的方法
All in All
DescriptionnnYou have devised a new encryption technique which encodes a message by inserting between its characters randomly generated strings in a clever way. Because of pending patent issues we will not discuss in detail how the strings are generated and inserted into the original message. To validate your method, however, it is necessary to write a program that checks if the message is re<em>all</em>y encoded in the final string.nnGiven two strings s and t, you have to decide whether s is a subsequence of t, i.e. if you can remove characters from t such that the concatenation of the remaining characters is s. nInputnnThe input contains several testcases. Each is specified by two strings s, t of alphanumeric ASCII characters separated by whitespace.The length of s and t will no more than 100000. nOutputnnFor each test case output “Yes”, if s is a subsequence of t,otherwise output “No”. nSample Inputnnsequence subsequence nperson compression nVERDI vivaVittorioEmanueleReDiItalia ncaseDoesMatter CaseDoesMatter nSample OutputnnYes nNo nYes nNo
springmvc 注解失败 No qualifying bean of type
这是代码[b]Controller[/b][code=java]@Controllerrnpublic class WeatherAction rn @Autowiredrn private WeatherService weatherService;rn @RequestMapping("/find")rn public @ResponseBody String find(String test)rn WeatherDO weatherDO = weatherService.findWeather(test);rn return weatherDO.getCityname();rn rn[/code][b]service[/b][code=java]public interface WeatherService rn public WeatherDO findWeather(String test);rn[/code][b]service实现[/b][code=java]@Servicernpublic class WeatherServiceImpl implements WeatherService rn @Autowiredrn private WeatherDao weatherDao;rn public WeatherDO findWeather(String test) rn if (Utils.isHowManyNumbers(6, test)) rn return weatherDao.findByPostcode(test);rn rn if (Utils.isHowManyNumbers(9, test)) rn return weatherDao.findByCitycode(test);rn rn return weatherDao.findByCityname(test);rn rn[/code][b]DAO[/b][code=java]public interface WeatherDao rn public WeatherDO findByCityname(String cityname);rn public WeatherDO findByCitycode(String citycode);rn public WeatherDO findByPostcode(String postcode);rn [/code]接下来就是配置文件[b]web.xml[/b][code=xml]rnrn rn rn rn encodingFilterrn org.springframework.web.filter.CharacterEncodingFilterrn rn encodingrn UTF-8 rn rn rn rn encodingFilterrn /* rn rn rn rn rn org.springframework.web.context.ContextLoaderListenerrn rn rn rn contextConfigLocationrn classpath*:spring-*.xml rn rn rn rn spring-dispatcherrn org.springframework.web.servlet.DispatcherServletrn rn contextConfigLocationrn classpath:spring/spring-dispatcher.xmlrn rn 1rn rn rn spring-dispatcherrn /*rn rn rn rn path-filterrn com.lljqiu.test.PathFilterrn rn rn path-filterrn /*rn rnrn[/code][b]spring-datasource.xml[/b][code=xml]rn rn rn rn rn rn $database.driver rn $database.url rn $database.username rn $database.password rn $database.maxActive rn $database.initialSize rn $database.maxWait rn $database.maxIdle rn $database.minIdle rn $database.removeAbandoned rn $database.removeAbandonedTimeout rn $database.connectionPropertiesrn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rnrn[/code][b]spring-dispatcher.xml[/b][code=xml]rnrn rn rn rn rn rn rn classpath:config/ftl.propertiesrn rn rn rn rn rn rn rn rn rn rn 10rn zh_CNrn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn[/code][b]spring-service.xml[b][code=xml]rnrn rn rn rn rn rn[/code]
spring整合mybatis 出现“No unique bean of type
做了一个[color=#00FF00]Junit测试 测试通过[/color] 但已部署到toncat上,启动时就报错了rn[code=java]严重: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListenerrnorg.springframework.<em>bean</em>s.factory.BeanCreationException: Error creating <em>bean</em> with name 'testTbDaoImpl': Injection of resource fields failed; nested exception is org.springframework.<em>bean</em>s.factory.NoSuchBeanDefinitionException: No unique <em>bean</em> of <em>type</em> [cn.byj.core.dao.TestTbDao] is defined: Unsatisfied dependency of <em>type</em> [interface cn.byj.core.dao.TestTbDao]: expected at least 1 matching <em>bean</em>rn at org.springframework.context.annotation.CommonAnnotationBeanPostProcessor.postProcessAfterInstantiation(CommonAnnotationBeanPostProcessor.java:292)rn at org.springframework.<em>bean</em>s.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:959)rn at org.springframework.<em>bean</em>s.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:472)rn at org.springframework.<em>bean</em>s.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)rn at java.security.AccessController.doPrivileged(Native Method)rn at org.springframework.<em>bean</em>s.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380)rn at org.springframework.<em>bean</em>s.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264)rn at org.springframework.<em>bean</em>s.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:221)rn at org.springframework.<em>bean</em>s.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261)rn at org.springframework.<em>bean</em>s.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185)rn at org.springframework.<em>bean</em>s.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164)rn at org.springframework.<em>bean</em>s.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:429)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:5016)rn at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5524)rn at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)rn at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901)rn at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)rn at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:649)rn at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1245)rn at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1895)rn at java.util.concurrent.Executors$RunnableAdapter.c<em>all</em>(Executors.java:471)rn at java.util.concurrent.FutureTask.run(FutureTask.java:262)rn at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)rn at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)rn at java.lang.Thread.run(Thread.java:744)rnCaused by: org.springframework.<em>bean</em>s.factory.NoSuchBeanDefinitionException: No unique <em>bean</em> of <em>type</em> [cn.byj.core.dao.TestTbDao] is defined: Unsatisfied dependency of <em>type</em> [interface cn.byj.core.dao.TestTbDao]: expected at least 1 matching <em>bean</em>rn at org.springframework.<em>bean</em>s.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:613)rn at org.springframework.context.annotation.CommonAnnotationBeanPostProcessor.autowireResource(CommonAnnotationBeanPostProcessor.java:431)rn at org.springframework.context.annotation.CommonAnnotationBeanPostProcessor.getResource(CommonAnnotationBeanPostProcessor.java:409)rn at org.springframework.context.annotation.CommonAnnotationBeanPostProcessor$ResourceElement.getResourceToInject(CommonAnnotationBeanPostProcessor.java:537)rn at org.springframework.<em>bean</em>s.factory.annotation.InjectionMetadata$InjectedElement.inject(InjectionMetadata.java:180)rn at org.springframework.<em>bean</em>s.factory.annotation.InjectionMetadata.injectFields(InjectionMetadata.java:105)rn at org.springframework.context.annotation.CommonAnnotationBeanPostProcessor.postProcessAfterInstantiation(CommonAnnotationBeanPostProcessor.java:289)rn ... 29 more[/code]rn[color=#00FF00]下面贴上配置文件[/color]rnrnapplication-context.xmlrn[img=https://img-bbs.csdn.net/upload/201509/09/1441780962_204355.jpg][/img]rnrnannotation.xmlrn[img=https://img-bbs.csdn.net/upload/201509/09/1441781065_207042.jpg][/img]rnrnjdbc.xmlrn[img=https://img-bbs.csdn.net/upload/201509/09/1441781101_960016.jpg][/img]rnrnmybatis.xmlrn[img=https://img-bbs.csdn.net/upload/201509/09/1441781104_748546.jpg][/img]rntransation.xml[img=https://img-bbs.csdn.net/upload/201509/09/1441781177_349573.jpg][/img]rnrnweb.xmlrn[img=https://img-bbs.csdn.net/upload/201509/09/1441781300_697095.jpg][/img]rnproperty.xml我就不贴了 求大神帮忙看一下
No unique bean of type [com.dao.IBaseDAO] is defined: expecte
错误信息:rnorg.springframework.<em>bean</em>s.factory.BeanCreationException: Error creating <em>bean</em> with name 'regionBIZImpl': Injection of resource fields failed; nested exception is org.springframework.<em>bean</em>s.factory.NoSuchBeanDefinitionException: No unique <em>bean</em> of <em>type</em> [com.dao.IBaseDAO] is defined: expected single matching <em>bean</em> but found 2: [regionDAO, userDAO]rnrn我的关系代码如下:rnrn·公共层代码:rnpublic interface IBaseDAO rnrnpublic class BaseDAOImpl extends HibernateDaoSupport implements IBaseDAO rnrn·使用层:rn@Repositoryrnpublic class RegionDAO extends BaseDAOImpl rnrn@Servicernpublic class RegionBIZImpl extends BaseBIZ implements IRegionBIZ rn @Resourcern private RegionDAO regionDAO;rnrn多多指教……
Bean named 'txAdvice' must be of type [org.aopalliance.aop.Advice]
org.springframework.<em>bean</em>s.factory.BeanCreationException: Error creating <em>bean</em> with name 'userService' defined in URL [file:/D:/WorkSpace/apache-tomcat-6.0.33/webapps/SingleUsers/WEB-INF/classes/applicationContext.xml]: Initialization of <em>bean</em> failed; nested exception is org.springframework.<em>bean</em>s.factory.BeanNotOfRequiredTypeException: Bean named 'txAdvice' must be of <em>type</em> [org.aop<em>all</em>iance.aop.Advice], but was actu<em>all</em>y of <em>type</em> [org.springframework.transaction.interceptor.TransactionInterceptor]rn at org.springframework.<em>bean</em>s.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:527)rn at org.springframework.<em>bean</em>s.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)rn at org.springframework.<em>bean</em>s.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:295)rn at org.springframework.<em>bean</em>s.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:225)rn at org.springframework.<em>bean</em>s.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:292)rn at org.springframework.<em>bean</em>s.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)rn at org.springframework.<em>bean</em>s.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:580)rn at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:913)rn at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:464)rn at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:377)rn at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:278)rn at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:111)rn at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4206)rn at org.apache.catalina.core.StandardContext.start(StandardContext.java:4705)rn at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:799)rn at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:779)rn at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:601)rn at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1079)rn at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:1002)rn at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:506)rn at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1317)rn at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:324)rn at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:142)rn at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1065)rn at org.apache.catalina.core.StandardHost.start(StandardHost.java:840)rn at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1057)rn at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:463)rn at org.apache.catalina.core.StandardService.start(StandardService.java:525)rn at org.apache.catalina.core.StandardServer.start(StandardServer.java:754)rn at org.apache.catalina.startup.Catalina.start(Catalina.java:595)rn at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)rn at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)rn at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)rn at java.lang.reflect.Method.invoke(Method.java:597)rn at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)rn at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)rnCaused by: org.springframework.<em>bean</em>s.factory.BeanNotOfRequiredTypeException: Bean named 'txAdvice' must be of <em>type</em> [org.aop<em>all</em>iance.aop.Advice], but was actu<em>all</em>y of <em>type</em> [org.springframework.transaction.interceptor.TransactionInterceptor]rn at org.springframework.<em>bean</em>s.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:353)rn at org.springframework.<em>bean</em>s.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:198)rn at org.springframework.aop.support.AbstractBeanFactoryPointcutAdvisor.getAdvice(AbstractBeanFactoryPointcutAdvisor.java:85)rn at org.springframework.aop.aspectj.AspectJProxyUtils.isAspectJAdvice(AspectJProxyUtils.java:67)rn at org.springframework.aop.aspectj.AspectJProxyUtils.makeAdvisorChainAspectJCapableIfNecessary(AspectJProxyUtils.java:49)rn at org.springframework.aop.aspectj.autoproxy.AspectJAwareAdvisorAutoProxyCreator.extendAdvisors(AspectJAwareAdvisorAutoProxyCreator.java:101)rn at org.springframework.aop.framework.autoproxy.AbstractAdvisorAutoProxyCreator.findEligibleAdvisors(AbstractAdvisorAutoProxyCreator.java:88)rn at org.springframework.aop.framework.autoproxy.AbstractAdvisorAutoProxyCreator.getAdvicesAndAdvisorsForBean(AbstractAdvisorAutoProxyCreator.java:68)rn at org.springframework.aop.framework.autoproxy.AbstractAutoProxyCreator.wrapIfNecessary(AbstractAutoProxyCreator.java:359)rn at org.springframework.aop.framework.autoproxy.AbstractAutoProxyCreator.postProcessAfterInitialization(AbstractAutoProxyCreator.java:322)rn at org.springframework.<em>bean</em>s.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsAfterInitialization(AbstractAutowireCapableBeanFactory.java:407)rn at org.springframework.<em>bean</em>s.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1426)rn at org.springframework.<em>bean</em>s.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)rn ... 35 more
No qualifying bean of type [com.dao.UserMapper] found for dependency:
使用 spring +maven + mybaits + jetty 启动是报错 rnrnCaused by: org.springframework.<em>bean</em>s.factory.NoSuchBeanDefinitionException: No qualifying <em>bean</em> of <em>type</em> [com.dao.UserMapper] found for dependency: expected at least 1 <em>bean</em> which qualifies as autowire candidate for this dependency. Dependency annotations: @javax.annotation.Resource(shareable=true, mappedName=, description=, name=, <em>type</em>=class java.lang.Object, lookup=, authenticationType=CONTAINER)rn at org.springframework.<em>bean</em>s.factory.support.DefaultListableBeanFactory.raiseNoSuchBeanDefinitionException(DefaultListableBeanFactory.java:1301)[img=https://img-bbs.csdn.net/upload/201601/27/1453872298_796959.png][/img]rn at org.springframework.<em>bean</em>s.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1047)rn at org.springframework.<em>bean</em>s.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:942)rn at org.springframework.context.annotation.CommonAnnotationBeanPostProcessor.autowireResource(CommonAnnotationBeanPostProcessor.java:457)rn at org.springframework.context.annotation.CommonAnnotationBeanPostProcessor.getResource(CommonAnnotationBeanPostProcessor.java:435)rn at org.springframework.context.annotation.CommonAnnotationBeanPostProcessor$ResourceElement.getResourceToInject(CommonAnnotationBeanPostProcessor.java:559)rn at org.springframework.<em>bean</em>s.factory.annotation.InjectionMetadata$InjectedElement.inject(InjectionMetadata.java:169)rn at org.springframework.<em>bean</em>s.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:88)rn at org.springframework.context.annotation.CommonAnnotationBeanPostProcessor.postProcessPropertyValues(CommonAnnotationBeanPostProcessor.java:305)rn ... 51 morern2016-01-27 13:25:15,069 (AbstractConnector.java:266) INFO [main] Started ServerConnector@352ef9c8HTTP/1.10.0.0.0:8080rn2016-01-27 13:25:15,070 (Server.java:350) INFO [main] Started @1903msrn**********Start jetty ***************rnrnrnrnrn jetty 能启动 不能调用mapper .rnrnrnrn
spring 找不到实现类(No qualifying bean of type
本来以前是好用的,后来,修改在bit包上,又加了一个包,就出错误了,现在改回去,也不好用了。rnrnaction 部分rn[code=java]rnpackage dyna.web.code.Bit;rn@Scope("proto<em>type</em>")rn@Controllerrnpublic class BitAction extends BaseAction implements ModelDriven rnrn @Autowiredrn private BitService bitService;rnrn[/code]rnrn接口部分rn[code=java]rnpackage dyna.web.code.Bit;rnpublic interface BitService rn rn rn public List getList(int s,int t);rn rn public int getCount();rn rn rnrn[/code]rnrn接口实现部分rn[code=java]rnpackage dyna.web.code.Bit.Impl;rn@Servicernpublic class BitServiceImpl implements BitServicernrn @Autowiredrn private BitMapper bitMapper;rn rn public List getList(int s,int t)rn //rn rn rn public int getCount()rn //rn rn rn rnrnrn[/code]rnrn配置文件部分rn[code=java]rn rn rn rn rn rn[/code]rnrn异常部分rnrn[code=java]rnrnUnable to instantiate Action, bitAction, defined for 'bit' in namespace '/'Error creating <em>bean</em> with name 'bitAction': Injection of autowired dependencies failed; nested exception is org.springframework.<em>bean</em>s.factory.BeanCreationException: Could not autowire field: private dyna.web.code.Bit.BitService dyna.web.code.Bit.BitAction.bitService; nested exception is org.springframework.<em>bean</em>s.factory.NoSuchBeanDefinitionException: No qualifying <em>bean</em> of <em>type</em> [dyna.web.code.Bit.BitService] found for dependency: expected at least 1 <em>bean</em> which qualifies as autowire candidate for this dependency. Dependency annotations: @org.springframework.<em>bean</em>s.factory.annotation.Autowired(required=true), @org.springframework.<em>bean</em>s.factory.annotation.Qualifier(value=bitService)rn com.opensymphony.xwork2.DefaultActionInvocation.createAction(DefaultActionInvocation.java:316)rn com.opensymphony.xwork2.DefaultActionInvocation.init(DefaultActionInvocation.java:397)rn com.opensymphony.xwork2.DefaultActionProxy.prepare(DefaultActionProxy.java:194)rn org.apache.struts2.impl.StrutsActionProxy.prepare(StrutsActionProxy.java:63)rn org.apache.struts2.impl.StrutsActionProxyFactory.createActionProxy(StrutsActionProxyFactory.java:39)rn com.opensymphony.xwork2.DefaultActionProxyFactory.createActionProxy(DefaultActionProxyFactory.java:58)rn org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:553)rn org.apache.struts2.dispatcher.ng.ExecuteOperations.executeAction(ExecuteOperations.java:77)rn org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:99)rnrnroot causernrnorg.springframework.<em>bean</em>s.factory.BeanCreationException: Error creating <em>bean</em> with name 'bitAction': Injection of autowired dependencies failed; nested exception is org.springframework.<em>bean</em>s.factory.BeanCreationException: Could not autowire field: private dyna.web.code.Bit.BitService dyna.web.code.Bit.BitAction.bitService; nested exception is org.springframework.<em>bean</em>s.factory.NoSuchBeanDefinitionException: No qualifying <em>bean</em> of <em>type</em> [dyna.web.code.Bit.BitService] found for dependency: expected at least 1 <em>bean</em> which qualifies as autowire candidate for this dependency. Dependency annotations: @org.springframework.<em>bean</em>s.factory.annotation.Autowired(required=true), @org.springframework.<em>bean</em>s.factory.annotation.Qualifier(value=bitService)rn org.springframework.<em>bean</em>s.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:288)rn org.springframework.<em>bean</em>s.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1116)rn org.springframework.<em>bean</em>s.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)rn org.springframework.<em>bean</em>s.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:458)rn org.springframework.<em>bean</em>s.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:314)rn org.springframework.<em>bean</em>s.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)rn org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1117)rn com.opensymphony.xwork2.spring.SpringObjectFactory.buildBean(SpringObjectFactory.java:151)rn com.opensymphony.xwork2.ObjectFactory.buildBean(ObjectFactory.java:151)rn com.opensymphony.xwork2.ObjectFactory.buildAction(ObjectFactory.java:121)rn com.opensymphony.xwork2.DefaultActionInvocation.createAction(DefaultActionInvocation.java:297)rn com.opensymphony.xwork2.DefaultActionInvocation.init(DefaultActionInvocation.java:397)rn com.opensymphony.xwork2.DefaultActionProxy.prepare(DefaultActionProxy.java:194)rn org.apache.struts2.impl.StrutsActionProxy.prepare(StrutsActionProxy.java:63)rn org.apache.struts2.impl.StrutsActionProxyFactory.createActionProxy(StrutsActionProxyFactory.java:39)rn com.opensymphony.xwork2.DefaultActionProxyFactory.createActionProxy(DefaultActionProxyFactory.java:58)rn org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:553)rn org.apache.struts2.dispatcher.ng.ExecuteOperations.executeAction(ExecuteOperations.java:77)rn org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:99)rnrnroot causernrnorg.springframework.<em>bean</em>s.factory.BeanCreationException: Could not autowire field: private dyna.web.code.Bit.BitService dyna.web.code.Bit.BitAction.bitService; nested exception is org.springframework.<em>bean</em>s.factory.NoSuchBeanDefinitionException: No qualifying <em>bean</em> of <em>type</em> [dyna.web.code.Bit.BitService] found for dependency: expected at least 1 <em>bean</em> which qualifies as autowire candidate for this dependency. Dependency annotations: @org.springframework.<em>bean</em>s.factory.annotation.Autowired(required=true), @org.springframework.<em>bean</em>s.factory.annotation.Qualifier(value=bitService)rn org.springframework.<em>bean</em>s.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:514)rn org.springframework.<em>bean</em>s.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:87)rn org.springframework.<em>bean</em>s.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:285)rn org.springframework.<em>bean</em>s.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1116)rn org.springframework.<em>bean</em>s.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)rn org.springframework.<em>bean</em>s.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:458)rn org.springframework.<em>bean</em>s.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:314)rn org.springframework.<em>bean</em>s.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)rn org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1117)rn com.opensymphony.xwork2.spring.SpringObjectFactory.buildBean(SpringObjectFactory.java:151)rn com.opensymphony.xwork2.ObjectFactory.buildBean(ObjectFactory.java:151)rn com.opensymphony.xwork2.ObjectFactory.buildAction(ObjectFactory.java:121)rn com.opensymphony.xwork2.DefaultActionInvocation.createAction(DefaultActionInvocation.java:297)rn com.opensymphony.xwork2.DefaultActionInvocation.init(DefaultActionInvocation.java:397)rn com.opensymphony.xwork2.DefaultActionProxy.prepare(DefaultActionProxy.java:194)rn org.apache.struts2.impl.StrutsActionProxy.prepare(StrutsActionProxy.java:63)rn org.apache.struts2.impl.StrutsActionProxyFactory.createActionProxy(StrutsActionProxyFactory.java:39)rn com.opensymphony.xwork2.DefaultActionProxyFactory.createActionProxy(DefaultActionProxyFactory.java:58)rn org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:553)rn org.apache.struts2.dispatcher.ng.ExecuteOperations.executeAction(ExecuteOperations.java:77)rn org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:99)rnrnroot causernrnorg.springframework.<em>bean</em>s.factory.NoSuchBeanDefinitionException: No qualifying <em>bean</em> of <em>type</em> [dyna.web.code.Bit.BitService] found for dependency: expected at least 1 <em>bean</em> which qualifies as autowire candidate for this dependency. Dependency annotations: @org.springframework.<em>bean</em>s.factory.annotation.Autowired(required=true), @org.springframework.<em>bean</em>s.factory.annotation.Qualifier(value=bitService)rn org.springframework.<em>bean</em>s.factory.support.DefaultListableBeanFactory.raiseNoSuchBeanDefinitionException(DefaultListableBeanFactory.java:986)rn org.springframework.<em>bean</em>s.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:856)rn org.springframework.<em>bean</em>s.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:768)rn org.springframework.<em>bean</em>s.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:486)rn org.springframework.<em>bean</em>s.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:87)rn org.springframework.<em>bean</em>s.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:285)rn org.springframework.<em>bean</em>s.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1116)rn org.springframework.<em>bean</em>s.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)rn org.springframework.<em>bean</em>s.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:458)rn[/code]
No matching bean of type [javax.servlet.ServletContext] found for dependency: ex
我在用junit测试SSH项目的时候抛了无法注入的错误(我的环境是ssh+maven),在tomcat里面跑没问题。。。错如如下:rnorg.springframework.<em>bean</em>s.factory.BeanCreationException: Error creating <em>bean</em> with name 'authorizeService': Injection of resource dependencies failed; nested exception is org.springframework.<em>bean</em>s.factory.BeanCreationException: Error creating <em>bean</em> with name 'sopService': Injection of resource dependencies failed; nested exception is org.springframework.<em>bean</em>s.factory.BeanCreationException: Error creating <em>bean</em> with name 'orderHandler': Injection of resource dependencies failed; nested exception is org.springframework.<em>bean</em>s.factory.BeanCreationException: Error creating <em>bean</em> with name 'mailService': Injection of resource dependencies failed; nested exception is org.springframework.<em>bean</em>s.factory.BeanCreationException: Error creating <em>bean</em> with name 'contentTemplateService': Injection of resource dependencies failed; nested exception is org.springframework.<em>bean</em>s.factory.NoSuchBeanDefinitionException: No matching <em>bean</em> of <em>type</em> [javax.servlet.ServletContext] found for dependency: expected at least 1 <em>bean</em> which qualifies as autowire candidate for this dependency. Dependency annotations: @javax.annotation.Resource(shareable=true, mappedName=, description=, name=, <em>type</em>=class java.lang.Object, authenticationType=CONTAINER)rn at org.springframework.context.annotation.CommonAnnotationBeanPostProcessor.postProcessPropertyValues(CommonAnnotationBeanPostProcessor.java:300)rn at org.springframework.<em>bean</em>s.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1074)rn at org.springframework.<em>bean</em>s.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:517)rn at org.springframework.<em>bean</em>s.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)rn at org.springframework.<em>bean</em>s.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:291)rn at org.springframework.<em>bean</em>s.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)rn at org.springframework.<em>bean</em>s.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:288)rn at org.springframework.<em>bean</em>s.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:190)rn at org.springframework.<em>bean</em>s.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:580)rn at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:895)rn at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:425)rn at org.springframework.context.support.ClassPathXmlApplicationContext.(ClassPathXmlApplicationContext.java:139)rn at org.springframework.context.support.ClassPathXmlApplicationContext.(ClassPathXmlApplicationContext.java:83)rn at com.ibm.sc.admin.test.Jtest2.t2(Jtest2.java:13)rn at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)rn at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)rn at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)rn at java.lang.reflect.Method.invoke(Method.java:597)rn at org.junit.runners.model.FrameworkMethod$1.runReflectiveC<em>all</em>(FrameworkMethod.java:44)rn at org.junit.internal.runners.model.ReflectiveC<em>all</em>able.run(ReflectiveC<em>all</em>able.java:15)rn at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)rn at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)rn at org.junit.runners.BlockJUnit4ClassRunner.runNotIgnored(BlockJUnit4ClassRunner.java:79)rn at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:71)rn at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:49)rn at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)rn at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)rn at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)rn at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)rn at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)rn at org.junit.runners.ParentRunner.run(ParentRunner.java:236)rn at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:49)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)rnrn[img=https://img-bbs.csdn.net/upload/201405/23/1400845609_322681.png][/img]rnrnrn
bean" must be declared.报错">Element type "bean" must be declared.报错
错误信息:2011-3-28 17:30:39 org.apache.coyote.http11.Http11Protocol initrn2011-3-28 17:30:44 org.apache.struts2.views.freemarker.FreemarkerManager getInstancern信息: Instantiating Freemarker ConfigManager!, org.apache.struts2.views.freemarker.FreemarkerManagerrn2011-3-28 17:30:46 com.opensymphony.xwork2.config.providers.XmlConfigurationProvider initrn信息: Parsing configuration file [struts-default.xml]rn2011-3-28 17:30:46 com.opensymphony.xwork2.config.providers.XmlConfigurationProvider initrn信息: Parsing configuration file [struts-plugin.xml]rn2011-3-28 17:30:46 com.opensymphony.xwork2.util.DomHelper$StartHandler errorrn严重: Element <em>type</em> "<em>bean</em>" must be declared. at (null:30:119)rnorg.xml.sax.SAXParseException: Element <em>type</em> "<em>bean</em>" must be declared.rn at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source)rn at org.apache.xerces.util.ErrorHandlerWrapper.error(Unknown Source)rn at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)rn at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)rn at org.apache.xerces.impl.dtd.XMLDTDValidator.handleStartElement(Unknown Source)rn at org.apache.xerces.impl.dtd.XMLDTDValidator.emptyElement(Unknown Source)rn at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown Source)rn at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)rn at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)rn at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)rn at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)rn at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)rn at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)rn at javax.xml.parsers.SAXParser.parse(Unknown Source)rn at com.opensymphony.xwork2.util.DomHelper.parse(DomHelper.java:104)rn at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loadConfigurationFiles(XmlConfigurationProvider.java:690)rn at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.init(XmlConfigurationProvider.java:121)rn at com.opensymphony.xwork2.config.impl.DefaultConfiguration.reload(DefaultConfiguration.java:97)rn at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:46)rn at org.apache.struts2.dispatcher.mapper.DefaultActionMapper.getMapping(DefaultActionMapper.java:238)rn at org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:227)rn at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:186)rn at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)rn at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214)rn at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)rn at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)rn at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:198)rn at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:152)rn at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)rn at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)rn at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137)rn at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)rn at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:118)rn at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)rn at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)rn at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)rn at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)rn at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)rn at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:929)rn at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160)rn at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:799)rn at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:705)rn at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:577)rn at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:683)rn at java.lang.Thread.run(Thread.java:534)rnrnrnapplicationContext.xml信息rnrnrn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn org.hibernate.dialect.MySQLDialectrn truern truern rn rn rn rn rn com/peony/checkUserOrder/domain/Customer.hbm.xmlrn com/peony/checkUserOrder/domain/Trade.hbm.xmlrn rn rn rn rn rn rn rn rn rn rn rn rnrnrnweb.xml信息rnrnrn checkUserOrderrn rn index.htmlrn index.htmrn index.jsprn default.htmlrn default.htmrn default.jsprn rn rn rn rn struts2rn org.apache.struts2.dispatcher.FilterDispatcherrn rn rn rn struts2rn /*rn rn rn rn rn rn org.springframework.web.context.ContextLoaderListenerrn rn rn rn rn contextConfigLocationrn /WEB-INF/applicationContext.xmlrn rn rn rn rn XFireServletrn org.codehaus.xfire.transport.http.XFireConfigurableServletrn rn rn rn XFireServletrn /servlet/XFireServlet/*rn rn rn rn XFireServletrn /services/*rn rn rnrnrnstruts.xml信息rnrnrnrn rn rn /success.jsprn /index.jsprn /index.jsprn rn rnrnrnstruts.properties信息rnstruts.devMode = falsernstruts.enable.DynamicMethodInvocation = falsernstruts.objectFactory=springrnrnrn请各位高手帮忙尽快解决~~小弟新手啊~~~~还有就是dao层下的hibernateTemplate 注入不进来,在本地测试没有问题,但是到了jsp上九报空指针的错误,请高手一并帮忙解决啊~~~都改了1天了,快愁死了~~~~~~~~
Unable to load bean: type: class:com.opensymphony.xwork2.ObjectFactory
开发环境:rnNetBeans 6.1 Jboss 5.0 JDK5rnrn使用技术:rnEJB Struts 2rnrn所建项目工程类型为:企业应用程序。rnrn异常是在右击项目名称,执行【取消部署后再次部署】后所报的异常。rnrn整了好多天了,求高手指点一二!rnrn异常如下:rn[code=Java]rn6:50:35,281 INFO [XmlConfigurationProvider] Parsing configuration file [struts-default.xml]rn16:50:36,015 ERROR [[/NewsManager-war]] Exception starting filter struts2rnUnable to load <em>bean</em>: <em>type</em>: class:com.opensymphony.xwork2.ObjectFactory - <em>bean</em> - jar:vfsfile:/D:/Jboss5.0/server/default/deploy/NewsManager.ear/NewsManager-war.war/WEB-INF/lib/struts2-core-2.0.11.1.jar!/struts-default.xml:30:72rn at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.register(XmlConfigurationProvider.java:208)rn at org.apache.struts2.config.StrutsXmlConfigurationProvider.register(StrutsXmlConfigurationProvider.java:101)rn at com.opensymphony.xwork2.config.impl.DefaultConfiguration.reload(DefaultConfiguration.java:131)rn at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:52)rn at org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(Dispatcher.java:395)rn at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:452)rn at org.apache.struts2.dispatcher.FilterDispatcher.init(FilterDispatcher.java:201)rn at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:234)rn at org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:332)rn at org.apache.catalina.core.ApplicationFilterConfig.(ApplicationFilterConfig.java:90)rn at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:3733)rn at org.apache.catalina.core.StandardContext.start(StandardContext.java:4369)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 sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)rn at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)rn at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)rn at java.lang.reflect.Method.invoke(Method.java:585)rn at org.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:297)rn at org.jboss.mx.server.RawDynamicInvoker.invoke(RawDynamicInvoker.java:164)rn at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:668)rn at org.apache.catalina.core.StandardContext.init(StandardContext.java:5357)rn at org.jboss.web.tomcat.service.deployers.TomcatDeployment.performDeployInternal(TomcatDeployment.java:347)rn at org.jboss.web.tomcat.service.deployers.TomcatDeployment.performDeploy(TomcatDeployment.java:143)rn at org.jboss.web.deployers.AbstractWarDeployment.start(AbstractWarDeployment.java:341)rn at org.jboss.web.deployers.WebModule.startModule(WebModule.java:89)rn at org.jboss.web.deployers.WebModule.start(WebModule.java:67)rn at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)rn at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)rn at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)rn at java.lang.reflect.Method.invoke(Method.java:585)rn at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:157)rn at org.jboss.mx.server.Invocation.dispatch(Invocation.java:96)rn at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)rn (AbstractSimpleRealDeployer.java:65)rn at org.jboss.deployers.spi.deployer.helpers.AbstractRealDeployer.deploy(AbstractRealDeployer.java:50)rn rn。。。。。。。。。。。。。。。。。。。。。。。。。。。。rnrn.scan(HDScanner.java:290)rn at org.jboss.system.server.profileservice.hotdeploy.HDScanner.run(HDScanner.java:221)rn at java.util.concurrent.Executors$RunnableAdapter.c<em>all</em>(Executors.java:417)rn at java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:280)rn at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:135)rn at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(ScheduledThreadPoolExecutor.java:65)rn at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.runPeriodic(ScheduledThreadPoolExecutor.java:142)rn at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:166)rn at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)rn at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)rn at java.lang.Thread.run(Thread.java:595)rnCaused by: Bean <em>type</em> class com.opensymphony.xwork2.ObjectFactory with the name xwork has already been loaded by <em>bean</em> - jar:vfsfile:/D:/Jboss5.0/server/default/lib/struts2-core-2.0.11.1.jar!/struts-default.xml:30:72 - <em>bean</em> - jar:vfsfile:/D:/Jboss5.0/server/default/deploy/NewsManager.ear/NewsManager-war.war/WEB-INF/lib/struts2-core-2.0.11.1.jar!/struts-default.xml:30:72rn at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.register(XmlConfigurationProvider.java:193)rn ... 83 morern16:50:36,140 ERROR [StandardContext] Error filterStartrn16:50:36,140 ERROR [StandardContext] Context [/NewsManager-war] startup failed due to previous errorsrn16:50:37,125 ERROR [[/NewsManager-war]] "Restricted listeners property file not foundrn16:50:38,359 INFO [XmlConfigurationProvider] Parsing configuration file [struts-default.xml]rnrn[/code]
org.apache.axis2.AxisFault: The [action] cannot be processed at the receiver
org.apache.axis2.AxisFault: The [action] cannot be <em>processed</em> at the receiverrn
statement processed with error,什么原因呢?
执行语句:EXEC DBMS_SNAPSHOT.REFRESH('JS','C');rn后,报错: statement <em>processed</em> with error, 在‘begin-of-statement’之后发现意外的标记‘exec_dbms_snapshot.refresh’。期望的标记可能包括:‘’。sqlstate=4260
关于Rows Processed 和Buffer Gets
在优化一个语句的时候,对其中的一个表建立了一个索引,单句测试的时候执行速度是提高不少,但是在系统中真正运行的时候,却发现语句实际的执行速度却是慢了很多,对比发现:rnRows Processed:优化前-258575.97rn 优化后-1004KrnBuffer Gets: 优化前-1.43rn 优化后-1.09rn不知道这两个参数都是什么意思,具体说明了系统的什么性能,有劳各位给予解答,谢谢。rn
spring boot 整合shiro 配置类报错问题
这里传入的是下边返回的自定义Realm,下边是报错,报的是该类不能被装载,由jdk自己装载,这里不是太懂,记录一下,由于错误太长,不好截屏,直接复制错误内容 >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> /////////////////////////////////////////////
2-2 Springboot自动配置Bean原理和配置自动配置的Bean
认识Springboot SpringBoot不是什么 不是应用服务器 不是JavaEE之类的规范 不是代码生成器 不是Spring Framework的升级版(帮助大家更好地使用Spring Framework) SpringBoot的特性 方便地创建可独立运行的Spring应用程序 直接内嵌了Tomcat、Jett...
NUC1657 All in All【字符串匹配】
All in All 时间限制: 1000ms 内存限制: 30000KB 通过次数: 1总提交次数: 1 问题描述 You have devised a new encryption technique which encodes a message by inserting between its characters randomly generated strings in
Getting Real
《Getting Real中文版》,37 Signals 团队作品。 在中国,不知有多少创业者跟我说过他想做成中国的 37 Signals。虽然我个人很少使用 37 Signals 的产品,但还是要佩服其团队创意常新,以及把产品做到一个极致的能力。或许有不少人知道,他们除了能做一大堆产品,还写过两本不错的书。今天推荐其中一本,Getting Real 的中文版。
Getting Started
前面提到过使用与LabVIEW相关的各个模块对应的keygen生成序列号和.lic文件进行破解的方法,现在还有人开发了一种无需序列号,直接在安装完成之后进行一键激活的工具——NI License Activator,该工具简单快捷有效,对NI LabVIEW相关套件的使用者而言非常实用。下面就简单介绍一下其使用界面及方法。
Getting into the SMRAM
系统管理中断SMI和系统管理内存SMM介绍。以及相关的攻击/安全机制讨论。
--all
适合所有初中级工程师,从RxJava的每个知识点进行讲解,并在每个知识点中都带有文字说明和代码例子说明。通过这次系统化的学习,您将可以完整的学习到RxJava家族的所有特性和常用的操作符,掌握操作符的使用,掌握RxJava与Rx其他第三方库的使用。可以用三句简单的话进行概括rnrn面试加分利器 = 加大录取机会rn加快工作效率 = 早点下班回家rn系统化的学习 = 能力全面提升
delete all delete all delete all delete all
delete <em>all</em> delete <em>all</em> delete <em>all</em> delete <em>all</em>
to all
如何查询某个人的所有贴子
springboot 启动时获取所有注入的beanspringboot通过返回调用bean的方法
import java.lang.reflect.Method; import org.springframework.util.ReflectionUtils; ConfigurableApplicationContext run = SpringApplication.run(ShopApiApplication.class, args); SpringContextUt...
关于IPCONFIG -ALL后显示的 NODE TYPE 的问题
我用API获取机器的IP,有时候会报无法获取;rnrn我查看了IPCONFIG -ALL 显示的信息rn有些的NODE TYPE 是 UNKNOW, 有些是 BORDCASE, 有些是 MIXEDrnrn只有MIXED的情况下我才能获取到MAC地址rn其他的情况下,就可能获取不到;rnrn请高手告诉我:NODE TYPE能改的吗?rn据我看的资料,这个NODE TYPE好像是和DHCP有关系;rnrn用API获取MAC还有什么情况会让我们获取不到的;rn谢谢了;
getting real
<em>getting</em> real 英文版, 著名美国创业团队37 signals 的创业建议
Getting MEAN
MEAN Mongo Express,Angular,Node
[Getting Started] Getting Started 开发入门 (英文版)
☆ 资源说明:☆ [Packt Publishing] Getting Started 开发入门 (英文版) [Packt Publishing] Getting Started with Google Guava (E-Book) ☆ 图书概要:☆ Write better, more efficient Java, and have fun doing so! Overview Write more robust code that is easier to read and maintain Learn how to use Preconditions to prevent and find errors faster Shows how Guava Collections can make working with Java Collections a breeze ☆ 出版信息:☆ [作者信息] Bill Bejeck [出版机构] Packt Publishing [出版日期] 2013年08月14日 [图书页数] 142页 [图书语言] 英语 [图书格式] PDF 格式
Getting to yes
Negotiation & persuade
Getting Meal
Life in university passes very fast. However, the memory about the dining h<em>all</em> always lasts long.nnRegard the dining h<em>all</em> as a 2D plane. Assume that in the dining h<em>all</em>, there is a window at every point (x, 0) for <em>all</em> integer x where students can get meals. In front of every window, there is a queue waiting for <em>getting</em> meals. The i-th person in the queue in front of window (x, 0) is at point (x, i). Every time, the student in (x, 1) gets the meal and leave the queue, then <em>all</em> the students in the queue go one unit toward the window.nnAlso, sometimes, a new window may be opened, and some student would go to the new window in order to get the meal earlier. Assume the new window opened is in (x, 0), and the following conditions hold.nnA new window is only opened at the beginning of a second and no two windows will be opened at the same time.nStudents will go to another queue only at the second the corresponding window is opened.nStudents who go to the new queue will be lined up in the order of the distance between his/her original position and the new window. The nearer one goes ahead. But if some students have the same distance, one of them will help others get meals so that they can be considered as one student in the queue.nIt takes one second for a student to get meal even if he/she should get for others.nIt takes one second for a student to go to the queue of the new window, despite how far he/she is from the window.nThe strategy students choose whether to go to the new queue is that if going to the new queue will not make him/her get meal later, he/she will choose to go, otherwise he/she will stay in the original queue. Also, every student knows that other students take the same strategy so that they can figure out whether to go.nWith the status at the beginning of the 0th second given, you should tell me at which window does every student get meals.nnInputnnThe input contains multiple test cases. For each case, the first line contains two integers n, m (0 ≤ n ≤ 100, 0 ≤ m ≤ 100) indicating the number of windows opened at the beginning of the 0th second and the number of windows to be opened. The next n lines each contains two integers xi, qi (0 ≤ qi ≤ 100, xi is a non-negtive signed 32-bit integer), which mean the window is at (xi, 0) and the number of students waiting in front of the window is qi. The next m lines each contains two integers xi, ti (both within 32-bit signed integers, and are non-negative), which mean the window at (xi, 0) is opened at the beginning of tith second. All xi in a case will be different.nnOutputnnFor each case, print one line containing the x coordinates where each student gets meal. The student with sm<em>all</em>er x coordinate at 0th second should be printed first. If the x coordinates are the same, the one being closer to the window should be printed first.nnSample Inputnn3 1n4 5n6 5n7 0n5 1nSample Outputnn4 4 5 4 5 6 6 5 6 5
SpringBoot在静态方法中使用注入Bean
第一种方式 给当前的类加上@Component 声明一个静态的属性(加上注解@Autowired),一个非静态的属性。 声明一个返回值为void并且不能抛出异常的方法,在其中将非静态属性赋值给静态属性。该方法上加上注解@PostConstruct 第二种方式 在<em>springboot</em>的启动类中,定义static变量ApplicationContext,利用容器的getBean方...
SpringBoot解决@Component无法注入其他Bean
一、现象 在SpringBoot新new一个普通类,习惯性添加@Component让Spring扫描。 在@Component修饰的类里注入了其他Bean,运行时提示注入的为null 但这个Bean可以在控制层被引入,在普通类就不行。   二、解决 找了些资料,最后也没解决注入的问题。 最后的方案就是去掉@Component注解,在new这个普通类时从Spring上下文实例中取出这个...
springboot启动流程之bean注册-源码分析(1)
1,断点进入主程序 2,初始化组件 其中实例化组件时,使用反射,如下图示 初始完组建后, 接着是application的run方法 在上面过程中,进入 context = this.createApplicationContext(); 进入,默认创建一个 AnnotationConfigServletWebServerApplicationContext实例 ...
SpringBoot 之 普通类获取Spring容器中的bean
我们知道如果我们要在一个类使用spring提供的<em>bean</em>对象,我们需要把这个类注入到spring容器中,交给spring容器进行管理,但是在实际当中,我们往往会碰到在一个普通的Java类中,想直接使用spring提供的其他对象或者说有一些不需要交给spring管理,但是需要用到spring里的一些对象。如果这是spring框架的独立应用程序,我们通过ApplicationContext ac =
SpringBoot中Junit测试注入Bean失败的解决方法
在SpringBoot中使用Junit做测试的时候测试DAO层的接口,但是一直提示注入Bean失败,报以下错误: org.springframework.<em>bean</em>s.factory.UnsatisfiedDependencyException: Error creating <em>bean</em> with name 'hellowood.TestFeedbackMapper': Unsatisfied depe
SpringBoot——yml注入和创建bean(二)
yml文件: yml属性注入: student: stu_name: 沈刚伟 stu_age: 123 stu_email: 123456@qq.com user_id: ${random.int[1000,2000]} //随机数 user_name: ${student.name2:吴没}//调用properties里面配置 如果为空默认为后面的 ...
springboot 加载完bean之后的初始化
一般情况下,我们的项目在刚启动的时候就需要初始化一些数据,特别有些是需要查询表的情况下,这时候我们就要用到<em>springboot</em>的初始化了, 我自己的个人网站就用到了这种技术 我们需要实现 CommandLineRunner 接口并在类上面添加 @Component 和 @Order(2) 注解 , 并重写run()方法,<em>springboot</em>会自动扫描这些注解,即可完成初始化, 注意:这个初始...
springboot默认创建的bean是单例
大家好,欢迎来到我的博客.这里主要是和大家分享it(java方面的技术)) <em>springboot</em>默认创建的<em>bean</em>是单例 spring <em>bean</em>作用域有下面几种 singleton:单例模式,当spring创建applicationContext容器的时候,spring会初始化所有的该作用域的实例,加上lazy-init就可以避免预处理 proto<em>type</em>:原型模式,每次通过get<em>bean</em>获取be...
SpringBoot基础篇Bean之基本定义与使用
更多Spring文章,欢迎点击 一灰灰Blog-Spring专题 我们知道在Spring中,有两个非常有名的特性,依赖注入(DI)与切面(AOP),其中依赖注入其主要的作用,可以说就是维护Spring容器创建的Bean之间的依赖关系,简单来说就是一个<em>bean</em>(假定名为A)持有另一个Bean(假定名为B)的引用作为成员变量b,则由Spring容器自动将B赋值给A的成员变量b 因此在想理解依赖注入...
Springboot 的bean实体类里面Date问题
注解 @JSONField(name = &quot;XX&quot;,format = &quot;yyyy-MM-dd&quot;) @DateTimeFormat(pattern=&quot;yyyy-MM-dd&quot;)    一直转型错误,需要用这两个注解才行,“注意:数据库中是否有特殊字符冲突。‘”...
springboot学习篇之bean的实例化方式
一、第一种方案是最常用的 @ComponentScan() 二、第二种是本文主要介绍的 继承ImportSelector类,实现selectImports方法 1、为什么能够实例化<em>bean</em> 这就需要了解和根据spring的源码了,spring在启动的过程中,会调用 2、该方法用于什么场景 应用场景很简单,就是个性化对对类进行实例化,比如在某种条件实例化A,在另外一种条件实例化...
Springboot aware 让bean获取容器的服务
声明:代码是JavaEE开发的颠覆者 Spring Boot实战代码中的,我买了这书,并练习 import org.springframework.context.annotation.ComponentScan; import org.springframework.context.annotation.Configuration; @Configuration @ComponentSca...
springboot 静态方法调用容器Bean 里面方法
由于项目是与第三方进行交互,在设计方面考虑,请求第三方接口的时候,必须将第三方请求入参和出参存入数据库,请求方法为静态方法,调用非静态方法可难到了博主,经过大量查询资料最终得以解决,解决方案如下,直接上代码 调用如下图所示 原始资料https://www.cnblogs.com/chen-lhx/p/6018436.html ...
【SpringBoot基础】Aware框架 Bean获取资源调度
【SpringBoot基础】Aware框架 Bean获取资源调度内容概要文件结构调用Bean类 AwareService配置类 AwareConfig测试类 Main输出显示 内容概要 Aware框架 : 原:<em>bean</em>注册到容器中,容器调用服务进行整合。 Aware: 使Bean获得容器的相关功能。 共6个接口 BeanNameAware : 获取容器中 Bean的名称 ResourceLoade...
axis+webservice教程下载
axis webservice 教程 java 相关下载链接:[url=//download.csdn.net/download/wsslang/3708005?utm_source=bbsseo]//download.csdn.net/download/wsslang/3708005?utm_source=bbsseo[/url]
CC2430-tinyOS安装指南下载
自己总结+网上参考;亲测可用; 每一步都很清楚,提供链接下载所需要的文件。 相关下载链接:[url=//download.csdn.net/download/skydream1/4934810?utm_source=bbsseo]//download.csdn.net/download/skydream1/4934810?utm_source=bbsseo[/url]
软件测试工具e-test suite入门使用说明下载
软件测试工具e-test suite入门使用说明 相关下载链接:[url=//download.csdn.net/download/jcy58/8252419?utm_source=bbsseo]//download.csdn.net/download/jcy58/8252419?utm_source=bbsseo[/url]
相关热词 c# xml的遍历循环 c# 取 查看源码没有的 c#解决高并发 委托 c#日期转化为字符串 c# 显示问号 c# 字典对象池 c#5.0 安装程序 c# 分页算法 c# gmail 发邮件 c# 多层文件
我们是很有底线的