Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JDBC driver throws an error: java.lang.NoClassDefFoundError: org/antlr/runtime/RecognitionException [JDBC436] #477

Closed
firebird-automations opened this issue Jun 7, 2016 · 5 comments

Comments

@firebird-automations
Copy link

Submitted by: Gregory Kotsaftis (gregkotsaftis)

The new JDBC driver throws this exception:

07/06/2016 18:54:07,855 ERROR org.firebirdsql.logging.Log4jLogger.error():124 - Unable to load generated key parser
java.lang.NoClassDefFoundError: org/antlr/runtime/RecognitionException
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:264)
at org.firebirdsql.jdbc.AbstractGeneratedKeysQuery.<clinit>(AbstractGeneratedKeysQuery.java:55)
at org.firebirdsql.jdbc.AbstractDatabaseMetaData.supportsGetGeneratedKeys(AbstractDatabaseMetaData.java:5417)
at com.mchange.v2.c3p0.impl.NewProxyDatabaseMetaData.supportsGetGeneratedKeys(NewProxyDatabaseMetaData.java:3578)
at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:124)
at org.hibernate.cfg.Configuration.buildSettingsInternal(Configuration.java:2863)
at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:2859)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1870)

Caused by: java.lang.ClassNotFoundException: org.antlr.runtime.RecognitionException
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)

Commits: b3ae953 d57ac46

@firebird-automations
Copy link
Author

Commented by: @mrotteveel

This is not a bug, this is intended behavior (and has been for four years, since 2.2.0) if you don't have the optional dependency antlr-runtime-3.4.jar on the classpath. The antlr-runtime-3.4 is required to be able to use the getGeneratedKeys functionality. As getGeneratedKeys functionality might be expected, inability to load it, will be logged once on each run on error level, see https://github.com/FirebirdSQL/jaybird/blob/Branch_2_2/src/main/org/firebirdsql/jdbc/AbstractGeneratedKeysQuery.java#L60

If you don't want this logged, then you need to put antlr-runtime-3.4 on the classpath.

@firebird-automations
Copy link
Author

Modified by: @mrotteveel

status: Open [ 1 ] => Closed [ 6 ]

resolution: Won't Fix [ 2 ]

@firebird-automations
Copy link
Author

Commented by: @mrotteveel

The only change that might trigger it now as opposed to previous versions, is that in versions before 2.2.10, AbstractDatabaseMetaData.supportsGetGeneratedKeys() would always return true, and now it first checks presence of getGeneratedKeys support before returning true if present or false otherwise. See http://www.firebirdsql.org/file/documentation/drivers_documentation/java/2.2.10/release_notes.html#changes-and-fixes-in-jaybird-2.2.10 and JDBC412

@firebird-automations
Copy link
Author

Commented by: Gregory Kotsaftis (gregkotsaftis)

Thanks for taking the time to answer this silly issue!
It's just that after 10 years of using firebird in our projects I could not get it to even imagine I was missing some other jar; since I never had such a message up to now.

@firebird-automations
Copy link
Author

Commented by: @mrotteveel

I will see if I can make the error message a little bit more clear.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants