Announcement Announcement Module
Collapse
No announcement yet.
AOP problem with more than one advisors. Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • AOP problem with more than one advisors.

    Hey guys,

    I am trying to run two advisors on single point cuts.

    <aop:config>
    <aopointcut id="serviceOperation" expression="execution(* com.primatics.analytics.service..*Service.*(..))"/>
    <aop:advisor pointcut-ref="serviceOperation" advice-ref="userTrailAdvice" order="1"/>
    <aop:advisor pointcut-ref="serviceOperation" advice-ref="txAdvice" order="2"/>
    </aop:config>

    <tx:advice id="txAdvice">
    <tx:attributes>
    <tx:method name="get*" read-only="true" propagation="SUPPORTS"/>
    <tx:method name="save*" read-only="false" propagation="REQUIRES_NEW"/>
    <tx:method name="update*" read-only="false" propagation="REQUIRES_NEW"/>
    <tx:method name="insert*" read-only="false" propagation="REQUIRES_NEW"/>
    <tx:method name="persist*" read-only="false" propagation="REQUIRES_NEW"/>
    <tx:method name="delete*" read-only="false" propagation="REQUIRES_NEW"/>
    <tx:method name="remove*" read-only="false" propagation="REQUIRES_NEW"/>
    </tx:attributes>
    </tx:advice>
    When I run through my services during the unit tests they run fine. But when I run them in JBoss I am getting

    ERROR [AssertionFailure] an assertion failure occured (this may indicate a bug in Hibernate, but is more likely due to unsafe use of the session)
    java.lang.NullPointerException: net/sf/ehcache/Element
    at net.sf.ehcache.Cache.put(Cache.java:560)
    at net.sf.ehcache.Cache.put(Cache.java:523)
    at org.hibernate.cache.EhCache.put(EhCache.java:119)
    at org.hibernate.cache.UpdateTimestampsCache.invalida te(UpdateTimestampsCache.java:69)
    at org.hibernate.engine.ActionQueue.afterTransactionC ompletion(ActionQueue.java:174)
    at org.hibernate.impl.SessionImpl.afterTransactionCom pletion(SessionImpl.java:424)
    at org.hibernate.jdbc.JDBCContext.afterTransactionCom pletion(JDBCContext.java:225)
    at org.hibernate.transaction.JDBCTransaction.rollback (JDBCTransaction.java:174)
    at org.hibernate.ejb.TransactionImpl.rollback(Transac tionImpl.java:85)
    at org.springframework.orm.jpa.JpaTransactionManager. doRollback(JpaTransactionManager.java:454)
    at org.springframework.transaction.support.AbstractPl atformTransactionManager.processRollback(AbstractP latformTransactionManager.java:753)
    at org.springframework.transaction.support.AbstractPl atformTransactionManager.rollback(AbstractPlatform TransactionManager.java:730)
    at org.springframework.transaction.interceptor.Transa ctionAspectSupport.completeTransactionAfterThrowin g(TransactionAspectSupport.java:332)
    at org.springframework.transaction.interceptor.Transa ctionInterceptor.invoke(TransactionInterceptor.jav a:111)
    at org.springframework.aop.framework.ReflectiveMethod Invocation.proceed(ReflectiveMethodInvocation.java :166)
    at org.springframework.aop.framework.adapter.AfterRet urningAdviceInterceptor.invoke(AfterReturningAdvic eInterceptor.java:50)
    at org.springframework.aop.framework.ReflectiveMethod Invocation.proceed(ReflectiveMethodInvocation.java :166)
    at org.springframework.aop.framework.JdkDynamicAopPro xy.invoke(JdkDynamicAopProxy.java:204)
    at $Proxy112.persistAuditTrail(Unknown Source)
    at com.primatics.analytics.audit.UserTrailLogMethodIn terceptor.afterReturning(UserTrailLogMethodInterce ptor.java:49)
    at org.springframework.aop.framework.adapter.AfterRet urningAdviceInterceptor.invoke(AfterReturningAdvic eInterceptor.java:51)
    at org.springframework.aop.framework.ReflectiveMethod Invocation.proceed(ReflectiveMethodInvocation.java :166)
    at org.springframework.aop.framework.JdkDynamicAopPro xy.invoke(JdkDynamicAopProxy.java:204)
    at $Proxy116.isAlreadyLoggedIn(Unknown Source)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Native MethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(De legatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at flex.messaging.services.remoting.adapters.JavaAdap ter.invoke(JavaAdapter.java:406)
    at flex.messaging.services.RemotingService.serviceMes sage(RemotingService.java:183)
    at flex.messaging.MessageBroker.routeMessageToService (MessageBroker.java:1417)
    at flex.messaging.endpoints.AbstractEndpoint.serviceM essage(AbstractEndpoint.java:878)
    at flex.messaging.endpoints.amf.MessageBrokerFilter.i nvoke(MessageBrokerFilter.java:121)
    at flex.messaging.endpoints.amf.LegacyFilter.invoke(L egacyFilter.java:158)
    at flex.messaging.endpoints.amf.SessionFilter.invoke( SessionFilter.java:49)
    at flex.messaging.endpoints.amf.BatchProcessFilter.in voke(BatchProcessFilter.java:67)
    at flex.messaging.endpoints.amf.SerializationFilter.i nvoke(SerializationFilter.java:146)
    at flex.messaging.endpoints.BaseHTTPEndpoint.service( BaseHTTPEndpoint.java:274)
    at flex.messaging.MessageBrokerServlet.service(Messag eBrokerServlet.java:377)
    at javax.servlet.http.HttpServlet.service(HttpServlet .java:810)
    at org.apache.catalina.core.ApplicationFilterChain.in ternalDoFilter(ApplicationFilterChain.java:252)
    at org.apache.catalina.core.ApplicationFilterChain.do Filter(ApplicationFilterChain.java:173)
    at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doF ilter(ReplyHeaderFilter.java:96)
    at org.apache.catalina.core.ApplicationFilterChain.in ternalDoFilter(ApplicationFilterChain.java:202)
    at org.apache.catalina.core.ApplicationFilterChain.do Filter(ApplicationFilterChain.java:173)
    at org.apache.catalina.core.StandardWrapperValve.invo ke(StandardWrapperValve.java:213)
    at org.apache.catalina.core.StandardContextValve.invo ke(StandardContextValve.java:178)
    at org.jboss.web.tomcat.security.SecurityAssociationV alve.invoke(SecurityAssociationValve.java:175)
    at org.jboss.web.tomcat.security.JaccContextValve.inv oke(JaccContextValve.java:74)
    at org.apache.catalina.core.StandardHostValve.invoke( StandardHostValve.java:126)
    at org.apache.catalina.valves.ErrorReportValve.invoke (ErrorReportValve.java:105)
    at org.jboss.web.tomcat.tc5.jca.CachedConnectionValve .invoke(CachedConnectionValve.java:156)
    at org.apache.catalina.core.StandardEngineValve.invok e(StandardEngineValve.java:107)
    at org.apache.catalina.connector.CoyoteAdapter.servic e(CoyoteAdapter.java:148)
    at org.apache.coyote.http11.Http11Processor.process(H ttp11Processor.java:869)
    at org.apache.coyote.http11.Http11BaseProtocol$Http11 ConnectionHandler.processConnection(Http11BaseProt ocol.java:664)
    at org.apache.tomcat.util.net.PoolTcpEndpoint.process Socket(PoolTcpEndpoint.java:527)
    at org.apache.tomcat.util.net.MasterSlaveWorkerThread .run(MasterSlaveWorkerThread.java:112)
    at java.lang.Thread.run(Thread.java:619)
Working...
X