You are viewing a plain text version of this content. The canonical link for it is here.
Posted to scm@geronimo.apache.org by jl...@apache.org on 2008/08/05 22:38:59 UTC
svn commit: r682936 - in /geronimo/sandbox/geronimo-netbeans-plugin:
nbproject/ src/org/apache/geronimo/netbeans/
src/org/apache/geronimo/netbeans/resources/
Author: jlaskowski
Date: Tue Aug 5 13:38:59 2008
New Revision: 682936
URL: http://svn.apache.org/viewvc?rev=682936&view=rev
Log:
(crazy world of classloaders)
Lots of hacks and workarounds to have a simple webapp deployed. It's nearly there, but still Geronimo spits exception that appropriate deployer is unavailable.
Modified:
geronimo/sandbox/geronimo-netbeans-plugin/nbproject/project.xml
geronimo/sandbox/geronimo-netbeans-plugin/src/org/apache/geronimo/netbeans/GeronimoDeploymentFactory.java
geronimo/sandbox/geronimo-netbeans-plugin/src/org/apache/geronimo/netbeans/GeronimoDeploymentManager.java
geronimo/sandbox/geronimo-netbeans-plugin/src/org/apache/geronimo/netbeans/GeronimoInstantiatingIterator.java
geronimo/sandbox/geronimo-netbeans-plugin/src/org/apache/geronimo/netbeans/GeronimoPluginProperties.java
geronimo/sandbox/geronimo-netbeans-plugin/src/org/apache/geronimo/netbeans/GeronimoPluginUtils.java
geronimo/sandbox/geronimo-netbeans-plugin/src/org/apache/geronimo/netbeans/resources/nbdep.xml
Modified: geronimo/sandbox/geronimo-netbeans-plugin/nbproject/project.xml
URL: http://svn.apache.org/viewvc/geronimo/sandbox/geronimo-netbeans-plugin/nbproject/project.xml?rev=682936&r1=682935&r2=682936&view=diff
==============================================================================
--- geronimo/sandbox/geronimo-netbeans-plugin/nbproject/project.xml (original)
+++ geronimo/sandbox/geronimo-netbeans-plugin/nbproject/project.xml Tue Aug 5 13:38:59 2008
@@ -16,6 +16,33 @@
</run-dependency>
</dependency>
<dependency>
+ <code-name-base>org.netbeans.api.java.classpath</code-name-base>
+ <build-prerequisite/>
+ <compile-dependency/>
+ <run-dependency>
+ <release-version>1</release-version>
+ <specification-version>1.18</specification-version>
+ </run-dependency>
+ </dependency>
+ <dependency>
+ <code-name-base>org.netbeans.api.xml</code-name-base>
+ <build-prerequisite/>
+ <compile-dependency/>
+ <run-dependency>
+ <release-version>1</release-version>
+ <specification-version>1.16</specification-version>
+ </run-dependency>
+ </dependency>
+ <dependency>
+ <code-name-base>org.netbeans.modules.j2ee.dd</code-name-base>
+ <build-prerequisite/>
+ <compile-dependency/>
+ <run-dependency>
+ <release-version>1</release-version>
+ <specification-version>1.12.0.2</specification-version>
+ </run-dependency>
+ </dependency>
+ <dependency>
<code-name-base>org.netbeans.modules.j2eeapis</code-name-base>
<build-prerequisite/>
<compile-dependency/>
Modified: geronimo/sandbox/geronimo-netbeans-plugin/src/org/apache/geronimo/netbeans/GeronimoDeploymentFactory.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/geronimo-netbeans-plugin/src/org/apache/geronimo/netbeans/GeronimoDeploymentFactory.java?rev=682936&r1=682935&r2=682936&view=diff
==============================================================================
--- geronimo/sandbox/geronimo-netbeans-plugin/src/org/apache/geronimo/netbeans/GeronimoDeploymentFactory.java (original)
+++ geronimo/sandbox/geronimo-netbeans-plugin/src/org/apache/geronimo/netbeans/GeronimoDeploymentFactory.java Tue Aug 5 13:38:59 2008
@@ -16,7 +16,9 @@
*/
package org.apache.geronimo.netbeans;
+import java.net.URL;
import java.net.URLClassLoader;
+import java.util.Enumeration;
import java.util.HashMap;
import java.util.Map;
import java.util.logging.Level;
@@ -32,10 +34,15 @@
*/
public class GeronimoDeploymentFactory implements DeploymentFactory {
- public static final String URI_PREFIX = "deployer:geronimo:";
- private static final String DEPLOYMENT_FACTORY_CLASS_NAME = "org.apache.geronimo.deployment.plugin.factories.DeploymentFactoryImpl";
- //private static final String DEPLOYMENT_FACTORY_CLASS_NAME = "org.apache.geronimo.deployment.plugin.factories.DeploymentFactoryBootstrapper";
- private static final Logger logger = Logger.getLogger(GeronimoDeploymentFactory.class.getName());
+ // Make sure GNP is always traced
+ static {
+ java.util.logging.Logger.getLogger("org.apache.geronimo.netbeans").setLevel(java.util.logging.Level.FINEST);
+ java.util.logging.Logger.getLogger("org.apache.geronimo.deployment.plugin.factories").setLevel(java.util.logging.Level.FINEST);
+ }
+ public static final String URI_PREFIX = "deployer:geronimo";
+ //private static final String DEPLOYMENT_FACTORY_CLASS_NAME = "org.apache.geronimo.deployment.plugin.factories.DeploymentFactoryImpl";
+ private static final String DEPLOYMENT_FACTORY_CLASS_NAME = "org.apache.geronimo.deployment.plugin.factories.DeploymentFactoryBootstrapper";
+ private static final Logger LOGGER = Logger.getLogger(GeronimoDeploymentFactory.class.getName());
private static DeploymentFactory instance;
/**
* Map of a server installation directory to a deployment factory
@@ -59,31 +66,24 @@
}
public DeploymentManager getDeploymentManager(String uri, String username, String password) throws DeploymentManagerCreationException {
+ return getDeploymentManager(uri, username, password, true);
+ }
+
+ public DeploymentManager getDisconnectedDeploymentManager(String uri) throws DeploymentManagerCreationException {
+ return getDeploymentManager(uri, null, null, false);
+ }
+
+ public DeploymentManager getDeploymentManager(String uri, String username, String password, boolean connected) throws DeploymentManagerCreationException {
if (!handlesURI(uri)) {
String msg = NbBundle.getMessage(GeronimoDeploymentFactory.class, "MSG_InvalidUri", uri);
throw new DeploymentManagerCreationException(msg);
}
-
DeploymentFactory df = getFactory(uri);
if (df == null) {
String msg = NbBundle.getMessage(GeronimoDeploymentFactory.class, "MSG_DmInstantiateFailed", uri);
throw new DeploymentManagerCreationException(msg);
}
-
- DeploymentManager dm = df.getDeploymentManager(uri, username, password);
- return new GeronimoDeploymentManager(dm, uri);
- }
-
- public DeploymentManager getDisconnectedDeploymentManager(String uri) throws DeploymentManagerCreationException {
- return getDeploymentManager(uri, null, null);
- }
-
- public String getDisplayName() {
- return NbBundle.getMessage(GeronimoDeploymentFactory.class, "LBL_DisplayName");
- }
-
- public String getProductVersion() {
- return NbBundle.getMessage(GeronimoDeploymentFactory.class, "LBL_FactoryVersion");
+ return new GeronimoDeploymentManager(df, uri, username, password, connected);
}
private DeploymentFactory getFactory(String uri) {
@@ -98,24 +98,32 @@
factory = factories.get(serverDir);
if (factory == null) {
- URLClassLoader loader = GeronimoPluginUtils.getGeronimoClassLoader(serverDir);
- ClassLoader oldLoader = Thread.currentThread().getContextClassLoader();
- Thread.currentThread().setContextClassLoader(loader);
-
try {
- factory = (DeploymentFactory) loader.loadClass(DEPLOYMENT_FACTORY_CLASS_NAME).newInstance();
- } catch (Exception e) {
- logger.log(Level.WARNING, e.getLocalizedMessage(), e);
- } finally {
- Thread.currentThread().setContextClassLoader(oldLoader);
- oldLoader = null;
+ URLClassLoader loader = GeronimoPluginUtils.getGeronimoClassLoader(serverDir);
+ ClassLoader oldCL = Thread.currentThread().getContextClassLoader();
+ try {
+ Thread.currentThread().setContextClassLoader(loader);
+ factory = (DeploymentFactory) loader.loadClass(DEPLOYMENT_FACTORY_CLASS_NAME).newInstance();
+ } finally {
+ Thread.currentThread().setContextClassLoader(oldCL);
+ }
+ } catch (Exception e) {
+ LOGGER.log(Level.WARNING, e.getLocalizedMessage(), e);
}
factories.put(serverDir, factory);
}
} catch (Exception e) {
- logger.log(Level.WARNING, e.getLocalizedMessage(), e);
+ LOGGER.log(Level.WARNING, e.getLocalizedMessage(), e);
}
assert factory != null : "factory is null";
return factory;
}
+
+ public String getDisplayName() {
+ return NbBundle.getMessage(GeronimoDeploymentFactory.class, "LBL_DisplayName");
+ }
+
+ public String getProductVersion() {
+ return NbBundle.getMessage(GeronimoDeploymentFactory.class, "LBL_FactoryVersion");
+ }
}
Modified: geronimo/sandbox/geronimo-netbeans-plugin/src/org/apache/geronimo/netbeans/GeronimoDeploymentManager.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/geronimo-netbeans-plugin/src/org/apache/geronimo/netbeans/GeronimoDeploymentManager.java?rev=682936&r1=682935&r2=682936&view=diff
==============================================================================
--- geronimo/sandbox/geronimo-netbeans-plugin/src/org/apache/geronimo/netbeans/GeronimoDeploymentManager.java (original)
+++ geronimo/sandbox/geronimo-netbeans-plugin/src/org/apache/geronimo/netbeans/GeronimoDeploymentManager.java Tue Aug 5 13:38:59 2008
@@ -18,7 +18,10 @@
import java.io.File;
import java.io.InputStream;
+import java.net.URLClassLoader;
import java.util.Locale;
+import java.util.logging.Level;
+import java.util.logging.Logger;
import javax.enterprise.deploy.model.DeployableObject;
import javax.enterprise.deploy.shared.DConfigBeanVersionType;
import javax.enterprise.deploy.shared.ModuleType;
@@ -27,8 +30,10 @@
import javax.enterprise.deploy.spi.Target;
import javax.enterprise.deploy.spi.TargetModuleID;
import javax.enterprise.deploy.spi.exceptions.DConfigBeanVersionUnsupportedException;
+import javax.enterprise.deploy.spi.exceptions.DeploymentManagerCreationException;
import javax.enterprise.deploy.spi.exceptions.InvalidModuleException;
import javax.enterprise.deploy.spi.exceptions.TargetException;
+import javax.enterprise.deploy.spi.factories.DeploymentFactory;
import javax.enterprise.deploy.spi.status.ProgressObject;
import org.netbeans.modules.j2ee.deployment.plugins.api.InstanceProperties;
@@ -41,14 +46,45 @@
public class GeronimoDeploymentManager implements DeploymentManager {
private DeploymentManager dm;
-
+ private DeploymentFactory df;
+ private boolean connected;
private String uri;
-
+ private String username;
+ private String password;
private InstanceProperties instanceProperties;
+ private static final Logger LOGGER = Logger.getLogger(GeronimoDeploymentFactory.class.getName());
- public GeronimoDeploymentManager(DeploymentManager dm, String uri) {
- this.dm = dm;
+ public GeronimoDeploymentManager(DeploymentFactory df, String uri, String username, String password, boolean connected) throws DeploymentManagerCreationException {
+ this.df = df;
this.uri = uri;
+ this.username = username;
+ this.password = password;
+ this.connected = connected;
+
+ String serverDir = GeronimoPluginUtils.getInstanceProperties(uri).getProperty(GeronimoPluginProperties.PROPERTY_SERVER_DIR);
+ if (serverDir == null) {
+ serverDir = GeronimoPluginProperties.getInstance().getInstallLocation();
+ }
+
+ URLClassLoader loader = GeronimoPluginUtils.getGeronimoClassLoader(serverDir);
+ ClassLoader oldCL = Thread.currentThread().getContextClassLoader();
+ try {
+ Thread.currentThread().setContextClassLoader(loader);
+ openWrappedDeploymentFactory();
+ } finally {
+ Thread.currentThread().setContextClassLoader(oldCL);
+ }
+ }
+
+ private void openWrappedDeploymentFactory() throws DeploymentManagerCreationException {
+ assert df != null : "Wrapped deployment factory must not be null";
+ LOGGER.log(Level.FINE, "Creating" + (connected ? "" : " disconnected") + " deployment manager");
+ if (connected) {
+ dm = df.getDeploymentManager(this.uri, this.username, this.password);
+ } else {
+ dm = df.getDisconnectedDeploymentManager(this.uri);
+ }
+ LOGGER.log(Level.FINE, (connected ? "" : "Disconnected ") + "deployment manager created " + this.dm);
}
public InstanceProperties getInstanceProperties() {
@@ -83,16 +119,49 @@
}
public ProgressObject distribute(Target[] target, File file, File file2) throws IllegalStateException {
- return dm.distribute(target, file, file2);
+ String serverDir = GeronimoPluginUtils.getInstanceProperties(uri).getProperty(GeronimoPluginProperties.PROPERTY_SERVER_DIR);
+ if (serverDir == null) {
+ serverDir = GeronimoPluginProperties.getInstance().getInstallLocation();
+ }
+ URLClassLoader loader = GeronimoPluginUtils.getGeronimoClassLoader(serverDir);
+ ClassLoader oldCL = Thread.currentThread().getContextClassLoader();
+ try {
+ Thread.currentThread().setContextClassLoader(loader);
+ return dm.distribute(target, file, file2);
+ } finally {
+ Thread.currentThread().setContextClassLoader(oldCL);
+ }
}
@SuppressWarnings("deprecation")
public ProgressObject distribute(Target[] target, InputStream is, InputStream is2) throws IllegalStateException {
- return dm.distribute(target, is, is2);
+ String serverDir = GeronimoPluginUtils.getInstanceProperties(uri).getProperty(GeronimoPluginProperties.PROPERTY_SERVER_DIR);
+ if (serverDir == null) {
+ serverDir = GeronimoPluginProperties.getInstance().getInstallLocation();
+ }
+ URLClassLoader loader = GeronimoPluginUtils.getGeronimoClassLoader(serverDir);
+ ClassLoader oldCL = Thread.currentThread().getContextClassLoader();
+ try {
+ Thread.currentThread().setContextClassLoader(loader);
+ return dm.distribute(target, is, is2);
+ } finally {
+ Thread.currentThread().setContextClassLoader(oldCL);
+ }
}
public ProgressObject distribute(Target[] target, ModuleType moduleType, InputStream is, InputStream is2) throws IllegalStateException {
- return dm.distribute(target, moduleType, is2, is2);
+ String serverDir = GeronimoPluginUtils.getInstanceProperties(uri).getProperty(GeronimoPluginProperties.PROPERTY_SERVER_DIR);
+ if (serverDir == null) {
+ serverDir = GeronimoPluginProperties.getInstance().getInstallLocation();
+ }
+ URLClassLoader loader = GeronimoPluginUtils.getGeronimoClassLoader(serverDir);
+ ClassLoader oldCL = Thread.currentThread().getContextClassLoader();
+ try {
+ Thread.currentThread().setContextClassLoader(loader);
+ return dm.distribute(target, moduleType, is2, is2);
+ } finally {
+ Thread.currentThread().setContextClassLoader(oldCL);
+ }
}
public ProgressObject start(TargetModuleID[] targetModuleId) throws IllegalStateException {
Modified: geronimo/sandbox/geronimo-netbeans-plugin/src/org/apache/geronimo/netbeans/GeronimoInstantiatingIterator.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/geronimo-netbeans-plugin/src/org/apache/geronimo/netbeans/GeronimoInstantiatingIterator.java?rev=682936&r1=682935&r2=682936&view=diff
==============================================================================
--- geronimo/sandbox/geronimo-netbeans-plugin/src/org/apache/geronimo/netbeans/GeronimoInstantiatingIterator.java (original)
+++ geronimo/sandbox/geronimo-netbeans-plugin/src/org/apache/geronimo/netbeans/GeronimoInstantiatingIterator.java Tue Aug 5 13:38:59 2008
@@ -56,14 +56,15 @@
String username = "system";
String password = "manager";
String hostname = "localhost";
- String httpPort = "8080";
- String url = GeronimoDeploymentFactory.URI_PREFIX + ":" + hostname + ":" + httpPort;
+ String port = "1099";
+ // FIXME: It relies on the defaults of JMX protocol hangling of BaseDeploymentFactory
+ // See framework/modules/geronimo-deploy-jsr88/src/main/java/org/apache/geronimo/deployment/plugin/factories/BaseDeploymentFactory.java::parseURI
+ String url = GeronimoDeploymentFactory.URI_PREFIX + ":" + "inVM";
try {
InstanceProperties ip = InstanceProperties.createInstanceProperties(url, username, password, displayName);
ip.setProperty(GeronimoPluginProperties.PROPERTY_SERVER_DIR, installLocation);
ip.setProperty(GeronimoPluginProperties.PROPERTY_HOSTNAME, hostname);
- // FIXME: Some parameters are in IP and some in GPP
- ip.setProperty(InstanceProperties.HTTP_PORT_NUMBER, httpPort);
+ ip.setProperty(GeronimoPluginProperties.PROPERTY_SERVER_VERSION, GeronimoPluginUtils.computeGeronimoVersion(installLocation));
result.add(ip);
} catch (Exception ex) {
String msg = NbBundle.getMessage(GeronimoInstantiatingIterator.class, "MSG_InstanceRegistrationFailed", displayName);
Modified: geronimo/sandbox/geronimo-netbeans-plugin/src/org/apache/geronimo/netbeans/GeronimoPluginProperties.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/geronimo-netbeans-plugin/src/org/apache/geronimo/netbeans/GeronimoPluginProperties.java?rev=682936&r1=682935&r2=682936&view=diff
==============================================================================
--- geronimo/sandbox/geronimo-netbeans-plugin/src/org/apache/geronimo/netbeans/GeronimoPluginProperties.java (original)
+++ geronimo/sandbox/geronimo-netbeans-plugin/src/org/apache/geronimo/netbeans/GeronimoPluginProperties.java Tue Aug 5 13:38:59 2008
@@ -36,6 +36,7 @@
public static final String PROPERTY_RMI_PORT_NUMBER = "rmiportnumber";
// FIXME: Handle the settings - save/restore
public static final String PROPERTY_HOSTNAME = "hostname";
+ public static final String PROPERTY_SERVER_VERSION = "server-version";
private static final Logger logger = Logger.getLogger(GeronimoPluginProperties.class.getName());
Modified: geronimo/sandbox/geronimo-netbeans-plugin/src/org/apache/geronimo/netbeans/GeronimoPluginUtils.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/geronimo-netbeans-plugin/src/org/apache/geronimo/netbeans/GeronimoPluginUtils.java?rev=682936&r1=682935&r2=682936&view=diff
==============================================================================
--- geronimo/sandbox/geronimo-netbeans-plugin/src/org/apache/geronimo/netbeans/GeronimoPluginUtils.java (original)
+++ geronimo/sandbox/geronimo-netbeans-plugin/src/org/apache/geronimo/netbeans/GeronimoPluginUtils.java Tue Aug 5 13:38:59 2008
@@ -218,20 +218,64 @@
}
urlList.clear();
+
+ File[] libs = new File(serverRoot + "/lib").listFiles();
+ for (File lib : libs) {
+ if (lib.getName().contains("commons-logging")) {
+ continue;
+ }
+ urlList.add(lib.toURI().toURL());
+ System.out.println(">> lib=" + lib.toURI().toURL());
+ }
+
+ urlList.add(new File(serverRoot + "/repository/commons-jexl/commons-jexl/1.1/commons-jexl-1.1.jar").toURI().toURL());
+ urlList.add(new File(serverRoot + "/repository/org/apache/geronimo/framework/geronimo-deploy-jsr88/" + version + "/geronimo-deploy-jsr88-" + version + ".jar").toURI().toURL());
+ urlList.add(new File(serverRoot + "/repository/org/apache/geronimo/framework/geronimo-deploy-config/" + version + "/geronimo-deploy-config-" + version + ".jar").toURI().toURL());
+ urlList.add(new File(serverRoot + "/repository/org/apache/geronimo/framework/geronimo-plugin/" + version + "/geronimo-plugin-" + version + ".jar").toURI().toURL());
+ urlList.add(new File(serverRoot + "/repository/org/apache/geronimo/framework/geronimo-system/" + version + "/geronimo-system-" + version + ".jar").toURI().toURL());
+ //urlList.add(new File(serverRoot + "/repository/org/apache/geronimo/specs/geronimo-javaee-deployment_1.1MR3_spec/1.0/geronimo-javaee-deployment_1.1MR3_spec-1.0.jar").toURI().toURL());
+ System.out.println("urlList.size=" + urlList.size());
+ urlList.remove(new File(serverRoot + "/lib/log4j-1.2.14.jar").toURI().toURL());
+ urlList.remove(new File(serverRoot + "/lib/commons-logging-1.0.4.jar").toURI().toURL());
+ urlList.remove(new File(serverRoot + "/lib/xpp3-1.1.3.4.O.jar").toURI().toURL());
+ urlList.remove(new File(serverRoot + "/lib/xstream-1.2.2.jar").toURI().toURL());
+ System.out.println("urlList.size=" + urlList.size());
+ for (URL url : urlList) {
+ System.out.println("file=" + url);
+ }
+
+ urlList.clear();
+
urlList.add(new File(serverRoot + "/lib/geronimo-deploy-jsr88-bootstrapper-2.1.1.jar").toURI().toURL());
urlList.add(new File(serverRoot + "/lib/geronimo-kernel-2.1.1.jar").toURI().toURL());
- urlList.add(new File(serverRoot + "/lib/cglib-nodep-2.1_3.jar").toURI().toURL());
urlList.add(new File(serverRoot + "/lib/asm-2.2.3.jar").toURI().toURL());
urlList.add(new File(serverRoot + "/lib/asm-commons-2.2.3.jar").toURI().toURL());
- urlList.add(new File(serverRoot + "/repository/org/apache/geronimo/framework/geronimo-deploy-jsr88/2.1.1/geronimo-deploy-jsr88-2.1.1.jar").toURI().toURL());
- loader = new GeronimoClassLoader(urlList.toArray(new URL[urlList.size()]), Thread.currentThread().getContextClassLoader());
+ urlList.add(new File(serverRoot + "/lib/cglib-nodep-2.1_3.jar").toURI().toURL());
+ urlList.add(new File(serverRoot + "/lib/log4j-1.2.14.jar").toURI().toURL());
+ urlList.add(new File(serverRoot + "/lib/xpp3-1.1.3.4.O.jar").toURI().toURL());
+ urlList.add(new File(serverRoot + "/lib/xstream-1.2.2.jar").toURI().toURL());
+// // org.apache.commons.logging.LogConfigurationException: Invalid class loader hierarchy. You have more than one version of 'org.apache.commons.logging.Log' visible, which is not allowed.
+// urlList.add(new File(serverRoot + "/lib/commons-logging-1.0.4.jar").toURI().toURL());
+ // Class-Path causes troubles due to commons-logging
+ urlList.add(new File(serverRoot + "/lib/jsr88-deploymentfactory.jar").toURI().toURL());
+// urlList.add(new File(serverRoot + "/repository/org/apache/geronimo/specs/geronimo-stax-api_1.0_spec/1.0.1/geronimo-stax-api_1.0_spec-1.0.1.jar").toURI().toURL());
+// urlList.add(new File(serverRoot + "/repository/org/apache/geronimo/specs/geronimo-javaee-deployment_1.1MR3_spec/1.0/geronimo-javaee-deployment_1.1MR3_spec-1.0.jar").toURI().toURL());
+// urlList.add(new File(serverRoot + "/lib/cglib-nodep-2.1_3.jar").toURI().toURL());
+// urlList.add(new File(serverRoot + "/lib/geronimo-transformer-2.1.1.jar").toURI().toURL());
+
+ //System.setProperty("Xorg.apache.geronimo.gbean.NoProxy", "false");
+
+ loader = new GeronimoClassLoader(urlList.toArray(new URL[urlList.size()]), GeronimoDeploymentFactory.class.getClassLoader());
+ System.out.println(Arrays.asList(loader.getURLs()));
} catch (Exception e) {
logger.log(Level.WARNING, e.getLocalizedMessage(), e);
}
- System.out.println(Arrays.asList(loader.getURLs()));
return loader;
}
+ static class Empty {
+ }
+
/**
* Borrowed from Geronimo Eclipse Plugin (GEP)
*
@@ -243,7 +287,7 @@
return computeGeronimoVersion(serverRoot.getAbsolutePath());
}
- private static String computeGeronimoVersion(String serverRoot) {
+ static String computeGeronimoVersion(String serverRoot) {
URL systemjarURL = null;
File libDir = new File(serverRoot + "/lib");
@@ -327,24 +371,19 @@
public static class GeronimoClassLoader extends URLClassLoader {
+ public GeronimoClassLoader(URL[] urls) throws MalformedURLException, RuntimeException {
+ super(urls);
+ }
+
public GeronimoClassLoader(URL[] urls, ClassLoader parent) throws MalformedURLException, RuntimeException {
super(urls, parent);
}
@Override
- protected PermissionCollection getPermissions(CodeSource codeSource) {
+ protected PermissionCollection getPermissions(CodeSource cs) {
Permissions p = new Permissions();
p.add(new AllPermission());
return p;
}
-
- @Override
- public Enumeration<URL> getResources(String name) throws IOException {
- // get rid of annoying warnings
- if (name.indexOf("jndi.properties") != -1 || name.indexOf("log4j.xml") != -1) {
- return Collections.enumeration(Collections.<URL>emptyList());
- }
- return super.getResources(name);
- }
}
}
Modified: geronimo/sandbox/geronimo-netbeans-plugin/src/org/apache/geronimo/netbeans/resources/nbdep.xml
URL: http://svn.apache.org/viewvc/geronimo/sandbox/geronimo-netbeans-plugin/src/org/apache/geronimo/netbeans/resources/nbdep.xml?rev=682936&r1=682935&r2=682936&view=diff
==============================================================================
--- geronimo/sandbox/geronimo-netbeans-plugin/src/org/apache/geronimo/netbeans/resources/nbdep.xml (original)
+++ geronimo/sandbox/geronimo-netbeans-plugin/src/org/apache/geronimo/netbeans/resources/nbdep.xml Tue Aug 5 13:38:59 2008
@@ -19,7 +19,7 @@
<!-- $Rev$ $Date$ -->
<netbeans-deployment>
- <disconnected-string>deployer:geronimo:localhost:8080</disconnected-string>
+ <disconnected-string>deployer:geronimo:inVM</disconnected-string>
<web-context-root>
<xpath>/</xpath>
<prop-name>contextRoot</prop-name>