Can't stop at exception in IntelliJ IDEA while writing Kotlin code - debugging

My code is trowing ArrayIndexOutOfBoundsException in a JUnit 4.12 test, I want to stop at that exception when it is thrown, but I can't for some reason.
Here are my debugger settings:
When I run my code with Debug, the exception is just logged to the console, and the debugger won't stop at the line where it has occurred.
What am I doing wrong?

Looks like the only way to stop at exception in a JUnit test is to create an exception breakpoint rule for that exception, because JUnit catches any excepiton that occurred in a test. Here is what I did:

Related

Logging after exception on application start

Using Spring boot 2.0.5. On application start occurs a exception with is logged 'ConfigServletWebServerApplicationContext : Exception encountered during context initialization'. But i need stacktrace. I was expecting stack trace will be logged later in SpringApplication.reportFailure '"Application run failed"'. But spring boot calls before this method ServletWebServerApplicationContext.stopAndReleaseWebServer and its seems that after this call any logging does not work anymore.
this can be related to your issue: spring boot discussion
spring boot github issue
You can also debug SpringApplication#reportFailure in the end (after catch (throwable)) it has generic logging of any error:
logger.error("Application run failed", ex)
In my case I had the logger from commons-logging which prevented logging to happen.

spring #transactional noRollbackFor unexpectedly rollsback...any clue?

I have following problem :
Servers runs on WL 12.
The main code is in a EAR, in methods with #Transactional explicitly written as NoRollbackFor=RuntimeException.class
When the exception occurs inside the EAR code, the noRollbackFor is correctly taken into account.
However, when the error occurs in a remote call to another WAR, the transaction is flagged as setRollbackOnly, and subsequent calls to the dabatase (read operations) fail (even if the exception is trapped in the calling code).
Any idea as to why this happens / how to avoid this ?
Thanks !
Make sure that your exception is of type RuntimeException, which triggers a rollback, but checked exception does not

Groovy: When I debuging object is not null

I have some problem with groovy. Sometimes when script is executed then exception NullPointerException is thrown but allways when I debugging the script the exception is no occurred. It looks like that my object sometimes is not created in time and Groovy try execute method on it. Someone have idea what could be the reason of problem:
Below is mentioned exception:
Caused by: java.lang.NullPointerException: Cannot invoke method getService() on null object.

Exception "Unable to commit: transaction marked for rollback" when using camel-jpa and JTA Transactions

I am currently working on a Tutorial to show camel-jpa on Karaf together with JTA Transactions. I use the following route:
from("jpa://net.lr.tutorial.karaf.camel.jpa2jms.model.Person").id("jpa2jms")
.transacted()
.marshal(df)
.bean(new ExceptionDecider())
.to("jms:person");
So I checked if the transactions work by throwing an exception in ExceptionDecider. When I do this I get the following Exception:
https://gist.github.com/3150591
Any ideas what I do wrong? I suspect it might be the way I setup the transaction manager.
You can find my whole project on github:
https://github.com/cschneider/Karaf-Tutorial/tree/master/cameljpa/jpa2jms
This happens when the transaction is marked inside an exception handler but the exception is swallowed. Normally such exceptions should bubble up and cause the whole transaction to rollback.
If the exception is swallowed instead then camel tries to commit at the end which results in the above exception.

SRVE0014E: uncaught service exception

I am getting below exception on one of our development environment. But it is working fine on another environment. unable to catch the trick. Can somebody help on this.
SRVE0014E: Uncaught service() exception root cause Jersey Spring Web
Application: `javax.servlet.ServletException: java.io.EOFException:
No content to map to Object due to end of input `
SRVE0014E appears to be application error. I would recommend checking the application log during the time of the exception thrown from the WebSphere exception. Additionally, investigate the functionality and behavior of Jersey Spring Web Application.

Resources