Discussion:
java.lang.NoClassDefFoundError: com/mysql/jdbc/ParameterBindings
Matthew Broadhead
2018-07-02 11:07:18 UTC
Permalink
recently i have been getting this exception during development.
restarting the container allows me to proceed.  i am worried it might
start happening in production.

java.lang.NoClassDefFoundError: com/mysql/jdbc/ParameterBindings
    at
com.mysql.jdbc.ConnectionImpl.clientPrepareStatement(ConnectionImpl.java:1450)
    at
com.mysql.jdbc.ConnectionImpl.prepareStatement(ConnectionImpl.java:4165)
    at sun.reflect.GeneratedMethodAccessor418.invoke(Unknown Source)
    at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at
org.apache.tomcat.jdbc.pool.ProxyConnection.invoke(ProxyConnection.java:126)
    at
org.apache.tomcat.jdbc.pool.JdbcInterceptor.invoke(JdbcInterceptor.java:108)
    at
org.apache.tomcat.jdbc.pool.DisposableConnectionFacade.invoke(DisposableConnectionFacade.java:81)
    at com.sun.proxy.$Proxy649.prepareStatement(Unknown Source)
    at
org.apache.openjpa.lib.jdbc.DelegatingConnection.prepareStatement(DelegatingConnection.java:135)
Romain Manni-Bucau
2018-07-02 11:23:51 UTC
Permalink
Hi

Does it happen after some redeployment?
Is mysql in tomee lib or the app lib folder?


Le lun. 2 juil. 2018 13:07, Matthew Broadhead
Post by Matthew Broadhead
recently i have been getting this exception during development.
restarting the container allows me to proceed. i am worried it might
start happening in production.
java.lang.NoClassDefFoundError: com/mysql/jdbc/ParameterBindings
at
com.mysql.jdbc.ConnectionImpl.clientPrepareStatement(ConnectionImpl.java:1450)
at
com.mysql.jdbc.ConnectionImpl.prepareStatement(ConnectionImpl.java:4165)
at sun.reflect.GeneratedMethodAccessor418.invoke(Unknown Source)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at
org.apache.tomcat.jdbc.pool.ProxyConnection.invoke(ProxyConnection.java:126)
at
org.apache.tomcat.jdbc.pool.JdbcInterceptor.invoke(JdbcInterceptor.java:108)
at
org.apache.tomcat.jdbc.pool.DisposableConnectionFacade.invoke(DisposableConnectionFacade.java:81)
at com.sun.proxy.$Proxy649.prepareStatement(Unknown Source)
at
org.apache.openjpa.lib.jdbc.DelegatingConnection.prepareStatement(DelegatingConnection.java:135)
Matthew Broadhead
2018-07-02 11:34:25 UTC
Permalink
yes it normally happens after some code changes.
library is in tomee lib.  i am on 7.0.3
Post by Romain Manni-Bucau
Hi
Does it happen after some redeployment?
Is mysql in tomee lib or the app lib folder?
Le lun. 2 juil. 2018 13:07, Matthew Broadhead
Post by Matthew Broadhead
recently i have been getting this exception during development.
restarting the container allows me to proceed. i am worried it might
start happening in production.
java.lang.NoClassDefFoundError: com/mysql/jdbc/ParameterBindings
at
com.mysql.jdbc.ConnectionImpl.clientPrepareStatement(ConnectionImpl.java:1450)
at
com.mysql.jdbc.ConnectionImpl.prepareStatement(ConnectionImpl.java:4165)
at sun.reflect.GeneratedMethodAccessor418.invoke(Unknown Source)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at
org.apache.tomcat.jdbc.pool.ProxyConnection.invoke(ProxyConnection.java:126)
at
org.apache.tomcat.jdbc.pool.JdbcInterceptor.invoke(JdbcInterceptor.java:108)
at
org.apache.tomcat.jdbc.pool.DisposableConnectionFacade.invoke(DisposableConnectionFacade.java:81)
at com.sun.proxy.$Proxy649.prepareStatement(Unknown Source)
at
org.apache.openjpa.lib.jdbc.DelegatingConnection.prepareStatement(DelegatingConnection.java:135)
Romain Manni-Bucau
2018-07-02 12:28:32 UTC
Permalink
Would be interesting to have the full stack and probably some logs around
this issue. But sounds more related to the dev setup than anything which
can happen in prod.

Romain Manni-Bucau
@rmannibucau <https://twitter.com/rmannibucau> | Blog
<https://rmannibucau.metawerx.net/> | Old Blog
<http://rmannibucau.wordpress.com> | Github <https://github.com/rmannibucau> |
LinkedIn <https://www.linkedin.com/in/rmannibucau> | Book
<https://www.packtpub.com/application-development/java-ee-8-high-performance>


Le lun. 2 juil. 2018 à 13:34, Matthew Broadhead
Post by Matthew Broadhead
yes it normally happens after some code changes.
library is in tomee lib. i am on 7.0.3
Post by Romain Manni-Bucau
Hi
Does it happen after some redeployment?
Is mysql in tomee lib or the app lib folder?
Le lun. 2 juil. 2018 13:07, Matthew Broadhead
Post by Matthew Broadhead
recently i have been getting this exception during development.
restarting the container allows me to proceed. i am worried it might
start happening in production.
java.lang.NoClassDefFoundError: com/mysql/jdbc/ParameterBindings
at
com.mysql.jdbc.ConnectionImpl.clientPrepareStatement(ConnectionImpl.java:1450)
Post by Romain Manni-Bucau
Post by Matthew Broadhead
at
com.mysql.jdbc.ConnectionImpl.prepareStatement(ConnectionImpl.java:4165)
at sun.reflect.GeneratedMethodAccessor418.invoke(Unknown Source)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
Post by Romain Manni-Bucau
Post by Matthew Broadhead
at java.lang.reflect.Method.invoke(Method.java:498)
at
org.apache.tomcat.jdbc.pool.ProxyConnection.invoke(ProxyConnection.java:126)
Post by Romain Manni-Bucau
Post by Matthew Broadhead
at
org.apache.tomcat.jdbc.pool.JdbcInterceptor.invoke(JdbcInterceptor.java:108)
Post by Romain Manni-Bucau
Post by Matthew Broadhead
at
org.apache.tomcat.jdbc.pool.DisposableConnectionFacade.invoke(DisposableConnectionFacade.java:81)
Post by Romain Manni-Bucau
Post by Matthew Broadhead
at com.sun.proxy.$Proxy649.prepareStatement(Unknown Source)
at
org.apache.openjpa.lib.jdbc.DelegatingConnection.prepareStatement(DelegatingConnection.java:135)
Matthew Broadhead
2018-07-11 06:58:30 UTC
Permalink
sorry i should have come back to you on this one.
turns out during testing i added the mysql connector to the pom as
runtime.  using your advice i changed it to test scope and the problem
has gone away.  error must have been because it was in tomee/lib and in
the project pom
Post by Romain Manni-Bucau
Would be interesting to have the full stack and probably some logs around
this issue. But sounds more related to the dev setup than anything which
can happen in prod.
Romain Manni-Bucau
@rmannibucau <https://twitter.com/rmannibucau> | Blog
<https://rmannibucau.metawerx.net/> | Old Blog
<http://rmannibucau.wordpress.com> | Github <https://github.com/rmannibucau> |
LinkedIn <https://www.linkedin.com/in/rmannibucau> | Book
<https://www.packtpub.com/application-development/java-ee-8-high-performance>
Le lun. 2 juil. 2018 à 13:34, Matthew Broadhead
Post by Matthew Broadhead
yes it normally happens after some code changes.
library is in tomee lib. i am on 7.0.3
Post by Romain Manni-Bucau
Hi
Does it happen after some redeployment?
Is mysql in tomee lib or the app lib folder?
Le lun. 2 juil. 2018 13:07, Matthew Broadhead
Post by Matthew Broadhead
recently i have been getting this exception during development.
restarting the container allows me to proceed. i am worried it might
start happening in production.
java.lang.NoClassDefFoundError: com/mysql/jdbc/ParameterBindings
at
com.mysql.jdbc.ConnectionImpl.clientPrepareStatement(ConnectionImpl.java:1450)
Post by Romain Manni-Bucau
Post by Matthew Broadhead
at
com.mysql.jdbc.ConnectionImpl.prepareStatement(ConnectionImpl.java:4165)
at sun.reflect.GeneratedMethodAccessor418.invoke(Unknown Source)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
Post by Romain Manni-Bucau
Post by Matthew Broadhead
at java.lang.reflect.Method.invoke(Method.java:498)
at
org.apache.tomcat.jdbc.pool.ProxyConnection.invoke(ProxyConnection.java:126)
Post by Romain Manni-Bucau
Post by Matthew Broadhead
at
org.apache.tomcat.jdbc.pool.JdbcInterceptor.invoke(JdbcInterceptor.java:108)
Post by Romain Manni-Bucau
Post by Matthew Broadhead
at
org.apache.tomcat.jdbc.pool.DisposableConnectionFacade.invoke(DisposableConnectionFacade.java:81)
Post by Romain Manni-Bucau
Post by Matthew Broadhead
at com.sun.proxy.$Proxy649.prepareStatement(Unknown Source)
at
org.apache.openjpa.lib.jdbc.DelegatingConnection.prepareStatement(DelegatingConnection.java:135)
Loading...