보뇨 다이어리

org.springframework.beans.factory.BeanCreationException 에러 본문

컴퓨터 관련/Java 정보

org.springframework.beans.factory.BeanCreationException 에러

보뇨 2018. 6. 29. 16:16
반응형

api 를 하나 추가하고 실행하니 아래와 같은 에러를 뱉음

근데 간단한 문제다 뭐냐하면...impl 쪽에 service 아노테이션을 적용하지않았기 떄문 

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'apiPadStatus': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: com.enow.eoz.pad_status.service.PadStatusService com.enow.eoz.pad_status.controller.ApiPadStatus.service; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No matching bean of type [com.enow.eoz.pad_status.service.PadStatusService] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}
    at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:287)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1106)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:517)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
    at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:294)
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:225)
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:291)
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:585)
    at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:913)
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:464)
    at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:385)
    at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:284)
    at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:111)
    at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4900)
    at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5363)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1410)
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1400)
    at java.util.concurrent.FutureTask.run(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)
cs


이렇게 9번줄에 추가시켜놓고 실행하면 끝난다

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
package com.enow.eoz.pad_status.service;
 
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
 
import com.vel.common.dao.BasicDAO;
import com.vel.jo.pad_status.model.PadStatusVO;
 
@Service
public class PadStatusServiceImpl implements PadStatusService {
 
    @Autowired
    private BasicDAO basicDAO;
    
    @Override
    public int padStatusInsert(PadStatusVO vo) throws Exception {
        return basicDAO.add("jo.pad_status.insertPadStatus", vo);
    }
}
 
cs


반응형