[jboss-user] [JBoss Seam] - Stateless EJB cant be invoked by POJO

QPool.Char do-not-reply at jboss.com
Thu Feb 7 09:44:41 EST 2008


Hello, i have a strange problem using SEAM.

I have a Stateless Session Bean:
@Stateless
  | @Name("ProcessStarter")
  | //@JndiName("ProcessStarterBean")
  | public class ProcessStarterBean implements ProcessStarter{
  |     ...
  | 	
  | 	public void startProcess(ExeWorkflowCreator creator)
  | 	throws ExeDocFrameworkException {		
  | 
Which is invoked by another stateless Session Bean:
@Stateless
  | @Name("menuPrincipal")
  | public class MenuPrincipalBean implements MenuPrincipal {
  |        @EJB ProcessStarter processStarter;
  | 	
  | 	public String startDemoWorkflow2() {
  | 		System.out.println("Starte Demo Workflow 2...");
  | 		try {
  | 			processStarter.startProcess(new DemoWorkflow2());
  | 		}
  | 		catch (ExeDocFrameworkException e) {
  | 			e.printStackTrace();
  | 		}
  | 		return "home";
  | 	}
  | 
This WORKS.

But now, i want this MenuPrincipalBean to invoke a normal Java Class called "DemoWorkflow" like this:
	public String startDemoWorkflow() {
  | 		System.out.println("Starte Demo Workflow...");
  | 		try {
  | 			DemoWorkflow dw = new DemoWorkflow();
  | 			dw.startProcess(dw);
  | 		}
  | 
with DemoWorkflow being a normal Java class (no sessionbean) which inherits another normal Java class which will then do the method-invocation and the ejb-injection.

DemoWorkflow inherits ExeWorkflowGate:
@Name("ExeWorkflowGate")
  | public class ExeWorkflowGate {
  | 	
  | 	@EJB ProcessStarter processStarter;
  | 	
  | 	public void startProcess(ExeWorkflowCreator exeWorkflowCreator) 
  | 	throws ExeDocFrameworkException {
  | 		processStarter.startProcess(exeWorkflowCreator);
  | 	}
  | 
I found out that injection doesnt work here, because the injected beanAttribute is always NULL. Furthermore, i tried everything to invoke the EJB with a JNDI-lookup, but it always says that the Bean is not bound...

The strange thing is that the injection from sessionBean---->sessionBean works, but normal class ----> sessionBean doesnt work.

I also tried to let the DemoWorkflow participate in SEAM Framework by adding @Name("...") annotation...

Anymore suggestions or explanations por favor ?

Thx in advance

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4127410#4127410

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4127410



More information about the jboss-user mailing list