NoSuchMethodException when using javasimon-jdbc3

42 views
Skip to first unread message

chaojun zhang

unread,
Oct 24, 2013, 1:08:43 AM10/24/13
to java...@googlegroups.com
 I found a bug in javasimon-jdbc3 maven project , there is a static variable define at line 34 of class org.javasimon.jdbc.SqlNormalizer which reference class org.javasimon.utils.Replacer.
But apparently we can't found the constructor method signature in class org.javasimon.utils.Replacer as below:(boolean is required for the third parameter ).


Caused by: java.lang.NoSuchMethodError: org.javasimon.utils.Replacer.<init>(Ljava/lang/String;Ljava/lang/String;Z)V
at org.javasimon.jdbc.SqlNormalizer.<clinit>(SqlNormalizer.java:24)
at org.javasimon.jdbc.SimonPreparedStatement.prepare(SimonPreparedStatement.java:51)
at org.javasimon.jdbc.SimonPreparedStatement.executeQuery(SimonPreparedStatement.java:66)
at org.springframework.jdbc.core.JdbcTemplate$1.doInPreparedStatement(JdbcTemplate.java:643)
at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:586)
at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:636)
at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:661)
at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:701)
at org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate.query(NamedParameterJdbcTemplate.java:166)
at org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate.query(NamedParameterJdbcTemplate.java:172)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.6.0_37]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [rt.jar:1.6.0_37]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [rt.jar:1.6.0_37]
at java.lang.reflect.Method.invoke(Method.java:597) [rt.jar:1.6.0_37]
at org.jboss.weld.bean.proxy.AbstractBeanInstance.invoke(AbstractBeanInstance.java:44)
at org.jboss.weld.bean.proxy.ProxyMethodHandler.invoke(ProxyMethodHandler.java:105)
at org.jboss.weld.proxies.NamedParameterJdbcOperations$448884020$Proxy$_$$_WeldClientProxy.query(NamedParameterJdbcOperations$448884020$Proxy$_$$_WeldClientProxy.java)
at com.lombardrisk.ocelot.core.dao.AliasDao.init(AliasDao.java:32)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.6.0_37]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [rt.jar:1.6.0_37]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [rt.jar:1.6.0_37]
at java.lang.reflect.Method.invoke(Method.java:597) [rt.jar:1.6.0_37]
at org.jboss.as.ee.component.ManagedReferenceLifecycleMethodInterceptorFactory$ManagedReferenceLifecycleMethodInterceptor.processInvocation(ManagedReferenceLifecycleMethodInterceptorFactory.java:130)
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
at org.jboss.invocation.WeavedInterceptor.processInvocation(WeavedInterceptor.java:53) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
at org.jboss.as.weld.injection.WeldInjectionInterceptor.processInvocation(WeldInjectionInterceptor.java:73)
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
at org.jboss.as.ee.component.ManagedReferenceInterceptorFactory$ManagedReferenceInterceptor.processInvocation(ManagedReferenceInterceptorFactory.java:95)
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
at org.jboss.as.ee.component.ManagedReferenceInterceptorFactory$ManagedReferenceInterceptor.processInvocation(ManagedReferenceInterceptorFactory.java:95)
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
at org.jboss.invocation.WeavedInterceptor.processInvocation(WeavedInterceptor.java:53) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
at org.jboss.as.ee.component.NamespaceContextInterceptor.processInvocation(NamespaceContextInterceptor.java:50)
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
at org.jboss.as.ejb3.tx.CMTTxInterceptor.invokeInOurTx(CMTTxInterceptor.java:228)
... 159 more

Richard Richter

unread,
Oct 24, 2013, 5:15:41 AM10/24/13
to java...@googlegroups.com
Hi

Please, can you tell which javasimon JARs you combine on the
classpath? Are they all from the same version? JDBC3 is now not
supported anymore - are you really stuck to such an old beast? :-) If
so, then you may need to patch the code by yourself.

Cheers

Virgo
> --
> You received this message because you are subscribed to the Google Groups
> "javasimon" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to javasimon+...@googlegroups.com.
> To post to this group, send email to java...@googlegroups.com.
> Visit this group at http://groups.google.com/group/javasimon.
> For more options, visit https://groups.google.com/groups/opt_out.

chaojun zhang

unread,
Oct 24, 2013, 9:29:16 AM10/24/13
to java...@googlegroups.com
Hi Virgo,

   I use version 2.5.0 for the javasimon-jdbc3 ,but the version of javasimon-core is 3.4.0
    <dependency>
<groupId>org.javasimon</groupId>
<artifactId>javasimon-jdbc3</artifactId>
<version>2.5.0</version>
</dependency>

chaojun zhang

unread,
Oct 24, 2013, 9:41:53 AM10/24/13
to java...@googlegroups.com
BTW, the javasimon-jdbc4 3.4.0 also have the same issue.


On Thursday, October 24, 2013 5:15:41 PM UTC+8, Virgo47 wrote:

Richard Richter

unread,
Oct 24, 2013, 10:27:24 AM10/24/13
to java...@googlegroups.com
Ok, that really should not work :-) - are you stuck to JDBC 3? What
Java version do you use?

Richard Richter

unread,
Oct 24, 2013, 10:28:11 AM10/24/13
to java...@googlegroups.com
Ah, then it indeed may be bug, I'll check it out on 3.4.0.

Richard Richter

unread,
Oct 24, 2013, 10:34:24 AM10/24/13
to java...@googlegroups.com
Well, this does not make any sense - we actually use this with 3.4.0
and there must be Replacer with that constructor. The line:
public Replacer(final String from, final String to, Modificator...
modificators) {

have not been changed since 17.4.2012. SqlNormalizer is even in our
unit tests, and it passes.

I can take action on this only if you can provide some failing unit
test, because any other reproduction is rather difficult for me.
However, my guess is that the problem is somewhere else, maybe on the
classpath. I can't tell, really.

I'm sorry

chaojun zhang

unread,
Oct 25, 2013, 4:23:29 AM10/25/13
to java...@googlegroups.com
Hi Virgo,
   I'm so sorry that the javasimon-jdbc4 is ok. But yes,  SqlNormalizer in jdbc3 version reference an undeclared constructor method .I will move to jdbc 4. our jdk is 1.6 or above.

Gérald Quintana

unread,
Oct 25, 2013, 5:45:47 AM10/25/13
to java...@googlegroups.com
Hi,

The jdbc3 was removed from javasimon since the 3.0 release I think. If you try to mix javasimon-jdbc3 v2.5 with javasimon-core v3.4 it won't work because core APIs changed.

In short,
- use the same release for all javasimon modules
- if you have a Java 5/JDBC3 application then you must stick to javasimon 2.x where the jdbc3 module is still available,
- if you have a Java 6/JDBC4 application then you can use the latest 3.4 release of javasimon
- if you have a Java 7/JDBC4.1 application then you can still use javasimon 3.4 release but you'll loose the JDBC4.1 specific features. There's some WIP to support JDBC4.1.

Gérald



2013/10/25 chaojun zhang <zcj2...@gmail.com>

chaojun zhang

unread,
Oct 25, 2013, 6:44:52 AM10/25/13
to java...@googlegroups.com
BTW, how can use the jmx in ejb 3.1 ?

Here I want create a @Singleton bean  with @Startup annotation which intend to register SimonManagermentMXBeanImpl , but the it required a parameter which reference Manage interface,how can i do that ?

chaojun zhang

unread,
Oct 25, 2013, 6:45:03 AM10/25/13
to java...@googlegroups.com
BTW, how can use the jmx in ejb 3.1 ?

Here I want create a @Singleton bean  with @Startup annotation which intend to register SimonManagermentMXBeanImpl , but the it required a parameter which reference Manage interface,how can i do that ?

On Friday, October 25, 2013 5:45:47 PM UTC+8, Gérald wrote:

Gérald Quintana

unread,
Oct 25, 2013, 7:37:49 AM10/25/13
to java...@googlegroups.com
It's written in constructor's JavaDoc. Quick answer:
new SimonManagerMXBeanImpl(SimonManager.manager())

Gérald
Reply all
Reply to author
Forward
0 new messages