[JBoss AOP] - Problem intercepting DataSource method calls in JBoss 4
by fbrueseke
Hi JBoss AOP folks.
I have been fiddling with JBoss AOP all day now and just can't find the right solution. I want to use AOP to monitor which data sources are there and how long acquiring connections takes.
I am using a -aop.xml configuration file in my deploy directory. The bindings are the following:
<bind pointcut="construction(org.jboss.resource.adapter.jdbc.WrapperDataSource->new(..))">
| <interceptor class="my.interceptors.aop.DatasourceRegistrar"/>
| </bind>
|
| <bind pointcut="execution(public java.sql.Connection org.jboss.resource.adapter.jdbc.WrapperDataSource->getConnection(..))">
| <interceptor class="my.interceptors.aop.DatasourceConnectionInterceptor"/>
| </bind>
I use JBoss AOP version 1.5.6 with "javaagent" and load-time weaving. My configuration file is the following:
<mbean code="org.jboss.aop.deployment.AspectManagerServiceJDK5"
| name="jboss.aop:service=AspectManager">
| <attribute name="EnableLoadtimeWeaving">true</attribute>
| <!-- only relevant when EnableLoadtimeWeaving is true.
| When transformer is on, every loaded class gets
| transformed. If AOP can't find the class, then it
| throws an exception. Sometimes, classes may not have
| all the classes they reference. So, the Suppressing
| is needed. (i.e. Jboss cache in the default configuration -->
| <attribute name="SuppressTransformationErrors">true</attribute>
| <attribute name="Prune">true</attribute>
| <attribute name="Include">org.jboss.test, org.jboss.injbossaop, org.jboss.resource</attribute>
| <attribute name="Exclude">org.jboss.</attribute>
| <!-- This avoids instrumentation of hibernate cglib enhanced proxies
| <attribute name="Ignore">*$$EnhancerByCGLIB$$*</attribute> -->
| <attribute name="Optimized">true</attribute>
| <attribute name="Verbose">false</attribute>
| </mbean>
The interceptors should print out some log messages. But it just doesn't happen anything.
Does anybody know why?
Please help.
Kind regards
Frank
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4218711#4218711
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4218711
17 years, 3 months
[Installation, Configuration & DEPLOYMENT] - Re: how to configure jaas with jboss 5.0.1
by BjPenn
this is the error message that jboss return:
org.apache.jasper.JasperException: java.lang.ClassCastException: org.hibernate.ejb.HibernatePersistence cannot be cast to javax.persistence.spi.PersistenceProvider
| org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:515)
| org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:411)
| org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:322)
| org.apache.jasper.servlet.JspServlet.service(JspServlet.java:249)
| javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
| com.sun.faces.context.ExternalContextImpl.dispatch(ExternalContextImpl.java:410)
| com.sun.faces.application.ViewHandlerImpl.executePageToBuildView(ViewHandlerImpl.java:468)
| com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:140)
| org.ajax4jsf.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:108)
| org.ajax4jsf.application.AjaxViewHandler.renderView(AjaxViewHandler.java:196)
| com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:110)
| com.sun.faces.lifecycle.Phase.doPhase(Phase.java:100)
| com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139)
| javax.faces.webapp.FacesServlet.service(FacesServlet.java:266)
| org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
|
| causa raÃz
|
| java.lang.ClassCastException: org.hibernate.ejb.HibernatePersistence cannot be cast to javax.persistence.spi.PersistenceProvider
| javax.persistence.Persistence.findAllProviders(Persistence.java:186)
| javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:103)
| javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:83)
| controller.usuariosC.<init>(usuariosC.java:29)
| org.apache.jsp.principal_jsp._jspService(principal_jsp.java:112)
| org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
| javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
| org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:369)
| org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:322)
| org.apache.jasper.servlet.JspServlet.service(JspServlet.java:249)
| javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
| com.sun.faces.context.ExternalContextImpl.dispatch(ExternalContextImpl.java:410)
| com.sun.faces.application.ViewHandlerImpl.executePageToBuildView(ViewHandlerImpl.java:468)
| com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:140)
| org.ajax4jsf.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:108)
| org.ajax4jsf.application.AjaxViewHandler.renderView(AjaxViewHandler.java:196)
| com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:110)
| com.sun.faces.lifecycle.Phase.doPhase(Phase.java:100)
| com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139)
| javax.faces.webapp.FacesServlet.service(FacesServlet.java:266)
| org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
|
| nota La traza completa de la causa de este error se encuentra en los archivos de diario de JBoss Web/2.1.2.GA.
| JBoss Web/2.1.2.GA
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4218709#4218709
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4218709
17 years, 3 months
[JBoss jBPM] - Re: Need help to fix timer issue
by Arunkumar DSRC
For example plz conside the following:
| <process-definition xmlns="urn:jbpm.org:jpdl-3.2" name="process6">
|
| <start-state name="start-state1">
| <transition to="tsmactoncr"></transition>
| </start-state>
|
| <state name="tsmactoncr" async="true">
| <timer name="timer" duedate="7 seconds" transition="to escalated">
| <action class="yourpackage.Action1"></action>
| </timer>
| <transition to="normailflow" name="to normal flow"></transition>
| <transition to="escalationflow" name="to escalated"></transition>
| </state>
|
| <state name="normailflow">
| <event type="node-enter">
| <script>
| System.out.println("Node-enter: normailflow");
| </script>
| </event>
| <transition to="end-state1"></transition>
| </state>
|
| <task-node name="escalationflow">
| <task name="mail to customer" notify="true">
| <assignment class="yourcompany.MailAssignmentHandler"></assignment>
| </task>
| <transition to="end-state1" name="to-end1"></transition>
| </task-node>
|
| <end-state name="end-state1"></end-state>
|
| </process-definition>
|
In above code I am trying to send a mail using task-node when the timer expires and it is escalation flow. when I try to have a AssignmentHandler it gives the Following Exception
org.jbpm.graph.def.DelegationException
at org.jbpm.graph.def.GraphElement.raiseException(GraphElement.java:382)
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.hibernate.proxy.pojo.cglib.CGLIBLazyInitializer.invoke(CGLIBLazyInitializer.java:157)
at org.jbpm.graph.def.ProcessDefinition$$EnhancerByCGLIB$$b2e1ca8f.raiseException()
at org.jbpm.graph.def.GraphElement.raiseException(GraphElement.java:373)
at org.jbpm.graph.def.GraphElement.executeAction(GraphElement.java:276)
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.hibernate.proxy.pojo.cglib.CGLIBLazyInitializer.invoke(CGLIBLazyInitializer.java:157)
at org.jbpm.graph.node.State$$EnhancerByCGLIB$$993b01f9.executeAction()
at org.jbpm.job.Timer.execute(Timer.java:56)
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.hibernate.proxy.pojo.cglib.CGLIBLazyInitializer.invoke(CGLIBLazyInitializer.java:157)
at org.jbpm.job.Job$$EnhancerByCGLIB$$e4a64402.execute()
at org.jbpm.job.executor.JobExecutorThread.executeJob(JobExecutorThread.java:173)
at org.jbpm.job.executor.JobExecutorThread.run(JobExecutorThread.java:64)
Caused by: java.lang.NullPointerException
at org.jbpm.graph.def.Action.execute(Action.java:122)
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.hibernate.proxy.pojo.cglib.CGLIBLazyInitializer.invoke(CGLIBLazyInitializer.java:157)
at org.jbpm.graph.def.Action$$EnhancerByCGLIB$$cc035953.execute()
at org.jbpm.graph.def.GraphElement.executeAction(GraphElement.java:259)
... 15 more
Any clue.
Thanks in advance
-Arunkumar
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4218706#4218706
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4218706
17 years, 3 months