[JBoss AOP] - Catching LazyInitialization exception within an Interceptor
by mlouna
Catching LazyInitialization exception within an aop Interceptor
Setup
1.JBoss AS 4.2.0 GA
2.EJB 3 persistence layer of data Model.
3.UI that calls a Delegation layer that JNDI lookup and returns EJBs back to UI
The Idea
1. To write an Interceptor that intercept calls of form
"my.persistence.*->get*()".
2. Try to invoke the Called Method
3. Catch LazyInitialization exception
4. If caught, Persist Target Object and Invoke Called Method with the new attached Target Object
Problem
Though I can see that LazyInitialization is thrown, it is never getting caught within the Interceptor.
Help
will be greatly appreciated...
Code
>aop>
>bind pointcut="call(* com.my.proj.persistence.*->get*())">
>interceptor class="com.proj.aop.MyInterceptor"/>
>/bind>
>/aop>
try {
methodInvocation.getCalledMethod().invoke(methodInvocation.getTargetObject(), methodInvocation.getArguments());
} catch (LazyInitializationException ex) {
// do things
}
OR
try {
methodInvocation.invokeNext();
} catch (LazyInitializationException ex) {
// do things
}
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4108387#4108387
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4108387
18 years, 5 months
[JBoss Portal] - Building datasource
by saurav
Hi All,
acc to the reference manual have been trying to setup the database.
gave a build datasource from the command line and getting errors for
no file found /thirdparty/libraries.ent
which it takes from the build.xml given below.
|
| <!DOCTYPE project [
| <!ENTITY libraries SYSTEM "../thirdparty/libraries.ent">
| <!ENTITY buildmagic SYSTEM "../tools/etc/buildfragments/buildmagic.ent">
| <!ENTITY tools SYSTEM "../tools/etc/buildfragments/tools.ent">
| <!ENTITY modules SYSTEM "../tools/etc/buildfragments/modules.ent">
| <!ENTITY defaults SYSTEM "../tools/etc/buildfragments/defaults.ent">
| <!ENTITY targets SYSTEM "../tools/etc/buildfragments/targets.ent">
| ]>
|
|
|
i can see the folder called thirdparty is not there.
Can anyone please help me to resolve the issue.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4108383#4108383
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4108383
18 years, 5 months