Software Workshop

Log4j

Logger cannot be resolved to a type 오류

Logger cannot be resolved
Logger cannot be resolved to a type 

log4j library가 dependency로 등록되어 있지 않아서 발생하는 에러 메시지이다. dependency에 log4j : log4j를 추가한다. 또는 소스코드 파일에 import org.apache.log4j.Logger;를 추가한다.

JUnit

Assert cannot be resolved 오류

Assert cannot be resolved
AfterClass cannot be resolved to a type
Before cannot be resolved to a type
BeforeClass cannot be resolved to a type
RunWith cannot be resolved to a type
Test cannot be resolved to a type
The attribute value is undefined for the annotation type RunWith 

JUnit library가 dependency로 등록되어 있지 않아서 발생하는 에러 메시지이다. dependency에 junit : junit을 추가한다.

Assert cannot be resolved 오류

소스코드 파일에 import org.junit.Assert;를 추가한다.

Test cannot be resolved 오류

소스코드 파일에 import org.junit.Test;를 추가한다.

Spring

BeanFactory cannot be resolved to a type 오류

BeanFactory cannot be resolved to a type
ClassPathResource cannot be resolved to a type
XmlBeanFactory cannot be resolved to a type
ApplicationContext cannot be resolved to a type
ClassPathXmlApplicationContext cannot be resolved to a type
MethodBeforeAdvice cannot be resolved to a type
The import org.springframework cannot be resolved 

Spring Framework library가 dependency로 등록되어 있지 않아서 발생하는 에러 메시지이다. dependency에 org.springframework : spring을 추가한다.

BeanFactory cannot be resolved to a type 오류

import org.springframework.beans.factory.BeanFactory;를 추가한다.

XMLBeanFactory cannot be resolved to a type 오류

import org.springframework.beans.factory.xml.XmlBeanFactory;를 추가한다.

ClassPathResource cannot be resolved to a type 오류

import [org.springframework.core.io](http://org.springframework.core.io).ClassPathResource;를 추가한다.

ApplicaitonContext cannot be resolved to a type 오류

import org.springframework.context.ApplicationContext;를 추가한다.

ClassPathXmlApplicationContext cannot be resolved to a type 오류

import org.springframework.context.support.ClassPathXmlApplicationContext;를 추가한다.

AspectJ

Failed to execute goal ... maven-compiler-plugin ... Compilation failure 오류

Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.0.2:compile (default-compile) on project knight: 
 Compilation failure: Compilation failure:
GrailNotFoundException.java:[3,1] annotations are not supported in -source 1.3
(use -source 5 or higher to enable annotations)
@SuppressWarnings("serial")
knight/QuestFailedException.java:[3,1] annotations are not supported in -source 1.3
(use -source 5 or higher to enable annotations)
@SuppressWarnings("serial") 

aspectj library가 dependency로 등록되어 있지 않아서 발생하는 에러 메시지이다. dependency에 maven : maven-aspectj-plugin을 추가한다.

Method cannot be resolved to a type 오류

Method cannot be resolved to a type
The type MinstrelAdvice must implement the inherited abstract method MethodBeforeAdvice.before(Method, Object[], Object) 

import java.lang.reflect.Method;를 추가한다.

MethodBeforeAdvice cannot be resolved to a type 오류

import org.springframework.aop.MethodBeforeAdvice;를 추가한다.