Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question about ecj support #6227

Open
lfi-aud opened this issue Jan 22, 2025 · 2 comments
Open

Question about ecj support #6227

lfi-aud opened this issue Jan 22, 2025 · 2 comments

Comments

@lfi-aud
Copy link

lfi-aud commented Jan 22, 2025

Hi,

We have a project where we use the latest version of spring-boot with java 21 (latest LTS java version).
In a new spring-boot project, no issue is found with the implementation of our use cases. But in the final app, we have a dependency which overrides one of your dependencies.
The dependency we have is jasperreports in version 6.3.0 which has org.eclipse.jdt.core.compiler:ecj:4.3.1 as a dependency.
This one overrides org.eclipse.jdt:ecj:3.33.0 used in org.drools:drools-ecj:10.0.0.

It leads us to the following exception:

Caused by: java.lang.RuntimeException: wrong class format
	at org.drools.ecj.EclipseJavaCompiler$2.findType(EclipseJavaCompiler.java:295)
	at org.drools.ecj.EclipseJavaCompiler$2.findType(EclipseJavaCompiler.java:252)
	at org.eclipse.jdt.internal.compiler.lookup.LookupEnvironment.askForType(LookupEnvironment.java:145)
	at org.eclipse.jdt.internal.compiler.lookup.PackageBinding.getType(PackageBinding.java:141)
	at org.eclipse.jdt.internal.compiler.lookup.Scope.findType(Scope.java:1675)
	at org.eclipse.jdt.internal.compiler.lookup.Scope.getTypeOrPackage(Scope.java:2819)
	at org.eclipse.jdt.internal.compiler.lookup.Scope.getBinding(Scope.java:1930)
	at org.eclipse.jdt.internal.compiler.lookup.BlockScope.getBinding(BlockScope.java:426)
	at org.eclipse.jdt.internal.compiler.ast.QualifiedNameReference.resolveType(QualifiedNameReference.java:992)
	at org.eclipse.jdt.internal.compiler.ast.MessageSend.resolveType(MessageSend.java:562)
	at org.eclipse.jdt.internal.compiler.ast.Expression.resolve(Expression.java:970)
	at org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration.resolveStatements(AbstractMethodDeclaration.java:510)
	at org.eclipse.jdt.internal.compiler.ast.MethodDeclaration.resolveStatements(MethodDeclaration.java:265)
	at org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration.resolve(AbstractMethodDeclaration.java:469)
	at org.eclipse.jdt.internal.compiler.ast.TypeDeclaration.resolve(TypeDeclaration.java:1185)
	at org.eclipse.jdt.internal.compiler.ast.TypeDeclaration.resolve(TypeDeclaration.java:1295)
	at org.eclipse.jdt.internal.compiler.ast.CompilationUnitDeclaration.resolve(CompilationUnitDeclaration.java:561)
	at org.eclipse.jdt.internal.compiler.Compiler.process(Compiler.java:770)
	at org.eclipse.jdt.internal.compiler.Compiler.compile(Compiler.java:470)
	at org.drools.ecj.EclipseJavaCompiler.compile(EclipseJavaCompiler.java:391)
	at org.kie.memorycompiler.AbstractJavaCompiler.compile(AbstractJavaCompiler.java:45)
	at org.drools.mvel.java.JavaDialect.compileAll(JavaDialect.java:418)
	at org.drools.compiler.compiler.DialectCompiletimeRegistry.compileAll(DialectCompiletimeRegistry.java:64)
	at org.drools.compiler.compiler.PackageRegistry.compileAll(PackageRegistry.java:88)
	at org.drools.compiler.builder.impl.PackageRegistryManagerImpl.compileAll(PackageRegistryManagerImpl.java:199)
	at org.drools.compiler.builder.impl.processors.ConsequenceCompilationPhase.process(ConsequenceCompilationPhase.java:38)
	at org.drools.compiler.builder.impl.KnowledgeBuilderImpl.wireAllRules(KnowledgeBuilderImpl.java:463)
	at org.drools.compiler.builder.impl.KnowledgeBuilderImpl.buildRules(KnowledgeBuilderImpl.java:1020)
	at org.drools.compiler.builder.impl.KnowledgeBuilderImpl.doFirstBuildStep(KnowledgeBuilderImpl.java:990)
	at org.drools.compiler.builder.impl.CompositeKnowledgeBuilderImpl.build(CompositeKnowledgeBuilderImpl.java:119)
	at org.drools.compiler.builder.impl.CompositeKnowledgeBuilderImpl.build(CompositeKnowledgeBuilderImpl.java:109)
	at org.drools.compiler.kie.builder.impl.AbstractKieProject.buildKnowledgePackages(AbstractKieProject.java:280)
	at org.drools.compiler.kie.builder.impl.AbstractKieProject.buildKnowledgePackages(AbstractKieProject.java:220)
	at org.drools.compiler.kie.builder.impl.AbstractKieProject.verify(AbstractKieProject.java:84)
	at org.drools.compiler.kie.builder.impl.KieBuilderImpl.buildKieProject(KieBuilderImpl.java:285)
	at org.drools.compiler.kie.builder.impl.KieBuilderImpl.buildAll(KieBuilderImpl.java:251)
	at org.drools.compiler.kie.builder.impl.KieBuilderImpl.buildAll(KieBuilderImpl.java:198)

Do you plan on updating ecj ? Or do you have a workaround to temporary fix this issue ?

Thank you.

@lfi-aud lfi-aud changed the title Questions about java version support and ecj support Question about ecj support Jan 22, 2025
@mariofusco
Copy link
Contributor

mariofusco commented Jan 23, 2025 via email

@lfi-aud
Copy link
Author

lfi-aud commented Jan 23, 2025

Hi,

Drools-ecj is used by default because it is a dependency of kie-ci but if I can exclude it, that's fine for me

Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants