자바

[m2eclipse] Failed to classload type while reading annotation metadata. This is a non-fatal error, but certain annotation metadata may be unavailable

fromm0 2012. 2. 23. 17:23
그 동안 잘 사용하던 m2eclipse..
갑자기 이상한 에러를 수업이 뿌려댄다. 

2012-02-23 17:06:06 [WARN ](AnnotationAttributesReadingVisitor :91 ) Failed to classload type while reading annotation metadata. This is a non-fatal error, but certain annotation metadata may be unavailable.

java.lang.ClassNotFoundException: org.junit.Before
.. 중략


org.eclipse.wst.common.component 파일을 열어본다. 
이 파일은 해당 프로젝트의 .setting 디렉터리안에 있다. 

1. 이전 파일 내용

<?xml version="1.0" encoding="UTF-8"?>
<project-modules id="moduleCoreId" project-version="1.5.0">
    <wb-module deploy-name="xxx">
        <wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/java"/>
        <wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/resources-local"/>
        <wb-resource deploy-path="/WEB-INF/classes" source-path="/src/acceptance-test/java"/>
        <wb-resource deploy-path="/WEB-INF/classes" source-path="/src/acceptance-test/resources"/>
        <wb-resource deploy-path="/" source-path="/src/main/webapp"/>
        <property name="java-output-path"/>
        <property name="context-root" value=""/>
    </wb-module>
</project-modules>


2. 수정한 파일내용

<?xml version="1.0" encoding="UTF-8"?>
<project-modules id="moduleCoreId" project-version="1.5.0">
    <wb-module deploy-name="xxx">
        <wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/java"/>
        <wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/resources"/>
        <wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/resources-local"/>
        <wb-resource deploy-path="/" source-path="/src/main/webapp"/>
        <property name="java-output-path"/>
        <property name="context-root" value=""/>
    </wb-module>
</project-modules>


이 설정으로 인해 테스트 코드가 실제 webapps에 지정된 곳에 함께 배포되어 발생한 에러로 추측된다. 
위처럼 테스트 관련 코드를 설정에서 제거하자 정상으로 돌아왔다.