You are viewing a plain text version of this content. The canonical link for it is here.
Posted to scm@geronimo.apache.org by ge...@apache.org on 2012/04/28 04:17:13 UTC
svn commit: r1331657 - in /geronimo/server/branches/3.0-beta: ./
framework/modules/geronimo-deployment/src/main/java/org/apache/geronimo/deployment/
framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/
framework/modules/ge...
Author: genspring
Date: Sat Apr 28 02:17:12 2012
New Revision: 1331657
URL: http://svn.apache.org/viewvc?rev=1331657&view=rev
Log:
GERONIMO-6341 orm.xml does not take effect in latest Geronimo 3.0 beta branch.
1, Move reference based bundle utils methods from geornimo kernel to xbean bundle-utils
2, Change the xbean dependency to latest snapshot to pick up the xbean bundle-utils changes in rev.1331428
Modified:
geronimo/server/branches/3.0-beta/framework/modules/geronimo-deployment/src/main/java/org/apache/geronimo/deployment/DeployableBundle.java
geronimo/server/branches/3.0-beta/framework/modules/geronimo-deployment/src/main/java/org/apache/geronimo/deployment/DeploymentContext.java
geronimo/server/branches/3.0-beta/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/Configuration.java
geronimo/server/branches/3.0-beta/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/SimpleConfigurationManager.java
geronimo/server/branches/3.0-beta/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/util/BundleUtil.java
geronimo/server/branches/3.0-beta/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/configuration/DependencyManager.java
geronimo/server/branches/3.0-beta/plugins/aries/geronimo-aries/src/main/java/org/apache/geronimo/aries/GeronimoApplication.java
geronimo/server/branches/3.0-beta/plugins/axis2/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/AxisServiceGenerator.java
geronimo/server/branches/3.0-beta/plugins/cxf/geronimo-cxf/src/main/java/org/apache/geronimo/cxf/CXFEndpoint.java
geronimo/server/branches/3.0-beta/plugins/jaxws/geronimo-jaxws/src/main/java/org/apache/geronimo/jaxws/client/JAXWSServiceReference.java
geronimo/server/branches/3.0-beta/plugins/jetty8/geronimo-jetty8-builder/src/main/java/org/apache/geronimo/jetty8/deployment/JettyModuleBuilder.java
geronimo/server/branches/3.0-beta/plugins/jetty8/geronimo-jetty8/src/main/java/org/apache/geronimo/jetty8/handler/GeronimoWebAppContext.java
geronimo/server/branches/3.0-beta/plugins/openjpa2/geronimo-persistence-jpa20-builder/src/main/java/org/apache/geronimo/persistence/builder/PersistenceUnitBuilder.java
geronimo/server/branches/3.0-beta/plugins/openjpa2/geronimo-persistence-jpa20/src/main/java/org/apache/geronimo/persistence/PersistenceUnitGBean.java
geronimo/server/branches/3.0-beta/plugins/tomcat/geronimo-tomcat7-builder/src/main/java/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilder.java
geronimo/server/branches/3.0-beta/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/BundleDirContext.java
geronimo/server/branches/3.0-beta/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/GeronimoStandardContext.java
geronimo/server/branches/3.0-beta/pom.xml
Modified: geronimo/server/branches/3.0-beta/framework/modules/geronimo-deployment/src/main/java/org/apache/geronimo/deployment/DeployableBundle.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/3.0-beta/framework/modules/geronimo-deployment/src/main/java/org/apache/geronimo/deployment/DeployableBundle.java?rev=1331657&r1=1331656&r2=1331657&view=diff
==============================================================================
--- geronimo/server/branches/3.0-beta/framework/modules/geronimo-deployment/src/main/java/org/apache/geronimo/deployment/DeployableBundle.java (original)
+++ geronimo/server/branches/3.0-beta/framework/modules/geronimo-deployment/src/main/java/org/apache/geronimo/deployment/DeployableBundle.java Sat Apr 28 02:17:12 2012
@@ -16,16 +16,21 @@
*/
package org.apache.geronimo.deployment;
+import java.net.MalformedURLException;
import java.net.URL;
import org.apache.xbean.osgi.bundle.util.BundleUtils;
import org.osgi.framework.Bundle;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
/**
* @version $Rev:386276 $ $Date$
*/
public class DeployableBundle implements Deployable {
+ private static final Logger logger = LoggerFactory.getLogger(DeployableBundle.class);
+
private Bundle bundle;
public DeployableBundle(Bundle bundle) {
@@ -33,7 +38,12 @@ public class DeployableBundle implements
}
public URL getResource(String name) {
- return BundleUtils.getEntry(bundle, name);
+ try {
+ return BundleUtils.getEntry(bundle, name);
+ } catch (MalformedURLException e) {
+ logger.warn("MalformedURLException when getting entry:" + name + " from bundle " + bundle.getSymbolicName(), e);
+ return null;
+ }
}
public void close() {
Modified: geronimo/server/branches/3.0-beta/framework/modules/geronimo-deployment/src/main/java/org/apache/geronimo/deployment/DeploymentContext.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/3.0-beta/framework/modules/geronimo-deployment/src/main/java/org/apache/geronimo/deployment/DeploymentContext.java?rev=1331657&r1=1331656&r2=1331657&view=diff
==============================================================================
--- geronimo/server/branches/3.0-beta/framework/modules/geronimo-deployment/src/main/java/org/apache/geronimo/deployment/DeploymentContext.java (original)
+++ geronimo/server/branches/3.0-beta/framework/modules/geronimo-deployment/src/main/java/org/apache/geronimo/deployment/DeploymentContext.java Sat Apr 28 02:17:12 2012
@@ -68,7 +68,6 @@ import org.apache.geronimo.kernel.reposi
import org.apache.geronimo.kernel.repository.Dependency;
import org.apache.geronimo.kernel.repository.Environment;
import org.apache.geronimo.kernel.repository.Repository;
-import org.apache.geronimo.kernel.util.BundleUtil;
import org.apache.geronimo.system.plugin.model.ArtifactType;
import org.apache.geronimo.system.plugin.model.DependencyType;
import org.apache.geronimo.system.plugin.model.PluginArtifactType;
@@ -199,7 +198,7 @@ public class DeploymentContext {
ConfigurationData configurationData = new ConfigurationData(moduleType, null, childConfigurationDatas, environment, baseDir, inPlaceConfigurationDir, naming);
createTempManifest();
createPluginMetadata();
- String location = BundleUtil.toReferenceFileLocation(getConfigurationDir());
+ String location = BundleUtils.toReferenceFileLocation(getConfigurationDir());
tempBundle = bundleContext.installBundle(location);
if (BundleUtils.canStart(tempBundle)) {
tempBundle.start(Bundle.START_TRANSIENT);
Modified: geronimo/server/branches/3.0-beta/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/Configuration.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/3.0-beta/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/Configuration.java?rev=1331657&r1=1331656&r2=1331657&view=diff
==============================================================================
--- geronimo/server/branches/3.0-beta/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/Configuration.java (original)
+++ geronimo/server/branches/3.0-beta/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/Configuration.java Sat Apr 28 02:17:12 2012
@@ -45,7 +45,7 @@ import org.apache.geronimo.kernel.Naming
import org.apache.geronimo.kernel.repository.Artifact;
import org.apache.geronimo.kernel.repository.Environment;
import org.apache.geronimo.kernel.repository.MissingDependencyException;
-import org.apache.geronimo.kernel.util.BundleUtil;
+import org.apache.xbean.osgi.bundle.util.BundleUtils;
import org.apache.xbean.osgi.bundle.util.DelegatingBundle;
import org.osgi.framework.Bundle;
import org.osgi.framework.BundleContext;
@@ -276,7 +276,7 @@ public class Configuration implements GB
}
try {
File file = configurationResolver.resolve(configurationId);
- return BundleUtil.toReferenceFileLocation(file);
+ return BundleUtils.toReferenceFileLocation(file);
} catch (MissingDependencyException e) {
return null;
} catch (IOException e) {
Modified: geronimo/server/branches/3.0-beta/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/SimpleConfigurationManager.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/3.0-beta/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/SimpleConfigurationManager.java?rev=1331657&r1=1331656&r2=1331657&view=diff
==============================================================================
--- geronimo/server/branches/3.0-beta/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/SimpleConfigurationManager.java (original)
+++ geronimo/server/branches/3.0-beta/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/SimpleConfigurationManager.java Sat Apr 28 02:17:12 2012
@@ -42,7 +42,6 @@ import org.apache.geronimo.kernel.reposi
import org.apache.geronimo.kernel.repository.MissingDependencyException;
import org.apache.geronimo.kernel.repository.Repository;
import org.apache.geronimo.kernel.repository.Version;
-import org.apache.geronimo.kernel.util.BundleUtil;
import org.apache.xbean.osgi.bundle.util.BundleUtils;
import org.osgi.framework.Bundle;
import org.osgi.framework.BundleContext;
@@ -625,7 +624,7 @@ public class SimpleConfigurationManager
monitor.reading(configurationId);
for (Repository repo : repositories) {
if (repo.contains(configurationId)) {
- return BundleUtil.toReferenceFileLocation(repo.getLocation(configurationId));
+ return BundleUtils.toReferenceFileLocation(repo.getLocation(configurationId));
}
}
NoSuchConfigException exception = new NoSuchConfigException(configurationId);
Modified: geronimo/server/branches/3.0-beta/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/util/BundleUtil.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/3.0-beta/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/util/BundleUtil.java?rev=1331657&r1=1331656&r2=1331657&view=diff
==============================================================================
--- geronimo/server/branches/3.0-beta/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/util/BundleUtil.java (original)
+++ geronimo/server/branches/3.0-beta/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/util/BundleUtil.java Sat Apr 28 02:17:12 2012
@@ -17,13 +17,7 @@
package org.apache.geronimo.kernel.util;
-import java.io.File;
-import java.io.IOException;
-import java.net.MalformedURLException;
-import java.net.URL;
-
import org.apache.geronimo.kernel.repository.Artifact;
-import org.osgi.framework.Bundle;
import org.osgi.framework.Version;
/**
@@ -36,12 +30,6 @@ public class BundleUtil {
public final static String EBA_GROUP_ID = "application";
- public final static String REFERENCE_SCHEME = "reference:";
-
- public final static String FILE_SCHEMA = "file:";
-
- public final static String REFERENCE_FILE_SCHEMA = "reference:file:";
-
public static String getVersion(org.osgi.framework.Version version) {
String str = version.getMajor() + "." + version.getMinor() + "." + version.getMicro();
String qualifier = version.getQualifier();
@@ -54,63 +42,5 @@ public class BundleUtil {
public static Artifact createArtifact(String group, String symbolicName, Version version) {
return new Artifact(group, symbolicName, getVersion(version), "eba");
}
-
- public static File toFile(Bundle bundle) {
- return toFile(bundle.getLocation());
- }
-
- public static File toFile(URL url) {
- return toFile(url.toExternalForm());
- }
-
- /**
- * Translate the reference:file:// style URL to the underlying file instance
- * @param url
- * @return
- */
- public static File toFile(String url) {
- if (url.startsWith(REFERENCE_FILE_SCHEMA)) {
- File file = new File(url.substring(REFERENCE_FILE_SCHEMA.length()));
- if (file.exists()) {
- return file;
- }
- }
- return null;
- }
-
- public static String toReferenceFileLocation(File file) throws IOException {
- if (!file.exists()) {
- throw new IOException("file not exist " + file.getAbsolutePath());
- }
- return REFERENCE_SCHEME + file.toURI();
- }
-
- public static URL getEntry(Bundle bundle, String name) throws MalformedURLException {
- File bundleFile = toFile(bundle);
- if (bundleFile != null && bundleFile.isDirectory()) {
- File entryFile = new File(bundleFile, name);
- if (entryFile.exists()) {
- return entryFile.toURI().toURL();
- } else {
- return null;
- }
- }
- return bundle.getEntry(name);
- }
-
- public static URL getNestedEntry(Bundle bundle, String jarEntryName, String subEntryName) throws MalformedURLException {
- File bundleFile = toFile(bundle);
- if (bundleFile != null && bundleFile.isDirectory()) {
- File entryFile = new File(bundleFile, jarEntryName);
- if (entryFile.exists()) {
- if (entryFile.isFile()) {
- return new URL("jar:" + entryFile.toURI().toURL() + "!/" + subEntryName);
- } else {
- return new File(entryFile, subEntryName).toURI().toURL();
- }
- }
- return null;
- }
- return new URL("jar:" + bundle.getEntry(jarEntryName).toString() + "!/" + subEntryName);
- }
+
}
Modified: geronimo/server/branches/3.0-beta/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/configuration/DependencyManager.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/3.0-beta/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/configuration/DependencyManager.java?rev=1331657&r1=1331656&r2=1331657&view=diff
==============================================================================
--- geronimo/server/branches/3.0-beta/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/configuration/DependencyManager.java (original)
+++ geronimo/server/branches/3.0-beta/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/configuration/DependencyManager.java Sat Apr 28 02:17:12 2012
@@ -213,9 +213,9 @@ public class DependencyManager implement
}
return new Artifact(artifactFragments[0], artifactFragments[1], artifactFragments.length > 2 ? artifactFragments[2] : "",
artifactFragments.length > 3 && artifactFragments[3].length() > 0 ? artifactFragments[3] : "jar");
- } else if(installationLocation.startsWith(BundleUtil.REFERENCE_SCHEME)) {
+ } else if(installationLocation.startsWith(BundleUtils.REFERENCE_SCHEME)) {
//TODO a better way for this ???
- String bundleFilePath = BundleUtil.toFile(installationLocation).getAbsolutePath();
+ String bundleFilePath = BundleUtils.toFile(installationLocation).getAbsolutePath();
for (Repository repo : repositories) {
if (repo instanceof AbstractRepository) {
File rootFile = ((AbstractRepository) repo).getRootFile();
@@ -534,7 +534,7 @@ public class DependencyManager implement
private String locateBundle(Artifact configurationId) throws NoSuchConfigException, IOException, InvalidConfigException {
for (Repository repo : repositories) {
if (repo.contains(configurationId)) {
- return BundleUtil.toReferenceFileLocation(repo.getLocation(configurationId));
+ return BundleUtils.toReferenceFileLocation(repo.getLocation(configurationId));
}
}
throw new NoSuchConfigException(configurationId);
Modified: geronimo/server/branches/3.0-beta/plugins/aries/geronimo-aries/src/main/java/org/apache/geronimo/aries/GeronimoApplication.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/3.0-beta/plugins/aries/geronimo-aries/src/main/java/org/apache/geronimo/aries/GeronimoApplication.java?rev=1331657&r1=1331656&r2=1331657&view=diff
==============================================================================
--- geronimo/server/branches/3.0-beta/plugins/aries/geronimo-aries/src/main/java/org/apache/geronimo/aries/GeronimoApplication.java (original)
+++ geronimo/server/branches/3.0-beta/plugins/aries/geronimo-aries/src/main/java/org/apache/geronimo/aries/GeronimoApplication.java Sat Apr 28 02:17:12 2012
@@ -36,7 +36,7 @@ import org.apache.aries.application.util
import org.apache.aries.application.utils.filesystem.IOUtils;
import org.apache.aries.application.utils.management.SimpleBundleInfo;
import org.apache.aries.application.utils.manifest.BundleManifest;
-import org.apache.geronimo.kernel.util.BundleUtil;
+import org.apache.xbean.osgi.bundle.util.BundleUtils;
import org.osgi.framework.Bundle;
/**
@@ -65,7 +65,7 @@ public class GeronimoApplication impleme
bundleInfo = new HashSet<BundleInfo>();
boolean bundleInfoCollected = false;
- File bundleFile = BundleUtil.toFile(bundle);
+ File bundleFile = BundleUtils.toFile(bundle);
if (bundleFile != null && bundleFile.isDirectory()) {
collectFileSystemBasedBundleInfos(bundleFile, applicationFactory);
bundleInfoCollected = true;
@@ -117,7 +117,7 @@ public class GeronimoApplication impleme
}
BundleManifest bm = BundleManifest.fromBundle(file);
if (bm != null && bm.isValid()) {
- bundleInfo.add(new SimpleBundleInfo(applicationFactory, bm, BundleUtil.toReferenceFileLocation(file)));
+ bundleInfo.add(new SimpleBundleInfo(applicationFactory, bm, BundleUtils.toReferenceFileLocation(file)));
}
}
}
Modified: geronimo/server/branches/3.0-beta/plugins/axis2/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/AxisServiceGenerator.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/3.0-beta/plugins/axis2/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/AxisServiceGenerator.java?rev=1331657&r1=1331656&r2=1331657&view=diff
==============================================================================
--- geronimo/server/branches/3.0-beta/plugins/axis2/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/AxisServiceGenerator.java (original)
+++ geronimo/server/branches/3.0-beta/plugins/axis2/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/AxisServiceGenerator.java Sat Apr 28 02:17:12 2012
@@ -327,7 +327,13 @@ public class AxisServiceGenerator
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) {
Modified: geronimo/server/branches/3.0-beta/plugins/cxf/geronimo-cxf/src/main/java/org/apache/geronimo/cxf/CXFEndpoint.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/3.0-beta/plugins/cxf/geronimo-cxf/src/main/java/org/apache/geronimo/cxf/CXFEndpoint.java?rev=1331657&r1=1331656&r2=1331657&view=diff
==============================================================================
--- geronimo/server/branches/3.0-beta/plugins/cxf/geronimo-cxf/src/main/java/org/apache/geronimo/cxf/CXFEndpoint.java (original)
+++ geronimo/server/branches/3.0-beta/plugins/cxf/geronimo-cxf/src/main/java/org/apache/geronimo/cxf/CXFEndpoint.java Sat Apr 28 02:17:12 2012
@@ -1,236 +1,244 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.geronimo.cxf;
-
-import java.net.MalformedURLException;
-import java.net.URI;
-import java.net.URL;
-import java.util.List;
-import java.util.concurrent.Executor;
-
-import javax.xml.ws.Binding;
-import javax.xml.ws.WebServiceException;
-import javax.xml.ws.handler.Handler;
-import javax.xml.ws.http.HTTPBinding;
-import javax.xml.ws.soap.SOAPBinding;
-
-import org.apache.cxf.Bus;
-import org.apache.cxf.endpoint.Server;
-import org.apache.cxf.endpoint.ServerImpl;
-import org.apache.cxf.jaxws.JaxWsServerFactoryBean;
-import org.apache.cxf.jaxws.handler.PortInfoImpl;
-import org.apache.cxf.jaxws.support.JaxWsEndpointImpl;
-import org.apache.cxf.jaxws.support.JaxWsImplementorInfo;
-import org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean;
-import org.apache.cxf.service.Service;
-import org.apache.geronimo.jaxws.PortInfo;
-import org.apache.geronimo.jaxws.annotations.AnnotationException;
-import org.apache.geronimo.jaxws.annotations.AnnotationProcessor;
-import org.apache.geronimo.jaxws.handler.GeronimoHandlerResolver;
-import org.apache.xbean.osgi.bundle.util.BundleUtils;
-import org.osgi.framework.Bundle;
-
-public abstract class CXFEndpoint {
-
- protected Bus bus;
-
- protected Object implementor;
-
- protected Server server;
-
- protected Service service;
-
- protected JaxWsImplementorInfo implInfo;
-
- protected JaxWsServiceFactoryBean serviceFactory;
-
- protected PortInfo portInfo;
-
- protected AnnotationProcessor annotationProcessor;
-
- private String address;
-
- private Bundle bundle;
-
- public CXFEndpoint(Bus bus, Object implementor, Bundle bundle) {
- this.bus = bus;
- this.implementor = implementor;
- this.portInfo = bus.getExtension(PortInfo.class);
- this.bundle = bundle;
- this.bus.setExtension(this, CXFEndpoint.class);
- }
-
- protected URL getWsdlURL(Bundle bundle, String wsdlFile) {
- if (wsdlFile == null || wsdlFile.trim().length() == 0) {
- return null;
- }
- URL wsdlURL = null;
- wsdlFile = wsdlFile.trim();
- try {
- wsdlURL = new URL(wsdlFile);
- } catch (MalformedURLException e) {
- // Not a URL, try as a resource
- wsdlURL = bundle.getResource("/" + wsdlFile);
- if (wsdlURL == null) {
- wsdlURL = BundleUtils.getEntry(bundle, wsdlFile);
- }
- }
- return wsdlURL;
- }
-
- protected Class getImplementorClass() {
- return this.implementor.getClass();
- }
-
- protected org.apache.cxf.endpoint.Endpoint getEndpoint() {
- return (getServer()).getEndpoint();
- }
-
- public boolean isSOAP11() {
- return SOAPBinding.SOAP11HTTP_BINDING.equals(implInfo.getBindingType()) ||
- SOAPBinding.SOAP11HTTP_MTOM_BINDING.equals(implInfo.getBindingType());
- }
-
- public boolean isHTTP() {
- return HTTPBinding.HTTP_BINDING.equals(implInfo.getBindingType());
- }
-
- public ServerImpl getServer() {
- return (ServerImpl) server;
- }
-
- public Binding getBinding() {
- return ((JaxWsEndpointImpl) getEndpoint()).getJaxwsBinding();
- }
-
- public void setExecutor(Executor executor) {
- service.setExecutor(executor);
- }
-
- public Executor getExecutor() {
- return service.getExecutor();
- }
-
- public Object getImplementor() {
- return implementor;
- }
-
- public boolean isPublished() {
- return server != null;
- }
-
- public void publish(String address) {
- doPublish(address);
- }
-
- private static class GeronimoJaxWsServerFactoryBean extends JaxWsServerFactoryBean {
- public GeronimoJaxWsServerFactoryBean() {
- // disable CXF resource injection
- doInit = false;
- }
- }
-
- protected void doPublish(String baseAddress) {
- // XXX: assume port 8080 by default since we don't know the actual port at startup
- String address = (baseAddress == null) ? "http://localhost:8080" : baseAddress;
-
- JaxWsServerFactoryBean svrFactory = new GeronimoJaxWsServerFactoryBean();
- svrFactory.setBus(bus);
- svrFactory.setAddress(address + this.portInfo.getLocation());
- svrFactory.setServiceFactory(serviceFactory);
- svrFactory.setStart(false);
- svrFactory.setServiceBean(implementor);
-
- if (HTTPBinding.HTTP_BINDING.equals(implInfo.getBindingType())) {
- svrFactory.setTransportId("http://cxf.apache.org/bindings/xformat");
- }
-
- server = svrFactory.create();
-
- init();
-
- //org.apache.cxf.endpoint.Endpoint endpoint = getEndpoint();
-
- if (getBinding() instanceof SOAPBinding && this.portInfo.getMtomFeatureInfo() != null) {
- ((SOAPBinding) getBinding()).setMTOMEnabled(this.portInfo.getMtomFeatureInfo().isEnabled());
- }
-
- server.start();
- }
-
- protected void init() {
- }
-
- /*
- * Update service's address on the very first invocation. The address
- * assumed at start up might not be valid.
- */
- synchronized void updateAddress(URI request) {
- if (this.address == null) {
- String requestAddress = CXFWebServiceContainer.getBaseUri(request);
- getEndpoint().getEndpointInfo().setAddress(requestAddress);
- this.address = requestAddress;
- }
- }
-
- /*
- * Set appropriate handlers for the port/service/bindings.
- */
- protected void initHandlers() throws Exception {
- GeronimoHandlerResolver handlerResolver = new GeronimoHandlerResolver(bundle, getImplementorClass(), portInfo.getHandlerChainsInfo(), null);
- PortInfoImpl portInfo = new PortInfoImpl(implInfo.getBindingType(),
- serviceFactory.getEndpointName(),
- service.getName());
- List<Handler> chain = handlerResolver.getHandlerChain(portInfo);
- getBinding().setHandlerChain(chain);
- }
-
- protected void injectResources(Object instance) throws AnnotationException {
- this.annotationProcessor.processAnnotations(instance);
- this.annotationProcessor.invokePostConstruct(instance);
- }
-
- protected void injectHandlers() {
- List<Handler> handlers = getBinding().getHandlerChain();
- try {
- for (Handler handler : handlers) {
- injectResources(handler);
- }
- } catch (AnnotationException e) {
- throw new WebServiceException("Handler annotation failed", e);
- }
- }
-
- protected void destroyHandlers() {
- if (this.annotationProcessor != null) {
- // call handlers preDestroy
- List<Handler> handlers = getBinding().getHandlerChain();
- for (Handler handler : handlers) {
- this.annotationProcessor.invokePreDestroy(handler);
- }
- }
- }
-
- public void stop() {
- // shutdown server
- if (this.server != null) {
- this.server.stop();
- }
- }
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.geronimo.cxf;
+
+import java.net.MalformedURLException;
+import java.net.URI;
+import java.net.URL;
+import java.util.List;
+import java.util.concurrent.Executor;
+
+import javax.xml.ws.Binding;
+import javax.xml.ws.WebServiceException;
+import javax.xml.ws.handler.Handler;
+import javax.xml.ws.http.HTTPBinding;
+import javax.xml.ws.soap.SOAPBinding;
+
+import org.apache.cxf.Bus;
+import org.apache.cxf.endpoint.Server;
+import org.apache.cxf.endpoint.ServerImpl;
+import org.apache.cxf.jaxws.JaxWsServerFactoryBean;
+import org.apache.cxf.jaxws.handler.PortInfoImpl;
+import org.apache.cxf.jaxws.support.JaxWsEndpointImpl;
+import org.apache.cxf.jaxws.support.JaxWsImplementorInfo;
+import org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean;
+import org.apache.cxf.service.Service;
+import org.apache.geronimo.jaxws.PortInfo;
+import org.apache.geronimo.jaxws.annotations.AnnotationException;
+import org.apache.geronimo.jaxws.annotations.AnnotationProcessor;
+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;
+
+ protected Server server;
+
+ protected Service service;
+
+ protected JaxWsImplementorInfo implInfo;
+
+ protected JaxWsServiceFactoryBean serviceFactory;
+
+ protected PortInfo portInfo;
+
+ protected AnnotationProcessor annotationProcessor;
+
+ private String address;
+
+ private Bundle bundle;
+
+ public CXFEndpoint(Bus bus, Object implementor, Bundle bundle) {
+ this.bus = bus;
+ this.implementor = implementor;
+ this.portInfo = bus.getExtension(PortInfo.class);
+ this.bundle = bundle;
+ this.bus.setExtension(this, CXFEndpoint.class);
+ }
+
+ protected URL getWsdlURL(Bundle bundle, String wsdlFile) {
+ if (wsdlFile == null || wsdlFile.trim().length() == 0) {
+ return null;
+ }
+ URL wsdlURL = null;
+ wsdlFile = wsdlFile.trim();
+ try {
+ wsdlURL = new URL(wsdlFile);
+ } catch (MalformedURLException e) {
+ // Not a URL, try as a resource
+ wsdlURL = bundle.getResource("/" + wsdlFile);
+ if (wsdlURL == null) {
+ try {
+ wsdlURL = BundleUtils.getEntry(bundle, wsdlFile);
+ } catch (MalformedURLException e1) {
+ log.warn("MalformedURLException when getting entry:" + wsdlFile + " from bundle " + bundle.getSymbolicName(), e);
+ }
+ }
+ }
+ return wsdlURL;
+ }
+
+ protected Class getImplementorClass() {
+ return this.implementor.getClass();
+ }
+
+ protected org.apache.cxf.endpoint.Endpoint getEndpoint() {
+ return (getServer()).getEndpoint();
+ }
+
+ public boolean isSOAP11() {
+ return SOAPBinding.SOAP11HTTP_BINDING.equals(implInfo.getBindingType()) ||
+ SOAPBinding.SOAP11HTTP_MTOM_BINDING.equals(implInfo.getBindingType());
+ }
+
+ public boolean isHTTP() {
+ return HTTPBinding.HTTP_BINDING.equals(implInfo.getBindingType());
+ }
+
+ public ServerImpl getServer() {
+ return (ServerImpl) server;
+ }
+
+ public Binding getBinding() {
+ return ((JaxWsEndpointImpl) getEndpoint()).getJaxwsBinding();
+ }
+
+ public void setExecutor(Executor executor) {
+ service.setExecutor(executor);
+ }
+
+ public Executor getExecutor() {
+ return service.getExecutor();
+ }
+
+ public Object getImplementor() {
+ return implementor;
+ }
+
+ public boolean isPublished() {
+ return server != null;
+ }
+
+ public void publish(String address) {
+ doPublish(address);
+ }
+
+ private static class GeronimoJaxWsServerFactoryBean extends JaxWsServerFactoryBean {
+ public GeronimoJaxWsServerFactoryBean() {
+ // disable CXF resource injection
+ doInit = false;
+ }
+ }
+
+ protected void doPublish(String baseAddress) {
+ // XXX: assume port 8080 by default since we don't know the actual port at startup
+ String address = (baseAddress == null) ? "http://localhost:8080" : baseAddress;
+
+ JaxWsServerFactoryBean svrFactory = new GeronimoJaxWsServerFactoryBean();
+ svrFactory.setBus(bus);
+ svrFactory.setAddress(address + this.portInfo.getLocation());
+ svrFactory.setServiceFactory(serviceFactory);
+ svrFactory.setStart(false);
+ svrFactory.setServiceBean(implementor);
+
+ if (HTTPBinding.HTTP_BINDING.equals(implInfo.getBindingType())) {
+ svrFactory.setTransportId("http://cxf.apache.org/bindings/xformat");
+ }
+
+ server = svrFactory.create();
+
+ init();
+
+ //org.apache.cxf.endpoint.Endpoint endpoint = getEndpoint();
+
+ if (getBinding() instanceof SOAPBinding && this.portInfo.getMtomFeatureInfo() != null) {
+ ((SOAPBinding) getBinding()).setMTOMEnabled(this.portInfo.getMtomFeatureInfo().isEnabled());
+ }
+
+ server.start();
+ }
+
+ protected void init() {
+ }
+
+ /*
+ * Update service's address on the very first invocation. The address
+ * assumed at start up might not be valid.
+ */
+ synchronized void updateAddress(URI request) {
+ if (this.address == null) {
+ String requestAddress = CXFWebServiceContainer.getBaseUri(request);
+ getEndpoint().getEndpointInfo().setAddress(requestAddress);
+ this.address = requestAddress;
+ }
+ }
+
+ /*
+ * Set appropriate handlers for the port/service/bindings.
+ */
+ protected void initHandlers() throws Exception {
+ GeronimoHandlerResolver handlerResolver = new GeronimoHandlerResolver(bundle, getImplementorClass(), portInfo.getHandlerChainsInfo(), null);
+ PortInfoImpl portInfo = new PortInfoImpl(implInfo.getBindingType(),
+ serviceFactory.getEndpointName(),
+ service.getName());
+ List<Handler> chain = handlerResolver.getHandlerChain(portInfo);
+ getBinding().setHandlerChain(chain);
+ }
+
+ protected void injectResources(Object instance) throws AnnotationException {
+ this.annotationProcessor.processAnnotations(instance);
+ this.annotationProcessor.invokePostConstruct(instance);
+ }
+
+ protected void injectHandlers() {
+ List<Handler> handlers = getBinding().getHandlerChain();
+ try {
+ for (Handler handler : handlers) {
+ injectResources(handler);
+ }
+ } catch (AnnotationException e) {
+ throw new WebServiceException("Handler annotation failed", e);
+ }
+ }
+
+ protected void destroyHandlers() {
+ if (this.annotationProcessor != null) {
+ // call handlers preDestroy
+ List<Handler> handlers = getBinding().getHandlerChain();
+ for (Handler handler : handlers) {
+ this.annotationProcessor.invokePreDestroy(handler);
+ }
+ }
+ }
+
+ public void stop() {
+ // shutdown server
+ if (this.server != null) {
+ this.server.stop();
+ }
+ }
+}
Modified: geronimo/server/branches/3.0-beta/plugins/jaxws/geronimo-jaxws/src/main/java/org/apache/geronimo/jaxws/client/JAXWSServiceReference.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/3.0-beta/plugins/jaxws/geronimo-jaxws/src/main/java/org/apache/geronimo/jaxws/client/JAXWSServiceReference.java?rev=1331657&r1=1331656&r2=1331657&view=diff
==============================================================================
--- geronimo/server/branches/3.0-beta/plugins/jaxws/geronimo-jaxws/src/main/java/org/apache/geronimo/jaxws/client/JAXWSServiceReference.java (original)
+++ geronimo/server/branches/3.0-beta/plugins/jaxws/geronimo-jaxws/src/main/java/org/apache/geronimo/jaxws/client/JAXWSServiceReference.java Sat Apr 28 02:17:12 2012
@@ -106,7 +106,12 @@ public abstract class JAXWSServiceRefere
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);
Modified: geronimo/server/branches/3.0-beta/plugins/jetty8/geronimo-jetty8-builder/src/main/java/org/apache/geronimo/jetty8/deployment/JettyModuleBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/3.0-beta/plugins/jetty8/geronimo-jetty8-builder/src/main/java/org/apache/geronimo/jetty8/deployment/JettyModuleBuilder.java?rev=1331657&r1=1331656&r2=1331657&view=diff
==============================================================================
--- geronimo/server/branches/3.0-beta/plugins/jetty8/geronimo-jetty8-builder/src/main/java/org/apache/geronimo/jetty8/deployment/JettyModuleBuilder.java (original)
+++ geronimo/server/branches/3.0-beta/plugins/jetty8/geronimo-jetty8-builder/src/main/java/org/apache/geronimo/jetty8/deployment/JettyModuleBuilder.java Sat Apr 28 02:17:12 2012
@@ -20,6 +20,7 @@ package org.apache.geronimo.jetty8.deplo
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;
@@ -200,7 +201,14 @@ public class JettyModuleBuilder extends
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 {
Modified: geronimo/server/branches/3.0-beta/plugins/jetty8/geronimo-jetty8/src/main/java/org/apache/geronimo/jetty8/handler/GeronimoWebAppContext.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/3.0-beta/plugins/jetty8/geronimo-jetty8/src/main/java/org/apache/geronimo/jetty8/handler/GeronimoWebAppContext.java?rev=1331657&r1=1331656&r2=1331657&view=diff
==============================================================================
--- geronimo/server/branches/3.0-beta/plugins/jetty8/geronimo-jetty8/src/main/java/org/apache/geronimo/jetty8/handler/GeronimoWebAppContext.java (original)
+++ geronimo/server/branches/3.0-beta/plugins/jetty8/geronimo-jetty8/src/main/java/org/apache/geronimo/jetty8/handler/GeronimoWebAppContext.java Sat Apr 28 02:17:12 2012
@@ -379,7 +379,13 @@ public class GeronimoWebAppContext exten
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) {
Modified: geronimo/server/branches/3.0-beta/plugins/openjpa2/geronimo-persistence-jpa20-builder/src/main/java/org/apache/geronimo/persistence/builder/PersistenceUnitBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/3.0-beta/plugins/openjpa2/geronimo-persistence-jpa20-builder/src/main/java/org/apache/geronimo/persistence/builder/PersistenceUnitBuilder.java?rev=1331657&r1=1331656&r2=1331657&view=diff
==============================================================================
--- geronimo/server/branches/3.0-beta/plugins/openjpa2/geronimo-persistence-jpa20-builder/src/main/java/org/apache/geronimo/persistence/builder/PersistenceUnitBuilder.java (original)
+++ geronimo/server/branches/3.0-beta/plugins/openjpa2/geronimo-persistence-jpa20-builder/src/main/java/org/apache/geronimo/persistence/builder/PersistenceUnitBuilder.java Sat Apr 28 02:17:12 2012
@@ -57,7 +57,6 @@ import org.apache.geronimo.kernel.Naming
import org.apache.geronimo.kernel.config.ConfigurationModuleType;
import org.apache.geronimo.kernel.config.ConfigurationStore;
import org.apache.geronimo.kernel.repository.Environment;
-import org.apache.geronimo.kernel.util.BundleUtil;
import org.apache.geronimo.kernel.util.IOUtils;
import org.apache.geronimo.naming.ResourceSource;
import org.apache.geronimo.persistence.PersistenceUnitGBean;
@@ -65,6 +64,7 @@ import org.apache.openejb.jee.JAXBContex
import org.apache.openejb.jee.JaxbJavaee;
import org.apache.openejb.jee.Persistence;
import org.apache.xbean.osgi.bundle.util.BundleResourceFinder;
+import org.apache.xbean.osgi.bundle.util.BundleUtils;
import org.apache.xbean.osgi.bundle.util.DiscoveryRange;
import org.apache.xbean.osgi.bundle.util.ResourceDiscoveryFilter;
import org.apache.xmlbeans.QNameSet;
@@ -198,7 +198,7 @@ public class PersistenceUnitBuilder impl
}
public boolean foundInJar(Bundle bundle, String jarName, ZipEntry entry, InputStream inputStream) throws Exception {
- URL url = BundleUtil.getNestedEntry(bundle, jarName, entry.getName());
+ URL url = BundleUtils.getNestedEntry(bundle, jarName, entry.getName());
persistenceURLs.put(url, jarName);
return true;
}
Modified: geronimo/server/branches/3.0-beta/plugins/openjpa2/geronimo-persistence-jpa20/src/main/java/org/apache/geronimo/persistence/PersistenceUnitGBean.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/3.0-beta/plugins/openjpa2/geronimo-persistence-jpa20/src/main/java/org/apache/geronimo/persistence/PersistenceUnitGBean.java?rev=1331657&r1=1331656&r2=1331657&view=diff
==============================================================================
--- geronimo/server/branches/3.0-beta/plugins/openjpa2/geronimo-persistence-jpa20/src/main/java/org/apache/geronimo/persistence/PersistenceUnitGBean.java (original)
+++ geronimo/server/branches/3.0-beta/plugins/openjpa2/geronimo-persistence-jpa20/src/main/java/org/apache/geronimo/persistence/PersistenceUnitGBean.java Sat Apr 28 02:17:12 2012
@@ -52,12 +52,12 @@ import org.apache.geronimo.gbean.annotat
import org.apache.geronimo.gbean.annotation.SpecialAttributeType;
import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
import org.apache.geronimo.kernel.classloader.TemporaryClassLoader;
-import org.apache.geronimo.kernel.util.BundleUtil;
import org.apache.geronimo.naming.ResourceSource;
import org.apache.geronimo.transaction.manager.TransactionManagerImpl;
import org.apache.geronimo.transformer.TransformerAgent;
import org.apache.xbean.osgi.bundle.util.BundleClassLoader;
import org.apache.xbean.osgi.bundle.util.BundleResourceHelper;
+import org.apache.xbean.osgi.bundle.util.BundleUtils;
import org.osgi.framework.Bundle;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -168,13 +168,13 @@ public class PersistenceUnitGBean implem
private static URL getPersistenceUnitRoot(Bundle bundle, String persistenceUnitRoot) throws MalformedURLException {
if (persistenceUnitRoot == null || persistenceUnitRoot.equals(".")) {
- return BundleUtil.getEntry(bundle, "/");
+ return BundleUtils.getEntry(bundle, "/");
} else {
// according to EJB3.0 Persistence Specification section 6.2
// 1. the root of a persistence unit could be the WEB-INF/classes directory of a WAR file
// 2. the root of a persistence unit could be EJB-JAR, APPCLIENT-JAR
// 3. the persistence unit can be a jar in the following 3 places: WEB-INF/lib directory of a war; root of a EAR; lib directory of a EAR
- return BundleUtil.getEntry(bundle, persistenceUnitRoot);
+ return BundleUtils.getEntry(bundle, persistenceUnitRoot);
}
}
@@ -324,7 +324,7 @@ public class PersistenceUnitGBean implem
// This classloader can only be used during PersistenceProvider.createContainerEntityManagerFactory() calls
// Possible that it could be cleaned up sooner, but for now it's destroyed when the PUGBean is stopped
- this.tempClassLoader = new TemporaryClassLoader(new BundleClassLoader(bundle,true,false));
+ this.tempClassLoader = new TemporaryClassLoader(new BundleClassLoader(bundle,true,true));
this.bundle = bundle;
}
Modified: geronimo/server/branches/3.0-beta/plugins/tomcat/geronimo-tomcat7-builder/src/main/java/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/3.0-beta/plugins/tomcat/geronimo-tomcat7-builder/src/main/java/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilder.java?rev=1331657&r1=1331656&r2=1331657&view=diff
==============================================================================
--- geronimo/server/branches/3.0-beta/plugins/tomcat/geronimo-tomcat7-builder/src/main/java/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilder.java (original)
+++ geronimo/server/branches/3.0-beta/plugins/tomcat/geronimo-tomcat7-builder/src/main/java/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilder.java Sat Apr 28 02:17:12 2012
@@ -22,6 +22,7 @@ import static java.lang.Boolean.TRUE;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
+import java.net.MalformedURLException;
import java.net.URL;
import java.util.Collection;
import java.util.Collections;
@@ -211,7 +212,13 @@ public class TomcatModuleBuilder extends
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 {
Modified: geronimo/server/branches/3.0-beta/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/BundleDirContext.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/3.0-beta/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/BundleDirContext.java?rev=1331657&r1=1331656&r2=1331657&view=diff
==============================================================================
--- geronimo/server/branches/3.0-beta/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/BundleDirContext.java (original)
+++ geronimo/server/branches/3.0-beta/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/BundleDirContext.java Sat Apr 28 02:17:12 2012
@@ -21,6 +21,7 @@ import java.io.ByteArrayOutputStream;
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 class BundleDirContext extends Ba
@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 @@ public class BundleDirContext extends Ba
@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;
}
Modified: geronimo/server/branches/3.0-beta/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/GeronimoStandardContext.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/3.0-beta/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/GeronimoStandardContext.java?rev=1331657&r1=1331656&r2=1331657&view=diff
==============================================================================
--- geronimo/server/branches/3.0-beta/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/GeronimoStandardContext.java (original)
+++ geronimo/server/branches/3.0-beta/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/GeronimoStandardContext.java Sat Apr 28 02:17:12 2012
@@ -74,7 +74,6 @@ import org.apache.catalina.valves.ValveB
import org.apache.geronimo.common.DeploymentException;
import org.apache.geronimo.common.GeronimoSecurityException;
import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
-import org.apache.geronimo.kernel.util.BundleUtil;
import org.apache.geronimo.kernel.util.FileUtils;
import org.apache.geronimo.kernel.util.IOUtils;
import org.apache.geronimo.kernel.util.JarUtils;
@@ -108,6 +107,7 @@ import org.apache.geronimo.webservices.W
import org.apache.naming.resources.FileDirContext;
import org.apache.tomcat.InstanceManager;
import org.apache.tomcat.util.IntrospectionUtils;
+import org.apache.xbean.osgi.bundle.util.BundleUtils;
import org.osgi.framework.Bundle;
import org.osgi.framework.BundleContext;
import org.osgi.framework.ServiceReference;
@@ -514,7 +514,7 @@ public class GeronimoStandardContext ext
}
protected DirContext createDirContext(TomcatContext tomcatContext) throws DeploymentException {
- File bundleFileRoot = BundleUtil.toFile(bundle);
+ File bundleFileRoot = BundleUtils.toFile(bundle);
if (bundleFileRoot != null) {
File applicationRoot = tomcatContext.getModulePath() == null ? bundleFileRoot : new File(bundleFileRoot, tomcatContext.getModulePath());
if (applicationRoot.exists() && applicationRoot.isDirectory()) {
@@ -636,7 +636,7 @@ public class GeronimoStandardContext ext
realPathTempDirectory.mkdirs();
String modulePath = tomcatContext.getModulePath() == null ? "" : tomcatContext.getModulePath();
try {
- File bundleFile = BundleUtil.toFile(bundle);
+ File bundleFile = BundleUtils.toFile(bundle);
if (bundleFile != null) {
if (bundleFile.isFile()) {
JarUtils.unzipToDirectory(new ZipFile(bundleFile), realPathTempDirectory, modulePath, true);
@@ -906,7 +906,7 @@ public class GeronimoStandardContext ext
InputStream in = null;
try {
URLConnection connection = url.openConnection();
- File file = BundleUtil.toFile(url);
+ File file = BundleUtils.toFile(url);
if (file != null) {
if (file.isFile()) {
in = new FileInputStream(file);
Modified: geronimo/server/branches/3.0-beta/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/server/branches/3.0-beta/pom.xml?rev=1331657&r1=1331656&r2=1331657&view=diff
==============================================================================
--- geronimo/server/branches/3.0-beta/pom.xml (original)
+++ geronimo/server/branches/3.0-beta/pom.xml Sat Apr 28 02:17:12 2012
@@ -77,7 +77,7 @@
<axis2Version>1.6.1_1</axis2Version>
<axiomVersion>1.2.12_1</axiomVersion>
<springVersion>2.5.6-SEC02</springVersion>
- <xbeanVersion>3.10</xbeanVersion>
+ <xbeanVersion>3.11-SNAPSHOT</xbeanVersion>
<jetty>jetty8</jetty>
<txmanagerVersion>3.1.1</txmanagerVersion>
<tranqlVersion>1.7</tranqlVersion>