1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860
|
#! /bin/sh -e
##
[ -f debian/patches/00patch-opts ] && . debian/patches/00patch-opts
patch_opts="${patch_opts:--f --no-backup-if-mismatch}"
if [ $# -ne 1 ]; then
echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
exit 1
fi
case "$1" in
-patch)
patch $patch_opts -p0 < $0;;
-unpatch)
patch $patch_opts -p0 -R < $0;;
*)
echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
exit 1;;
esac
exit 0
@DPATCH@
diff -r -u source-tree.orig/plugins/org.eclipse.tomcat/build.properties source-tree/plugins/org.eclipse.tomcat/build.properties
--- source-tree.orig/plugins/org.eclipse.tomcat/build.properties 2006-12-16 09:53:31.000000000 +0100
+++ source-tree/plugins/org.eclipse.tomcat/build.properties 2006-12-16 10:04:09.000000000 +0100
@@ -11,7 +11,7 @@
bin.includes = conf/,\
webapps/,\
plugin.xml,\
- *.jar,\
+ lib/*.jar,\
plugin.properties,\
preferences.ini,\
about.html,\
diff -r -u source-tree.orig/plugins/org.eclipse.tomcat/.classpath source-tree/plugins/org.eclipse.tomcat/.classpath
--- source-tree.orig/plugins/org.eclipse.tomcat/.classpath 2006-12-16 09:53:31.000000000 +0100
+++ source-tree/plugins/org.eclipse.tomcat/.classpath 2006-12-16 10:04:09.000000000 +0100
@@ -1,28 +1,27 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
- <classpathentry exported="true" sourcepath="D:/tomcat4.1.30src" kind="lib" path="catalina.jar"/>
- <classpathentry exported="true" sourcepath="D:/tomcat4.1.30src" kind="lib" path="bootstrap.jar"/>
- <classpathentry exported="true" sourcepath="D:/tomcat4.1.30src" kind="lib" path="commons-beanutils.jar"/>
- <classpathentry exported="true" sourcepath="D:/tomcat4.1.30src" kind="lib" path="commons-collections.jar"/>
- <classpathentry exported="true" sourcepath="D:/tomcat4.1.30src" kind="lib" path="commons-digester.jar"/>
- <classpathentry exported="true" sourcepath="D:/tomcat4.1.30src" kind="lib" path="commons-logging-api.jar"/>
- <classpathentry exported="true" sourcepath="D:/tomcat4.1.30src" kind="lib" path="commons-modeler.jar"/>
- <classpathentry exported="true" sourcepath="D:/tomcat4.1.30src" kind="lib" path="jakarta-regexp-1.3.jar"/>
- <classpathentry exported="true" sourcepath="D:/tomcat4.1.30src" kind="lib" path="jasper-compiler.jar"/>
- <classpathentry exported="true" sourcepath="D:/tomcat4.1.30src" kind="lib" path="jasper-runtime.jar"/>
- <classpathentry exported="true" sourcepath="D:/tomcat4.1.30src" kind="lib" path="mx4j-jmx.jar"/>
- <classpathentry exported="true" sourcepath="D:/tomcat4.1.30src" kind="lib" path="naming-common.jar"/>
- <classpathentry exported="true" sourcepath="D:/tomcat4.1.30src" kind="lib" path="naming-factory.jar"/>
- <classpathentry exported="true" sourcepath="D:/tomcat4.1.30src" kind="lib" path="naming-resources.jar"/>
- <classpathentry exported="true" sourcepath="D:/tomcat4.1.30src" kind="lib" path="servlet.jar"/>
- <classpathentry exported="true" sourcepath="D:/tomcat4.1.30src" kind="lib" path="servlets-common.jar"/>
- <classpathentry exported="true" sourcepath="D:/tomcat4.1.30src" kind="lib" path="servlets-default.jar"/>
- <classpathentry exported="true" sourcepath="D:/tomcat4.1.30src" kind="lib" path="servlets-invoker.jar"/>
- <classpathentry exported="true" sourcepath="D:/tomcat4.1.30src" kind="lib" path="servlets-manager.jar"/>
- <classpathentry exported="true" sourcepath="D:/tomcat4.1.30src" kind="lib" path="tomcat-coyote.jar"/>
- <classpathentry exported="true" sourcepath="D:/tomcat4.1.30src" kind="lib" path="tomcat-http11.jar"/>
- <classpathentry exported="true" sourcepath="D:/tomcat4.1.30src" kind="lib" path="tomcat-util.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/catalina.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/catalina-optional.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/commons-el.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/commons-modeler.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/jmx.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/jsp-api.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/naming-factory.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/naming-resources.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/servlet-api.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/servlets-default.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/tomcat-coyote.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/tomcat-http.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/tomcat-util.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/commons-beanutils.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/commons-collections.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/commons-digester.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/commons-logging-api.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/regexp.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/commons-digester-rss.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/jasper-compiler.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/jasper-runtime.jar"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.4"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="output" path="bin"/>
diff -r -u source-tree.orig/plugins/org.eclipse.tomcat/META-INF/MANIFEST.MF source-tree/plugins/org.eclipse.tomcat/META-INF/MANIFEST.MF
--- source-tree.orig/plugins/org.eclipse.tomcat/META-INF/MANIFEST.MF 2006-12-16 09:53:31.000000000 +0100
+++ source-tree/plugins/org.eclipse.tomcat/META-INF/MANIFEST.MF 2006-12-16 10:04:09.000000000 +0100
@@ -2,30 +2,30 @@
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.tomcat; singleton:=true
-Bundle-Version: 4.1.130.qualifier
+Bundle-Version: 5.5.17.qualifier
Bundle-ClassPath: tomcatwrapper.jar,
- catalina.jar,
- bootstrap.jar,
- commons-beanutils.jar,
- commons-collections.jar,
- commons-digester.jar,
- commons-logging-api.jar,
- commons-modeler.jar,
- jakarta-regexp-1.3.jar,
- jasper-compiler.jar,
- jasper-runtime.jar,
- mx4j-jmx.jar,
- naming-common.jar,
- naming-factory.jar,
- naming-resources.jar,
- servlet.jar,
- servlets-common.jar,
- servlets-default.jar,
- servlets-invoker.jar,
- servlets-manager.jar,
- tomcat-coyote.jar,
- tomcat-http11.jar,
- tomcat-util.jar
+ lib/catalina.jar,
+ lib/catalina-optional.jar,
+ lib/commons-beanutils.jar,
+ lib/commons-collections.jar,
+ lib/commons-digester.jar,
+ lib/commons-digester-rss.jar,
+ lib/commons-el.jar,
+ lib/commons-logging-api.jar,
+ lib/commons-modeler.jar,
+ lib/jasper-compiler.jar,
+ lib/jasper-runtime.jar,
+ lib/mx4j-jmx.jar,
+ lib/jsp-api.jar,
+ lib/naming-factory.jar,
+ lib/naming-resources.jar,
+ lib/regexp.jar,
+ lib/servlet-api.jar,
+ lib/servlets-default.jar,
+ lib/tomcat-coyote.jar,
+ lib/tomcat-http.jar,
+ lib/tomcat-util.jar,
+ lib/servlets-invoker.jar
Bundle-Activator: org.eclipse.tomcat.internal.TomcatPlugin
Bundle-Vendor: %providerName
Bundle-Localization: plugin
@@ -33,6 +33,74 @@
org.apache.ant;bundle-version="[1.6.5,1.7.0)";resolution:=optional,
org.eclipse.core.runtime;bundle-version="[3.1.0,4.0.0)"
Eclipse-LazyStart: true
-Export-Package: org.eclipse.tomcat.internal;x-internal:=true,
+Eclipse-BuddyPolicy: global
+Export-Package: javax.management;x-internal:=true,
+ javax.management.loading;x-internal:=true,
+ javax.management.modelmbean;x-internal:=true,
+ javax.management.monitor;x-internal:=true,
+ javax.management.openmbean;x-internal:=true,
+ javax.management.relation;x-internal:=true,
+ javax.management.timer;x-internal:=true,
+ javax.servlet;x-internal:=true,
+ javax.servlet.http;x-internal:=true,
+ javax.servlet.jsp;x-internal:=true,
+ javax.servlet.jsp.tagext;x-internal:=true,
+ mx4j;x-internal:=true,
+ mx4j.loading;x-internal:=true,
+ mx4j.log;x-internal:=true,
+ mx4j.persist;x-internal:=true,
+ mx4j.server;x-internal:=true,
+ mx4j.server.interceptor;x-internal:=true,
+ mx4j.timer;x-internal:=true,
+ mx4j.util;x-internal:=true,
+ org.apache.catalina;x-internal:=true,
+ org.apache.catalina.connector;x-internal:=true,
+ org.apache.catalina.core;x-internal:=true,
+ org.apache.catalina.realm;x-internal:=true,
+ org.apache.catalina.servlets;x-internal:=true,
+ org.apache.commons.beanutils;x-internal:=true,
+ org.apache.commons.beanutils.converters;x-internal:=true,
+ org.apache.commons.beanutils.locale;x-internal:=true,
+ org.apache.commons.beanutils.locale.converters;x-internal:=true,
+ org.apache.commons.collections;x-internal:=true,
+ org.apache.commons.collections.comparators;x-internal:=true,
+ org.apache.commons.collections.iterators;x-internal:=true,
+ org.apache.commons.digester;x-internal:=true,
+ org.apache.commons.digester.rss;x-internal:=true,
+ org.apache.commons.digester.xmlrules;x-internal:=true,
+ org.apache.commons.logging;x-internal:=true,
+ org.apache.commons.logging.impl;x-internal:=true,
+ org.apache.commons.modeler;x-internal:=true,
+ org.apache.commons.modeler.ant;x-internal:=true,
+ org.apache.commons.modeler.mbeans;x-internal:=true,
+ org.apache.commons.modeler.modules;x-internal:=true,
+ org.apache.commons.modeler.util;x-internal:=true,
+ org.apache.coyote;x-internal:=true,
+ org.apache.coyote.http11;x-internal:=true,
+ org.apache.coyote.http11.filters;x-internal:=true,
+ org.apache.coyote.memory;x-internal:=true,
+ org.apache.jasper;x-internal:=true,
+ org.apache.jasper.compiler;x-internal:=true,
+ org.apache.jasper.runtime;x-internal:=true,
+ org.apache.jasper.servlet;x-internal:=true,
+ org.apache.jasper.util;x-internal:=true,
+ org.apache.jasper.xmlparser;x-internal:=true,
+ org.apache.naming;x-internal:=true,
+ org.apache.naming.factory;x-internal:=true,
+ org.apache.naming.java;x-internal:=true,
+ org.apache.naming.resources;x-internal:=true,
+ org.apache.regexp;x-internal:=true,
+ org.apache.tomcat.util;x-internal:=true,
+ org.apache.tomcat.util.buf;x-internal:=true,
+ org.apache.tomcat.util.collections;x-internal:=true,
+ org.apache.tomcat.util.http;x-internal:=true,
+ org.apache.tomcat.util.http.mapper;x-internal:=true,
+ org.apache.tomcat.util.log;x-internal:=true,
+ org.apache.tomcat.util.net;x-internal:=true,
+ org.apache.tomcat.util.net.jsse;x-internal:=true,
+ org.apache.tomcat.util.res;x-internal:=true,
+ org.apache.tomcat.util.threads;x-internal:=true,
+ org.eclipse.tomcat.internal;x-internal:=true,
+ org.eclipse.tomcat.internal;x-internal:=true,
org.eclipse.tomcat.internal.extensions;x-internal:=true
Bundle-RequiredExecutionEnvironment: J2SE-1.4
diff -r -u source-tree.orig/plugins/org.eclipse.tomcat/src/org/eclipse/tomcat/internal/EclipseErrorReportValve.java source-tree/plugins/org.eclipse.tomcat/src/org/eclipse/tomcat/internal/EclipseErrorReportValve.java
--- source-tree.orig/plugins/org.eclipse.tomcat/src/org/eclipse/tomcat/internal/EclipseErrorReportValve.java 2006-12-16 09:53:31.000000000 +0100
+++ source-tree/plugins/org.eclipse.tomcat/src/org/eclipse/tomcat/internal/EclipseErrorReportValve.java 2006-12-16 10:04:09.000000000 +0100
@@ -69,15 +69,27 @@
package org.eclipse.tomcat.internal;
-import java.io.*;
-import java.util.*;
-
-import javax.servlet.*;
-import javax.servlet.http.*;
-
-import org.apache.catalina.*;
-import org.apache.catalina.util.*;
-import org.apache.catalina.valves.*;
+import java.io.IOException;
+import java.io.PrintWriter;
+import java.io.StringWriter;
+import java.io.Writer;
+import java.util.Locale;
+
+import javax.servlet.ServletException;
+import javax.servlet.ServletRequest;
+import javax.servlet.ServletResponse;
+import javax.servlet.http.HttpServletResponse;
+
+import mx4j.log.Logger;
+
+import org.apache.catalina.Globals;
+import org.apache.catalina.Valve;
+import org.apache.catalina.connector.Request;
+import org.apache.catalina.connector.Response;
+import org.apache.catalina.util.RequestUtil;
+import org.apache.catalina.util.StringManager;
+import org.apache.catalina.valves.Constants;
+import org.apache.catalina.valves.ValveBase;
import org.eclipse.core.runtime.Platform;
@@ -145,12 +157,12 @@
* @exception IOException if an input/output error occurs
* @exception ServletException if a servlet error occurs
*/
- public void invoke(Request request, Response response,
- ValveContext context)
+ public void invoke(Request request, Response response)
throws IOException, ServletException {
// Perform the request
- context.invokeNext(request, response);
+ Valve nextValve = getNext();
+ nextValve.invoke(request, response);
ServletRequest sreq = (ServletRequest) request;
Throwable throwable =
@@ -220,14 +232,11 @@
throws IOException {
// Do nothing on non-HTTP responses
- if (!(response instanceof HttpResponse))
- return;
- HttpResponse hresponse = (HttpResponse) response;
if (!(response instanceof HttpServletResponse))
return;
HttpServletResponse hres = (HttpServletResponse) response;
- int statusCode = hresponse.getStatus();
- String message = RequestUtil.filter(hresponse.getMessage());
+ int statusCode = response.getStatus();
+ String message = RequestUtil.filter(response.getMessage());
if (message == null)
message = ""; //$NON-NLS-1$
@@ -373,9 +382,9 @@
*/
protected void log(String message) {
- Logger logger = container.getLogger();
+ Logger logger = (Logger) container.getLogger();
if (logger != null)
- logger.log(this.toString() + ": " + message); //$NON-NLS-1$
+ logger.info(this.toString() + ": " + message); //$NON-NLS-1$
else
System.out.println(this.toString() + ": " + message); //$NON-NLS-1$
@@ -390,9 +399,9 @@
*/
protected void log(String message, Throwable throwable) {
- Logger logger = container.getLogger();
+ Logger logger = (Logger) container.getLogger();
if (logger != null)
- logger.log(this.toString() + ": " + message, throwable); //$NON-NLS-1$
+ logger.info(this.toString() + ": " + message, throwable); //$NON-NLS-1$
else {
System.out.println(this.toString() + ": " + message); //$NON-NLS-1$
throwable.printStackTrace(System.out);
diff -r -u source-tree.orig/plugins/org.eclipse.tomcat/src/org/eclipse/tomcat/internal/TomcatAppServer.java source-tree/plugins/org.eclipse.tomcat/src/org/eclipse/tomcat/internal/TomcatAppServer.java
--- source-tree.orig/plugins/org.eclipse.tomcat/src/org/eclipse/tomcat/internal/TomcatAppServer.java 2006-12-16 09:53:31.000000000 +0100
+++ source-tree/plugins/org.eclipse.tomcat/src/org/eclipse/tomcat/internal/TomcatAppServer.java 2006-12-16 10:06:32.000000000 +0100
@@ -4,7 +4,7 @@
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
@@ -17,23 +17,24 @@
import java.net.UnknownHostException;
import java.util.ArrayList;
-import org.apache.catalina.Connector;
+import mx4j.log.FileLogger;
+
import org.apache.catalina.Context;
import org.apache.catalina.Engine;
import org.apache.catalina.Host;
+import org.apache.catalina.Lifecycle;
import org.apache.catalina.LifecycleEvent;
import org.apache.catalina.LifecycleException;
import org.apache.catalina.LifecycleListener;
import org.apache.catalina.Realm;
+import org.apache.catalina.connector.Connector;
import org.apache.catalina.core.StandardContext;
import org.apache.catalina.core.StandardHost;
-import org.apache.catalina.logger.FileLogger;
import org.apache.catalina.realm.MemoryRealm;
import org.apache.catalina.startup.Embedded;
-import org.apache.coyote.tomcat4.CoyoteConnector;
-import org.apache.coyote.tomcat4.CoyoteServerSocketFactory;
+import org.apache.coyote.http11.Http11Protocol;
+import org.apache.tomcat.util.net.jsse.JSSEImplementation;
import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.FileLocator;
import org.eclipse.core.runtime.IConfigurationElement;
import org.eclipse.core.runtime.IExtension;
import org.eclipse.core.runtime.IExtensionPoint;
@@ -56,6 +57,8 @@
* should not be used
*/
public final static int SSL_DISABLED = -1;
+
+ private final static String NULL = null;
private String hostAddress;
@@ -76,7 +79,9 @@
private Host host = null;
private Connector httpConnector = null;
+ private boolean hasConnection = false;
private Connector sslConnector = null;
+ private boolean hasSSLConnection = false;
// Con
private ArrayList contexts = new ArrayList();
@@ -92,24 +97,34 @@
* java.lang.String)
*/
public synchronized void start(int port, String hostAddress) throws CoreException {
- this.hostAddress = hostAddress;
+ // if null passed for hostAddress, use local host
+ if (hostAddress == null) {
+ this.hostAddress = "127.0.0.1"; //$NON-NLS-1$
+ } else {
+ this.hostAddress = hostAddress;
+ }
+ InetAddress iAddress = null;
+
+ //Defaults to LOCALHOST
+ try{
+ iAddress = InetAddress.getByName(this.hostAddress);
+ } catch (UnknownHostException uhe) {
+ // will default to all interfaces
+ }
+
+ String hostname = iAddress.getHostName();
+
this.port = port;
-
if (isStarted) {
return;
}
isStarted = true;
try {
- FileLogger logger = new FileLogger();
- logger.setDirectory(TomcatPlugin.getDefault().getStateLocation()
- .toOSString());
- embedded = new Embedded(logger, new MemoryRealm());
- embedded.setDebug(0);
- embedded.setLogger(logger);
+ embedded = new Embedded(new MemoryRealm());
URL installURL = TomcatPlugin.getDefault().getBundle()
.getEntry("/"); //$NON-NLS-1$
- URL resolvedURL = FileLocator.resolve(installURL);
- String home = FileLocator.toFileURL(resolvedURL).getFile();
+ URL resolvedURL = Platform.resolve(installURL);
+ String home = Platform.asLocalURL(resolvedURL).getFile();
System.setProperty("catalina.home", home); //$NON-NLS-1$
String base = home;
System.setProperty("catalina.base", base); //$NON-NLS-1$
@@ -120,14 +135,21 @@
Realm realm = getRealm();
embedded.setRealm(realm);
}
-
+ //the embedded application is now started by using embedded.start()
+ embedded.addLifecycleListener(new LifecycleListener(){
+ public void lifecycleEvent(LifecycleEvent event) {
+ if (Lifecycle.START_EVENT.equals(event.getType()))
+ running = true;
+ }
+
+ });
// start now, and then add all the contexts..
embedded.start();
// Create a very basic container hierarchy
engine = embedded.createEngine();
- host = embedded.createHost("localhost", home + "/webapps"); //$NON-NLS-1$ //$NON-NLS-2$
+ host = embedded.createHost(hostname, home + "webapps"); //$NON-NLS-1$
// all request go to our only host
engine.setDefaultHost(host.getName());
@@ -136,8 +158,9 @@
((StandardHost) host)
.setErrorReportValveClass("org.eclipse.tomcat.internal.EclipseErrorReportValve"); //$NON-NLS-1$
}
+
engine.addChild(host);
-
+
// Install the assembled container hierarchy
PrintStream sysOut = System.out;
// reassign standard output to prevent Tomcat from writing
@@ -150,7 +173,7 @@
}
// Root context
- Context root = embedded.createContext("", home + "/webapps/ROOT"); //$NON-NLS-1$ //$NON-NLS-2$
+ Context root = embedded.createContext("", home + "webapps/ROOT"); //$NON-NLS-1$ //$NON-NLS-2$
// this line should be replaced once tomcat provides support
// for setting the working directory
if (root instanceof StandardContext) {
@@ -159,20 +182,13 @@
}
root.setLoader(embedded.createLoader(this.getClass()
.getClassLoader()));
- contexts.add(root);
+
host.addChild(root);
-
- InetAddress iAddress = null;
- if (this.hostAddress != null) {
- try {
- iAddress = InetAddress.getByName(this.hostAddress);
- } catch (UnknownHostException uhe) {
- // will default to all interfaces
- }
- }
+ contexts.add(root);
+
updateSslPort(iAddress);
if (this.port == 0) {
- this.port = SocketUtil.findUnusedLocalPort(iAddress);
+ this.port = SocketUtil.findUnusedLocalPort(iAddress);
if (this.port == -1) {
throw new CoreException(
new Status(
@@ -184,51 +200,55 @@
}
}
- // Create Connector
- Connector connector = embedded.createConnector(null, this.port,
- false);
- // Override defaults on CoyoteConnector
- if (connector instanceof CoyoteConnector) {
- CoyoteConnector connectorImpl = (CoyoteConnector) connector;
- if (iAddress != null) {
- // bug in Embedded that incorrectly sets host on connector.
- // pass null when creating connector, and set host here if
- // it is specified
- connectorImpl.setAddress(iAddress.getHostAddress());
- }
- Preferences pref = TomcatPlugin.getDefault()
- .getPluginPreferences();
- int acceptCount = pref.getInt(TomcatPlugin.PREF_ACCEPT_COUNT);
- if (acceptCount > 0) {
- connectorImpl.setAcceptCount(acceptCount);
- }
- int maxProcessors = pref
- .getInt(TomcatPlugin.PREF_MAX_PROCESSORS);
- if (maxProcessors > 0) {
- connectorImpl.setMaxProcessors(maxProcessors);
- }
- int minProcessors = pref
- .getInt(TomcatPlugin.PREF_MIN_PROCESSORS);
- if (minProcessors > 0) {
- connectorImpl.setMinProcessors(minProcessors);
- }
- if (this.sslPort > 0) {
- connectorImpl.setRedirectPort(this.sslPort);
- connectorImpl.setEnableLookups(true);
- connectorImpl.setConnectionTimeout(20000);
- connectorImpl.setUseURIValidationHack(false);
- connectorImpl.setDisableUploadTimeout(true);
+ // Create Connector
+ Connector connector = embedded.createConnector(iAddress.getHostAddress(), this.port,false);;
+
+ Preferences pref = TomcatPlugin.getDefault()
+ .getPluginPreferences();
+ /**
+ * To extend additional properties, make use of org.apache.tomcat.util.IntrospectionUtils
+ * A Connector will initialize a protocolhandler defaults to org.apache.coyote.http11.Http11Protocol
+ * format : connector.setProperty("STRING_PROP_NAME","STRING_PROP_VALUE");
+ *
+ */
+
+ int acceptCount = pref.getInt(TomcatPlugin.PREF_ACCEPT_COUNT);
+ if (acceptCount > 0) {
+ connector.setProperty("backlog",""+acceptCount); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+
+ int maxProcessors = pref
+ .getInt(TomcatPlugin.PREF_MAX_PROCESSORS);
+ if (maxProcessors > 0) {
+ connector.setProperty("maxThreads",""+maxProcessors); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+
+ int minProcessors = pref
+ .getInt(TomcatPlugin.PREF_MIN_PROCESSORS);
+ if (minProcessors > 0) {
+ connector.setProperty("minSpareThreads",""+minProcessors); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+
+ if (this.sslPort > 0) {
+ connector.setRedirectPort(this.sslPort);
+ connector.setEnableLookups(true);
+ connector.setProperty("soTimeout",""+20000); //$NON-NLS-1$ //$NON-NLS-2$
+ //connector.setUseURIValidationHack(false); no longer available
+ connector.setUseBodyEncodingForURI(false);
+ String disableUploadTimeout = pref.getString(TomcatPlugin.DISABLE_UPLOAD_TIMEOUT);
+ if ((disableUploadTimeout != null) && (!("".equals(disableUploadTimeout.trim())))) { //$NON-NLS-1$
+ connector.setProperty("disableUploadTimeout", disableUploadTimeout); //$NON-NLS-1$
}
- // connectorImpl.setDebug(0);
- // If there is problem in embedded.addConnector()
- // there is no exception, so add a listener
- connectorImpl.addLifecycleListener(new LifecycleListener() {
- public void lifecycleEvent(LifecycleEvent event) {
- if ("start".equals(event.getType())) //$NON-NLS-1$
- running = true;
- }
- });
}
+ // connectorImpl.setDebug(0);
+ // If there is problem in embedded.addConnector()
+ // there is no exception, so add a listener
+ connector.addLifecycleListener(new LifecycleListener() {
+ public void lifecycleEvent(LifecycleEvent event) {
+ if (Lifecycle.START_EVENT.equals(event.getType()))
+ hasConnection = true;
+ }
+ });
// add Connector to Tomcat
PrintStream sysErr = System.err;
@@ -236,21 +256,16 @@
// its version message there.
System.setErr(new PrintStream(new ByteArrayOutputStream()));
try {
- embedded.addConnector(connector);
- httpConnector = connector;
+ this.httpConnector = connector;
+ embedded.addConnector(this.httpConnector);
+ httpConnector.start();
} finally {
System.setErr(sysErr);
}
-
if (this.sslPort > 0) {
createSSLConnector(iAddress, this.sslPort);
}
- // if null passed for hostAddress, use local host
- if (this.hostAddress == null) {
- this.hostAddress = "127.0.0.1"; //$NON-NLS-1$
- }
-
// running = true;
TomcatPlugin.getDefault().setAppserver(this);
@@ -307,82 +322,115 @@
* @throws CoreException
*/
private void createSSLConnector(InetAddress iAddress, int sslport)
- throws CoreException {
+ throws CoreException {
+
// Create Connector
- this.sslConnector = embedded.createConnector(null, sslport, false);
- // Override defaults on CoyoteConnector
- if (this.sslConnector instanceof CoyoteConnector) {
- CoyoteConnector connectorImpl = (CoyoteConnector) this.sslConnector;
- if (iAddress != null) {
- // bug in Embedded that incorrectly sets host on connector.
- // pass null when creating connector, and set host here if
- // it is specified
- connectorImpl.setAddress(iAddress.getHostAddress());
- }
- Preferences pref = TomcatPlugin.getDefault().getPluginPreferences();
- int acceptCount = pref.getInt(TomcatPlugin.PREF_ACCEPT_COUNT);
- if (acceptCount > 0) {
- connectorImpl.setAcceptCount(acceptCount);
- }
- int maxProcessors = pref.getInt(TomcatPlugin.PREF_MAX_PROCESSORS);
- if (maxProcessors > 0) {
- connectorImpl.setMaxProcessors(maxProcessors);
- }
- int minProcessors = pref.getInt(TomcatPlugin.PREF_MIN_PROCESSORS);
- if (minProcessors > 0) {
- connectorImpl.setMinProcessors(minProcessors);
- }
- connectorImpl.setUseURIValidationHack(false);
- connectorImpl.setDisableUploadTimeout(true);
- connectorImpl.setSecure(true);
- String scheme = pref.getString(TomcatPlugin.PREF_SSL_SCHEME);
- if ((scheme != null) && (!("".equals(scheme.trim())))) { //$NON-NLS-1$
- connectorImpl.setScheme(scheme);
- }
- connectorImpl.setEnableLookups(true);
- CoyoteServerSocketFactory factory = new CoyoteServerSocketFactory();
- factory.setClientAuth(false);
- String protocol = pref.getString(TomcatPlugin.PREF_SSL_PROTOCOL);
- if ((protocol != null) && (!("".equals(protocol.trim())))) { //$NON-NLS-1$
- factory.setProtocol(protocol);
- }
- String algorithm = pref.getString(TomcatPlugin.PREF_SSL_ALGORITHM);
- if ((algorithm != null) && (!("".equals(algorithm.trim())))) { //$NON-NLS-1$
- factory.setAlgorithm(algorithm);
- }
- String keyStoreFile = pref
- .getString(TomcatPlugin.PREF_KEY_STORE_FILE);
- if ((keyStoreFile != null) && (!("".equals(keyStoreFile.trim())))) { //$NON-NLS-1$
- factory.setKeystoreFile(keyStoreFile);
- }
- String keyStorePassword = pref
- .getString(TomcatPlugin.PREF_KEY_STORE_PASSWORD);
- if ((keyStorePassword != null)
- && (!("".equals(keyStorePassword.trim())))) { //$NON-NLS-1$
- factory.setKeystorePass(keyStorePassword);
- }
- connectorImpl.setFactory(factory);
- connectorImpl.setDebug(0);
- // If there is problem in embedded.addConnector()
- // there is no exception, so add a listener
- connectorImpl.addLifecycleListener(new LifecycleListener() {
- public void lifecycleEvent(LifecycleEvent event) {
- if ("start".equals(event.getType())) //$NON-NLS-1$
- running = true;
- }
- });
- }
+ //Defaults to local if IAddress is null
+ Connector connector = embedded.createConnector(iAddress.getHostAddress(), this.port,false);
- // add Connector to Tomcat
- PrintStream sysErr = System.err;
- // reassign standard error to prevent Coyote from writing
- // its version message there.
- System.setErr(new PrintStream(new ByteArrayOutputStream()));
- try {
- embedded.addConnector(this.sslConnector);
- } finally {
- System.setErr(sysErr);
+ //--------------------create the Protocol-----------------------//
+ Preferences pref = TomcatPlugin.getDefault().getPluginPreferences();
+ /**
+ * To extend additional properties, make use of org.apache.tomcat.util.IntrospectionUtils
+ * A Connector will initialize a protocolhandler which initialize a SSLImplementation which initialize
+ * a ServerSocketFactory
+ * format : connector.setProperty("STRING_PROP_NAME","STRING_PROP_VALUE");
+ *
+ */
+ //----------------configure connector -------------------------------//
+ // by looking at the code, it seems like the protocol go in first
+ String protocol = pref.getString(TomcatPlugin.PREF_SSL_PROTOCOL);
+ if ((protocol != null) && (!("".equals(protocol.trim())))) { //$NON-NLS-1$
+ connector.setProperty("protocol",protocol); //$NON-NLS-1$
+ }
+ String protocols = pref.getString(TomcatPlugin.PREF_SSL_PROTOCOLS);
+ if ((protocols != null) && (!("".equals(protocols.trim())))) { //$NON-NLS-1$
+ connector.setProperty("protocols",protocols); //$NON-NLS-1$
+ }
+ String protocolClassName = Http11Protocol.class.getName();
+ connector.setProtocol(protocolClassName);
+
+ String JSSEImplementationName = JSSEImplementation.class.getName();
+ connector.setProperty("sslImplementation",JSSEImplementationName); //$NON-NLS-1$
+
+ String disableUploadTimeout = pref.getString(TomcatPlugin.DISABLE_UPLOAD_TIMEOUT);
+ if ((disableUploadTimeout != null) && (!("".equals(disableUploadTimeout.trim())))) { //$NON-NLS-1$
+ connector.setProperty("disableUploadTimeout", disableUploadTimeout); //$NON-NLS-1$
+ }
+
+ String algorithm = pref.getString(TomcatPlugin.PREF_SSL_ALGORITHM);
+ if ((algorithm != null) && (!("".equals(algorithm.trim())))) { //$NON-NLS-1$
+ connector.setProperty("algorithm", algorithm); //$NON-NLS-1$
+ }
+ int maxProcessors = pref.getInt(TomcatPlugin.PREF_MAX_PROCESSORS);
+ if (maxProcessors > 0) {
+ //connector.setMaxProcessors(maxProcessors);
+ connector.setProperty("maxThreads",""+maxProcessors); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+ int minProcessors = pref.getInt(TomcatPlugin.PREF_MIN_PROCESSORS);
+ if (minProcessors > 0) {
+ //connector.setMinProcessors(minProcessors);
+ connector.setProperty("minSpareThreads",""+minProcessors); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+ //this is making use of org.apache.tomcat.util.IntrospectionUtils
+ connector.setProperty("disableUploadTimeout",""+true); //$NON-NLS-1$ //$NON-NLS-2$
+ String clientauth = pref.getString(TomcatPlugin.PREF_CLIENT_AUTHENTICATION);
+ if ((clientauth != null) && (!("".equals(clientauth.trim())))) { //$NON-NLS-1$
+ connector.setProperty("clientauth",clientauth); //$NON-NLS-1$
+ }
+
+ int acceptCount = pref.getInt(TomcatPlugin.PREF_ACCEPT_COUNT);
+ if (acceptCount > 0) {
+ connector.setProperty("backlog",""+acceptCount); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+
+ String keyStoreFile = pref
+ .getString(TomcatPlugin.PREF_KEY_STORE_FILE);
+ if ((keyStoreFile != null) && (!("".equals(keyStoreFile.trim())))) { //$NON-NLS-1$
+ connector.setProperty("keystore", keyStoreFile); //$NON-NLS-1$
+ }
+ String keyStorePassword = pref
+ .getString(TomcatPlugin.PREF_KEY_STORE_PASSWORD);
+ if ((keyStorePassword != null)
+ && (!("".equals(keyStorePassword.trim())))) { //$NON-NLS-1$
+ connector.setProperty("keypass", keyStorePassword); //$NON-NLS-1$
+ }
+ //connector.setUseURIValidationHack(false); --no longer avaliable, hope they fixed the bug
+ connector.setUseBodyEncodingForURI(false);
+ // connector.setSecure(true); ---setting ssLImplementation set secure to true
+ String scheme = pref.getString(TomcatPlugin.PREF_SSL_SCHEME);
+ if ((scheme != null) && (!("".equals(scheme.trim())))) { //$NON-NLS-1$
+ connector.setScheme(scheme);
+ }
+ connector.setEnableLookups(true);
+
+ //connector.setFactory(factory); --no longer needed, now handled by SSLImplemenatation
+ // If there is problem in embedded.addConnector()
+ // there is no exception, so add a listener
+ connector.addLifecycleListener(new LifecycleListener() {
+ public void lifecycleEvent(LifecycleEvent event) {
+ if (Lifecycle.START_EVENT.equals(event.getType())||Lifecycle.PERIODIC_EVENT.equals(event.getType()))
+ hasSSLConnection = true;
+ }
+ });
+ // add Connector to Tomcat
+ PrintStream sysErr = (PrintStream) System.err;
+ // reassign standard error to prevent Coyote from writing
+ // its version message there.
+ System.setErr(new PrintStream(new ByteArrayOutputStream()));
+ try{
+ sslConnector = connector;
+ embedded.addConnector(this.sslConnector);
+ sslConnector.start();
+ } catch(LifecycleException e){
+ TomcatPlugin
+ .logError(
+ "Exception occurred while establishing secure connection.", //$NON-NLS-1$
+ e);
}
+ finally {
+ System.setErr(sysErr);
+ }
}
/**
@@ -461,17 +509,16 @@
*/
public synchronized void start(String webappName, IPath path, ClassLoader customLoader)
throws CoreException {
-
+
if (!isStarted) {
start(port, hostAddress);
- }
+ }
if (!running) {
throw new CoreException(new Status(IStatus.ERROR,
TomcatPlugin.PLUGIN_ID, IStatus.OK, NLS.bind(
TomcatResources.TomcatAppServer_addingWebapp,
webappName, path.toOSString()), null));
}
-
String contextPath = webappName;
if (!contextPath.startsWith("/")) { //$NON-NLS-1$
contextPath = "/" + contextPath; //$NON-NLS-1$
@@ -486,7 +533,6 @@
WebAppClassLoader webappLoader = new WebAppClassLoader(customLoader);
context.setLoader(embedded.createLoader(webappLoader));
-
host.addChild(context);
contexts.add(context);
} catch (Exception exc) {
@@ -601,4 +647,4 @@
return TomcatPlugin.getDefault().getStateLocation().append(webApp)
.toOSString();
}
-}
+}
\ Kein Zeilenumbruch am Dateiende.
diff -r -u source-tree.orig/plugins/org.eclipse.tomcat/src/org/eclipse/tomcat/internal/TomcatPlugin.java source-tree/plugins/org.eclipse.tomcat/src/org/eclipse/tomcat/internal/TomcatPlugin.java
--- source-tree.orig/plugins/org.eclipse.tomcat/src/org/eclipse/tomcat/internal/TomcatPlugin.java 2006-12-16 09:53:31.000000000 +0100
+++ source-tree/plugins/org.eclipse.tomcat/src/org/eclipse/tomcat/internal/TomcatPlugin.java 2006-12-16 10:04:09.000000000 +0100
@@ -24,13 +24,16 @@
public final static String PREF_ACCEPT_COUNT = "acceptCount"; //$NON-NLS-1$
public final static String PREF_MAX_PROCESSORS = "maxProcessors"; //$NON-NLS-1$
public final static String PREF_MIN_PROCESSORS = "minProcessors"; //$NON-NLS-1$
+ public final static String DISABLE_UPLOAD_TIMEOUT = "disableUploadTimeout"; //$NON-NLS-1$
public final static String PREF_SSL_PORT = "sslPort"; //$NON-NLS-1$
public final static String PREF_SSL_PROTOCOL = "sslProtocol"; //$NON-NLS-1$
+ public final static String PREF_SSL_PROTOCOLS = "sslProtocols"; //$NON-NLS-1$
public final static String PREF_SSL_SCHEME = "sslScheme"; //$NON-NLS-1$
public final static String PREF_SSL_ALGORITHM = "sslAlgorithm"; //$NON-NLS-1$
public final static String PREF_KEY_STORE_FILE = "keyStoreFile"; //$NON-NLS-1$
public final static String PREF_KEY_STORE_PASSWORD = "keyStorePassword"; //$NON-NLS-1$
+ public final static String PREF_CLIENT_AUTHENTICATION = "clientauth"; //$NON-NLS-1$
private static TomcatPlugin plugin;
// private static BundleContext bundleContext;
|