seam-2.2.2 java 8 drools update

时间:2014-12-08 18:26:30

标签: java drools seam2

我必须在java 8环境中编译并运行seam-2.2.2应用程序。一切都很好,除了缝线身份管理。这似乎与seam-2.2.2的Drools有关

当我在java 8环境中运行seam应用程序时,会引发以下异常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

1 个答案:

答案 0 :(得分:1)

我认为这里发生的事情是来自seams(和你的应用程序)的一些Java代码是使用java 8编译器编译的。然后调用org.drools.compiler.PackageBuilder来编译一些DRL。最终,这将调用Java编译器来编译从DRL生成的Java代码。为此,通过Eclipse调用Java编译器,当遇到(由于import语句)由Java 8编译的类时,此编译器不满意。

因此,这是修复Eclipse和Java安装的问题。

有一种方法可以配置Drools使用的Java编译器,但通常使用默认设置(即Eclipse)可以很好地工作。