Skip to main content

[webtier] fix for issue 7990 - Error registering contexts when re-enabling HTTP listener

1 reply [Last post]
Anonymous

Hi Jan,

I've attached a way to fix it on V2.1. I think it'll work for V3 too,
I'll try.
Could you review the patch?

Regards,
Dies
Index: MapperListener.java
===================================================================
RCS file: /cvs/glassfish/appserv-webtier/src/java/org/apache/coyote/tomcat5/MapperListener.java,v
retrieving revision 1.18
diff -u -r1.18 MapperListener.java
--- MapperListener.java 11 Oct 2007 23:15:58 -0000 1.18
+++ MapperListener.java 23 Apr 2009 11:36:40 -0000
@@ -201,7 +201,7 @@

// Query contexts
- onStr = domain + ":j2eeType=WebModule,*";
+ onStr = domain + ":j2eeType=WebModule,*,J2EEServer=" + myInstance;
objectName = new ObjectName(onStr);
set = mBeanServer.queryMBeans(objectName, null);
iterator = set.iterator();
@@ -211,7 +211,7 @@
}

// Query wrappers
- onStr = domain + ":j2eeType=Servlet,*";
+ onStr = domain + ":j2eeType=Servlet,*,J2EEServer=" + myInstance;
objectName = new ObjectName(onStr);
set = mBeanServer.queryMBeans(objectName, null);
iterator = set.iterator();

---------------------------------------------------------------------
To unsubscribe, e-mail: webtier-unsubscribe@glassfish.dev.java.net
For additional commands, e-mail: webtier-help@glassfish.dev.java.net

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Jan Luehe

On 04/23/09 10:13 PM, Dies Koper wrote:
> Hi Jan,
>
> I've attached a way to fix it on V2.1. I think it'll work for V3 too,
> I'll try.
> Could you review the patch?
>

Looks great, Dies!

This would be in line with how MapperListener#isNotificationEnabled filters
out and ignores any notifications corresponding to MBeans belonging to
a different server instance than the server instance on which the
MapperListener
is running:

public boolean isNotificationEnabled(Notification notification) {

String otherInstance = objectName.getKeyProperty("J2EEServer");
if (myInstance != null && otherInstance != null
&& !otherInstance.equals(myInstance)) {
return false;
}

Thanks!

Jan
> Regards,
> Dies
>
> ------------------------------------------------------------------------
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: webtier-unsubscribe@glassfish.dev.java.net
> For additional commands, e-mail: webtier-help@glassfish.dev.java.net

[att1.html]