2014-12-08 16 views
0

Java 8 환경에서 seam-2.2.2 응용 프로그램을 컴파일하고 실행해야합니다. 이음새 신원 관리를 제외한 모든 것이 잘 작동합니다. 이것은 Drools와 관련이있는 것 같습니다. 2.2.2seam-2.2.2 java 8 drools update

자바 8 환경에서 이음새 응용 프로그램을 실행할 때 다음 예외가 발생합니다. org.jboss.seam.InstantiationException : Seam 구성 요소를 인스턴스화 할 수 없습니다. org.jboss .seam.security.ruleBasedPermissionResolver

응용 프로그램을 구성하는 drools을 제외하고 더 이상 예외는 없습니다. 솔기 응용 프로그램이 올바르게 작동하고 있습니다. java 5 환경에서는 예외가 발생하지 않습니다.

이 문제를 해결하는 방법은 무엇입니까?

감사

KEM은

Session event listener threw exception 
org.jboss.seam.InstantiationException: Could not instantiate Seam component: org.jboss.seam.security.ruleBasedPermissionResolver 
    at org.jboss.seam.Component.newInstance(Component.java:2170) 
    at org.jboss.seam.contexts.Contexts.startup(Contexts.java:304) 
    at org.jboss.seam.contexts.Contexts.startup(Contexts.java:278) 
    at org.jboss.seam.contexts.Lifecycle.beginSession(Lifecycle.java:233) 
    at org.jboss.seam.contexts.ServletLifecycle.beginSession(ServletLifecycle.java:182) 
    at org.jboss.seam.servlet.SeamListener.sessionCreated(SeamListener.java:46) 
    at org.apache.catalina.session.StandardSession.tellNew(StandardSession.java:397) 
    at org.apache.catalina.session.StandardSession.setId(StandardSession.java:369) 
    at org.apache.catalina.session.ManagerBase.createSession(ManagerBase.java:828) 
    at org.apache.catalina.session.StandardManager.createSession(StandardManager.java:291) 
    at org.apache.catalina.connector.Request.doGetSession(Request.java:2312) 
    at org.apache.catalina.connector.Request.getSession(Request.java:2075) 
    at org.apache.catalina.connector.RequestFacade.getSession(RequestFacade.java:833) 
    at org.apache.catalina.connector.RequestFacade.getSession(RequestFacade.java:844) 
    at org.jboss.seam.web.IdentityRequestWrapper.<init>(IdentityRequestWrapper.java:23) 
    at org.jboss.seam.web.IdentityFilter.doFilter(IdentityFilter.java:40) 
    at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69) 
    at org.jboss.seam.web.LoggingFilter.doFilter(LoggingFilter.java:60) 
    at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69) 
    at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:90) 
    at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69) 
    at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:64) 
    at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69) 
    at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:45) 
    at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69) 
    at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:206) 
    at org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:290) 
    at org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:388) 
    at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:515) 
    at org.jboss.seam.web.Ajax4jsfFilter.doFilter(Ajax4jsfFilter.java:56) 
    at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69) 
    at org.jboss.seam.web.HotDeployFilter.doFilter(HotDeployFilter.java:53) 
    at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69) 
    at org.jboss.seam.servlet.SeamFilter.doFilter(SeamFilter.java:158) 
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) 
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) 
    at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96) 
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) 
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) 
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230) 
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175) 
    at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:182) 
    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:432) 
    at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84) 
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) 
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) 
    at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157) 
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) 
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:262) 
    at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844) 
    at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583) 
    at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446) 
    at java.lang.Thread.run(Thread.java:745) 
Caused by: org.jboss.seam.InstantiationException: Could not instantiate Seam component: securityRules 
    at org.jboss.seam.Component.newInstance(Component.java:2170) 
    at org.jboss.seam.Component.getInstance(Component.java:2024) 
    at org.jboss.seam.Component.getInstance(Component.java:1986) 
    at org.jboss.seam.Component.getInstance(Component.java:1980) 
    at org.jboss.seam.Namespace.getComponentInstance(Namespace.java:55) 
    at org.jboss.seam.Namespace.getComponentInstance(Namespace.java:50) 
    at org.jboss.seam.el.SeamELResolver.resolveBase(SeamELResolver.java:148) 
    at org.jboss.seam.el.SeamELResolver.getValue(SeamELResolver.java:51) 
    at javax.el.CompositeELResolver.getValue(CompositeELResolver.java:53) 
    at org.jboss.el.parser.AstIdentifier.getValue(AstIdentifier.java:44) 
    at org.jboss.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:186) 
    at org.jboss.seam.core.Expressions$1.getValue(Expressions.java:156) 
    at org.jboss.seam.Component$ELInitialValue.getValue(Component.java:2557) 
    at org.jboss.seam.Component.initialize(Component.java:1530) 
    at org.jboss.seam.Component.postConstructJavaBean(Component.java:1456) 
    at org.jboss.seam.Component.postConstruct(Component.java:1379) 
    at org.jboss.seam.Component.newInstance(Component.java:2155) 
    ... 52 more 
Caused by: java.lang.RuntimeException: wrong class format 
    at org.drools.commons.jci.compilers.EclipseJavaCompiler$2.findType(EclipseJavaCompiler.java:260) 
    at org.drools.commons.jci.compilers.EclipseJavaCompiler$2.findType(EclipseJavaCompiler.java:204) 
    at org.eclipse.jdt.internal.compiler.lookup.LookupEnvironment.askForType(LookupEnvironment.java:97) 
    at org.eclipse.jdt.internal.compiler.lookup.UnresolvedReferenceBinding.resolve(UnresolvedReferenceBinding.java:49) 
    at org.eclipse.jdt.internal.compiler.lookup.BinaryTypeBinding.resolveType(BinaryTypeBinding.java:101) 
    at org.eclipse.jdt.internal.compiler.lookup.LookupEnvironment.getTypeFromTypeSignature(LookupEnvironment.java:1264) 
    at org.eclipse.jdt.internal.compiler.lookup.LookupEnvironment.getTypeFromVariantTypeSignature(LookupEnvironment.java:1316) 
    at org.eclipse.jdt.internal.compiler.lookup.LookupEnvironment.getTypeArgumentsFromSignature(LookupEnvironment.java:1107) 
    at org.eclipse.jdt.internal.compiler.lookup.LookupEnvironment.getTypeFromTypeSignature(LookupEnvironment.java:1269) 
    at org.eclipse.jdt.internal.compiler.lookup.BinaryTypeBinding.createFields(BinaryTypeBinding.java:356) 
    at org.eclipse.jdt.internal.compiler.lookup.BinaryTypeBinding.cachePartsFrom(BinaryTypeBinding.java:332) 
    at org.eclipse.jdt.internal.compiler.lookup.LookupEnvironment.createBinaryTypeFrom(LookupEnvironment.java:719) 
    at org.eclipse.jdt.internal.compiler.lookup.LookupEnvironment.createBinaryTypeFrom(LookupEnvironment.java:699) 
    at org.eclipse.jdt.internal.compiler.Compiler.accept(Compiler.java:294) 
    at org.eclipse.jdt.internal.compiler.lookup.LookupEnvironment.askForType(LookupEnvironment.java:102) 
    at org.eclipse.jdt.internal.compiler.lookup.UnresolvedReferenceBinding.resolve(UnresolvedReferenceBinding.java:49) 
    at org.eclipse.jdt.internal.compiler.lookup.BinaryTypeBinding.resolveType(BinaryTypeBinding.java:101) 
    at org.eclipse.jdt.internal.compiler.lookup.ParameterizedTypeBinding.resolve(ParameterizedTypeBinding.java:835) 
    at org.eclipse.jdt.internal.compiler.lookup.BinaryTypeBinding.resolveType(BinaryTypeBinding.java:117) 
    at org.eclipse.jdt.internal.compiler.lookup.BinaryTypeBinding.resolveTypesFor(BinaryTypeBinding.java:916) 
    at org.eclipse.jdt.internal.compiler.lookup.BinaryTypeBinding.getExactMethod(BinaryTypeBinding.java:715) 
    at org.eclipse.jdt.internal.compiler.lookup.Scope.findExactMethod(Scope.java:771) 
    at org.eclipse.jdt.internal.compiler.lookup.Scope.getMethod(Scope.java:2106) 
    at org.eclipse.jdt.internal.compiler.ast.MessageSend.resolveType(MessageSend.java:432) 
    at org.eclipse.jdt.internal.compiler.ast.MessageSend.resolveType(MessageSend.java:344) 
    at org.eclipse.jdt.internal.compiler.ast.Expression.resolve(Expression.java:882) 
    at org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration.resolveStatements(AbstractMethodDeclaration.java:444) 
    at org.eclipse.jdt.internal.compiler.ast.MethodDeclaration.resolveStatements(MethodDeclaration.java:191) 
    at org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration.resolve(AbstractMethodDeclaration.java:403) 
    at org.eclipse.jdt.internal.compiler.ast.TypeDeclaration.resolve(TypeDeclaration.java:1096) 
    at org.eclipse.jdt.internal.compiler.ast.TypeDeclaration.resolve(TypeDeclaration.java:1184) 
    at org.eclipse.jdt.internal.compiler.ast.CompilationUnitDeclaration.resolve(CompilationUnitDeclaration.java:535) 
    at org.eclipse.jdt.internal.compiler.Compiler.process(Compiler.java:743) 
    at org.eclipse.jdt.internal.compiler.Compiler.compile(Compiler.java:444) 
    at org.drools.commons.jci.compilers.EclipseJavaCompiler.compile(EclipseJavaCompiler.java:351) 
    at org.drools.commons.jci.compilers.AbstractJavaCompiler.compile(AbstractJavaCompiler.java:51) 
    at org.drools.rule.builder.dialect.java.JavaDialect.compileAll(JavaDialect.java:389) 
    at org.drools.compiler.DialectCompiletimeRegistry.compileAll(DialectCompiletimeRegistry.java:56) 
    at org.drools.compiler.PackageRegistry.compileAll(PackageRegistry.java:74) 
    at org.drools.compiler.PackageBuilder.compileAll(PackageBuilder.java:690) 
    at org.drools.compiler.PackageBuilder.addPackage(PackageBuilder.java:653) 
    at org.drools.compiler.PackageBuilder.addPackageFromDrl(PackageBuilder.java:278) 
    at org.jboss.seam.drools.RuleBase.compileRuleBase(RuleBase.java:80) 
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) 
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) 
    at java.lang.reflect.Method.invoke(Method.java:483) 
    at org.jboss.seam.util.Reflections.invoke(Reflections.java:22) 
    at org.jboss.seam.util.Reflections.invokeAndWrap(Reflections.java:144) 
    at org.jboss.seam.Component.callComponentMethod(Component.java:2275) 
    at org.jboss.seam.Component.callCreateMethod(Component.java:2198) 
    at org.jboss.seam.Component.newInstance(Component.java:2158) 
    ... 68 more 
Caused by: org.eclipse.jdt.internal.compiler.classfmt.ClassFormatException 
    at org.eclipse.jdt.internal.compiler.classfmt.ClassFileReader.<init>(ClassFileReader.java:369) 
    at org.drools.commons.jci.compilers.EclipseJavaCompiler$2.findType(EclipseJavaCompiler.java:254) 
    ... 119 more 
+0

믿기 어렵습니다. Drools 5.x 및 6.x는 Java 7 및 8을 사용하여 정상적으로 실행됩니다. - "있는 것처럼 보이는"사실을 뒷받침하는 사실은 무엇입니까? – laune

+0

질문이 업데이트되었습니다. 감사합니다 – kem

+0

심리스 코드에서 예외가 발생했습니다. * 전체 * (!) 스택 추적이 이에 대해 더 많은 것을 밝힐 수 있습니다. – laune

답변

1

여기 일어나고 솔기 (및 응용 프로그램)에서 일부 자바 코드는 자바 (8) 컴파일러를 사용하여 컴파일 된 것입니다 무슨 생각합니다. 그런 다음 org.drools.compiler.PackageBuilder이 호출되어 일부 DRL을 컴파일합니다. 그러면 결국 Java 컴파일러를 호출하여 DRL에서 생성 된 Java 코드를 컴파일합니다. 이를 위해 Java 컴파일러는 Eclipse를 통해 호출되며 Java 8에서 컴파일 한 클래스를 가져올 때이 컴파일러는 만족스럽지 않습니다.

따라서이 문제를 해결하는 것이 좋습니다. Eclipse 및 Java 설치.

Drools에서 Java 컴파일러를 사용하도록 구성하는 방법이 있지만 일반적으로 Eclipse를 통해 기본값을 사용하면 잘 작동합니다.

+0

나는 netbeans with java 8 compiler를 사용하고 있습니다. 이음새 응용 프로그램 내 코드의 일부는 Java 8이 필요합니다. – kem

+0

예, 그럼, 어딘가에있는 Eclipse 플러그인도 8-ish인지 확인하십시오. – laune

+0

정말 고마워요. 문제에 대한 나의 해석은 잘못되었습니다. org.eclipse.jdt.core_3.10 ... jar 파일을 seam_app/lib/core.jar에 복사하면 문제가 해결됩니다. – kem