You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@cayenne.apache.org by Erdinc <ko...@yahoo.com> on 2011/03/01 15:15:32 UTC

java.lang.NoSuchMethodError: org.apache.cayenne.access.QueryLogger.setLogger(Lorg/apache/cayenne/log/JdbcEventLogger;)V

Hi,
I just downloaded v 3.1M1. When I try to create ServerRuntime with the command;

new ServerRuntime("cayenne.xml");


It gives the error on the subject line;
 
Caused by: java.lang.NoSuchMethodError: 
org.apache.cayenne.access.QueryLogger.setLogger(Lorg/apache/cayenne/log/JdbcEventLogger;)V

 at 
org.apache.cayenne.configuration.server.ServerModule.configure(ServerModule.java:87)

 at org.apache.cayenne.di.spi.DefaultInjector.<init>(DefaultInjector.java:65)
 at org.apache.cayenne.di.DIBootstrap.createInjector(DIBootstrap.java:38)
 at 
org.apache.cayenne.configuration.CayenneRuntime.<init>(CayenneRuntime.java:92)
 at 
org.apache.cayenne.configuration.server.ServerRuntime.<init>(ServerRuntime.java:50)


I think there is problem in ServerModule;

    CommonsJdbcEventLogger logger = new CommonsJdbcEventLogger();
    QueryLogger.setLogger(logger);

ServerModule sends CommonsJdbcEventLogger but QueryLogger receives that param;
 public static void setLogger(JdbcEventLogger logger)


But how the cayenne could be compiled is mystery for me. Any idea?



---------------------------------------------------
http://www.nofailtime.com 
Application monitoring
--------------------------------------------------- 


      

Re: java.lang.NoSuchMethodError: org.apache.cayenne.access.QueryLogger.setLogger(Lorg/apache/cayenne/log/JdbcEventLogger;)V

Posted by Øyvind Harboe <oy...@zylin.com>.
You need to load cayenne.xml into the modeler in 3.1 and save
it out again.

It will be converted and saved with a new name, cayenne-foo.xml,
which is what you pass to new ServerRuntime().



-- 
Øyvind Harboe

Can Zylin Consulting help on your project?

US toll free 1-866-980-3434 / International +47 51 87 40 27

http://www.zylin.com/zy1000.html
ARM7 ARM9 ARM11 XScale Cortex
JTAG debugger and flash programmer

Re: java.lang.NoSuchMethodError: org.apache.cayenne.access.QueryLogger.setLogger(Lorg/apache/cayenne/log/JdbcEventLogger;)V

Posted by Erdinc <ko...@yahoo.com>.
Thank you for your prompt reply. My project depends on 3.1.M1 release, I removed 
3.0 package. I unzip cayenne package and decompiled QueryLogger;

public static void setLogger(JdbcEventLogger logger)
{
logger = logger;
}
 
I see CommonsJdbcEventLogger is a JdbcEventLogger. There should'nt be any 
error.  I didnt understand. I may try on my other machine also ...




________________________________
From: Andrus Adamchik <an...@objectstyle.org>
To: user@cayenne.apache.org
Sent: Tue, March 1, 2011 4:18:54 PM
Subject: Re: java.lang.NoSuchMethodError: 
org.apache.cayenne.access.QueryLogger.setLogger(Lorg/apache/cayenne/log/JdbcEventLogger;)V


Are you sure you don't have Cayenne 3.0 in the classpath?

> ServerModule sends CommonsJdbcEventLogger but QueryLogger receives that param;
>  public static void setLogger(JdbcEventLogger logger)
> 
> 
> But how the cayenne could be compiled is mystery for me. Any idea?

CommonsJdbcEventLogger implements JdbcEventLogger

Andrus

On Mar 1, 2011, at 4:15 PM, Erdinc wrote:

> Hi,
> I just downloaded v 3.1M1. When I try to create ServerRuntime with the 
command;
> 
> new ServerRuntime("cayenne.xml");
> 
> 
> It gives the error on the subject line;
>  
> Caused by: java.lang.NoSuchMethodError: 
>org.apache.cayenne.access.QueryLogger.setLogger(Lorg/apache/cayenne/log/JdbcEventLogger;)V
>V
> 
>  at 
>org.apache.cayenne.configuration.server.ServerModule.configure(ServerModule.java:87)
>)
> 
>  at org.apache.cayenne.di.spi.DefaultInjector.<init>(DefaultInjector.java:65)
>  at org.apache.cayenne.di.DIBootstrap.createInjector(DIBootstrap.java:38)
>  at 
> org.apache.cayenne.configuration.CayenneRuntime.<init>(CayenneRuntime.java:92)
>  at 
>org.apache.cayenne.configuration.server.ServerRuntime.<init>(ServerRuntime.java:50)
>)
> 
> 
> I think there is problem in ServerModule;
> 
>    CommonsJdbcEventLogger logger = new CommonsJdbcEventLogger();
>    QueryLogger.setLogger(logger);
> 
> ServerModule sends CommonsJdbcEventLogger but QueryLogger receives that param;
>  public static void setLogger(JdbcEventLogger logger)
> 
> 
> But how the cayenne could be compiled is mystery for me. Any idea?
> 
> 
> 
> ---------------------------------------------------
> http://www.nofailtime.com 
> Application monitoring
> --------------------------------------------------- 
> 
> 


      

Re: java.lang.NoSuchMethodError: org.apache.cayenne.access.QueryLogger.setLogger(Lorg/apache/cayenne/log/JdbcEventLogger;)V

Posted by Andrus Adamchik <an...@objectstyle.org>.
Are you sure you don't have Cayenne 3.0 in the classpath?

> ServerModule sends CommonsJdbcEventLogger but QueryLogger receives that param;
>  public static void setLogger(JdbcEventLogger logger)
> 
> 
> But how the cayenne could be compiled is mystery for me. Any idea?

CommonsJdbcEventLogger implements JdbcEventLogger

Andrus

On Mar 1, 2011, at 4:15 PM, Erdinc wrote:

> Hi,
> I just downloaded v 3.1M1. When I try to create ServerRuntime with the command;
> 
> new ServerRuntime("cayenne.xml");
> 
> 
> It gives the error on the subject line;
>  
> Caused by: java.lang.NoSuchMethodError: 
> org.apache.cayenne.access.QueryLogger.setLogger(Lorg/apache/cayenne/log/JdbcEventLogger;)V
> 
>  at 
> org.apache.cayenne.configuration.server.ServerModule.configure(ServerModule.java:87)
> 
>  at org.apache.cayenne.di.spi.DefaultInjector.<init>(DefaultInjector.java:65)
>  at org.apache.cayenne.di.DIBootstrap.createInjector(DIBootstrap.java:38)
>  at 
> org.apache.cayenne.configuration.CayenneRuntime.<init>(CayenneRuntime.java:92)
>  at 
> org.apache.cayenne.configuration.server.ServerRuntime.<init>(ServerRuntime.java:50)
> 
> 
> I think there is problem in ServerModule;
> 
>     CommonsJdbcEventLogger logger = new CommonsJdbcEventLogger();
>     QueryLogger.setLogger(logger);
> 
> ServerModule sends CommonsJdbcEventLogger but QueryLogger receives that param;
>  public static void setLogger(JdbcEventLogger logger)
> 
> 
> But how the cayenne could be compiled is mystery for me. Any idea?
> 
> 
> 
> ---------------------------------------------------
> http://www.nofailtime.com 
> Application monitoring
> --------------------------------------------------- 
> 
>