App runs in Release build, but receive FATAL UNHANDLED EXCEPTION in Debug - java

I am getting some unhandeled exceptions that I don't understand.
It is a Xamarin Android App. The app runs perfectly fine using the Release build, however, when run in Debug the UI hangs and I get this error:
[mono] at System.Runtime.CompilerServices.TaskAwaiter`1[SpotifyWebAPI.Models.PrivateProfile].GetResult () [0x00000] in :0
[mono] at IntervalAndroid.MainActivity+c__async0.MoveNext () [0x0006d] in /Users/f/Projects/FourByFourInterval/IntervalAndroid/MainActivity.cs:390
[mono-rt] [ERROR] FATAL UNHANDLED EXCEPTION: System.NullReferenceException: Object reference not set to an instance of an object
[mono-rt] at SpotifyWebAPI.SpotifyWebAPIClass+c__async1A.MoveNext () [0x00000] in :0
[mono-rt] --- End of stack trace from previous location where exception was thrown ---
etc. The full error can be viewed on pastebin
EDIT 2: In Debug mode choosing to "Run without debugging" works perfectly fine.
EDIT: Setting Debug information in Project options to None solves the issue, but Symbols only and Full persists.
I have read that not having the correct android.permission.*, but since it works in Release (and not the otherway around where android.permission.INTERNET might be an issue) I don't think so.
But honestly, I have no idea.
Thank you for helping out
- Fred

Related

When i try to debug my project it throws no such file error

So the problem is that my project do not debug correctly, it is pretty big so i can not figure out when it started throw this error:
error image
java.nio.file.NoSuchFileException: /Users/similization/Library/Java/JavaVirtualMachines/openjdk-18.0.1.1/Contents/Home/conf/jndi.properties
P.S. I tried to use another versions of tomcat and tried to reinstall everything, but nothing changed and also none of my JVM version have such file (jndi.properties). When i just run my project - everything works fine but i'd like to have debug ability. After i stopped debugging my project i got this message from IntelliJ Idea:
Application Server was not connected before run configuration stop, reason:
javax.management.InstanceNotFoundException: Catalina:type=Server
UPDATE 1
Here is a full
stack trace
"java.base/sun.nio.fs.UnixException.translateToIOException(UnixException.java:92)"
"java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:106)"
"java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:111)"
"java.base/sun.nio.fs.UnixFileSystemProvider.newByteChannel(UnixFileSystemProvider.java:218)"
"java.base/java.nio.file.Files.newByteChannel(Files.java:380)"
"java.base/java.nio.file.Files.newByteChannel(Files.java:432)"
"java.base/java.nio.file.spi.FileSystemProvider.newInputStream(FileSystemProvider.java:422)"
"java.base/java.nio.file.Files.newInputStream(Files.java:160)"
"java.naming/com.sun.naming.internal.VersionHelper.lambda$getJavaHomeConfStream$4(VersionHelper.java:228)"
"java.base/java.security.AccessController.doPrivileged(AccessController.java:318)" "java.naming/com.sun.naming.internal.VersionHelper.getJavaHomeConfStream(VersionHelper.java:233)"
"java.naming/com.sun.naming.internal.ResourceManager.getApplicationResources(ResourceManager.java:530)"
"java.naming/com.sun.naming.internal.ResourceManager.getInitialEnvironment(ResourceManager.java:188)"
"java.naming/javax.naming.InitialContext.init(InitialContext.java:232)"
"java.naming/javax.naming.InitialContext.<init>(InitialContext.java:184)"
"org.apache.catalina.mbeans.GlobalResourcesLifecycleListener.createMBeans(GlobalResourcesLifecycleListener.java:99)"
"org.apache.catalina.mbeans.GlobalResourcesLifecycleListener.lifecycleEvent(GlobalResourcesLifecycleListener.java:82)"
"org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:123)"
"org.apache.catalina.util.LifecycleBase.setStateInternal(LifecycleBase.java:423)"
"org.apache.catalina.util.LifecycleBase.setState(LifecycleBase.java:366)"
"org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:923)"
"org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)"
"org.apache.catalina.startup.Catalina.start(Catalina.java:772)"
"java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104)"
"java.base/java.lang.reflect.Method.invoke(Method.java:577)"
"org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:345)"
"org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:476)"
there maybe 2 diffrent posssblity
1.there should be run time error
2.your file name has mis matched javac MyFirstJavaProgram. java'
or can you just share image of your code

Debugging Java in eclipse error

I am trying to debug my simple program in Eclipse. When I run it, the program runs as expected. But when I try to debug it, the program output is as expected but there is an error
ERROR: JDWP Unable to get JNI 1.2 environment, jvm->GetEnv() return code = -2
JDWP exit error AGENT_ERROR_NO_JNI_ENV(183): [util.c:838]
I would like to use the advantage of debugging mode. I want to know how to tweak this error.
Use
System.exit(0);
at the end of main() method
That is a bug when you have some breakpoints marked. Simply the easiest way is to clear all breakpoints in your code. That worked for me.
To find all breakpoints switch to DEBUG mode.

Unable to run the FIT test using fit runner in java

As per the example stated in the following link I tried on running the program.
But my eclipse is throwing an error stated as
An error has occurred. See error log for more details.
org/eclipse/jdt/internal/debug/ui/launcher/JavaLaunchConfigurationTab
Also the Two minitue example montioned at the Fitnesse.org also not functioning.
It says as 0 test run.
Thanks in advance

IntelliJ IDEA won't stop on assertions in debug mode

Why won't IntelliJ IDEA stop in debug mode when an assertion is triggered? I get a java.lang.AssertionError to console, but the running code doesn't pause at it as it is supposed to. Here are my exception breakpoints settings:
I found out that somehow debugger doesn't stop on assertions when running tests, but it does stop when running other code. The code I was trying to make stop on a failed assertion in debug mode was a test. That seems to be the issue, but I don't understand why would IDE behave that way.
Open source code of AssertionError and put a breakpoint on the constructor it will stop.

AGENT_ERROR_INVALID_EVENT_TYPE when testing an eclipse plugin

I'm developing an eclipse plugin. When testing it, I sometimes encounter the following error:
JDWP exit error AGENT_ERROR_INVALID_EVENT_TYPE(204): ExceptionOccurred [../../../src/share/back/eventHelper.c:808]
FATAL ERROR in native method: JDWP ExceptionOccurred, jvmtiError=AGENT_ERROR_INVALID_EVENT_TYPE(204)
Which immediately kills the running eclipse instance (not the eclipse host).
Does anyone know what can lead to this error? I suspect some multithreading shenanigans, but it's not easy pinpointing it.
Turns out this was the result of a wayward Thread.stop() method invoked when running eclipse in debug mode. This didn't happen in run mode, only in debug mode, and it no longer appeared after removing the stop() method.
I guess it is deprecated for a good reason!
You are passing wrong arguments to the jvm. You can try first by removing all the options and then adding one by one to find out which one causes the error

Categories

Resources