View | Details | Raw Unified | Return to bug 49030
Collapse All | Expand All

(-)java/org/apache/catalina/connector/Connector.java (-1 / +14 lines)
Lines 18-24 Link Here
18
18
19
package org.apache.catalina.connector;
19
package org.apache.catalina.connector;
20
20
21
import java.net.URLEncoder;
22
import java.util.HashMap;
21
import java.util.HashMap;
23
22
24
import javax.management.MBeanRegistration;
23
import javax.management.MBeanRegistration;
Lines 1259-1262 Link Here
1259
        getService().removeConnector(this);
1258
        getService().removeConnector(this);
1260
    }
1259
    }
1261
1260
1261
    /**
1262
     * Provide a useful toString() implementation as it may be used when logging
1263
     * Lifecycle errors to identify the component.
1264
     */
1265
    @Override
1266
    public String toString() {
1267
        // Not worth caching this right now
1268
        StringBuilder sb = new StringBuilder("Connector[");
1269
        sb.append(getProtocol());
1270
        sb.append('-');
1271
        sb.append(getPort());
1272
        sb.append(']');
1273
        return sb.toString();
1274
    }
1262
}
1275
}
(-)java/org/apache/catalina/connector/MapperListener.java (-1 / +3 lines)
Lines 169-176 Link Here
169
     * unregister this from JMImplementation:type=MBeanServerDelegate
169
     * unregister this from JMImplementation:type=MBeanServerDelegate
170
     */
170
     */
171
    public void destroy() {
171
    public void destroy() {
172
        if (mBeanServer == null) {
173
            return;
174
        }
172
        try {
175
        try {
173
174
            ObjectName objectName = new ObjectName(
176
            ObjectName objectName = new ObjectName(
175
                    "JMImplementation:type=MBeanServerDelegate");
177
                    "JMImplementation:type=MBeanServerDelegate");
176
            mBeanServer.removeNotificationListener(objectName, this);
178
            mBeanServer.removeNotificationListener(objectName, this);
(-)java/org/apache/catalina/core/LocalStrings.properties (+4 lines)
Lines 177-182 Link Here
177
standardServer.start.connectors=At least one connector is not associated with any container
177
standardServer.start.connectors=At least one connector is not associated with any container
178
standardServer.start.started=This server has already been started
178
standardServer.start.started=This server has already been started
179
standardServer.stop.notStarted=This server has not yet been started
179
standardServer.stop.notStarted=This server has not yet been started
180
standardService.connector.initFailed=Failed to initialize connector [{0}]
181
standardService.connector.pauseFailed=Failed to pause connector [{0}]
182
standardService.connector.startFailed=Failed to start connector [{0}]
183
standardService.connector.stopFailed=Failed to stop connector [{0}]
180
standardService.initialize.initialized=This service has already been initialized
184
standardService.initialize.initialized=This service has already been initialized
181
standardService.initialize.failed=Service initializing at {0} failed
185
standardService.initialize.failed=Service initializing at {0} failed
182
standardService.register.failed=Error registering Service at domain {0}
186
standardService.register.failed=Error registering Service at domain {0}
(-)java/org/apache/catalina/core/StandardService.java (-7 / +39 lines)
Lines 266-272 Link Here
266
                try {
266
                try {
267
                    connector.initialize();
267
                    connector.initialize();
268
                } catch (LifecycleException e) {
268
                } catch (LifecycleException e) {
269
                    log.error("Connector.initialize", e);
269
                    log.error(sm.getString(
270
                            "standardService.connector.initFailed",
271
                            connector), e);
270
                }
272
                }
271
            }
273
            }
272
274
Lines 274-280 Link Here
274
                try {
276
                try {
275
                    ((Lifecycle) connector).start();
277
                    ((Lifecycle) connector).start();
276
                } catch (LifecycleException e) {
278
                } catch (LifecycleException e) {
277
                    log.error("Connector.start", e);
279
                    log.error(sm.getString(
280
                            "standardService.connector.startFailed",
281
                            connector), e);
278
                }
282
                }
279
            }
283
            }
280
284
Lines 338-344 Link Here
338
                try {
342
                try {
339
                    ((Lifecycle) connectors[j]).stop();
343
                    ((Lifecycle) connectors[j]).stop();
340
                } catch (LifecycleException e) {
344
                } catch (LifecycleException e) {
341
                    log.error("Connector.stop", e);
345
                    log.error(sm.getString(
346
                            "standardService.connector.stopFailed",
347
                            connectors[j]), e);
342
                }
348
                }
343
            }
349
            }
344
            connectors[j].setContainer(null);
350
            connectors[j].setContainer(null);
Lines 530-537 Link Here
530
        // Start our defined Connectors second
536
        // Start our defined Connectors second
531
        synchronized (connectors) {
537
        synchronized (connectors) {
532
            for (int i = 0; i < connectors.length; i++) {
538
            for (int i = 0; i < connectors.length; i++) {
533
                if (connectors[i] instanceof Lifecycle)
539
                try {
534
                    ((Lifecycle) connectors[i]).start();
540
                    ((Lifecycle) connectors[i]).start();
541
                } catch (Exception e) {
542
                    log.error(sm.getString(
543
                            "standardService.connector.startFailed",
544
                            connectors[i]), e);
545
                }
535
            }
546
            }
536
        }
547
        }
537
        
548
        
Lines 563-569 Link Here
563
        // Stop our defined Connectors first
574
        // Stop our defined Connectors first
564
        synchronized (connectors) {
575
        synchronized (connectors) {
565
            for (int i = 0; i < connectors.length; i++) {
576
            for (int i = 0; i < connectors.length; i++) {
566
                connectors[i].pause();
577
                try {
578
                    connectors[i].pause();
579
                } catch (Exception e) {
580
                    log.error(sm.getString(
581
                            "standardService.connector.pauseFailed",
582
                            connectors[i]), e);
583
                }
567
            }
584
            }
568
        }
585
        }
569
586
Lines 592-599 Link Here
592
        // Stop our defined Connectors first
609
        // Stop our defined Connectors first
593
        synchronized (connectors) {
610
        synchronized (connectors) {
594
            for (int i = 0; i < connectors.length; i++) {
611
            for (int i = 0; i < connectors.length; i++) {
595
                if (connectors[i] instanceof Lifecycle)
612
                try {
596
                    ((Lifecycle) connectors[i]).stop();
613
                    ((Lifecycle) connectors[i]).stop();
614
                } catch (Exception e) {
615
                    log.error(sm.getString(
616
                            "standardService.connector.stopFailed",
617
                            connectors[i]), e);
618
                }
597
            }
619
            }
598
        }
620
        }
599
621
Lines 676-684 Link Here
676
698
677
        // Initialize our defined Connectors
699
        // Initialize our defined Connectors
678
        synchronized (connectors) {
700
        synchronized (connectors) {
679
                for (int i = 0; i < connectors.length; i++) {
701
            for (int i = 0; i < connectors.length; i++) {
702
                try {
680
                    connectors[i].initialize();
703
                    connectors[i].initialize();
704
                } catch (Exception e) {
705
                    String message = sm.getString(
706
                            "standardService.connector.initFailed",
707
                            connectors[i]);
708
                    log.error(message, e);
709
710
                    if (Boolean.getBoolean("org.apache.catalina.startup.EXIT_ON_INIT_FAILURE"))
711
                        throw new LifecycleException(message);
681
                }
712
                }
713
            }
682
        }
714
        }
683
    }
715
    }
684
    
716
    
(-)java/org/apache/jk/common/ChannelSocket.java (-1 / +3 lines)
Lines 509-515 Link Here
509
		unLockSocket();
509
		unLockSocket();
510
	    }
510
	    }
511
511
512
            sSocket.close(); // XXX?
512
            if (sSocket != null) {
513
                sSocket.close(); // XXX?
514
            }
513
            
515
            
514
            if( tpOName != null )  {
516
            if( tpOName != null )  {
515
                Registry.getRegistry(null, null).unregisterComponent(tpOName);
517
                Registry.getRegistry(null, null).unregisterComponent(tpOName);

Return to bug 49030