/** * Configures the specified context element with the extra classpath (if any) of the given WAR. * @param deployable Deployable to create extra classpath XML token for. * @param context The context element to configure, must not be {@code null}. */ protected void configureExtraClasspathToken(WAR deployable, Element context) { getLogger().warn("Tomcat 5.x doesn't support extra classpath on WARs", this.getClass().getName()); }
/** * Creates the extra classpath XML token. * @param deployable Deployable to create extra classpath XML token for. * @return Extra classpath XML token. */ protected String getExtraClasspathToken(WAR deployable) { getLogger().warn("Tomcat 5.x doesn't support extra classpath on WARs", this.getClass().getName()); return ""; }
/** * Configures the specified context element with the extra classpath (if any) of the given WAR. * @param deployable Deployable to create extra classpath XML token for. * @param context The context element to configure, must not be {@code null}. */ protected void configureExtraClasspathToken(WAR deployable, Element context) { getLogger().warn("Tomcat 5.x doesn't support extra classpath on WARs", this.getClass().getName()); }
/** * Creates the extra classpath XML token. * @param deployable Deployable to create extra classpath XML token for. * @return Extra classpath XML token. */ protected String getExtraClasspathToken(WAR deployable) { getLogger().warn("Tomcat 5.x doesn't support extra classpath on WARs", this.getClass().getName()); return ""; }
/** * If necessary, warn the user about this deployer's limitations. */ protected void warn() { if (this.warn) { getLogger().warn("The jonas5x local deployer requires the target JOnAS server to be in" + " development mode.", getClass().getName()); getLogger().warn("", getClass().getName()); getLogger().warn("If this is not the case, please use the jonas5x remote deployer.", getClass().getName()); getLogger().warn("Note that the jonas5x remote deployer can be used on a local server" + " by setting the server name to localhost.", getClass().getName()); } } }
/** * If necessary, warn the user about this deployer's limitations. */ protected void warn() { if (this.warn) { getLogger().warn("The jonas5x local deployer requires the target JOnAS server to be in" + " development mode.", getClass().getName()); getLogger().warn("", getClass().getName()); getLogger().warn("If this is not the case, please use the jonas5x remote deployer.", getClass().getName()); getLogger().warn("Note that the jonas5x remote deployer can be used on a local server" + " by setting the server name to localhost.", getClass().getName()); } } }
/** * runs the thread. */ @Override public void run() { try { this.runAndThrow(); } catch (Throwable t) { if (!this.stopped) { this.lastException = t; this.logger.warn("Error in the embedded HTTP server: " + t.toString(), this.getClass().getName()); for (StackTraceElement ste : t.getStackTrace()) { this.logger.warn(ste.toString(), this.getClass().getName()); } } } }
/** * runs the thread. */ @Override public void run() { try { this.runAndThrow(); } catch (Throwable t) { if (!this.stopped) { this.lastException = t; this.logger.warn("Error in the embedded HTTP server: " + t.toString(), this.getClass().getName()); for (StackTraceElement ste : t.getStackTrace()) { this.logger.warn(ste.toString(), this.getClass().getName()); } } } }
/** * @param jndiName JNDI name to be sanitized. * @return Sanitized JNDI name. */ private String sanitizeJndiName(String jndiName) { String response = jndiName; if (!jndiName.startsWith("java:/")) { response = "java:/" + jndiName; getConfiguration().getLogger().warn("WildFly requires resource JNDI names " + "to start with java:/, hence changing the given JNDI name to: " + response, this.getClass().getName()); } return response; }
/** * @param jndiName JNDI name to be sanitized. * @return Sanitized JNDI name. */ private String sanitizeJndiName(String jndiName) { String response = jndiName; if (!jndiName.startsWith("java:/")) { response = "java:/" + jndiName; getConfiguration().getLogger().warn("WildFly requires resource JNDI names " + "to start with java:/, hence changing the given JNDI name to: " + response, this.getClass().getName()); } return response; }
/** * @return Jetty <code>OPTIONS</code> argument. */ protected synchronized String getOptions() { if (this.options == null) { StringBuilder options = new StringBuilder("OPTIONS=Server"); File jspLib = new File(getHome(), "lib/jsp"); if (jspLib.isDirectory()) { options.append(",jsp"); } else { getLogger().warn("JSP librairies not found in " + jspLib + ", JSP support will be disabled", this.getClass().getName()); } options.append("," + this.defaultFinalOptions); this.options = options.toString(); } return this.options; } }
/** * @return Jetty <code>OPTIONS</code> argument. */ protected synchronized String getOptions() { if (this.options == null) { StringBuilder options = new StringBuilder("OPTIONS=Server"); File jspLib = new File(getHome(), "lib/jsp"); if (jspLib.isDirectory()) { options.append(",jsp"); } else { getLogger().warn("JSP librairies not found in " + jspLib + ", JSP support will be disabled", this.getClass().getName()); } options.append("," + this.defaultFinalOptions); this.options = options.toString(); } return this.options; } }
/** * Calculate the absolute directory for any given path. This method will also emit a warning if * the given path is not absolute. * @param type Directory type, for example <code>container home</code>. * @param directory Directory path. * @return Absolute directory path. */ private String calculateAbsoluteDirectory(String type, String directory) { File directoryFile = new File(directory); if (!directoryFile.isAbsolute()) { String absoluteDirectory = directoryFile.getAbsolutePath(); if (getLogger() != null) { getLogger().warn("The provided " + type + " directory [" + directory + "] is not an absolute directory. Replacing it with its absolute directory " + "counterpart, i.e. [" + absoluteDirectory + "] To avoid this message in " + "the future, you can also use the ${basedir} variable in your " + "paths.", this.getClass().getName()); } return absoluteDirectory; } else { return directory; } }
/** * Create module from JAR file and add it to the script list. * @param jarFile JAR resource representing module. * @param container Container with modules. * @param configurationScript List of configuration scripts to be executed. */ protected void addModuleScript(String jarFile, InstalledLocalContainer container, List<ScriptCommand> configurationScript) { String moduleName = WildFlyModuleUtils.getModuleName(container, jarFile); boolean isModuleDeployed = WildFlyModuleUtils.isModuleDeployed(container, jarFile); if (isModuleDeployed) { getLogger().warn("Module " + moduleName + " already exists, skipping it.", this.getClass().getName()); } else { // Dependencies needed for DataSource driver initialization. List<String> commonDependencies = Arrays.asList("javax.api", "javax.transaction.api"); List<String> dependencies = new ArrayList<String>(); dependencies.addAll(commonDependencies); dependencies.addAll(modules); configurationScript.add(getConfigurationFactory().addModuleScript(moduleName, Arrays.asList(jarFile), dependencies)); } modules.add(moduleName); }
/** * Create module from JAR file and add it to the script list. * @param jarFile JAR resource representing module. * @param container Container with modules. * @param configurationScript List of configuration scripts to be executed. */ protected void addModuleScript(String jarFile, InstalledLocalContainer container, List<ScriptCommand> configurationScript) { String moduleName = WildFlyModuleUtils.getModuleName(container, jarFile); boolean isModuleDeployed = WildFlyModuleUtils.isModuleDeployed(container, jarFile); if (isModuleDeployed) { getLogger().warn("Module " + moduleName + " already exists, skipping it.", this.getClass().getName()); } else { // Dependencies needed for DataSource driver initialization. List<String> commonDependencies = Arrays.asList("javax.api", "javax.transaction.api"); List<String> dependencies = new ArrayList<String>(); dependencies.addAll(commonDependencies); dependencies.addAll(modules); configurationScript.add(getConfigurationFactory().addModuleScript(moduleName, Arrays.asList(jarFile), dependencies)); } modules.add(moduleName); }
/** * Warn user and throw an Exception if any unsupported {@link Resource}s are setup for this * configuration. */ public void collectUnsupportedResourcesAndThrowException() { if (!getResources().isEmpty() && !this.getCapability().supportsProperty(ResourcePropertySet.RESOURCE)) { StringBuilder errorMessage = new StringBuilder(); for (Resource resource : getResources()) { String message = "This configuration does not support Resource configuration! JndiName: " + resource.getName(); getLogger().warn(message, getClass().getName()); if (!errorMessage.toString().equals("")) { errorMessage.append("\n"); } errorMessage.append(message); } throw new CargoException(errorMessage.toString()); } }
/** * Add option of spawn if property exists * * @param java the predefined JVM launcher which will spawn */ private void addSpawn(JvmLauncher java) { boolean spawnProcess = Boolean.parseBoolean(getConfiguration().getPropertyValue( GeneralPropertySet.SPAWN_PROCESS)); if (spawnProcess) { if (getOutput() == null) { java.setSpawn(spawnProcess); } else { getLogger().warn("Process cannot be spawned unless output is null", this.getClass().getName()); } } }
/** * Checks the versions of the servlet API in each descriptor, and logs a warning if a mismatch * might result in the loss of definitions. * * @param theWebXml The descriptor that will be merged with the original */ protected final void checkServletVersions(WebXml theWebXml) { if (this.webXml.getVersion() != null && this.webXml.getVersion().compareTo(theWebXml.getVersion()) < 0) { getLogger().warn("Merging elements from a version " + theWebXml.getVersion() + " descriptor into a version " + this.webXml.getVersion() + ", some elements may be skipped", this.getClass().getName()); } }
@Override public void run() { try { if (container != null && (org.codehaus.cargo.container.State.STARTED == container.getState() || org.codehaus.cargo.container.State.STARTING == container.getState())) { log.info("Stopping container...",""); container.stop(); } } catch (Exception e) { log.warn("Failed stopping the container", ""); } } });
/** * Checks the versions of the servlet API in each descriptor, and logs a warning if a mismatch * might result in the loss of definitions. * * @param theWebXml The descriptor that will be merged with the original */ protected final void checkServletVersions(WebXml theWebXml) { if (this.webXml.getVersion() != null && this.webXml.getVersion().compareTo(theWebXml.getVersion()) < 0) { getLogger().warn("Merging elements from a version " + theWebXml.getVersion() + " descriptor into a version " + this.webXml.getVersion() + ", some elements may be skipped", this.getClass().getName()); } }