Vlad February 2016

How to retrieve full exception message from compiled jar without changing the code?

Java application terminates with exception:

liquibase.exception.LiquibaseException: liquibase.command.CommandExecutionException: liquibase.exception.DatabaseException: java.lang.NumberFormatException
        at liquibase.integration.commandline.CommandLineUtils.doDiffToChangeLog(CommandLineUtils.java:211)
        at liquibase.integration.commandline.Main.doMigration(Main.java:967)
        at liquibase.integration.commandline.Main.run(Main.java:180)
        at liquibase.integration.commandline.Main.main(Main.java:99)
Caused by: liquibase.command.CommandExecutionException: liquibase.exception.DatabaseException: java.lang.NumberFormatException
        at liquibase.command.AbstractCommand.execute(AbstractCommand.java:13)
        at liquibase.integration.commandline.CommandLineUtils.doDiffToChangeLog(CommandLineUtils.java:209)
        ... 3 more
Caused by: liquibase.exception.DatabaseException: java.lang.NumberFormatException
        at liquibase.snapshot.jvm.ColumnSnapshotGenerator.addTo(ColumnSnapshotGenerator.java:120)
        at liquibase.snapshot.jvm.JdbcSnapshotGenerator.snapshot(JdbcSnapshotGenerator.java:73)
        at liquibase.snapshot.SnapshotGeneratorChain.snapshot(SnapshotGeneratorChain.java:50)
        at liquibase.snapshot.DatabaseSnapshot.include(DatabaseSnapshot.java:194)
        at liquibase.snapshot.DatabaseSnapshot.replaceObject(DatabaseSnapshot.java:292)
        at liquibase.snapshot.DatabaseSnapshot.replaceObject(DatabaseSnapshot.java:314)
        at liquibase.snapshot.DatabaseSnapshot.includeNestedObjects(DatabaseSnapshot.java:234)
        at liquibase.snapshot.DatabaseSnapshot.include(DatabaseSnapshot.java:208)
        at liquibase.snapshot.DatabaseSnapshot.init(DatabaseSnapshot.java:70)
        at liquibase.snapshot.DatabaseSnapshot.<init>(DatabaseSnapshot.java:44)
        at liquibase.snapshot.JdbcDatabaseSnapshot.<init>(JdbcDatabaseSnapshot.java:21)
        at liquibase.snapshot.SnapshotGeneratorFactory.createSna        

Answers


Kenster February 2016

Caused by: java.lang.NumberFormatException

...

I now that NumberFormatException should contain "For input string" text. What can I do to view the message text for that exception?

There may not be a message for you to view. If the NumberFormatException had a detail message, it would be part of the stack trace. Here is the javadoc for NumberFormatException. You will note that there's no guarantee the exception will have a detailed message. In fact, it has a no-argument constructor which is documented to construct "a NumberFormatException with no detail message".

Additionally, here is the main constructor for the OpenJDK implementation of the BigDecimal class. If you look through it, you'll see that it throws NumberFormatExceptions with no detail message in a few places.

Post Status

Asked in February 2016
Viewed 2,485 times
Voted 14
Answered 1 times

Search




Leave an answer