While upgrading to jdk7 to jdk11 with wildfly16 drools are not working - drools

Hi I am having following configuration:
java version-jdk11
server-wildfly16
jars-drools 6.0 and ecj 4.6.1
in server location: C:\wildfly-16.0.0.Final\modules\org\eclipse\jdt\main
I am having jar: jasper-jdt-6.0.29
having an ear.
but after deploying my application opens though when i check rules so drls not working.
below error i am getting..
/servlet/com.fourcs.clm.iwarranty.eclaims.dataview.servlets.ClaimSearchServlet
Path Info:null
Query String:null
Stack Trace:
java.lang.NoSuchFieldError: compilation_beginningToCompile
at deployment.CLMEAR.ear//org.eclipse.jdt.internal.compiler.Compiler.compile(Compiler.java:428)
at deployment.CLMEAR.ear//org.eclipse.jdt.internal.compiler.Compiler.compile(Compiler.java:417)
at deployment.CLMEAR.ear//org.drools.compiler.commons.jci.compilers.EclipseJavaCompiler.compile(EclipseJavaCompiler.java:405)
at deployment.CLMEAR.ear//org.drools.compiler.commons.jci.compilers.AbstractJavaCompiler.compile(AbstractJavaCompiler.java:49)
at deployment.CLMEAR.ear//org.drools.compiler.rule.builder.dialect.java.JavaDialect.compileAll(JavaDialect.java:405)
at deployment.CLMEAR.ear//org.drools.compiler.compiler.DialectCompiletimeRegistry.compileAll(DialectCompiletimeRegistry.java:46)
at deployment.CLMEAR.ear//org.drools.compiler.compiler.PackageRegistry.compileAll(PackageRegistry.java:110)
at deployment.CLMEAR.ear//org.drools.compiler.compiler.PackageBuilder.compileAll(PackageBuilder.java:1334)
at deployment.CLMEAR.ear//org.drools.compiler.compiler.PackageBuilder.compileRules(PackageBuilder.java:1058)
at deployment.CLMEAR.ear//org.drools.compiler.compiler.PackageBuilder.compileAllRules(PackageBuilder.java:972)
I tried upgrading jar version ecj 4.3.1 to 4.6.1 but that also not worked.
How to resolve this error. Any idea?

If you look on the drools usage forums, you can find that Drools does not work with JDK11.
Drools 6 works with JDK7, but that version is from 2013. Latest Drools versions (7.X) work on WildFly 10 to 14 with JDK8.

Related

Error in eclipse project grails/groovy

I have the following error when working with grails project in eclipse
An internal error occurred during: "Requesting Java AST from selection".
org.codehaus.groovy.eclipse.core.compiler.GroovySnippetCompiler.(Lorg/codehaus/groovy/eclipse/core/model/GroovyProjectFacade;)V
Anybody have the same problem?
How fix the problem?
Update:
The issue was fixed in the latest Snapshot releases of Groovy Eclipse 2.9.3 so you may now just follow the guide # https://technology.first8.nl/eclipse-neon-grails-2-x-with-groovy-and-gsp-support/
Previous answer:
I also stumbled across this error and it happens only in classes that are grails-artefacts (services, controllers, ...). It seems to be related to recent changes in grails-eclipse plugin 2.9.2. A version from june 2017 worked without any issues and a recent upgrade to 2.9.2 release from january 2018 brought up the issue.
I fixed the issue by using the groovy-eclipse 2.9.2 version from 2015 which is contained in the GGTS update-site zip (http://download.springsource.com/release/TOOLS/update/3.6.4.RELEASE/e4.5/springsource-tool-suite-3.6.4.RELEASE-e4.5-updatesite.zip).
What I was searching for (without success) was an archive of release versions of the groovy-eclipse 2.9.2 branch. This way I would at least have the option to install the working 2.9.2 version from june 2017... If anyone has a clue where to find older versions I would be happy for a hint!
The stacktrace of the initially mentioned Exception looks like that:
java.lang.NoSuchMethodError: org.codehaus.groovy.eclipse.core.compiler.GroovySnippetCompiler.<init>(Lorg/codehaus/groovy/eclipse/core/model/GroovyProjectFacade;)V
at org.grails.ide.eclipse.editor.groovy.types.PerProjectTypeCache.setProject(PerProjectTypeCache.java:107)
at org.grails.ide.eclipse.core.internal.plugins.GrailsCore$PerProjectCacheManager.get(GrailsCore.java:54)
at org.grails.ide.eclipse.core.internal.plugins.GrailsCore.connect(GrailsCore.java:199)
at org.grails.ide.eclipse.editor.groovy.elements.GrailsProject.findAllServices(GrailsProject.java:510)
at org.grails.ide.eclipse.editor.groovy.types.PerProjectServiceCache.ensureInitialized(PerProjectServiceCache.java:108)
at org.grails.ide.eclipse.editor.groovy.types.PerProjectServiceCache.findServicesFor(PerProjectServiceCache.java:93)
at org.grails.ide.eclipse.editor.groovy.elements.AbstractGrailsElement.populateInjectedServices(AbstractGrailsElement.java:148)
at org.grails.ide.eclipse.editor.groovy.elements.ControllerClass.initializeTypeLookup(ControllerClass.java:284)
at org.grails.ide.eclipse.editor.groovy.types.GrailsTypeLookup.initialize(GrailsTypeLookup.java:100)
at org.eclipse.jdt.groovy.search.TypeInferencingVisitorWithRequestor.visitCompilationUnit(TypeInferencingVisitorWithRequestor.java:347)
at org.codehaus.groovy.eclipse.codebrowsing.requestor.CodeSelectHelper.selectASTNode(CodeSelectHelper.java:126)
at org.codehaus.groovy.eclipse.search.GroovyOccurrencesFinder.initialize(GroovyOccurrencesFinder.java:181)
at org.codehaus.groovy.eclipse.search.GroovyOccurrencesFinder.findOccurrences(GroovyOccurrencesFinder.java:209)
at org.codehaus.groovy.eclipse.editor.GroovyEditor.updateOccurrenceAnnotations(GroovyEditor.java:1317)
at org.eclipse.jdt.internal.ui.javaeditor.JavaEditor$6.selectionChanged(JavaEditor.java:3380)
at org.eclipse.jdt.internal.ui.viewsupport.SelectionListenerWithASTManager$PartListenerGroup.calculateASTandInform(SelectionListenerWithASTManager.java:178)
at org.eclipse.jdt.internal.ui.viewsupport.SelectionListenerWithASTManager$PartListenerGroup$3.run(SelectionListenerWithASTManager.java:155)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)

java.lang.ClassCastException: __redirected.__XMLInputFactory cannot be cast to org.codehaus.stax2.XMLInputFactory2

I am migration Java Web Application from jboss 6.0 to wildfly 11. I am getting
"java.lang.ClassCastException: __redirected.__XMLInputFactory cannot
be cast to org.codehaus.stax2.XMLInputFactory2" while running the code
on wildfly 11.0.0.Final. Junit tests are working without error.
Looks like there is some dependency issue in wildfly but unable to find any solution. Appreciate any help to resolve this issue..
I have included following woodstox dependencies in pom.
woodstox-core-asl 4.4.1
stax2-api 3.1.4
Thanks
Sanjay
This is caused by duplicate classes in the classpath.
Wildfly ships stax2-api as part of the woodstocks module, see modules/system/layers/base/org/codehaus/woodstox/main/ in the wildfly dist folder.
If you also have it in your application's lib folder, this will cause issues.
The solution is to either set the dependency to <scope>provided</scope> (or build) in pom.xml, or if you really need a special version, exclude wildfly's module via jboss-deployment-structure.xml.
See https://docs.jboss.org/author/display/WFLY10/Class+Loading+in+WildFly for more information on classloading in Wildfly.

How to solve the 'Unable to find Asm for stackmap generation' error on startup of STS?

I am trying to use the Spring Tool Suite 3.8.3 on Ubuntu 16.04. Upon startup I get this error:
An internal error occured during: "Initializing Java Tooling"
with the detailed message:
An internal error occurred during: "Initializing Java Tooling". Unable
to find Asm for stackmap generation (Looking for
'aj.org.objectweb.asm.ClassReader'). Stackmap generation for woven
code is required to avoid verify errors on a Java 1.7 or higher
runtime when weaving type org.eclipse.jdt.core.search.SearchPattern
when weaving classes when weaving
I have to admit that I have no idea what I should do here and I failed to find any pointers online. Any advice or hint is welcome.
It was for me due to the scala plug-in which I have installed a few days back. Uninstall the scala plugin and change to JDK 8 or JDK 11 it will work.
If anyone is still having a similar problem with Eclipse and needs to use Java 11 or higher (Eclipse nowadays seems to require Java 11) then have a look into this plugin as it seems to be required for the kotlin plugin.
https://marketplace.eclipse.org/content/aspectj-development-tools
I think you have installed Java 9 on your system. That's why you are facing compatibility issue and getting the stated errors. I therefore suggest you to degrade your java version to 8 for which it will work well and you wont be facing any error issue in that.
You can install java8 from this link!
I had to downgrade the JRE used to run Eclipse. Downgrading from Java 15 to Java 11 solved the problem.
Use the -vm option in eclipse.ini, eg.
-vm
c:\Dev\jdk-11\bin
My STS did not even start after installing scala plugin. I had to manually delete scala jars and folders from the STS /plugins. After that it started working.

NoSuchMethodError: org.eclipse.jetty.util.MultiMap.add

I loaded my Spring/Maven project in Eclipse (Spring Tools Suite variant), installed Run Jetty Run, and clicked Run Jetty.
PROBLEM: Jetty does not start correctly:
OpenJDK 64-Bit Server VM warning: ignoring option MaxPermSize=128m; support was removed in 8.0
Running Jetty 9.0.0.M3
ParentLoaderPriority enabled
Enable config class:runjettyrun.webapp.RJRWebInfConfiguration
Enable config class:org.eclipse.jetty.webapp.WebXmlConfiguration
Enable config class:runjettyrun.webapp.RJRMetaInfoConfiguration
Enable config class:org.eclipse.jetty.webapp.FragmentConfiguration
Enable config class:runjettyrun.annotation.RJRAnnotationConfiguration
Enable config class:org.eclipse.jetty.webapp.JettyWebXmlConfiguration
Enable config class:org.eclipse.jetty.webapp.TagLibConfiguration
ProjectClassLoader: entry=/home/nico/src/nemaki/core/target/classes
ProjectClassLoader: entry=/home/nico/.m2/repository/javax/servlet/javax.servlet-api/3.0.1/javax.servlet-api-3.0.1.jar
[... many other JAR libraries, none being Jetty ...]
ProjectClassLoader: entry=/home/nico/.m2/repository/jp/aegif/nemakiware/nemakiware-common/2.3.10/nemakiware-common-2.3.10.jar
Excluded entry=/home/nico/src/nemaki/core/target/test-classes
2016-09-30 17:17:09.780:INFO:oejs.Server:main: jetty-9.0.0.M3
2016-09-30 17:17:12.121:WARN:oejuc.AbstractLifeCycle:main: FAILED o.e.j.w.WebAppContext#694e1548{/core,[file:/home/nico/src/nemaki/core/WebContent/],STARTING}: java.lang.NoSuchMethodError: org.eclipse.jetty.util.MultiMap.add(Ljava/lang/Object;Ljava/lang/Object;)V
java.lang.NoSuchMethodError: org.eclipse.jetty.util.MultiMap.add(Ljava/lang/Object;Ljava/lang/Object;)V
at org.eclipse.jetty.annotations.ClassInheritanceHandler.handle(ClassInheritanceHandler.java:56)
at org.eclipse.jetty.annotations.AnnotationParser$MyClassVisitor.visit(AnnotationParser.java:398)
at org.objectweb.asm.ClassReader.accept(Unknown Source)
QUESTION: How can I fix it?
You are running an unstable version of Jetty.
Version 9.0.0.M3 is not a stable release (that's an experimental milestone release, a candidate for release, something to help integrators start to evolve their code for the eventual release).
Use a stable release, such as 9.3.12.v20160915 and you'll have a much better experience.
In 9.3.12.v20160915 the MultiMap class can be found in jetty-util-9.3.12.v20160915.jar
Also note, Jetty 9 is servlet 3.1, not 3.0.1 (seen in your output)
As explained by Joakim, 9.0.0.M3 is an old version of Jetty.
Fortunately, Run Jetty Run has been updated a few weeks ago.
Here is how to use the latest Run Jetty Run:
Uninstall from Eclipse any existing version of Run Jetty Run
Add this update site: http://xzer.github.io/run-jetty-run-updatesite/nightly/
Install from it the required component and the optional component 9.3.6
You now have Run Jetty Run using Jetty 9.3.6, which is a year old already but does not trigger the error above. Be sure to select it in Run configurations.

Deplyoment Issue in Migrating from Primefaces 3.5 to 4.0

I was using primefaces 3.5 in my project and now have updated to 4.0 but its failing to deploy on Glassfish after upgrading and resulting in the following error:
Severe: Critical error during deployment:
com.sun.faces.config.ConfigurationException: java.lang.Exception:
No Function Found on type: org.primefaces.util.ComponentUtils with
signature: java.lang.String resolveWidgetVar(java.lang.String)
I have removed the 3.5 version JAR and placed the new one in the project library, but still failing to deploy with the mentioned error given.
I'm using:
Glassfish: 4.1,
Netbeans 8.0.1
You should clear glassfish cache because old primefaces library which referred in the class path of your app server.
Stop the glassfish server.
Delete the content of the osgi-cache, by removing the felix directory in your domain. This is usually found in glassfish4/glassfish/domains/domain1/osgi-cache