너무어려웡
502
2017-04-10 16:51:18 작성 2017-04-10 17:08:13 수정됨
11
1337

이메일 전송 관련 도와주세요 ㅠㅠ


MembershipController.java

------------------------------------------------------------------------------------

package com.ic.atct;


import javax.servlet.http.HttpServletRequest;

import javax.servlet.http.HttpSession;


import org.springframework.beans.factory.annotation.Autowired;

import org.springframework.stereotype.Controller;

import org.springframework.web.bind.annotation.RequestMapping;



import dao.MembershipDao;

import util.EmailSender;

import vo.EmailVo;

import vo.MembershipVo;


@Controller

public class MembershipController {

MembershipDao dao;

@Autowired

HttpServletRequest request;

@Autowired

HttpSession session;

public MembershipController() {}

public MembershipController(MembershipDao dao) {

super();

this.dao = dao;}

@RequestMapping("/membership_lose_pwd.do")

public String lose_pwd(MembershipVo vo) {

MembershipVo pwd_vo=dao.select_lose_pwd(vo);


EmailVo lose_pwd = new EmailVo();

lose_pwd.setSubject("회원님의 비밀번호를 확인하세요");

lose_pwd.setReceiver(vo.getEmail());

lose_pwd.setContent("회원님의 비밀번호는 "+pwd_vo.getPwd()+"입니다.");

EmailSender.SendEmail(lose_pwd);


return "redirect:/membership_lose_pwd_form.do";

}

}

-----------------------------------------------------------------------------------------------------------------

EmailSender.java

-----------------------------------------------------------------------------------------------------------------

package util;

 


import org.springframework.beans.factory.annotation.Autowired;

import org.springframework.mail.MailSender;

import org.springframework.mail.SimpleMailMessage;

import org.springframework.stereotype.Component;


import vo.EmailVo;



@Component

public class EmailSender

{

@Autowired

private static  MailSender mailSender;

public void setMailSender(MailSender mailSender) {

EmailSender.mailSender = mailSender;

}


public static void SendEmail(EmailVo lose_pwd) {

SimpleMailMessage message = new SimpleMailMessage();

message.setFrom("atct12345@gmail.com");

message.setTo(lose_pwd.getReceiver());

message.setSubject(lose_pwd.getSubject());

message.setText(lose_pwd.getContent());

mailSender.send(message);

}

}

-----------------------------------------------------------------------------------------------------------------
servlet_context.xml
-----------------------------------------------------------------------------------------------------------------
<?xml version="1.0" encoding="UTF-8"?>
<beans:beans xmlns="http://www.springframework.org/schema/mvc"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:beans="http://www.springframework.org/schema/beans"
xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd">

<!-- DispatcherServlet Context: defines this servlet's request-processing infrastructure -->
<!-- Enables the Spring MVC @Controller programming model -->
<annotation-driven />

<!-- Handles HTTP GET requests for /resources/** by efficiently serving up static resources in the ${webappRoot}/resources directory -->
<resources mapping="/resources/**" location="/resources/" />

<!-- Resolves views selected for rendering by @Controllers to .jsp resources in the /WEB-INF/views directory -->
<beans:bean class="org.springframework.web.servlet.view.InternalResourceViewResolver">
<beans:property name="prefix" value="/WEB-INF/views/" />
<beans:property name="suffix" value=".jsp" />
</beans:bean>
<context:component-scan base-package="com.ic.atct" />
  <!-- gmail -->

    <beans:bean id="mailSender" class ="org.springframework.mail.javamail.JavaMailSenderImpl" >
        <beans:property name="host" value="smtp.gmail.com" />
        <beans:property name="port" value="587" />
        <beans:property name="defaultEncoding" value="utf-8"/>
        <beans:property name="username" value="atct12345@gmail.com" />
        <beans:property name="password" value="12345atct" />
       
        <beans:property name="javaMailProperties">
            <beans:props>
                <beans:prop key="mail.smtp.starttls.enable">true</beans:prop>
                <beans:prop key="mail.smtp.auth">true</beans:prop>
                <beans:prop key="mail.smtps.debug">true</beans:prop>
            </beans:props>
        </beans:property>    
    </beans:bean>
    
    <beans:bean id="email" class="vo.EmailVo"></beans:bean>
    <beans:bean id="emailSender" class="util.EmailSender">
  <beans:property name="mailSender" ref="mailSender"></beans:property>
  </beans:bean>
 
<context:component-scan base-package="util"></context:component-scan>
<beans:bean id="message" class="org.springframework.mail.SimpleMailMessage">
  <beans:property name="from" value="atctmail@gmail.com"/>
</beans:bean>
</beans:beans>
-----------------------------------------------------------------------------------------------------------------
EmailVo.java
-----------------------------------------------------------------------------------------------------------------
package vo;

public class EmailVo {
String subject;
String content;
String receiver;
public EmailVo() {
// TODO Auto-generated constructor stub
}

public EmailVo(String subject, String content, String receiver) {
super();
this.subject = subject;
this.content = content;
this.receiver = receiver;
}
public String getSubject() {
return subject;
}
public void setSubject(String subject) {
this.subject = subject;
}
public String getContent() {
return content;
}
public void setContent(String content) {
this.content = content;
}
public String getReceiver() {
return receiver;
}
public void setReceiver(String receiver) {
this.receiver = receiver;
}
}
-----------------------------------------------------------------------------------------------------------------

HTTP Status 500 - Request processing failed; nested exception is java.lang.NullPointerException

type Exception report

message Request processing failed; nested exception is java.lang.NullPointerException

description The server encountered an internal error that prevented it from fulfilling this request.

exception

org.springframework.web.util.NestedServletException: Request processing failed; nested exception is java.lang.NullPointerException
	org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:894)
	org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:789)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:648)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
	org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
	org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88)
	org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)

root cause

java.lang.NullPointerException
	util.EmailSender.SendEmail(EmailSender.java:18)
	com.ic.atct.MembershipController.lose_pwd(MembershipController.java:224)
	sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	java.lang.reflect.Method.invoke(Method.java:498)
	org.springframework.web.method.support.InvocableHandlerMethod.invoke(InvocableHandlerMethod.java:213)
	org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:126)
	org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:96)
	org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:617)
	org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:578)
	org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:80)
	org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:923)
	org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:852)
	org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:882)
	org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:789)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:648)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
	org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
	org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88)
	org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)

note The full stack trace of the root cause is available in the Apache Tomcat/8.0.36 logs.


Apache Tomcat/8.0.36


EmailSender.java:18 => mailSender.send(message);
에서 계속 오류 나오는데 일주일째 찾아보고 질문 올려도 해결이 안되네요 ㅠㅠ
제발 도와주세요 흐헣....

0
0
  • 답변 11

  • GAN
    1k
    2017-04-10 17:17:18

    Spring 안 본지 오래돼서 정확한 답변은 아닙니다.

    static 메소드인 SendEmail 을 호출하고 계신데 해당 메소드에서 사용하는 mailSender 가 null 이어서 발생하는 에러 입니다.

    코드 상으로 해당 mailSender 는 생성자에서 초기화를 하는데 SendEmail 호출 전에 생성자가 호출되지 않았거나 생성자에 매개변수가 null 이 넘어간 것 같습니다.
    생성자에서 mailSender 로그 찍어보시고 SendEmail 메소드에서도 찍어서 매개변수와 호출 순서가 어떻게 되는지 확인해보세요.

    그리고 되도록이면 mailSender 와 SendEmail 을 static 이 아닌 멤버 변수와 메소드로 변경하신 후 Controller 에서 DI 를 통해 사용하세요.

    0
  • 너무어려웡
    502
    2017-04-10 17:21:27

    package util;

     


    import org.springframework.beans.factory.annotation.Autowired;

    import org.springframework.mail.MailSender;

    import org.springframework.mail.SimpleMailMessage;

    import org.springframework.stereotype.Component;


    import vo.EmailVo;



    @Component

    public class EmailSender

    {

    @Autowired

    private static  MailSender mailSender;

    public void setMailSender(MailSender mailSender) {

    EmailSender.mailSender = mailSender;

    }


    public static void SendEmail(EmailVo lose_pwd) {

    SimpleMailMessage message = new SimpleMailMessage();

    message.setFrom("atctmail@gmail.com");

    message.setTo(lose_pwd.getReceiver());

    message.setSubject(lose_pwd.getSubject());

    message.setText(lose_pwd.getContent());

    System.out.println(message);

    mailSender.send(message);

    }

    }

    실행해보면
    SimpleMailMessage: from=atct12345@gmail.com; replyTo=null; to=smi_i@naver.com; cc=; bcc=; sentDate=null; subject=회원님의 비밀번호를 확인하세요; text=회원님의 비밀번호는 12345입니다.

    라고 출력은 됩니다 ㅠ
    0
  • 음...
    1k
    2017-04-10 17:23:59

    MembershipController 콘트롤러에서 EmailSender.SendEmail(lose_pwd); 하고 계시니 당연히 동작을 안하겠지요...

    EmailSender 를 DI 방식으로 변경하시면 될것 같습니다.

    0
  • GAN
    1k
    2017-04-10 17:26:27
    message 가 문제가 아니라 static 변수인 mailSender 가 문제입니다.
    생성자에서 mailSender 로그 찍어보시고 SendEmail 에서 mailSender 로그 찍어보세요.
    어떤 로그가 먼저 나오는지와 어디서 null 인지 확인 해보세요.


    0
  • 너무어려웡
    502
    2017-04-10 17:32:20 작성 2017-04-10 17:35:33 수정됨

    EmailSender 파일 static을 제거 하고 나면

    컨트롤러 쪽 EmailSender.SendEmail(lose_pwd); 에서 

    Cannot make a static reference to the non-static method SendEmail(EmailVo) from the type EmailSender

    라는 오류가 뜨는데 이거 해결 어떻게 해야 할까요 ㅠㅠ?



    0
  • GAN
    1k
    2017-04-10 17:38:08
    DI 사용하세요.


    0
  • 너무어려웡
    502
    2017-04-10 17:47:15

    DI 사용을 어떻게 하는건가요 ㅠㅠ 검색해서 찾아봐도 잘 모르겠네요 ㅠㅠ..

    죄송합니다 ㅠ...

    0
  • GAN
    1k
    2017-04-10 17:51:29
    Controller 에 @Autowired EmailSender emailSender; 추가하시고 emailSender.SendEmail 로 호출해보세요.


    0
  • 너무어려웡
    502
    2017-04-10 18:02:39

    HTTP Status 500 - Servlet.init() for servlet appServlet threw exception

    type Exception report

    message Servlet.init() for servlet appServlet threw exception

    description The server encountered an internal error that prevented it from fulfilling this request.

    exception

    javax.servlet.ServletException: Servlet.init() for servlet appServlet threw exception
    	org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502)
    	org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)
    	org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:616)
    	org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:528)
    	org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1099)
    	org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:670)
    	org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1520)
    	org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1476)
    	java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    	java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    	org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
    	java.lang.Thread.run(Thread.java:745)
    

    root cause

    org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'com.ic.atct.MembershipController#0': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: util.EmailSender com.ic.atct.MembershipController.emailSender; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No matching bean of type [util.EmailSender] 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)}
    	org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:287)
    	org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1106)
    	org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:517)
    	org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
    	org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:294)
    	org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:225)
    	org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:291)
    	org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193)
    	org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:585)
    	org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:913)
    	org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:464)
    	org.springframework.web.servlet.FrameworkServlet.configureAndRefreshWebApplicationContext(FrameworkServlet.java:631)
    	org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:588)
    	org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:645)
    	org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:508)
    	org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:449)
    	org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:133)
    	javax.servlet.GenericServlet.init(GenericServlet.java:158)
    	org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502)
    	org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)
    	org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:616)
    	org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:528)
    	org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1099)
    	org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:670)
    	org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1520)
    	org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1476)
    	java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    	java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    	org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
    	java.lang.Thread.run(Thread.java:745)
    

    root cause

    org.springframework.beans.factory.BeanCreationException: Could not autowire field: util.EmailSender com.ic.atct.MembershipController.emailSender; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No matching bean of type [util.EmailSender] 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)}
    	org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:506)
    	org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:87)
    	org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:284)
    	org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1106)
    	org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:517)
    	org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
    	org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:294)
    	org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:225)
    	org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:291)
    	org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193)
    	org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:585)
    	org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:913)
    	org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:464)
    	org.springframework.web.servlet.FrameworkServlet.configureAndRefreshWebApplicationContext(FrameworkServlet.java:631)
    	org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:588)
    	org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:645)
    	org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:508)
    	org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:449)
    	org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:133)
    	javax.servlet.GenericServlet.init(GenericServlet.java:158)
    	org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502)
    	org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)
    	org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:616)
    	org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:528)
    	org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1099)
    	org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:670)
    	org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1520)
    	org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1476)
    	java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    	java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    	org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
    	java.lang.Thread.run(Thread.java:745)
    

    root cause

    org.springframework.beans.factory.NoSuchBeanDefinitionException: No matching bean of type [util.EmailSender] 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)}
    	org.springframework.beans.factory.support.DefaultListableBeanFactory.raiseNoSuchBeanDefinitionException(DefaultListableBeanFactory.java:924)
    	org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:793)
    	org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:707)
    	org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:478)
    	org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:87)
    	org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:284)
    	org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1106)
    	org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:517)
    	org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
    	org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:294)
    	org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:225)
    	org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:291)
    	org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193)
    	org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:585)
    	org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:913)
    	org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:464)
    	org.springframework.web.servlet.FrameworkServlet.configureAndRefreshWebApplicationContext(FrameworkServlet.java:631)
    	org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:588)
    	org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:645)
    	org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:508)
    	org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:449)
    	org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:133)
    	javax.servlet.GenericServlet.init(GenericServlet.java:158)
    	org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502)
    	org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)
    	org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:616)
    	org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:528)
    	org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1099)
    	org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:670)
    	org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1520)
    	org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1476)
    	java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    	java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    	org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
    	java.lang.Thread.run(Thread.java:745)
    

    note The full stack trace of the root cause is available in the Apache Tomcat/8.0.36 logs.


    Apache Tomcat/8.0.36


    라고 떠서 번역기 돌려보니 자동 종속 종속성 주입 실패? 라고 뜨는데...

    왜 이럴까요 ㅠㅠ


    0
  • 음...
    1k
    2017-04-10 18:16:31

    @너무어려웡님 스무고개하면서 문제를 해결할 순 없을것 같구요.

    우선 익셉션 원인 파악에 앞서 익셉션이 표현하고 현상이 뭔지부터 검색해보시는 건 어떠세요?

    예외상황의 의미를 알게되면 원인을 짐작하실 수 있지 않을까요?

    0
  • 즈루시
    13k
    2017-04-11 09:30:56

    스프링 책에 있을법한 예제인데...

    인터넷 소스 긁어다 하시는건가요?


    디버깅 방법부터 터득하셔야할것 같습니다

    이메일 이전에 관련 에러 처리 능력이 급선무네요;;

    0
  • 로그인을 하시면 답변을 등록할 수 있습니다.