[jboss-user] [JBoss Seam] - Re: Missing exceptions within asynchronious methods

gbc@gmx.de do-not-reply at jboss.com
Wed Aug 22 17:59:01 EDT 2007


Second Post regarding the missing Seam Exception:

Here I have two SessionBeans:

Interface One:

  | package org.esit.server.sessionbeans;
  | 
  | import javax.ejb.Local;
  | 
  | @Local
  | public interface Blob {  
  |     
  | 	public boolean isAvailable();
  | 	
  | 	public void raiseBlob();
  | 	
  | 	public void destroy();
  | 	
  | }
  | 

SessionBean One:

  | package org.esit.server.sessionbeans;
  | 
  | import javax.ejb.Remove;
  | import javax.ejb.Stateful;
  | 
  | import org.jboss.seam.annotations.In;
  | import org.jboss.seam.annotations.Logger;
  | import org.jboss.seam.annotations.Name;
  | import org.jboss.seam.core.Events;
  | import org.jboss.seam.faces.FacesMessages;
  | import org.jboss.seam.log.Log;
  | 
  | @Stateful
  | @Name("blob")
  | public class BlobAction implements Blob {
  | 
  | 	@In	FacesMessages facesMessages;
  | 
  | 	@In Events events;
  | 	
  | 	@Logger Log log;
  | 	
  | 	public boolean isAvailable() {
  | 		boolean out = true;
  | 		facesMessages.add("isAvailable(): #0", out);
  | 		return out;
  | 	}
  | 
  | 	public void raiseBlob() {
  | 		facesMessages.add("raiseEvent() called");
  | 		events.raiseAsynchronousEvent("blob");
  | 	}
  | 
  | 	@Remove
  | 	public void destroy() { }
  | }
  | 

Interface Two:

  | package org.esit.server.sessionbeans;
  | 
  | import javax.ejb.Local;
  | 
  | @Local
  | public interface Foo {
  | 
  | 	public void observeBlob();
  | 	
  | 	public void destroy();
  | 	
  | }
  | 

SessionBean Two:

  | package org.esit.server.sessionbeans;
  | 
  | import javax.ejb.Remove;
  | import javax.ejb.Stateful;
  | 
  | import org.jboss.seam.annotations.In;
  | import org.jboss.seam.annotations.Name;
  | import org.jboss.seam.annotations.Observer;
  | 
  | @Stateful
  | @Name("fooAction")
  | public class FooAction implements Foo{
  | 
  | 	@In(create=true) Blob blb;
  | 	
  | 	@Observer("blob")
  | 	public void observeBlob() {
  | 		System.out.println("blob");
  | 		throw new RuntimeException("blob");
  | 	}
  | 	
  | 	@Remove
  | 	public void destroy() {
  | 	}
  | 	
  | }
  | 

Same Page with invoking button gives no server output at all. The injected Blob variable name is misspelled so that the component cannot be found.

Correcting the variable name to blob, the server shows only
[code|
23:56:35,359 INFO  [STDOUT] blob
[/code|
like in the example above and no RuntimeException again.

So long, Greetz GHad

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

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



More information about the jboss-user mailing list