[jboss-user] [Remoting] - Re: Exception propagation using servlet transport

ron.sigal@jboss.com do-not-reply at jboss.com
Sat Nov 15 00:41:42 EST 2008


Prompted by Abbasi Ujjainwala, I've taken another look at this thread, and I think I see what the problem is.  I'm guessing that you're working from the "EJBAndJNDIOverHTTPWithUnifiedInvoker" wiki page at http://www.jboss.org/community/docs/DOC-9632?  The problem is, you're trying to do an EJB3 invocation, but you've added the "return-exception" parameter to a Connector configuration that is a blend of EJB2 and EJB3 artifacts.  E.g., the InvocationMarshaller is strictly for EJB2.

Instead, you want to start with this this Connector configuration:


  |   <!-- Unified invoker (based on remoting) for invocations via HTTP with target EJB3 beans. -->
  |   <mbean code="org.jboss.remoting.transport.Connector"
  |      name="jboss.remoting:service=connector,transport=servlet,target=ejb3"
  |      display-name="EJB3 Servlet transport Connector">
  |      <depends>jboss.aop:service=AspectDeployer</depends>
  |      <attribute name="InvokerLocator">
  |        servlet://${jboss.bind.address}:8080/unified-invoker/Ejb3ServerInvokerServlet
  |      </attribute>
  |      <attribute name="Configuration">
  |         <handlers>
  |            <handler subsystem="AOP">org.jboss.aspects.remoting.AOPRemotingInvocationHandler</handler>
  |         </handlers>
  |      </attribute>
  |   </mbean> 
  | 

and add the return-exception parameter:


  | <attribute name="InvokerLocator">
  |   servlet://${jboss.bind.address}:8080/unified-invok/Ejb3ServerInvokerServlet/?return-exception=true
  | </attribute>
  | 

Two other things.

1. noThrowOnError="true" probably isn't what you want.  That setting will cause Remoting to return the exception as the value of the invocation, rather than throw the exception.

2. I gather that you've been experimenting with Remoting 2.5.0.SP1.  Note that the treatment of exceptions has changed since the 2.2 releases.  I didn't want to change the default behavior of Remoting in a minor release, so I made it possible to turn on the behavior of sending the actual exception from the server back to the client but left the default behavior alone.  For release 2.4.0.GA and above, that behavior becomes the default, and it can be reverted to the original behavior by setting the parameter "dont-return-exception" to "true".

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

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



More information about the jboss-user mailing list