안녕하세요, 스프링에서 정적 초기화를 처리하는 방법은 무엇입니까? 내 bean에 정적 초기화가있다.스프링의 정적 초기화 스프링
private static final Map<String, String> exceptionMapping = ErrorExceptionMapping.getExceptionMapping();
그리고 전에 ErrorExceptionMapping이로드되었는지주의해야한다. 나는이 시도 :
<bean id="errorExceptionMapping" class="cz.instance.transl.util.ErrorExceptionMapping" />
<bean id="validateService" class="cz.instance.transl.services.ValidateService" depends-on="errorExceptionMapping" >
을하지만 정적 초기화를 생략하거나, 빈의 메소드 내에서의 물론 벌금 메소드를 호출하면 나는
java.lang.NoClassDefFoundError: Could not initialize class cz.instance.transl.util.ErrorExceptionMapping
을 얻었다. 초기화 콜백 (affterPropertiesSet())이 도움이되지 않는다고 가정합니다.
중간에 붙여 넣은 코드를 보았습니다.하지만 클래스에 대해 NoClassDefFoundError를 제공합니다. 이 수업에는 내가 선언해야 할 다른 수업이 많이 있습니다. – lisak
@lisak : 업데이트되었습니다. – axtavt