I'm using Scala 2.9.1
I've defined a Logging trait as such:
trait Logging {
def debug(msg: String, throwables: Throwable*) = ....
....
}
And I have a JMSPublisher class which mixes-in the Logging trait:
class JMSPublisher extends Publisher with Logging {
def publishProducts(list: List[_ <: Product]) = ....
def publish(list: Seq[Product]) = ....
}
This all compiles fine. My issue is that I have a user who wants to load my JMSPublisher into Spring. He's using Spring 2.5.6.
When the ApplicationContext is loaded during startup, the app crashes with an IllegalStateException, complaining that it can't find a bridged-method related to my Logging trait.
Initialization of bean failed; nested exception is java.lang.IllegalStateException: Unable to locate bridged method for bridge method 'public void com.app.messaging.JmsPublisher.debug(java.lang.String, scala.collection.Seq)'
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:480)
.....stack trace follows.......
This code worked under Scala-2.8, and I heard that Scala is marking trait that have some methods as bridged in 2.9. I think this is what is causing Spring to fail. I can't upgrade to Scala-2.9 if my class can't be loaded by Spring.
Has anyone run into this issue? Is there any fix or work-around?