# 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/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) *************** *** 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; --- 101,125 ---- } } ! public static URLClassLoader getJBClassLoader(InstanceProperties ip){ try { + String serverRoot = ip.getProperty(JBPluginProperties.PROPERTY_ROOT_DIR); + // dom4j.jar library for JBoss Application Server 4.0.4 and lower + File dom4jLib = new File(serverRoot + "/lib/dom4j.jar"); + + // dom4j.jar library for JBoss Application Server 4.0.5 and higher + if(!dom4jLib.exists()) { + String domainRoot = ip.getProperty(JBPluginProperties.PROPERTY_SERVER_DIR); + dom4jLib = 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 ! dom4jLib.toURI().toURL() //NOI18N }; URLClassLoader loader = new JBClassLoader(urls, JBDeploymentFactory.class.getClassLoader()); return loader; *************** *** 122,129 **** public DeploymentFactory getFactory(String instanceURL) { DeploymentFactory jbossFactory = null; 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 --- 132,140 ---- public DeploymentFactory getFactory(String instanceURL) { DeploymentFactory jbossFactory = null; try { ! InstanceProperties ip = InstanceProperties.getInstanceProperties(instanceURL); ! String jbossRoot = ip.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 *************** *** 132,138 **** 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); --- 143,149 ---- jbossFactory = (DeploymentFactory) jbossFactories.get(jbossRoot); if ( jbossFactory == null ) { ! URLClassLoader loader = getJBClassLoader(ip); jbossFactory = (DeploymentFactory) loader.loadClass("org.jboss.deployment.spi.factories.DeploymentFactoryImpl").newInstance();//NOI18N jbossFactories.put(jbossRoot, jbossFactory); *************** *** 187,196 **** } else { df = getFactory(uri); - if (df == null) { - throw new DeploymentManagerCreationException(NbBundle.getMessage(JBDeploymentFactory.class, "MSG_ERROR_CREATING_DM", uri)); // NOI18N } - } String jbURI = uri; try { --- 198,204 ---- 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,184 ---- try{ oldLoader = Thread.currentThread().getContextClassLoader(); ! URLClassLoader loader = JBDeploymentFactory.getJBClassLoader(ip); Thread.currentThread().setContextClassLoader(loader); Object srv = dm.refreshRMIServer(); 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,122 ---- try { oldLoader = Thread.currentThread().getContextClassLoader(); InstanceProperties ip = this.getInstanceProperties(); ! URLClassLoader loader = JBDeploymentFactory.getJBClassLoader(ip); Thread.currentThread().setContextClassLoader(loader); JBProperties props = getProperties();