This is a different issue from the threads mentioned. Those threads
are classloader issues, where the slf4j classes can't be found.
In Franz's case, the org.slfj4.Logger interface is properly loaded by
the classloader. The issue is that the ioc container is confusing the
Logger parameter for a service, and trying to fetch an implementation
of Logger from the registry.
I ran into the same issue last night with a 5.0.10 snapshot build.
It's a bit inconsistent, though.
In one of my contribute methods, I inject several services, plus the
Logger. That works fine.
I had another contribute method with several parameters to which I
added a Logger parameter. And that one broke, just like Franz is
seeing, with a "no service implements org.slf4j.Logger" exception.
In my case, I as able to work around the issue. I was doing a bit of
object creation within the contribute method, but I realized I could
let Tapestry autobuild those objects and register them as services.
Instead of injecting the object dependencies into my contribute
method, I was able to inject the objects directly. That worked around
the issue.
You ought to be able to do the same thing. In your service binder
method of your application module, you should be able to:
binder
.bind
(HibernateConfigurer
.class
,DatabaseConnectionProeprtiesHibernateConfigurer
.class).withId("dbconfigurer");
And then instead injecting Logger, you should be able to:
public static void
contributeHibernateSessionSource
(OrderedConfiguration<HibernateConfigurer> config,
@InjectService("dbconfigurer")
HibernateConfigurer dbconfigurer) {
config.add(dbconfigurer,"after:Default");
}
HTH,
Robert
On Feb 2, 2008, at 2/212:42 AM , Alex.Hon wrote:
see: http://www.nabble.com/About-Slf4j-Error-td13591128.html#a15240195
http://www.nabble.com/About-Slf4j-Error-td13591128.html#a15240195
Franz Amador wrote:
This used to work, but now it's broken for me in 5.0.6 and 5.0.7.
I'm not
sure how to debug this. Apparently a proxy is being created for
Logger,
but when HibernateSessionManagerImpl tries to use it, it can't be
realized. Thanks in advance for any help.
Here are the relevant bits of AppModule.java:
import org.slf4j.Logger;
...
public class AppModule {
...
public static void
contributeHibernateSessionSource
(OrderedConfiguration<HibernateConfigurer>
config, Logger log) {
config.add("DatabaseConnectionProperties", new
DatabaseConnectionPropertiesHibernateConfigurer(log),
"after:Default");
}
...
and here's the stack trace:
Caused by: java.lang.RuntimeException: Exception constructing service
'HibernateSessionSource': Error invoking service builder method
org.apache.tapestry.hibernate.HibernateModule.build(Logger, List) (at
HibernateModule.java:111) (for service 'HibernateSessionSource'):
Error
invoking service contribution method
com
.centricsoftware
.pi
.services
.AppModule.contributeHibernateSessionSource(OrderedConfiguration,
Logger): No service implements the interface org.slf4j.Logger.
at
org
.apache
.tapestry
.ioc
.internal
.services
.JustInTimeObjectCreator.createObject(JustInTimeObjectCreator.java:
76)
at
$
HibernateSessionSource_1173bde489d
._delegate($HibernateSessionSource_1173bde489d.java)
at
$
HibernateSessionSource_1173bde489d
.create($HibernateSessionSource_1173bde489d.java)
at
org
.apache
.tapestry
.internal
.hibernate
.HibernateSessionManagerImpl
.<init>(HibernateSessionManagerImpl.java:31)
at
org
.apache
.tapestry.hibernate.HibernateModule.build(HibernateModule.java:73)
Franz Amador
[EMAIL PROTECTED]
--
View this message in context:
http://www.nabble.com/T5.0.7%3A-No-service-implements-the-interface-org.slf4j.Logger-tp14584395p15240200.html
Sent from the Tapestry - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]