[EJB 3.0] - Re: injection SFSB to SLSB
by xmedeko
Hmm, I have changed my all SLSBs info SFSBs, but it didn't help my problem. If fact, I need something like http session, but for session beans called from Swing client. I.e. the client calls a several session bean, they gets some object which are related to this client (a quick operation) and then make some lengthy operation, like accessing DB or the local filesystem.
Yes, if I will have just one SFSB, then it would work for me. However, I'd like to have more remote interfaces just to have the code logically separated, since I have a quite few business methods to call.
Thanks for any help
Andy
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4225923#4225923
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4225923
17 years
[JBossWS] - WebFault and Declared RuntimeException is wrapped by SOAPFau
by skajotde
Hi All !
I'm writing webservice with JBoss 4.2.3 and jbossws-native-3.0.3.GA. When I declare checked exception, client can catch right unbinded exception.
@WebMethod
| public String testWyjatek003(@WebParam(name = "paramString") String paramString) throws WyjatekTestowy,
| WyjatekTestowyDziedziczacy;
When I declare runtime exception, exception is right unmarshalled as cause of SOAPFaultException but is not unwrapped.
| @WebMethod
| public String testWyjatekRuntime005(@WebParam(name = "paramString") String paramString)
| throws WyjatekTestowyRuntime02;
|
| @WebFault
| @ApplicationException(rollback = true)
| public class WyjatekTestowyRuntime02 extends RuntimeException {
| [...]
| }
|
I was investigating this case and I found ClientProxy.handleException(Exception ex)
private void handleException(Exception ex) throws Throwable
| {
| if (ex instanceof SOAPFaultException)
| {
| // Unwrap the cause if it is an Application Exception, otherwise use a protocol exception
| Throwable cause = ex.getCause();
| if (cause instanceof Exception)
| {
| // Throw unwrapped WebServiceException
| if (cause instanceof WebServiceException)
| throw (WebServiceException)cause;
|
| // Throw wrapped SOAPException
| if (cause instanceof SOAPException)
| throw (SOAPFaultException)ex;
|
| // Throw wrapped RuntimeException
| if (cause instanceof RuntimeException)
| throw (SOAPFaultException)ex;
|
| // Throw all other causes
| throw (Exception)cause;
| }
| }
| throw ex;
| }
So RuntimeException is wrapped with SOAPFaultException.
Is there way to write transparent code with declaring RuntimException and services with JBossWS ?
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4225916#4225916
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4225916
17 years