Eclipse shows empty error message with Java 9 - java

I have installed the Java 9 plugin. My project hasn't changed, but when I try to run, I get this:
If you need anything else, feel free to comment that you don't have enough info.
My .log file: https://pastebin.com/SQXZVcQk

Seems like a configuration issue as per my understanding. There are two possible causes/solution to it:
From the logs:
Root exception:
java.lang.ExceptionInInitializerError
at com.jniwrapper.util.ProcessorInfo.b(SourceFile:95)
Caused by: com.jniwrapper.LibraryNotFoundException: Cannot find JNIWrapper native library (jniwrap64.dll) in java.library.path:
Eclipse is not able to configure the java.library.path properly, in which case you can try setting the VM argument using the following on the command line:
-Djava.library.path="${workspace_loc:project}\lib;${env_var:PATH}"
Check out How to add native library to "java.library.path" with Eclipse launch (instead of overriding it) for further details and platform specific solutions.
&& make sure you include the path to jdk-9 early access build that should ideally be a must for the plugin used based out of Java9.
Also, the log reads
!ENTRY org.eclipse.ui 4 0 2017-08-27 09:22:31.358
!MESSAGE Unhandled event loop exception
!STACK 0
java.lang.ArrayIndexOutOfBoundsException: -1
at es.org.chemi.games.snake.ui.GameField.createGameField(GameField.java:217)
at es.org.chemi.games.snake.ui.GameField$1.controlResized(GameField.java:99)
at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:236)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:86)
at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4428)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1079)
For the pertaining code, you might want to look into the implementation of
createGameField at GameField.java:217. If this wasn't specifically occurring on previous java version for you then solving (1) should get rid of this or else you might want to give the solutions at Eclipse Bug: Unhandled event loop exception No more handles a try.

On receiving the same error in eclipse I fixed it by selecting this option instead of the default (highlighted by the red arrow in the snapshot)

Related

Project not compiling after Dagger version update (FileTooBigException)

I have upgraded my project Dagger version from 2.29.1 to 2.44, but after the upgrade I am not able to compile the code.
This is the error I am getting:
e: org.jetbrains.kotlin.util.KotlinFrontEndException: Front-end Internal error: Failed to analyze declaration SomeExtnContractImpl
File being compiled: (97,1) in FILE_NAME.kt
The root cause org.jetbrains.kotlin.com.intellij.openapi.util.io.FileTooBigException was thrown at: org.jetbrains.kotlin.com.intellij.openapi.util.io.FileUtil.loadFileBytes(FileUtil.java:201)
Caused by: org.jetbrains.kotlin.com.intellij.openapi.util.io.FileTooBigException: Attempt to load 'PROJECT_PATH/DaggeAppComponent.java' in memory buffer, file length is 24808949 bytes.
I have tired setting custom editor properties with these values (in KB):
idea.max.content.load.filesize=30000
idea.max.intellisense.filesize=35000
idea.max.vcs.loaded.size.kb=30000
But I'm still getting the same error. Please suggest what can be done to fix this?
To fix this error, a possible workaround is to use this in gradle.properties
kotlin.daemon.jvmargs=-Didea.max.content.load.filesize=300000 -Didea.max.intellisense.filesize=300000
Note: 300000 here will be equivalent to 30 MB.

How to get KQueue to be available in Java in OSX?

My packages are as following:
implementation("io.netty:netty-transport-native-epoll:$nettyVersion")
implementation("io.netty:netty-transport-native-kqueue:$nettyVersion")
implementation("io.netty:netty-transport-native-epoll:$nettyVersion:linux-aarch_64")
implementation("io.netty:netty-transport-native-epoll:$nettyVersion:linux-x86_64")
implementation("io.netty:netty-transport-native-kqueue:$nettyVersion:osx-x86_64")
Gradle showing the package getting installed correctly: (where <source> is the path to our internal library storage)
Cached resource <source>/releases/io/netty/netty-transport-native-kqueue/4.1.78.Final/netty-transport-native-kqueue-4.1.78.Final-osx-x86_64.jar is up-to-date (lastModified: Fri Jun 24 17:45:28 PDT 2022).
Gradle output showing the system:
------------------------------------------------------------------------
Detecting the operating system and CPU architecture
------------------------------------------------------------------------
os.detected.name=osx
os.detected.arch=x86_64
os.detected.version=12.4
os.detected.version.major=12
os.detected.version.minor=4
os.detected.classifier=osx-x86_64
Simplest way I can reproduce is:
KQueue.isAvailable()
returns false.
If I run the following to get more information:
KQueue.unavailabilityCause().printStackTrace();
I get: (removed repeating or unnecessary stack traces)
java.lang.UnsatisfiedLinkError: could not load a native library: netty_transport_native_kqueue_x86_64
at io.netty.util.internal.NativeLibraryLoader.load(NativeLibraryLoader.java:239)
at io.netty.channel.kqueue.Native.loadNativeLibrary(Native.java:155)
...
Suppressed: java.lang.UnsatisfiedLinkError: no netty_transport_native_kqueue_x86_64 in java.library.path: /Users/kdilsiz/Library/Java/Extensions:/Library/Java/Extensions:/Network/Library/Java/Extensions:/System/Library/Java/Extensions:/usr/lib/java:.
...
Am I not supposed to be able to run this code? What am I missing?
If I search online for the error, it shows outdated Netty package loading errors (only showing up in debug level logging). This is NOT my problem. The package loads correctly when I run gradle and I can see it is being cached/loaded with gradle -info --refresh-dependencies.
It was due to one of the dependencies importing netty-all. This was causing the Kqueue packages to be imported twice and with different versions.
The problem was that I did not fully read the stack trace from:
KQueue.unavailabilityCause().printStackTrace();
In the end of that stack trace, it said:
Caused by: java.lang.IllegalStateException: Multiple resources found for 'META-INF/native/libnetty_transport_native_kqueue_x86_64.jnilib' with different content:
...
After that, I was able to find where the package was coming from and fix it. Then I was able to locally run the Java Code to run domain socket and test it locally.
I used IntelliJ to run it after the fix. (VsCode had a problem even after the fix, hence wanted to mention it)

Checkstyle plugin in Eclipse: Checkstyle Execution failed due to an internal error

I'm trying to figure out how to solve this issue.
I have Eclipse Ide for enterprise java and web developers installed, version 2021-06 (4.20.0) and Checkstyle plugin, version 8.44.0.
Edit: my SO is ubuntu 20.04.2 LTS
The problem is when I create a new configuration, either from scratch or copying Suns Check configuration (that is my goal, I want a configuration like Suns check but with some differences) from the menu Window -> preferences -> Checkstyle.
Then, after I create the configuration, I try to use it on a project (a standard java project) by right-clicking the project, properties and go to checkstyle, select "checkstyle active for this project" and then select the configuration I just created from the dropdown. And after that, right-clicking the project, going to checkstyle -> "check code with checkstyle" results in the folliwing message:
Checkstyle Execution failed due to an internal error, please check the error log for details...
So I did, I went to the eclipse log, and found the following:
>
!ENTRY net.sf.eclipsecs.core 4 0 2021-10-22 23:19:43.102
!MESSAGE Checkstyle-Plugin: unable to parse configuration stream
!STACK 0
com.puppycrawl.tools.checkstyle.api.CheckstyleException: unable to parse configuration stream
at com.puppycrawl.tools.checkstyle.ConfigurationLoader.loadConfiguration(ConfigurationLoader.java:325)
at com.puppycrawl.tools.checkstyle.ConfigurationLoader.loadConfiguration(ConfigurationLoader.java:287)
at net.sf.eclipsecs.core.builder.CheckerFactory.createCheckerInternal(CheckerFactory.java:217)
at net.sf.eclipsecs.core.builder.CheckerFactory.createChecker(CheckerFactory.java:122)
at net.sf.eclipsecs.core.builder.Auditor.runAudit(Auditor.java:139)
at net.sf.eclipsecs.core.builder.CheckstyleBuilder.handleBuildSelection(CheckstyleBuilder.java:307)
at net.sf.eclipsecs.core.jobs.RunCheckstyleOnFilesJob.runInWorkspace(RunCheckstyleOnFilesJob.java:119)
at org.eclipse.core.internal.resources.InternalWorkspaceJob.run(InternalWorkspaceJob.java:42)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)
Caused by: org.xml.sax.SAXException: com.puppycrawl.tools.checkstyle.api.CheckstyleException: Property ${org.checkstyle.sun.suppressionxpathfilter.config} has not been set
com.puppycrawl.tools.checkstyle.api.CheckstyleException: Property ${org.checkstyle.sun.suppressionxpathfilter.config} has not been set
at com.puppycrawl.tools.checkstyle.ConfigurationLoader$InternalLoader.startElement(ConfigurationLoader.java:530)
at java.xml/com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.startElement(AbstractSAXParser.java:518)
at java.xml/com.sun.org.apache.xerces.internal.parsers.AbstractXMLDocumentParser.emptyElement(AbstractXMLDocumentParser.java:183)
at java.xml/com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDValidator.emptyElement(XMLDTDValidator.java:752)
at java.xml/com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanStartElement(XMLDocumentFragmentScannerImpl.java:1386)
at java.xml/com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2725)
at java.xml/com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:605)
at java.xml/com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:541)
at java.xml/com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:888)
at java.xml/com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:824)
at java.xml/com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:141)
at java.xml/com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1224)
at java.xml/com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:635)
at com.puppycrawl.tools.checkstyle.XmlLoader.parseInputSource(XmlLoader.java:86)
at com.puppycrawl.tools.checkstyle.ConfigurationLoader.parseInputSource(ConfigurationLoader.java:198)
at com.puppycrawl.tools.checkstyle.ConfigurationLoader.loadConfiguration(ConfigurationLoader.java:315)
... 8 more
Caused by: com.puppycrawl.tools.checkstyle.api.CheckstyleException: Property ${org.checkstyle.sun.suppressionxpathfilter.config} has not been set
at com.puppycrawl.tools.checkstyle.ConfigurationLoader.replaceProperties(ConfigurationLoader.java:376)
at com.puppycrawl.tools.checkstyle.ConfigurationLoader.access$500(ConfigurationLoader.java:51)
at com.puppycrawl.tools.checkstyle.ConfigurationLoader$InternalLoader.startElement(ConfigurationLoader.java:525)
... 23 more
It seems to be a problem with the org.checkstyle.sun.suppressionxpathfilter.config property, so I googled it and found the following page:
https://checkstyle.sourceforge.io/sun_style.html that says something about the default value this property should have, so I configured this value in the properties window for my configuration, but nothing changed.
What can be the cause of this? How can I solve this problem?

VirtualMachine.attach failing

I wrote a program that uses the VirtualMachine attach API to dynamically attach to a jar. My machine is 64 bit, and the only reason I can think of that would stop is because of my messing around with the environment variables of java(no java_home was set and I tried to fix it). Since getting this error, I have reinstalled both the JDK and JRE to no avail. My guess is that it is some sort of problem loading attach.dll, which is 64 bit.
Anyone have suggestions?
Stack trace of error:
at sun.tools.attach.HotSpotAttachProvider.listVirtualMachines(HotSpotAttachProvider.java:92)
at sun.tools.attach.WindowsAttachProvider.listVirtualMachines(WindowsAttachProvider.java:76)
at com.sun.tools.attach.VirtualMachine.list(VirtualMachine.java:147)
at me.stoud.*.JVM.<init>(JVM.java:19)
at me.stoud.helper.*.checkJVM(CheckHelper.java:158)
at me.stoud.helper.*.initiateChecks(CheckHelper.java:39)
at me.stoud.start.Launch.main(Launch.java:33)
Caused by: java.lang.NullPointerException
at sun.jvmstat.perfdata.monitor.protocol.local.LocalVmManager.activeVms(LocalVmManager.java:148)
at sun.jvmstat.perfdata.monitor.protocol.local.MonitoredHostProvider.activeVms(MonitoredHostProvider.java:150)
at sun.tools.attach.HotSpotAttachProvider.listVirtualMachines(HotSpotAttachProvider.java:81)
... 6 more
Forgot to include: it's a java.lang.InternalError being thrown

GWT compilation failed

I am developping a GWT Application and when I was about to compile I got a message "GWT Compilation Failed" without any stacktrace.
Then I've tried something even simpler, like creating the sample application and I've got "Creation of element failed. Reason: Invocation of com.google.gwt.user.tools.WebAppCreator failed".
I did a lot of research and tried a lot of stuff (change folder permissions, deactivate antivirus, changed version of eclipse and gwt, checked windows event logger (found nothing), recreate workspace, remove ClassPath environment variavble...). The most weird thing is that in my personal computer everything works fine, but copying the eclipse folder to my work's computer I get always the same problems.
This is the .log from eclipse.
!ENTRY org.eclipse.jdt.ui 4 10001 2014-05-19 17:07:17.829
!MESSAGE Internal Error
!STACK 1
Java Model Exception: Core Exception [code 0] Invocation of com.google.gwt.user.tools.WebAppCreator failed. See the error log for more details.
at org.eclipse.jdt.internal.core.BatchOperation.executeOperation(BatchOperation.java:50)
at org.eclipse.jdt.internal.core.JavaModelOperation.run(JavaModelOperation.java:728)
at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2344)
at org.eclipse.jdt.core.JavaCore.run(JavaCore.java:5204)
at org.eclipse.jdt.internal.ui.actions.WorkbenchRunnableAdapter.run(WorkbenchRunnableAdapter.java:106)
at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:121)
Caused by: org.eclipse.core.runtime.CoreException: Invocation of com.google.gwt.user.tools.WebAppCreator failed. See the error log for more details.
at com.google.gwt.eclipse.core.runtime.tools.WebAppProjectCreatorRunner.createProject(WebAppProjectCreatorRunner.java:70)
at com.google.gdt.eclipse.suite.wizards.WebAppProjectCreator.createGWTProject(WebAppProjectCreator.java:683)
at com.google.gdt.eclipse.suite.wizards.WebAppProjectCreator.create(WebAppProjectCreator.java:292)
at com.google.gdt.eclipse.suite.wizards.NewWebAppProjectWizard.finishPage(NewWebAppProjectWizard.java:154)
at org.eclipse.jdt.internal.ui.wizards.NewElementWizard$2.run(NewElementWizard.java:118)
at org.eclipse.jdt.internal.core.BatchOperation.executeOperation(BatchOperation.java:39)
at org.eclipse.jdt.internal.core.JavaModelOperation.run(JavaModelOperation.java:728)
at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2344)
at org.eclipse.jdt.core.JavaCore.run(JavaCore.java:5204)
at org.eclipse.jdt.internal.ui.actions.WorkbenchRunnableAdapter.run(WorkbenchRunnableAdapter.java:106)
at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:121)
!SUBENTRY 1 com.google.gwt.eclipse.core 4 0 2014-05-19 17:07:17.829
!MESSAGE Invocation of com.google.gwt.user.tools.WebAppCreator failed. See the error log for more details.
Does anyone has any ideas about how to fix this?
I removed ClassPath entry from Windows Environment Variables and it did the trick.

Categories

Resources