[jboss-user] [JBoss Seam] - pass seam component to external ejb call causes exception [u

leezard do-not-reply at jboss.com
Thu Jun 21 16:56:54 EDT 2007


Hi all again,

My next seam problem is: I have an external ejb, I call to perform some operations. I have also set of classes delivered in separate jar. One of those classes was marked as seam component I couldn't do it via annotation so I added:

<component name="request" class="com.jboss.seam.test.TestTransactionRequest" auto-create="true" scope="CONVERSATION"/>

Now my bean code is: 

  | @Stateful
  | @Name("processTransactionRevoke")
  | @Scope(ScopeType.CONVERSATION)
  | public class ProcessTransactionRevokeBean implements ProcessTransactionRevoke {
  | 
  | 	private boolean revokeSuccesful;
  | 	
  | 	@Logger
  | 	private Log logger;
  | 	
  | 	@RequestParameter
  | 	String transactionId;
  | 	
  | 	@In
  | 	TestTransactionRequest request;
  |  	
  | 	@EJB
  | 	TransactionRevokeService service;
  | 	
  | 	@Begin(pageflow="transactionRevoke")
  | 	public void begin() {
  | 		logger.info("Begin called");
  | 		request.setParentTransaction(transactionId);
  | 		logger.info("Parent trid: " + request.getParentTransaction());
  | 	}
  | 	
  | 	public void revokeTransaction() {
  | 		logger.info("processing");
  | 		try {
  | 		        logger.info("Parent trid: " + request.getParentTransaction());
  | 			revokeService.revokeTransaction(revokeRequest, false);
  | 			revokeSuccesful = true;
  | 			logger.info("succeed");
  | 		} catch(Exception e) {
  | 			logger.info("failed");
  | 			e.printStackTrace();
  | 			revokeSuccesful = false;
  | 		}
  | 	}
  | 
  | 	public boolean isRevokeSuccesful() {
  | 		return revokeSuccesful;
  | 	}
  | 
  | 	@Remove @Destroy
  | 	public void destroy() {}	
  | }
  | 

Logs say that request is initialized and has parentTransaction set properly, but when I pass request to service.revokeTransaction method I get an exception saying:


  | 22:44:03,952 ERROR [STDERR] javax.ejb.EJBTransactionRolledbackException
  | 22:44:03,952 ERROR [STDERR]     at org.jboss.ejb3.tx.Ejb3TxPolicy.handleInCallerTx(Ejb3TxPolicy.java:87)
  | 22:44:03,952 ERROR [STDERR]     at org.jboss.aspects.tx.TxPolicy.invokeInCallerTx(TxPolicy.java:130)
  | 22:44:03,952 ERROR [STDERR]     at org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java:195)
  | 22:44:03,952 ERROR [STDERR]     at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
  | 22:44:03,952 ERROR [STDERR]     at org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropagationInterceptor.java:76)
  | 22:44:03,952 ERROR [STDERR]     at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
  | 22:44:03,952 ERROR [STDERR]     at org.jboss.ejb3.stateless.StatelessInstanceInterceptor.invoke(StatelessInstanceInterceptor.java:62)
  | 22:44:03,952 ERROR [STDERR]     at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
  | 22:44:03,952 ERROR [STDERR]     at org.jboss.aspects.security.AuthenticationInterceptor.invoke(AuthenticationInterceptor.java:77)
  | 22:44:03,952 ERROR [STDERR]     at org.jboss.ejb3.security.Ejb3AuthenticationInterceptor.invoke(Ejb3AuthenticationInterceptor.java:106)
  | 22:44:03,952 ERROR [STDERR]     at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
  | 22:44:03,952 ERROR [STDERR]     at org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:46)
  | 22:44:03,952 ERROR [STDERR]     at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
  | 22:44:03,952 ERROR [STDERR]     at org.jboss.ejb3.asynchronous.AsynchronousInterceptor.invoke(AsynchronousInterceptor.java:106)
  | 22:44:03,952 ERROR [STDERR]     at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
  | 22:44:03,952 ERROR [STDERR]     at org.jboss.ejb3.stateless.StatelessContainer.dynamicInvoke(StatelessContainer.java:278)
  | 22:44:03,952 ERROR [STDERR]     at org.jboss.ejb3.remoting.IsLocalInterceptor.invokeLocal(IsLocalInterceptor.java:79)
  | 22:44:03,952 ERROR [STDERR]     at org.jboss.ejb3.remoting.IsLocalInterceptor.invoke(IsLocalInterceptor.java:70)
  | 22:44:03,952 ERROR [STDERR]     at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
  | 22:44:03,952 ERROR [STDERR]     at org.jboss.ejb3.stateless.StatelessRemoteProxy.invoke(StatelessRemoteProxy.java:103)
  | 22:44:03,952 ERROR [STDERR]     at $Proxy89.revokeTransaction(Unknown Source)
  | ...
  | 22:44:03,962 ERROR [STDERR] Caused by: java.lang.NullPointerException
  | 22:44:03,962 ERROR [STDERR]     at org.jboss.seam.intercept.JavaBeanInterceptor.markDirty(JavaBeanInterceptor.java:94)
  | 22:44:03,962 ERROR [STDERR]     at org.jboss.seam.intercept.JavaBeanInterceptor.invoke(JavaBeanInterceptor.java:79)
  | 22:44:03,962 ERROR [STDERR]     at com.jboss.seam.test.TestTransactionRequest_$$_javassist_7.getParentTransaction(TestTransactionRevokeRequest_$$_javassist_7.java)
  | 22:44:03,962 ERROR [STDERR]     at com.jboss.seam.test.bean.TransactionRevokeServiceBean.revokeTransaction(TransactionRevokeServiceBean.java:67)
  | 

What's wrong with it? 

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

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



More information about the jboss-user mailing list