ASF Bugzilla – Attachment 25633 Details for
Bug 49030
Processing of Tomcat Connector configuration can leave some connectors uninitialized
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
2010-06-24_tc6_bug49030.patch
2010-06-24_tc6_bug49030.patch (text/plain), 7.03 KB, created by
Konstantin Kolinko
on 2010-06-23 21:47:06 UTC
(
hide
)
Description:
2010-06-24_tc6_bug49030.patch
Filename:
MIME Type:
Creator:
Konstantin Kolinko
Created:
2010-06-23 21:47:06 UTC
Size:
7.03 KB
patch
obsolete
>Index: java/org/apache/catalina/connector/Connector.java >=================================================================== >--- java/org/apache/catalina/connector/Connector.java (revision 957366) >+++ java/org/apache/catalina/connector/Connector.java (working copy) >@@ -18,7 +18,6 @@ > > package org.apache.catalina.connector; > >-import java.net.URLEncoder; > import java.util.HashMap; > > import javax.management.MBeanRegistration; >@@ -1259,4 +1258,18 @@ > getService().removeConnector(this); > } > >+ /** >+ * Provide a useful toString() implementation as it may be used when logging >+ * Lifecycle errors to identify the component. >+ */ >+ @Override >+ public String toString() { >+ // Not worth caching this right now >+ StringBuilder sb = new StringBuilder("Connector["); >+ sb.append(getProtocol()); >+ sb.append('-'); >+ sb.append(getPort()); >+ sb.append(']'); >+ return sb.toString(); >+ } > } >Index: java/org/apache/catalina/connector/MapperListener.java >=================================================================== >--- java/org/apache/catalina/connector/MapperListener.java (revision 957366) >+++ java/org/apache/catalina/connector/MapperListener.java (working copy) >@@ -169,8 +169,10 @@ > * unregister this from JMImplementation:type=MBeanServerDelegate > */ > public void destroy() { >+ if (mBeanServer == null) { >+ return; >+ } > try { >- > ObjectName objectName = new ObjectName( > "JMImplementation:type=MBeanServerDelegate"); > mBeanServer.removeNotificationListener(objectName, this); >Index: java/org/apache/catalina/core/LocalStrings.properties >=================================================================== >--- java/org/apache/catalina/core/LocalStrings.properties (revision 957366) >+++ java/org/apache/catalina/core/LocalStrings.properties (working copy) >@@ -177,6 +177,10 @@ > standardServer.start.connectors=At least one connector is not associated with any container > standardServer.start.started=This server has already been started > standardServer.stop.notStarted=This server has not yet been started >+standardService.connector.initFailed=Failed to initialize connector [{0}] >+standardService.connector.pauseFailed=Failed to pause connector [{0}] >+standardService.connector.startFailed=Failed to start connector [{0}] >+standardService.connector.stopFailed=Failed to stop connector [{0}] > standardService.initialize.initialized=This service has already been initialized > standardService.initialize.failed=Service initializing at {0} failed > standardService.register.failed=Error registering Service at domain {0} >Index: java/org/apache/catalina/core/StandardService.java >=================================================================== >--- java/org/apache/catalina/core/StandardService.java (revision 957366) >+++ java/org/apache/catalina/core/StandardService.java (working copy) >@@ -266,7 +266,9 @@ > try { > connector.initialize(); > } catch (LifecycleException e) { >- log.error("Connector.initialize", e); >+ log.error(sm.getString( >+ "standardService.connector.initFailed", >+ connector), e); > } > } > >@@ -274,7 +276,9 @@ > try { > ((Lifecycle) connector).start(); > } catch (LifecycleException e) { >- log.error("Connector.start", e); >+ log.error(sm.getString( >+ "standardService.connector.startFailed", >+ connector), e); > } > } > >@@ -338,7 +342,9 @@ > try { > ((Lifecycle) connectors[j]).stop(); > } catch (LifecycleException e) { >- log.error("Connector.stop", e); >+ log.error(sm.getString( >+ "standardService.connector.stopFailed", >+ connectors[j]), e); > } > } > connectors[j].setContainer(null); >@@ -530,8 +536,13 @@ > // Start our defined Connectors second > synchronized (connectors) { > for (int i = 0; i < connectors.length; i++) { >- if (connectors[i] instanceof Lifecycle) >+ try { > ((Lifecycle) connectors[i]).start(); >+ } catch (Exception e) { >+ log.error(sm.getString( >+ "standardService.connector.startFailed", >+ connectors[i]), e); >+ } > } > } > >@@ -563,7 +574,13 @@ > // Stop our defined Connectors first > synchronized (connectors) { > for (int i = 0; i < connectors.length; i++) { >- connectors[i].pause(); >+ try { >+ connectors[i].pause(); >+ } catch (Exception e) { >+ log.error(sm.getString( >+ "standardService.connector.pauseFailed", >+ connectors[i]), e); >+ } > } > } > >@@ -592,8 +609,13 @@ > // Stop our defined Connectors first > synchronized (connectors) { > for (int i = 0; i < connectors.length; i++) { >- if (connectors[i] instanceof Lifecycle) >+ try { > ((Lifecycle) connectors[i]).stop(); >+ } catch (Exception e) { >+ log.error(sm.getString( >+ "standardService.connector.stopFailed", >+ connectors[i]), e); >+ } > } > } > >@@ -676,9 +698,19 @@ > > // Initialize our defined Connectors > synchronized (connectors) { >- for (int i = 0; i < connectors.length; i++) { >+ for (int i = 0; i < connectors.length; i++) { >+ try { > connectors[i].initialize(); >+ } catch (Exception e) { >+ String message = sm.getString( >+ "standardService.connector.initFailed", >+ connectors[i]); >+ log.error(message, e); >+ >+ if (Boolean.getBoolean("org.apache.catalina.startup.EXIT_ON_INIT_FAILURE")) >+ throw new LifecycleException(message); > } >+ } > } > } > >Index: java/org/apache/jk/common/ChannelSocket.java >=================================================================== >--- java/org/apache/jk/common/ChannelSocket.java (revision 957366) >+++ java/org/apache/jk/common/ChannelSocket.java (working copy) >@@ -509,7 +509,9 @@ > unLockSocket(); > } > >- sSocket.close(); // XXX? >+ if (sSocket != null) { >+ sSocket.close(); // XXX? >+ } > > if( tpOName != null ) { > Registry.getRegistry(null, null).unregisterComponent(tpOName);
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 49030
: 25633