You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomee.apache.org by cchet <t....@curecomp.com> on 2013/03/12 15:38:49 UTC

OpenEjb cannot find @ApplicationExcption in different module (API module)

I read that the OpenEjb searches the current ejb module for
@ApplicationException annotated Exceptions and not the other modules.
We have the exceptions placed in the *API projects and the services are in
the *Impl projects.

I know i can add the application exceptions to the ejb-jar.xml but i want to
avoid this.
I read that this issue was fixed in 3.1 but in open-ejb-4.5.1 as we use it,
it is not able to find the appliaction exceptions unless they are listed in
the current ejb module ejb-jar.xml.

Is there a way to configure openEjb where to search for them, because i
cannot find any clue about this issue in the internet ?

open-ejb-core-4.5.1, deltaspike-cdi-ctrl-0.3-incubating
at our junit tests.

Thanks in advance.




--
View this message in context: http://openejb.979440.n4.nabble.com/OpenEjb-cannot-find-ApplicationExcption-in-different-module-API-module-tp4661442.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: OpenEjb cannot find @ApplicationExcption in different module (API module)

Posted by Romain Manni-Bucau <rm...@gmail.com>.
just add an ejb-jar.xml (empty) in META-INF, it should be enough

*Romain Manni-Bucau*
*Twitter: @rmannibucau <https://twitter.com/rmannibucau>*
*Blog: **http://rmannibucau.wordpress.com/*<http://rmannibucau.wordpress.com/>
*LinkedIn: **http://fr.linkedin.com/in/rmannibucau*
*Github: https://github.com/rmannibucau*



2013/3/13 cchet <t....@curecomp.com>

> Thanks a lot.
>
> How do i allow the scanning of the api jar, via
> openejb.deployments.classpath.include ?
> When will open-ejb-core-4.6.0 be released ?
>
>
>
> --
> View this message in context:
> http://openejb.979440.n4.nabble.com/OpenEjb-cannot-find-ApplicationExcption-in-different-module-API-module-tp4661442p4661494.html
> Sent from the OpenEJB User mailing list archive at Nabble.com.
>

Re: OpenEjb cannot find @ApplicationExcption in different module (API module)

Posted by cchet <t....@curecomp.com>.
Thanks a lot.

How do i allow the scanning of the api jar, via
openejb.deployments.classpath.include ?
When will open-ejb-core-4.6.0 be released ?



--
View this message in context: http://openejb.979440.n4.nabble.com/OpenEjb-cannot-find-ApplicationExcption-in-different-module-API-module-tp4661442p4661494.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: OpenEjb cannot find @ApplicationExcption in different module (API module)

Posted by Romain Manni-Bucau <rm...@gmail.com>.
added a property (https://issues.apache.org/jira/browse/OPENEJB-2005) for it

note: that's not activated by default since not compliant to the spec + you
need to allow scanning in your api jar (otherwise it is not even seen)

*Romain Manni-Bucau*
*Twitter: @rmannibucau <https://twitter.com/rmannibucau>*
*Blog: **http://rmannibucau.wordpress.com/*<http://rmannibucau.wordpress.com/>
*LinkedIn: **http://fr.linkedin.com/in/rmannibucau*
*Github: https://github.com/rmannibucau*



2013/3/13 Jean-Louis MONTEIRO <je...@gmail.com>

> Ah ok, I did not get the whole context.
> AFAIR, it's the desired behavior.
>
> If the ApplicationException is not in the module it's ignored which is
> relevant as per the spec.
> If you want to use an ApplicationException from another module, you have to
> declare it in the current module.
>
> JLouis
>
>
> 2013/3/13 cchet <t....@curecomp.com>
>
> > openejb-demo_does_not_find_application_exception_in_different_module.zip
> > <
> >
> http://openejb.979440.n4.nabble.com/file/n4661484/openejb-demo_does_not_find_application_exception_in_different_module.zip
> > >
> >
> > Here i send you the demo maven projects which shows this issue.
> > *OpenEjbServiceAPI:*
> > Contains the ServiceAPI and the exceptions
> >
> > *OpenEjbServiceImpl:*
> > Contains the service impl and the tests.
> >
> > If the supertype excption
> > 'com.clevercure.demo.openejb.service.exception.ApplicationException'
> > (annotated with @ApplicationException) is added to the
> > OpenEjbServiceImpl#META-INF/ejb-jar.xml (application-exception) then the
> > test will work, otherwise the thrown application exception is wrapped
> into
> > an EJBException.
> >
> >
> >
> > --
> > View this message in context:
> >
> http://openejb.979440.n4.nabble.com/OpenEjb-cannot-find-ApplicationExcption-in-different-module-API-module-tp4661442p4661484.html
> > Sent from the OpenEJB User mailing list archive at Nabble.com.
> >
>
>
>
> --
> Jean-Louis
>

Re: OpenEjb cannot find @ApplicationExcption in different module (API module)

Posted by Jean-Louis MONTEIRO <je...@gmail.com>.
Ah ok, I did not get the whole context.
AFAIR, it's the desired behavior.

If the ApplicationException is not in the module it's ignored which is
relevant as per the spec.
If you want to use an ApplicationException from another module, you have to
declare it in the current module.

JLouis


2013/3/13 cchet <t....@curecomp.com>

> openejb-demo_does_not_find_application_exception_in_different_module.zip
> <
> http://openejb.979440.n4.nabble.com/file/n4661484/openejb-demo_does_not_find_application_exception_in_different_module.zip
> >
>
> Here i send you the demo maven projects which shows this issue.
> *OpenEjbServiceAPI:*
> Contains the ServiceAPI and the exceptions
>
> *OpenEjbServiceImpl:*
> Contains the service impl and the tests.
>
> If the supertype excption
> 'com.clevercure.demo.openejb.service.exception.ApplicationException'
> (annotated with @ApplicationException) is added to the
> OpenEjbServiceImpl#META-INF/ejb-jar.xml (application-exception) then the
> test will work, otherwise the thrown application exception is wrapped into
> an EJBException.
>
>
>
> --
> View this message in context:
> http://openejb.979440.n4.nabble.com/OpenEjb-cannot-find-ApplicationExcption-in-different-module-API-module-tp4661442p4661484.html
> Sent from the OpenEJB User mailing list archive at Nabble.com.
>



-- 
Jean-Louis

Re: OpenEjb cannot find @ApplicationExcption in different module (API module)

Posted by cchet <t....@curecomp.com>.
openejb-demo_does_not_find_application_exception_in_different_module.zip
<http://openejb.979440.n4.nabble.com/file/n4661484/openejb-demo_does_not_find_application_exception_in_different_module.zip>  

Here i send you the demo maven projects which shows this issue.
*OpenEjbServiceAPI:*
Contains the ServiceAPI and the exceptions

*OpenEjbServiceImpl:*
Contains the service impl and the tests.

If the supertype excption
'com.clevercure.demo.openejb.service.exception.ApplicationException'
(annotated with @ApplicationException) is added to the
OpenEjbServiceImpl#META-INF/ejb-jar.xml (application-exception) then the
test will work, otherwise the thrown application exception is wrapped into
an EJBException.



--
View this message in context: http://openejb.979440.n4.nabble.com/OpenEjb-cannot-find-ApplicationExcption-in-different-module-API-module-tp4661442p4661484.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: OpenEjb cannot find @ApplicationExcption in different module (API module)

Posted by Romain Manni-Bucau <rm...@gmail.com>.
please don't post multiple times the same question on the list

*Romain Manni-Bucau*
*Twitter: @rmannibucau <https://twitter.com/rmannibucau>*
*Blog: **http://rmannibucau.wordpress.com/*<http://rmannibucau.wordpress.com/>
*LinkedIn: **http://fr.linkedin.com/in/rmannibucau*
*Github: https://github.com/rmannibucau*



2013/3/12 cchet <t....@curecomp.com>

> I read that the OpenEjb searches the current ejb module for
> @ApplicationException annotated Exceptions and not the other modules.
> We have the exceptions placed in the *API projects and the services are in
> the *Impl projects.
>
> I know i can add the application exceptions to the ejb-jar.xml but i want
> to
> avoid this.
> I read that this issue was fixed in 3.1 but in open-ejb-4.5.1 as we use it,
> it is not able to find the appliaction exceptions unless they are listed in
> the current ejb module ejb-jar.xml.
>
> Is there a way to configure openEjb where to search for them, because i
> cannot find any clue about this issue in the internet ?
>
> open-ejb-core-4.5.1, deltaspike-cdi-ctrl-0.3-incubating
> at our junit tests.
>
> Thanks in advance.
>
>
>
>
> --
> View this message in context:
> http://openejb.979440.n4.nabble.com/OpenEjb-cannot-find-ApplicationExcption-in-different-module-API-module-tp4661442.html
> Sent from the OpenEJB User mailing list archive at Nabble.com.
>