Hi, I have a question related to Tomcat 7.0.69 running in a voyage (debian) system. I have a java application that was running with "Embedded" class from Tomcat 6.0.Now I am trying to upgrade it to run with Tomcat 7.0.69. The current java application is initializing some static objects and then starts the "Embedded" class with some Servlets.The Servlets that were initialized access to the static objects from the application that started them. This works fine with Tomcat 6.0. Now, I am using the "Tomcat" class from Tomcat 7.0 to start the same Servlets.The servlets are initialized and I can access to their context path. The problem is when I try to access from the Servlet to a static initialized object from the application that started them.The object is null here. I do not know if this is related to the context class loader. The code looks something like this: // Port numberint port = 8080; // Create an embedded serverthis.embedded = new Tomcat();this.embedded.setBaseDir(getPath());this.embedded.setPort(port); // Set default virtual hostthis.host = this.embedded.getHost();this.host.setAppBase(getPath() + "/webapps"); // Create the ROOT contextthis.rootcontext = this.embedded.addWebapp(this.host, "", getPath() + "/webapps/ROOT");this.rootcontext.setReloadable(false);this.rootcontext.addWelcomeFile("index.jsp"); // Create servlet contextthis.rootcontext = this.embedded.addWebapp(this.host, "/context", "/home/path/to/app");this.rootcontext.setReloadable(false);context.setPrivileged(true); // Set connector propertiesConnector connector = this.embedded.getConnector();connector.setSecure(false);connector.setProperty("maxThreads", "10");connector.setProperty("acceptCount", "20");connector.setProperty("asyncTimeout", "30000");connector.setProperty("connectionTimeout", "30000");connector.setProperty("socket.soTimeout", "30000");connector.setEnableLookups(false);this.embedded.setConnector(connector); // Start the embedded serverthis.embedded.start();
Can you please help me with this question? Best regards,Daniel Rocha