[jboss-user] [EJB 3.0 Users] - Multiple default PostConstruct method not called

debasish.raychawdhuri do-not-reply at jboss.com
Thu Oct 8 16:16:58 EDT 2009


I think I have encountered a strange behaviour

The specification EJB3.0 clearly says that it is possible to have multiple default interceptors can be specified and all of them can have @PostConstruct. The order of the invocation would be the same as in the deployment descriptor. However, in JBoss, only the first one is called and the rest are ignored. It is completely repeatable

I'm using JBoss Version 5.0.1.GA (build: SVNTag=JBoss_5_0_1_GA date=200902232048)

The following is my ejb-jar.xml

  | <?xml version="1.0" encoding="UTF-8"?>
  | <ejb-jar xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:ejb="http://java.sun.com/xml/ns/javaee/ejb-jar_3_0.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/ejb-jar_3_0.xsd" version="3.0">
  |   <display-name>DemoEJB </display-name>
  |   <enterprise-beans>
  |     <session>
  |       <ejb-name>DemoFirstEJB</ejb-name>
  |       <business-local>com.ejb.demo.DemoFirstEJBLocal</business-local>
  |       <timeout-method>
  |         <method-name>timeout</method-name>
  |       </timeout-method>
  |       <transaction-type>Container</transaction-type>
  |       
  |       <message-destination-ref>
  |       	<message-destination-ref-name>demoDestination</message-destination-ref-name>
  |       	<message-destination-link>demoDestination</message-destination-link>
  |       	<injection-target>
  |       		<injection-target-class>com.ejb.demo.DemoFirstEJB</injection-target-class>
  |       		<injection-target-name>topic</injection-target-name>
  |       	</injection-target>
  |       	
  |       </message-destination-ref>
  |       
  |     </session>
  |     <message-driven>
  |     	<ejb-name>DemoMDB</ejb-name>
  |     	<message-destination-link>demoDestination</message-destination-link>
  |     	<activation-config>
  |     		<activation-config-property>
  |     			<activation-config-property-name>destination</activation-config-property-name>
  |     			<activation-config-property-value>/topic/testTopic</activation-config-property-value>
  |     		</activation-config-property>
  |     	</activation-config>
  |     	
  |     </message-driven>
  |   </enterprise-beans>
  |   <interceptors>
  |     <description>Timout Interceptor</description>
  |     <interceptor>
  |       <interceptor-class>com.ejb.demo.interceptors.DemoInterceptor</interceptor-class>
  |      
  |       <post-construct>
  |       	<lifecycle-callback-method>postConstruct</lifecycle-callback-method>
  |       </post-construct>
  |      
  |     </interceptor>
  |     <interceptor>
  |     	<interceptor-class>org.javaeeutils.logger.interceptors.LoggingInterceptor</interceptor-class>
  |     </interceptor>
  |   </interceptors>
  |   <assembly-descriptor>
  |   	<container-transaction>
  |   		
  |   		<method>
  |   			<ejb-name>DemoFirstEJB</ejb-name>
  |   			<method-name>*</method-name>
  |   		</method>
  |   		<trans-attribute>Required</trans-attribute>
  |   	</container-transaction>
  |   	
  |     <interceptor-binding>
  |       <ejb-name>*</ejb-name>
  |      
  | 	  <interceptor-class>org.javaeeutils.logger.interceptors.LoggingInterceptor</interceptor-class>
  | 	  <interceptor-class>com.ejb.demo.interceptors.DemoInterceptor</interceptor-class>
  |     </interceptor-binding>
  |    
  | 
  |     <message-destination>
  |   		<message-destination-name>demoDestination</message-destination-name>
  |   		<mapped-name>/topic/testTopic</mapped-name>
  |   	</message-destination>
  |   
  |   </assembly-descriptor>
  |   
  | </ejb-jar>
  | 
 

View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4259454#4259454

Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4259454



More information about the jboss-user mailing list