You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomee.apache.org by Jean-Louis MONTEIRO <je...@atosorigin.com> on 2008/09/25 18:54:07 UTC

Application exception handling problem

Hi all,

I'm facing a problem with application exceptions handling in OpenEJB (trunk
version).
Just for information, it worked on previous version (3.0).

It's directly link with the point "14.2.1 Application Exception" from the
last EJB 3.0 specification.
The AnnotationDeployer (from the core module) does not include application
exception (with ApplicationException annotation). 

I think the problem is more or less at line 429 because the test is always
false (except when the application exception is declared in the ejb-jar.xml
file).
Should the test be ?
if (assemblyDescriptor.getApplicationException(exceptionClass) == null) {

Kind regards,
Jean-Louis






-- 
View this message in context: http://www.nabble.com/Application-exception-handling-problem-tp19673820p19673820.html
Sent from the OpenEJB Dev mailing list archive at Nabble.com.


Re: Application exception handling problem

Posted by Jean-Louis MONTEIRO <je...@atosorigin.com>.
Hi again,

Now that I'm looking exceptions handling I will have a look on the recent
post from a colleague ;-)
http://www.nabble.com/exceptions-handling-with-Webservices-td19668275.html
http://www.nabble.com/exceptions-handling-with-Webservices-td19668275.html 

Jean-Louis


Jean-Louis MONTEIRO wrote:
> 
> Hi all,
> 
> I'm facing a problem with application exceptions handling in OpenEJB
> (trunk version).
> Just for information, it worked on previous version (3.0).
> 
> It's directly link with the point "14.2.1 Application Exception" from the
> last EJB 3.0 specification.
> The AnnotationDeployer (from the core module) does not include application
> exception (with ApplicationException annotation). 
> 
> I think the problem is more or less at line 429 because the test is always
> false (except when the application exception is declared in the
> ejb-jar.xml file).
> Should the test be ?
> if (assemblyDescriptor.getApplicationException(exceptionClass) == null) {
> 
> Kind regards,
> Jean-Louis
> 
> 
> 
> 
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Application-exception-handling-problem-tp19673820p19673861.html
Sent from the OpenEJB Dev mailing list archive at Nabble.com.


Re: Application exception handling problem

Posted by David Blevins <da...@visi.com>.
On Oct 14, 2008, at 11:42 PM, Jean-Louis MONTEIRO wrote:
> before publishing next release, any comment on that point ?

Just a note on the release side of things, I think a regression or a  
legal issue would be good reasons to respin 3.1.  Barring that, I  
think we can target everything else at 3.1.1 and hopefully get that  
out in just a few weeks.  Hopefully we don't do the 6+ month delay  
between releases again.

-David


Re: Application exception handling problem

Posted by Jean-Louis MONTEIRO <je...@atosorigin.com>.
Hi all,

before publishing next release, any comment on that point ?

Regards,
Jean-Louis



Jean-Louis MONTEIRO wrote:
> 
> Hi,
> 
> I had a look on the post 
> http://www.nabble.com/exceptions-handling-with-Webservices-td19668275.html
> http://www.nabble.com/exceptions-handling-with-Webservices-td19668275.html
> .
> 
> I have a question related to the EjbInterceptor class (openejb-cxf
> module).
> In the invoke method, we can either directly call the target EJB bean
> (when no handler has been defined) or delegate to the CXF chain when
> handlers have been defined.
> 
> Regarding the first case, when an ApplicationException is thrown. This
> exception is caught by the preEjbInvoke method (from the
> EjbMethodInvoker). The preEjbInvoke method registers all exceptions as
> UNCHECKED so the client always receives a SOAPFaultException instead of
> the user defined application exception.
> 
> We can work around this problem by adding a dummy handler or change the
> test to be sure it's always false. 
> 
> To conclude, the optimization made to directly invoke the target EJB bean
> does not handle exceptions correctly.
> 
> Any input is welcome.
> Kind regards,
> Jean-Louis
> 
> 
> 
> David Blevins wrote:
>> 
>> Good catch!  Went ahead and made that change.
>> 
>> -David
>> 
>> On Sep 25, 2008, at 11:54 AM, Jean-Louis MONTEIRO wrote:
>> 
>>>
>>> Hi all,
>>>
>>> I'm facing a problem with application exceptions handling in OpenEJB  
>>> (trunk
>>> version).
>>> Just for information, it worked on previous version (3.0).
>>>
>>> It's directly link with the point "14.2.1 Application Exception"  
>>> from the
>>> last EJB 3.0 specification.
>>> The AnnotationDeployer (from the core module) does not include  
>>> application
>>> exception (with ApplicationException annotation).
>>>
>>> I think the problem is more or less at line 429 because the test is  
>>> always
>>> false (except when the application exception is declared in the ejb- 
>>> jar.xml
>>> file).
>>> Should the test be ?
>>> if (assemblyDescriptor.getApplicationException(exceptionClass) ==  
>>> null) {
>>>
>>> Kind regards,
>>> Jean-Louis
>>>
>>>
>>>
>>>
>>>
>>>
>>> -- 
>>> View this message in context:
>>> http://www.nabble.com/Application-exception-handling-problem-tp19673820p19673820.html
>>> Sent from the OpenEJB Dev mailing list archive at Nabble.com.
>>>
>>>
>> 
>> 
>> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Application-exception-handling-problem-tp19673820p19987699.html
Sent from the OpenEJB Dev mailing list archive at Nabble.com.


Re: Application exception handling problem

Posted by David Blevins <da...@visi.com>.
On Oct 3, 2008, at 3:04 AM, Jean-Louis MONTEIRO wrote:

>
> Hi,
>
> I had a look on the post
> http://www.nabble.com/exceptions-handling-with-Webservices-td19668275.html
> http://www.nabble.com/exceptions-handling-with-Webservices-td19668275.html 
>  .
>
> I have a question related to the EjbInterceptor class (openejb-cxf  
> module).
> In the invoke method, we can either directly call the target EJB  
> bean (when
> no handler has been defined) or delegate to the CXF chain when  
> handlers have
> been defined.
>
> Regarding the first case, when an ApplicationException is thrown. This
> exception is caught by the preEjbInvoke method (from the  
> EjbMethodInvoker).
> The preEjbInvoke method registers all exceptions as UNCHECKED so the  
> client
> always receives a SOAPFaultException instead of the user defined  
> application
> exception.
>
> We can work around this problem by adding a dummy handler or change  
> the test
> to be sure it's always false.
>
> To conclude, the optimization made to directly invoke the target EJB  
> bean
> does not handle exceptions correctly.

Didn't work on that code -- I'm not sure I understand the motivation  
behind the optimization.

Jarek, you have any insight?

-David


Re: Application exception handling problem

Posted by Jean-Louis MONTEIRO <je...@atosorigin.com>.
Hi,

I had a look on the post 
http://www.nabble.com/exceptions-handling-with-Webservices-td19668275.html
http://www.nabble.com/exceptions-handling-with-Webservices-td19668275.html .

I have a question related to the EjbInterceptor class (openejb-cxf module).
In the invoke method, we can either directly call the target EJB bean (when
no handler has been defined) or delegate to the CXF chain when handlers have
been defined.

Regarding the first case, when an ApplicationException is thrown. This
exception is caught by the preEjbInvoke method (from the EjbMethodInvoker).
The preEjbInvoke method registers all exceptions as UNCHECKED so the client
always receives a SOAPFaultException instead of the user defined application
exception.

We can work around this problem by adding a dummy handler or change the test
to be sure it's always false. 

To conclude, the optimization made to directly invoke the target EJB bean
does not handle exceptions correctly.

Any input is welcome.
Kind regards,
Jean-Louis



David Blevins wrote:
> 
> Good catch!  Went ahead and made that change.
> 
> -David
> 
> On Sep 25, 2008, at 11:54 AM, Jean-Louis MONTEIRO wrote:
> 
>>
>> Hi all,
>>
>> I'm facing a problem with application exceptions handling in OpenEJB  
>> (trunk
>> version).
>> Just for information, it worked on previous version (3.0).
>>
>> It's directly link with the point "14.2.1 Application Exception"  
>> from the
>> last EJB 3.0 specification.
>> The AnnotationDeployer (from the core module) does not include  
>> application
>> exception (with ApplicationException annotation).
>>
>> I think the problem is more or less at line 429 because the test is  
>> always
>> false (except when the application exception is declared in the ejb- 
>> jar.xml
>> file).
>> Should the test be ?
>> if (assemblyDescriptor.getApplicationException(exceptionClass) ==  
>> null) {
>>
>> Kind regards,
>> Jean-Louis
>>
>>
>>
>>
>>
>>
>> -- 
>> View this message in context:
>> http://www.nabble.com/Application-exception-handling-problem-tp19673820p19673820.html
>> Sent from the OpenEJB Dev mailing list archive at Nabble.com.
>>
>>
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Application-exception-handling-problem-tp19673820p19794986.html
Sent from the OpenEJB Dev mailing list archive at Nabble.com.


Re: Application exception handling problem

Posted by Jean-Louis MONTEIRO <je...@atosorigin.com>.
Done.
No JIRA has been opened so here is the patch file.
http://www.nabble.com/file/p23271111/patch-itests-ApplicationException.txt
patch-itests-ApplicationException.txt 

Jean-Louis


David Blevins wrote:
> 
> 
> On Apr 27, 2009, at 5:40 AM, Jean-Louis MONTEIRO wrote:
> 
>>
>> David,
>>
>> Some months ago, I did some itests to avoid regression.
>> When I synchronize my working copy with the trunk, I always have  
>> those files
>> changed.
>>
>> Do you think it would be possible to add itests for that.
> 
> Sure, if you have a test for it, we'll be happy to add it.
> 
> -David
> 
> 
>>
>>
>>
>> Jean-Louis
>>
>>
>> David Blevins wrote:
>>>
>>> Good catch!  Went ahead and made that change.
>>>
>>> -David
>>>
>>> On Sep 25, 2008, at 11:54 AM, Jean-Louis MONTEIRO wrote:
>>>
>>>>
>>>> Hi all,
>>>>
>>>> I'm facing a problem with application exceptions handling in OpenEJB
>>>> (trunk
>>>> version).
>>>> Just for information, it worked on previous version (3.0).
>>>>
>>>> It's directly link with the point "14.2.1 Application Exception"
>>>> from the
>>>> last EJB 3.0 specification.
>>>> The AnnotationDeployer (from the core module) does not include
>>>> application
>>>> exception (with ApplicationException annotation).
>>>>
>>>> I think the problem is more or less at line 429 because the test is
>>>> always
>>>> false (except when the application exception is declared in the ejb-
>>>> jar.xml
>>>> file).
>>>> Should the test be ?
>>>> if (assemblyDescriptor.getApplicationException(exceptionClass) ==
>>>> null) {
>>>>
>>>> Kind regards,
>>>> Jean-Louis
>>>
>>
>> -- 
>> View this message in context:
>> http://www.nabble.com/Application-exception-handling-problem-tp19673820p23255435.html
>> Sent from the OpenEJB Dev mailing list archive at Nabble.com.
>>
>>
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Application-exception-handling-problem-tp19673820p23271111.html
Sent from the OpenEJB Dev mailing list archive at Nabble.com.


Re: Application exception handling problem

Posted by David Blevins <da...@visi.com>.
On Apr 27, 2009, at 5:40 AM, Jean-Louis MONTEIRO wrote:

>
> David,
>
> Some months ago, I did some itests to avoid regression.
> When I synchronize my working copy with the trunk, I always have  
> those files
> changed.
>
> Do you think it would be possible to add itests for that.

Sure, if you have a test for it, we'll be happy to add it.

-David


>
>
>
> Jean-Louis
>
>
> David Blevins wrote:
>>
>> Good catch!  Went ahead and made that change.
>>
>> -David
>>
>> On Sep 25, 2008, at 11:54 AM, Jean-Louis MONTEIRO wrote:
>>
>>>
>>> Hi all,
>>>
>>> I'm facing a problem with application exceptions handling in OpenEJB
>>> (trunk
>>> version).
>>> Just for information, it worked on previous version (3.0).
>>>
>>> It's directly link with the point "14.2.1 Application Exception"
>>> from the
>>> last EJB 3.0 specification.
>>> The AnnotationDeployer (from the core module) does not include
>>> application
>>> exception (with ApplicationException annotation).
>>>
>>> I think the problem is more or less at line 429 because the test is
>>> always
>>> false (except when the application exception is declared in the ejb-
>>> jar.xml
>>> file).
>>> Should the test be ?
>>> if (assemblyDescriptor.getApplicationException(exceptionClass) ==
>>> null) {
>>>
>>> Kind regards,
>>> Jean-Louis
>>
>
> -- 
> View this message in context: http://www.nabble.com/Application-exception-handling-problem-tp19673820p23255435.html
> Sent from the OpenEJB Dev mailing list archive at Nabble.com.
>
>


Re: Application exception handling problem

Posted by Jean-Louis MONTEIRO <je...@atosorigin.com>.
David,

Some months ago, I did some itests to avoid regression. 
When I synchronize my working copy with the trunk, I always have those files
changed.

Do you think it would be possible to add itests for that.


Jean-Louis


David Blevins wrote:
> 
> Good catch!  Went ahead and made that change.
> 
> -David
> 
> On Sep 25, 2008, at 11:54 AM, Jean-Louis MONTEIRO wrote:
> 
>>
>> Hi all,
>>
>> I'm facing a problem with application exceptions handling in OpenEJB  
>> (trunk
>> version).
>> Just for information, it worked on previous version (3.0).
>>
>> It's directly link with the point "14.2.1 Application Exception"  
>> from the
>> last EJB 3.0 specification.
>> The AnnotationDeployer (from the core module) does not include  
>> application
>> exception (with ApplicationException annotation).
>>
>> I think the problem is more or less at line 429 because the test is  
>> always
>> false (except when the application exception is declared in the ejb- 
>> jar.xml
>> file).
>> Should the test be ?
>> if (assemblyDescriptor.getApplicationException(exceptionClass) ==  
>> null) {
>>
>> Kind regards,
>> Jean-Louis
> 

-- 
View this message in context: http://www.nabble.com/Application-exception-handling-problem-tp19673820p23255435.html
Sent from the OpenEJB Dev mailing list archive at Nabble.com.


Re: Application exception handling problem

Posted by David Blevins <da...@visi.com>.
Good catch!  Went ahead and made that change.

-David

On Sep 25, 2008, at 11:54 AM, Jean-Louis MONTEIRO wrote:

>
> Hi all,
>
> I'm facing a problem with application exceptions handling in OpenEJB  
> (trunk
> version).
> Just for information, it worked on previous version (3.0).
>
> It's directly link with the point "14.2.1 Application Exception"  
> from the
> last EJB 3.0 specification.
> The AnnotationDeployer (from the core module) does not include  
> application
> exception (with ApplicationException annotation).
>
> I think the problem is more or less at line 429 because the test is  
> always
> false (except when the application exception is declared in the ejb- 
> jar.xml
> file).
> Should the test be ?
> if (assemblyDescriptor.getApplicationException(exceptionClass) ==  
> null) {
>
> Kind regards,
> Jean-Louis
>
>
>
>
>
>
> -- 
> View this message in context: http://www.nabble.com/Application-exception-handling-problem-tp19673820p19673820.html
> Sent from the OpenEJB Dev mailing list archive at Nabble.com.
>
>