Thursday, June 16, 2011

Trying it in Java

Just to be sure the no-local-interface-needed bit works in my setup, I re-write the bean implementation in Java (and got rid of all interfaces):

package com.scalaejb;

import javax.ejb.Stateless;

@Stateless
public class ScalaEjbImpl {
public void sayHi( String name ) { System.out.println("Hi J, "+name); }
}

I also had to modify my client with a new injection. Instead of injecting a Local reference I just inject a bean reference (still in Scala):

@EJB private var localEJB:ScalaEjbImpl = _

All good and working. Of course I don't want the Java implementation of the bean, so its back to debugging the problem with the Scala version. At least we've proven:

  • Scala EJBs work
  • No-Interface EJBs (in Java) work w/Glassfish 3.1
Now we just need to get these working together.

No comments:

Post a Comment