diff --git a/plugins/axis2/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/AxisServiceGenerator.java b/plugins/axis2/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/AxisServiceGenerator.java index 68657772d8..028854f421 100644 --- a/plugins/axis2/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/AxisServiceGenerator.java +++ b/plugins/axis2/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/AxisServiceGenerator.java @@ -327,7 +327,13 @@ public static URL getWsdlURL(String wsdlFile, Bundle bundle) { if (wsdlFile == null) { return null; } - URL wsdlURL = BundleUtils.getEntry(bundle, wsdlFile); + URL wsdlURL; + try { + wsdlURL = BundleUtils.getEntry(bundle, wsdlFile); + } catch (MalformedURLException e) { + log.warn("MalformedURLException when getting entry:" + wsdlFile + " from bundle " + bundle.getSymbolicName(), e); + wsdlURL = null; + } if (wsdlURL == null) { wsdlURL = bundle.getResource(wsdlFile); if (wsdlURL == null) { diff --git a/plugins/cxf/geronimo-cxf/src/main/java/org/apache/geronimo/cxf/CXFEndpoint.java b/plugins/cxf/geronimo-cxf/src/main/java/org/apache/geronimo/cxf/CXFEndpoint.java index 6f6ab0161b..aa2fb36e67 100644 --- a/plugins/cxf/geronimo-cxf/src/main/java/org/apache/geronimo/cxf/CXFEndpoint.java +++ b/plugins/cxf/geronimo-cxf/src/main/java/org/apache/geronimo/cxf/CXFEndpoint.java @@ -45,9 +45,13 @@ import org.apache.geronimo.jaxws.handler.GeronimoHandlerResolver; import org.apache.xbean.osgi.bundle.util.BundleUtils; import org.osgi.framework.Bundle; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public abstract class CXFEndpoint { + private static final Logger log = LoggerFactory.getLogger(CXFEndpoint.class); + protected Bus bus; protected Object implementor; @@ -88,7 +92,11 @@ protected URL getWsdlURL(Bundle bundle, String wsdlFile) { // Not a URL, try as a resource wsdlURL = bundle.getResource("/" + wsdlFile); if (wsdlURL == null) { - wsdlURL = BundleUtils.getEntry(bundle, wsdlFile); + try { + wsdlURL = BundleUtils.getEntry(bundle, wsdlFile); + } catch (MalformedURLException e1) { + log.warn("MalformedURLException when getting entry:" + wsdlFile + " from bundle " + bundle.getSymbolicName(), e); + } } } return wsdlURL; diff --git a/plugins/jaxws/geronimo-jaxws/src/main/java/org/apache/geronimo/jaxws/client/JAXWSServiceReference.java b/plugins/jaxws/geronimo-jaxws/src/main/java/org/apache/geronimo/jaxws/client/JAXWSServiceReference.java index 8929a6b5e9..e1574ad009 100644 --- a/plugins/jaxws/geronimo-jaxws/src/main/java/org/apache/geronimo/jaxws/client/JAXWSServiceReference.java +++ b/plugins/jaxws/geronimo-jaxws/src/main/java/org/apache/geronimo/jaxws/client/JAXWSServiceReference.java @@ -106,7 +106,12 @@ private URL getWsdlURL() { if (wsdlURL == null) { wsdlURL = bundle.getResource(this.wsdlURI.toString()); if (wsdlURL == null) { - wsdlURL = BundleUtils.getEntry(bundle, wsdlURI.toString()); + try { + wsdlURL = BundleUtils.getEntry(bundle, wsdlURI.toString()); + } catch (MalformedURLException e) { + LOG.warn("MalformedURLException when getting entry:" + wsdlURI + " from bundle " + bundle.getSymbolicName(), e); + wsdlURL = null; + } } if (wsdlURL == null) { LOG.warn("Failed to obtain WSDL: " + this.wsdlURI); diff --git a/plugins/jetty8/geronimo-jetty8-builder/src/main/java/org/apache/geronimo/jetty8/deployment/JettyModuleBuilder.java b/plugins/jetty8/geronimo-jetty8-builder/src/main/java/org/apache/geronimo/jetty8/deployment/JettyModuleBuilder.java index 5019738c9b..4049333864 100644 --- a/plugins/jetty8/geronimo-jetty8-builder/src/main/java/org/apache/geronimo/jetty8/deployment/JettyModuleBuilder.java +++ b/plugins/jetty8/geronimo-jetty8-builder/src/main/java/org/apache/geronimo/jetty8/deployment/JettyModuleBuilder.java @@ -20,6 +20,7 @@ import java.io.File; import java.io.IOException; import java.io.InputStream; +import java.net.MalformedURLException; import java.net.URI; import java.net.URL; import java.util.Collection; @@ -165,9 +166,8 @@ public JettyModuleBuilder(@ParamAttribute(name = "defaultEnvironment") Environme super(kernel, serviceBuilders, namingBuilders, resourceEnvironmentSetter, webServiceBuilder, moduleBuilderExtensions, bundleContext); this.defaultEnvironment = defaultEnvironment; this.defaultSessionTimeoutMinutes = (defaultSessionTimeoutSeconds == null) ? 30 * 60 : defaultSessionTimeoutSeconds; - this.jettyContainerObjectName = jettyContainerName; + this.jettyContainerObjectName = jettyContainerName; this.webAppInfoFactory = new StandardWebAppInfoFactory(defaultWebApp, null); - this.clusteringBuilders = new NamespaceDrivenBuilderCollection(clusteringBuilders);//, GerClusteringDocument.type.getDocumentElementName()); } @@ -181,7 +181,7 @@ public void doStop() { XmlBeansUtil.unregisterNamespaceUpdates(NAMESPACE_UPDATES); kernel.getLifecycleMonitor().removeLifecycleListener(jspServletInfoProviderListener); //TODO not yet implemented - // SchemaConversionUtils.unregisterNamespaceConversions(GERONIMO_SCHEMA_CONVERSIONS); +// SchemaConversionUtils.unregisterNamespaceConversions(GERONIMO_SCHEMA_CONVERSIONS); } public void doFail() { @@ -201,7 +201,14 @@ public Module createModule(Bundle bundle, Naming naming, ModuleIDBuilder idBuild String specDD = null; WebApp webApp = null; - URL specDDUrl = BundleUtils.getEntry(bundle, "WEB-INF/web.xml"); + URL specDDUrl; + try { + specDDUrl = BundleUtils.getEntry(bundle, "WEB-INF/web.xml"); + } catch (MalformedURLException e) { + log.warn("MalformedURLException when getting entry:" + "WEB-INF/web.xml" + " from bundle " + bundle.getSymbolicName(), e); + specDDUrl = null; + } + if (specDDUrl == null) { webApp = new WebApp(); } else { @@ -486,7 +493,7 @@ public void addGBeans(EARContext earContext, Module module, Bundle bundle, Colle //TODO merge from default web app if (webAppInfo.sessionConfig != null) { - if (webAppInfo.sessionConfig.sessionTimeoutMinutes == -1 && defaultSessionTimeoutMinutes != -1) { + if (webAppInfo.sessionConfig.sessionTimeoutMinutes == null && defaultSessionTimeoutMinutes != -1) { webAppInfo.sessionConfig.sessionTimeoutMinutes = defaultSessionTimeoutMinutes; } } diff --git a/plugins/jetty8/geronimo-jetty8/src/main/java/org/apache/geronimo/jetty8/handler/GeronimoWebAppContext.java b/plugins/jetty8/geronimo-jetty8/src/main/java/org/apache/geronimo/jetty8/handler/GeronimoWebAppContext.java index edfadf98d7..f995355fd7 100644 --- a/plugins/jetty8/geronimo-jetty8/src/main/java/org/apache/geronimo/jetty8/handler/GeronimoWebAppContext.java +++ b/plugins/jetty8/geronimo-jetty8/src/main/java/org/apache/geronimo/jetty8/handler/GeronimoWebAppContext.java @@ -379,7 +379,13 @@ protected void addRoles(String... roles) { private Resource lookupResource(String uriInContext) { Bundle bundle = integrationContext.getBundle(); - URL url = BundleUtils.getEntry(bundle, uriInContext); + URL url; + try { + url = BundleUtils.getEntry(bundle, uriInContext); + } catch (MalformedURLException e) { + logger.warn("MalformedURLException when getting entry:" + uriInContext + " from bundle " + bundle.getSymbolicName(), e); + url = null; + } if (url == null) { url = bundle.getResource("META-INF/resources" + uriInContext); if (url == null) { diff --git a/plugins/tomcat/geronimo-tomcat7-builder/src/main/java/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilder.java b/plugins/tomcat/geronimo-tomcat7-builder/src/main/java/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilder.java index 47c34f849e..0ea4ba95cd 100644 --- a/plugins/tomcat/geronimo-tomcat7-builder/src/main/java/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilder.java +++ b/plugins/tomcat/geronimo-tomcat7-builder/src/main/java/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilder.java @@ -212,7 +212,13 @@ public Module createModule(Bundle bundle, Naming naming, ModuleIDBuilder idBuild String specDD = null; WebApp webApp = null; - URL specDDUrl = BundleUtils.getEntry(bundle, "WEB-INF/web.xml"); + URL specDDUrl; + try { + specDDUrl = BundleUtils.getEntry(bundle, "WEB-INF/web.xml"); + } catch (MalformedURLException e) { + log.warn("MalformedURLException when getting entry:" + "WEB-INF/web.xml" + " from bundle " + bundle.getSymbolicName(), e); + specDDUrl = null; + } if (specDDUrl == null) { webApp = new WebApp(); } else { diff --git a/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/BundleDirContext.java b/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/BundleDirContext.java index 3ef5223f78..9db128e932 100644 --- a/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/BundleDirContext.java +++ b/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/BundleDirContext.java @@ -21,6 +21,7 @@ import java.io.File; import java.io.IOException; import java.io.InputStream; +import java.net.MalformedURLException; import java.net.URL; import java.util.Collections; import java.util.Enumeration; @@ -233,7 +234,13 @@ public void unbind(String arg0) throws NamingException { @Override protected Attributes doGetAttributes(String name, String[] attrIds) throws NamingException { name = getName(name); - URL url = BundleUtils.getEntry(bundle, name); + URL url; + try { + url = BundleUtils.getEntry(bundle, name); + } catch (MalformedURLException e) { + logger.warn("MalformedURLException when getting entry:" + name + " from bundle " + bundle.getSymbolicName(), e); + url = null; + } if (url == null) { return null; } @@ -264,7 +271,13 @@ protected List doListBindings(String name) throws NamingException { @Override protected Object doLookup(String name) { name = getName(name); - URL url = BundleUtils.getEntry(bundle, name); + URL url; + try { + url = BundleUtils.getEntry(bundle, name); + } catch (MalformedURLException e) { + logger.warn("MalformedURLException when getting entry:" + name + " from bundle " + bundle.getSymbolicName(), e); + url = null; + } if (url == null) { return null; }