[JBoss AOP] - Proper annotation matching pointcut
by alesj
What's proper point-cut to intercept
- any method invocation on classes that are anotated with @FooBar
- method invocation of method annotated with @FooBar
I have this
| <bind xmlns="urn:jboss:aop-beans:1.0" pointcut="execution(* @org.jboss.demos.ioc.annotations.FooBar->*(..)) OR execution(* *->@org.jboss.demos.ioc.annotations.FooBar(..))">
| <interceptor-ref name="StopWatchInterceptor"/>
| </bind>
|
is it OK?
As I don't see it intercept this
| <bean name="SimpleExecutorOnMethod" class="org.jboss.demos.ioc.annotations.SimpleExecutor">
| <install method="execute">
| <annotation>@org.jboss.demos.ioc.annotations.FooBar</annotation>
| </install>
| </bean>
|
but this could be an issue with what MC provides as pushed metadata in install element.
Note: I don't expect it to be intercepted from MC's install - as that would probably require additional reflection+aop handling.
I have an extra call to the bean's execute method from some other 'user' code.
I'll take RTFM for an answer as well ... :-)
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4184899#4184899
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4184899
17 years, 6 months
[JCA/JBoss] - Re: Problem looking up XADatasource - Always returns Datasou
by vickyk
"pradeeps" wrote :
| The connection that is gotten from this datasource is going to participate in a distributed transaction with JMS XA QueueConnectionFactory. I am using the Atomikos JTA API.
|
| This distributed TX will happen only if both the resources support XA.
|
| Are you recommending that I create the XADataSource object in my code and not look up using JNDI?
|
| Thanks.
|
I assume that you must have Atomikos TM configured with the JBoss.Now when you are getting the connection from the xa-datasource the jca framework will transparently enlist the connection associated with the datasource in the ongoing transaction.
Here is the psuedo code :
UserTransaction utx = (UserTransaction) ctx.lookup("UserTransaction");
|
| Getting JMS XA QueueConnectionFactory from JNDI
|
| Getting JMS session which will also enlist the corresponding XAResource in the ongoing TX
|
| DataSource ds = (DataSource) ctx.lookup("java:/pxDS");
| Connection con = ds.getConnection(); // Here JCA will enlist the connection(precisely XAResource) in ongoing JTA transaction transparently.
| utx.commit();
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4184898#4184898
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4184898
17 years, 6 months
[Installation, Configuration & DEPLOYMENT] - jboss errors - help needed
by sujan.one
Hello,
I get the following errors when I try to start an instance in jboss:
Plzz help
11:31:49,011 WARN [ServiceController] Problem starting service jboss.mq:service=InvocationLayer,type=HTTP
java.net.UnknownHostException: -: -
at java.net.InetAddress.getLocalHost(InetAddress.java:1346)
at org.jboss.mq.il.http.HTTPServerILService.getConstructedURL(HTTPServerILService.java:328)
at org.jboss.mq.il.http.HTTPServerILService.startService(HTTPServerILService.java:81)
at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:289)
at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:245)
at sun.reflect.GeneratedMethodAccessor2.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:978)
at $Proxy0.start(Unknown Source)
at org.jboss.system.ServiceController.start(ServiceController.java:417)
at org.jboss.system.ServiceController.start(ServiceController.java:435)
at org.jboss.system.ServiceController.start(ServiceController.java:435)
at org.jboss.system.ServiceController.start(ServiceController.java:435)
at org.jboss.system.ServiceController.start(ServiceController.java:435)
at org.jboss.system.ServiceController.start(ServiceController.java:435)
at org.jboss.system.ServiceController.start(ServiceController.java:435)
at org.jboss.system.ServiceController.start(ServiceController.java:435)
at org.jboss.system.ServiceController.start(ServiceController.java:435)
at org.jboss.system.ServiceController.start(ServiceController.java:435)
at org.jboss.system.ServiceController.start(ServiceController.java:435)
at sun.reflect.GeneratedMethodAccessor9.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
at $Proxy4.start(Unknown Source)
at org.jboss.deployment.SARDeployer.start(SARDeployer.java:302)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
at $Proxy33.start(Unknown Source)
at org.jboss.deployment.XSLSubDeployer.start(XSLSubDeployer.java:197)
at org.jboss.deployment.MainDeployer.start(MainDeployer.java:1025)
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:819)
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:782)
at sun.reflect.GeneratedMethodAccessor54.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
at $Proxy8.deploy(Unknown Source)
at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:421)
at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:634)
at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(AbstractDeploymentScanner.java:263)
at org.jboss.deployment.scanner.AbstractDeploymentScanner.startService(AbstractDeploymentScanner.java:336)
at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:289)
at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:245)
at sun.reflect.GeneratedMethodAccessor2.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:978)
at $Proxy0.start(Unknown Source)
at org.jboss.system.ServiceController.start(ServiceController.java:417)
at sun.reflect.GeneratedMethodAccessor9.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
at $Proxy4.start(Unknown Source)
at org.jboss.deployment.SARDeployer.start(SARDeployer.java:302)
at org.jboss.deployment.MainDeployer.start(MainDeployer.java:1025)
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:819)
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:782)
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:766)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
at $Proxy5.deploy(Unknown Source)
at org.jboss.system.server.ServerImpl.doStart(ServerImpl.java:482)
at org.jboss.system.server.ServerImpl.start(ServerImpl.java:362)
at org.jboss.Main.boot(Main.java:200)
at org.jboss.Main$1.run(Main.java:490)
at java.lang.Thread.run(Thread.java:595)
11:31:49,527 ERROR [URLDeploymentScanner] Incomplete Deployment listing:
--- MBeans waiting for other MBeans ---
ObjectName: jboss:service=invoker,type=http
State: FAILED
Reason: java.net.UnknownHostException: -: -
ObjectName: jboss:service=invoker,type=http,target=Naming
State: FAILED
Reason: java.net.UnknownHostException: -: -
ObjectName: jboss:service=invoker,type=http,target=Naming,readonly=true
State: FAILED
Reason: java.net.UnknownHostException: -: -
ObjectName: jboss.mq:service=InvocationLayer,type=HTTP
State: FAILED
Reason: java.net.UnknownHostException: -: -
I Depend On:
jboss.mq:service=Invoker
jboss.web:service=WebServer
--- MBEANS THAT ARE THE ROOT CAUSE OF THE PROBLEM ---
ObjectName: jboss:service=invoker,type=http,target=Naming,readonly=true
State: FAILED
Reason: java.net.UnknownHostException: -: -
ObjectName: jboss:service=invoker,type=http
State: FAILED
Reason: java.net.UnknownHostException: -: -
ObjectName: jboss.mq:service=InvocationLayer,type=HTTP
State: FAILED
Reason: java.net.UnknownHostException: -: -
I Depend On:
jboss.mq:service=Invoker
jboss.web:service=WebServer
ObjectName: jboss:service=invoker,type=http,target=Naming
State: FAILED
Reason: java.net.UnknownHostException: -: -
My /etc/hosts file is well configured.
Is there anything I am missing?
Please advice.
Thanks in advance.
-S
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4184886#4184886
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4184886
17 years, 6 months
[Persistence, JBoss/CMP, Hibernate, Database] - JBoss CMP loading behavior problem
by perisb
I am observing, via CMP log records (and poor system performance), unexpected relationship loading behavior by JBoss CMP.
No document I've seen has been clear on how CMR works with read-ahead, so I'm not really sure what I should expect.
The situation:
* JBoss 4.0.2
* Two entities, A and B, with a 1-many relationship from A to B.
* Both entities running with the predefined 'Instance per Transaction' container configuration
* no CMP optimizations defined, other than the default ones in standardjbosscmp-jdbc.xml:
...
<read-ahead>
on-load
<page-size>1000</page-size>
<eager-load-group>*</eager-load-group>
</read-ahead>
<list-cache-max>1000</list-cache-max>
<clean-read-ahead-on-load>false</clean-read-ahead-on-load>
...
The problem is with the following simplified code scrap (running in a stateful Session method, within a transaction):
1) A a = ...
2) Collection bs = a.getBs();
3) Iterator I = bs.iterator();
4) B b = (B)iterator.next();
5) System.err.println(b.getFoo());
6) while (I.hasNext())
7) System.err.println((I.next()B).getFoo());
8) System.err.println(b.getFoo());
Everything is fine until line 8.
At line 2 I see a relationship load query executed: SELECT OID FROM B where (a=?).
At line 5 I see : SELECT OID, foo from B where (OID=?) OR (OID=?) OR ...
The number of parameters seems to match the number of Bs that were found at line 2.
So this looks like read-ahead to me, even though I've not specified a relationship configuration; perhaps its the default at work?
This is evidenced by the the fact that lines 6-7 run without another query being executed.
The problem is that at line 8, the same query as in line 5 is reexecuted!
It appears that instances loaded within the transaction are discarded by going back and invoking on the first iterated B.
This is not what I expect.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4184884#4184884
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4184884
17 years, 6 months