Amila,

Can you check this again? If the init method is called twice on the
same instance, then this would be a huge bug (because it would cause
an important resource leak). On the other hand, if the init method is
called a second time on a different instance, then the test
mbeanSupport == null will have no effect since mbeanSupport is an
instance attribute. Note that if two instances of the same transport
(extending AbstractTransport) run in the same VM, there is indeed an
issue with JMX because both instances try to bind an MBean to the same
name. This however only results in a warning.

Andreas

On Tue, Nov 3, 2009 at 05:05,  <ami...@apache.org> wrote:
> Author: amilas
> Date: Tue Nov  3 04:05:45 2009
> New Revision: 832297
>
> URL: http://svn.apache.org/viewvc?rev=832297&view=rev
> Log:
> register an mbean only if it is not call once. when doing an in out operaton 
> with mail
> transport gives an exception at client side since it causes call init method 
> twice.
>
> Modified:
>    
> webservices/commons/trunk/modules/transport/modules/base/src/main/java/org/apache/axis2/transport/base/AbstractTransportListener.java
>
> Modified: 
> webservices/commons/trunk/modules/transport/modules/base/src/main/java/org/apache/axis2/transport/base/AbstractTransportListener.java
> URL: 
> http://svn.apache.org/viewvc/webservices/commons/trunk/modules/transport/modules/base/src/main/java/org/apache/axis2/transport/base/AbstractTransportListener.java?rev=832297&r1=832296&r2=832297&view=diff
> ==============================================================================
> --- 
> webservices/commons/trunk/modules/transport/modules/base/src/main/java/org/apache/axis2/transport/base/AbstractTransportListener.java
>  (original)
> +++ 
> webservices/commons/trunk/modules/transport/modules/base/src/main/java/org/apache/axis2/transport/base/AbstractTransportListener.java
>  Tue Nov  3 04:05:45 2009
> @@ -129,8 +129,11 @@
>                 });
>
>         // register with JMX
> -        mbeanSupport = new TransportMBeanSupport(this, getTransportName());
> -        mbeanSupport.register();
> +        if (mbeanSupport == null) {
> +            mbeanSupport = new TransportMBeanSupport(this, 
> getTransportName());
> +            mbeanSupport.register();
> +        }
> +
>     }
>
>     public void destroy() {
>
>
>

Reply via email to