Skip to content

Commit

Permalink
Merge changes from GERONIMO-6341 orm.xml does not take effect in late…
Browse files Browse the repository at this point in the history
…st Geronimo 3.0 beta branch.

git-svn-id: https://svn.apache.org/repos/asf/geronimo/server/trunk@1341511 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
Haihong Xu committed May 22, 2012
1 parent 688bf80 commit 2fc85d2
Show file tree
Hide file tree
Showing 7 changed files with 63 additions and 12 deletions.
Expand Up @@ -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) {
Expand Down
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down
Expand Up @@ -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);
Expand Down
Expand Up @@ -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;
Expand Down Expand Up @@ -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());
}

Expand All @@ -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() {
Expand All @@ -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 {
Expand Down Expand Up @@ -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;
}
}
Expand Down
Expand Up @@ -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) {
Expand Down
Expand Up @@ -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 {
Expand Down
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
}
Expand Down Expand Up @@ -264,7 +271,13 @@ protected List<NamingEntry> 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;
}
Expand Down

0 comments on commit 2fc85d2

Please sign in to comment.