# This patch file was generated by NetBeans IDE # Following Index: paths are relative to: /home/marigan/cvs/nb60/serverplugins/jboss4 # This patch can be applied using context Tools: Patch action on respective folder. # It uses platform neutral UTF-8 encoding and \n newlines. # Above lines and this line are ignored by the patching process. Index: src/org/netbeans/modules/j2ee/jboss4/ide/ui/AddServerPropertiesPanel.java *** /home/marigan/cvs/nb60/serverplugins/jboss4/src/org/netbeans/modules/j2ee/jboss4/ide/ui/AddServerPropertiesPanel.java Base (1.8) --- /home/marigan/cvs/nb60/serverplugins/jboss4/src/org/netbeans/modules/j2ee/jboss4/ide/ui/AddServerPropertiesPanel.java Locally Modified (Based On 1.8) *************** *** 115,120 **** --- 115,122 ---- instantiatingIterator.setServerPath(panel.getDomainPath()); instantiatingIterator.setDeployDir(JBPluginUtils.getDeployDir( panel.getDomainPath())); + JBPluginProperties.getInstance().setDomainLocation(panel.getDomainPath()); + return true; } Index: src/org/netbeans/modules/j2ee/jboss4/JBDeploymentFactory.java *** /home/marigan/cvs/nb60/serverplugins/jboss4/src/org/netbeans/modules/j2ee/jboss4/JBDeploymentFactory.java Base (1.12) --- /home/marigan/cvs/nb60/serverplugins/jboss4/src/org/netbeans/modules/j2ee/jboss4/JBDeploymentFactory.java Locally Modified (Based On 1.12) *************** *** 33,40 **** import java.util.Collections; import java.util.Enumeration; import java.util.HashSet; - import java.util.Iterator; - import java.util.MissingResourceException; import java.util.Set; import org.netbeans.modules.j2ee.jboss4.ide.ui.JBPluginUtils; import org.openide.ErrorManager; --- 33,38 ---- *************** *** 43,50 **** import javax.enterprise.deploy.spi.exceptions.DeploymentManagerCreationException; import javax.enterprise.deploy.spi.factories.DeploymentFactory; import javax.enterprise.deploy.shared.factories.DeploymentFactoryManager; - import org.netbeans.modules.j2ee.deployment.impl.ServerInstance; - import org.netbeans.modules.j2ee.deployment.impl.ServerRegistry; import org.openide.filesystems.FileObject; import org.openide.filesystems.FileUtil; import org.openide.filesystems.Repository; --- 41,46 ---- *************** *** 101,115 **** } } ! public static URLClassLoader getJBClassLoader(String serverRoot){ try { URL urls[] = new URL[]{ new File(serverRoot + "/client/jbossall-client.jar").toURI().toURL(), //NOI18N new File(serverRoot + "/client/jboss-common-client.jar").toURI().toURL(), //NOI18N new File(serverRoot + "/client/jboss-deployment.jar").toURI().toURL(), //NOI18N new File(serverRoot + "/client/jnp-client.jar").toURI().toURL(), //NOI18N ! new File(serverRoot + "/lib/dom4j.jar").toURI().toURL() //NOI18N }; URLClassLoader loader = new JBClassLoader(urls, JBDeploymentFactory.class.getClassLoader()); return loader; --- 97,117 ---- } } ! public static URLClassLoader getJBClassLoader(String serverRoot, String domainRoot){ try { + // dom4j.jar library for JBoss Application Server 4.0.4 and lower + File dom404 = new File(serverRoot + "/lib/dom4j.jar"); + + // dom4j.jar library for JBoss Application Server 4.0.5 + File dom405 = new File(domainRoot + "/lib/dom4j.jar"); + URL urls[] = new URL[]{ new File(serverRoot + "/client/jbossall-client.jar").toURI().toURL(), //NOI18N new File(serverRoot + "/client/jboss-common-client.jar").toURI().toURL(), //NOI18N new File(serverRoot + "/client/jboss-deployment.jar").toURI().toURL(), //NOI18N new File(serverRoot + "/client/jnp-client.jar").toURI().toURL(), //NOI18N ! (dom404.exists()) ? (dom404.toURI().toURL()) : (dom405.toURI().toURL()) //NOI18N }; URLClassLoader loader = new JBClassLoader(urls, JBDeploymentFactory.class.getClassLoader()); return loader; *************** *** 124,138 **** try { String jbossRoot = InstanceProperties.getInstanceProperties(instanceURL). getProperty(JBPluginProperties.PROPERTY_ROOT_DIR); // if jbossRoot is null, then we are in a server instance registration process, thus this call // is made from InstanceProperties creation -> JBPluginProperties singleton contains // install location of the instance being registered if (jbossRoot == null) jbossRoot = JBPluginProperties.getInstance().getInstallLocation(); jbossFactory = (DeploymentFactory) jbossFactories.get(jbossRoot); if ( jbossFactory == null ) { ! URLClassLoader loader = getJBClassLoader(jbossRoot); jbossFactory = (DeploymentFactory) loader.loadClass("org.jboss.deployment.spi.factories.DeploymentFactoryImpl").newInstance();//NOI18N jbossFactories.put(jbossRoot, jbossFactory); --- 126,150 ---- try { String jbossRoot = InstanceProperties.getInstanceProperties(instanceURL). getProperty(JBPluginProperties.PROPERTY_ROOT_DIR); + + String domainRoot = InstanceProperties.getInstanceProperties(instanceURL). + getProperty(JBPluginProperties.PROPERTY_SERVER_DIR); + // if jbossRoot is null, then we are in a server instance registration process, thus this call // is made from InstanceProperties creation -> JBPluginProperties singleton contains // install location of the instance being registered if (jbossRoot == null) jbossRoot = JBPluginProperties.getInstance().getInstallLocation(); + // if domainRoot is null, then we are in a server instance registration process, thus this call + // is made from InstanceProperties creation -> JBPluginProperties singleton contains + // install location of the instance being registered + if (domainRoot == null) + domainRoot = JBPluginProperties.getInstance().getDomainLocation(); + jbossFactory = (DeploymentFactory) jbossFactories.get(jbossRoot); if ( jbossFactory == null ) { ! URLClassLoader loader = getJBClassLoader(jbossRoot, domainRoot); jbossFactory = (DeploymentFactory) loader.loadClass("org.jboss.deployment.spi.factories.DeploymentFactoryImpl").newInstance();//NOI18N jbossFactories.put(jbossRoot, jbossFactory); Index: src/org/netbeans/modules/j2ee/jboss4/nodes/Util.java *** /home/marigan/cvs/nb60/serverplugins/jboss4/src/org/netbeans/modules/j2ee/jboss4/nodes/Util.java Base (1.2) --- /home/marigan/cvs/nb60/serverplugins/jboss4/src/org/netbeans/modules/j2ee/jboss4/nodes/Util.java Locally Modified (Based On 1.2) *************** *** 178,185 **** try{ oldLoader = Thread.currentThread().getContextClassLoader(); ! String serverRoot = ip.getProperty(JBPluginProperties.PROPERTY_ROOT_DIR); ! URLClassLoader loader = JBDeploymentFactory.getJBClassLoader(serverRoot); Thread.currentThread().setContextClassLoader(loader); Object srv = dm.refreshRMIServer(); --- 178,186 ---- try{ oldLoader = Thread.currentThread().getContextClassLoader(); ! ! URLClassLoader loader = JBDeploymentFactory.getJBClassLoader(ip.getProperty(JBPluginProperties.PROPERTY_ROOT_DIR), ! ip.getProperty(JBPluginProperties.PROPERTY_SERVER_DIR)); Thread.currentThread().setContextClassLoader(loader); Object srv = dm.refreshRMIServer(); Index: src/org/netbeans/modules/j2ee/jboss4/ide/ui/JBPluginProperties.java *** /home/marigan/cvs/nb60/serverplugins/jboss4/src/org/netbeans/modules/j2ee/jboss4/ide/ui/JBPluginProperties.java Base (1.5) --- /home/marigan/cvs/nb60/serverplugins/jboss4/src/org/netbeans/modules/j2ee/jboss4/ide/ui/JBPluginProperties.java Locally Modified (Based On 1.5) *************** *** 43,48 **** --- 43,49 ---- private static JBPluginProperties pluginProperties = null; private String installLocation; + private String domainLocation; public static JBPluginProperties getInstance(){ *************** *** 160,166 **** --- 161,179 ---- return this.installLocation; } + public void setDomainLocation(String domainLocation) { + if ( domainLocation.endsWith("/") || domainLocation.endsWith("\\") ){ + domainLocation = domainLocation.substring(0, domainLocation.length() - 1 ); } + + this.domainLocation = domainLocation; + } + + public String getDomainLocation() { + return domainLocation; + } + } Index: src/org/netbeans/modules/j2ee/jboss4/JBDeploymentManager.java *** /home/marigan/cvs/nb60/serverplugins/jboss4/src/org/netbeans/modules/j2ee/jboss4/JBDeploymentManager.java Base (1.15) --- /home/marigan/cvs/nb60/serverplugins/jboss4/src/org/netbeans/modules/j2ee/jboss4/JBDeploymentManager.java Locally Modified (Based On 1.15) *************** *** 116,122 **** try { oldLoader = Thread.currentThread().getContextClassLoader(); InstanceProperties ip = this.getInstanceProperties(); ! URLClassLoader loader = JBDeploymentFactory.getJBClassLoader(ip.getProperty(JBPluginProperties.PROPERTY_ROOT_DIR)); Thread.currentThread().setContextClassLoader(loader); JBProperties props = getProperties(); --- 116,123 ---- try { oldLoader = Thread.currentThread().getContextClassLoader(); InstanceProperties ip = this.getInstanceProperties(); ! URLClassLoader loader = JBDeploymentFactory.getJBClassLoader(ip.getProperty(JBPluginProperties.PROPERTY_ROOT_DIR), ! ip.getProperty(JBPluginProperties.PROPERTY_SERVER_DIR)); Thread.currentThread().setContextClassLoader(loader); JBProperties props = getProperties();