우리 프로젝트에는 다음과 같은 코드가 있지만 잘 동작하지만 무작위로 클래스 정의 오류를 런타임에 찾을 수 없습니다. 매주 일요일마다 App 서버가 다시 시작되므로 임의의 서버 인스턴스에서이 오류가 발생하는 경우가 있습니다. 서버를 다시 시작하면 문제가 해결되지만 클래스 로딩이 중단되는 이유를 알 수 있습니다. Java 8 람다 - 런타임 오류
는이 질문에 다소 유사한 오류가 발생했습니다하고 문제가 JDK 9 Transforming lambdas in Java 8에서 해결 된 것 같습니다하지만 누군가가 그것을 설명 할 수있는 결론을하기 전에 가끔 발생하는 이유 오류의 같은 종류이며.
public boolean isAttachmentExpired(final Document_Attachment da) {
return this.bcDocumentScreen.getValidator().getAttachmentsValidator().isAttachmentExpired(da);
}
public boolean isAttachmentWarningShown() {
return CollectionUtils.isNotEmpty(getAttachments()) && getAttachments().stream().anyMatch(this::isAttachmentExpired);
}
public boolean isAttachmentExpired(final Document_Attachment da) {
final Date today = DateHelper.today();
return DateHelper.diffInYears(today, da.getUploaded()) >= 1;
}
오류 : -
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.GeneratedMethodAccessor1913.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.jboss.seam.util.Reflections.invoke(Reflections.java:22)
at org.jboss.seam.intercept.RootInvocationContext.proceed(RootInvocationContext.java:32)
at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:56)
at org.jboss.seam.core.BijectionInterceptor.aroundInvoke(BijectionInterceptor.java:79)
at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
at org.jboss.seam.persistence.ManagedEntityInterceptor.aroundInvoke(ManagedEntityInterceptor.java:48)
at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
at org.jboss.seam.transaction.RollbackInterceptor.aroundInvoke(RollbackInterceptor.java:28)
at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
at org.jboss.seam.core.MethodContextInterceptor.aroundInvoke(MethodContextInterceptor.java:44)
at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:107)
at org.jboss.seam.intercept.JavaBeanInterceptor.interceptInvocation(JavaBeanInterceptor.java:196)
at org.jboss.seam.intercept.JavaBeanInterceptor.invoke(JavaBeanInterceptor.java:114)
at com.XXX.BcdAttachmentsSection_$$_javassist_seam_91.isAttachmentWarningShown(BcdAttachmentsSection_$$_javassist_seam_91.java)
at sun.reflect.GeneratedMethodAccessor1912.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at javax.el.BeanELResolver.getValue(BeanELResolver.java:363)
at com.sun.faces.el.DemuxCompositeELResolver._getValue(DemuxCompositeELResolver.java:176)
at com.sun.faces.el.DemuxCompositeELResolver.getValue(DemuxCompositeELResolver.java:203)
at org.jboss.el.parser.AstPropertySuffix.getValue(AstPropertySuffix.java:53)
at org.jboss.el.parser.AstValue.getValue(AstValue.java:67)
at org.jboss.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:186)
at com.sun.faces.facelets.el.TagValueExpression.getValue(TagValueExpression.java:109)
... 122 more
Caused by: java.lang.NoClassDefFoundError: com/XXX/docsections/BcdAttachmentsSection$$Lambda$75
at com.XXX.BcdAttachmentsSection$$Lambda$75/1736532374.get$Lambda(Unknown Source)
at com.XXXX.isAttachmentWarningShown(BcdAttachmentsSection.java:51)
... 150 more
종료하는 동안 이런 현상이 발생합니까? – teppic
아니요, 사용자가 isAttachmentWarningShown 메소드가 호출되는 모듈에 액세스하려고 할 때마다 발생합니다. –
Reflection 클래스와 익명 클래스 사이의이 비 호환성을 알고 있지만 jboss가 'Predicate'에서 Reflection을 통해 메소드를 호출하려고하는 이유를 알지 못합니다. . – Holger