Index: src/org/netbeans/modules/j2ee/jboss4/Bundle.properties =================================================================== RCS file: /cvs/serverplugins/jboss4/src/org/netbeans/modules/j2ee/jboss4/Bundle.properties,v retrieving revision 1.5.8.3.2.2 diff -u -r1.5.8.3.2.2 Bundle.properties --- src/org/netbeans/modules/j2ee/jboss4/Bundle.properties 1 Jul 2006 05:25:04 -0000 1.5.8.3.2.2 +++ src/org/netbeans/modules/j2ee/jboss4/Bundle.properties 20 Feb 2007 14:53:57 -0000 @@ -18,7 +18,7 @@ # -SERVER_NAME=JBoss Application Server 4 +SERVER_NAME=JBoss Application Server LBL_JBossFactoryVersion=Deployment Factory for JBoss 4 plugin MSG_DEPLOYING=Deploying {0} Index: src/org/netbeans/modules/j2ee/jboss4/JBDeploymentFactory.java =================================================================== RCS file: /cvs/serverplugins/jboss4/src/org/netbeans/modules/j2ee/jboss4/JBDeploymentFactory.java,v retrieving revision 1.4.8.3.2.5.18.1 diff -u -r1.4.8.3.2.5.18.1 JBDeploymentFactory.java --- src/org/netbeans/modules/j2ee/jboss4/JBDeploymentFactory.java 8 Jan 2007 11:03:06 -0000 1.4.8.3.2.5.18.1 +++ src/org/netbeans/modules/j2ee/jboss4/JBDeploymentFactory.java 20 Feb 2007 14:53:57 -0000 @@ -30,9 +30,11 @@ import java.security.CodeSource; import java.security.PermissionCollection; import java.security.Permissions; +import java.util.ArrayList; import java.util.Collections; import java.util.Enumeration; import java.util.HashSet; +import java.util.List; import java.util.Set; import org.netbeans.modules.j2ee.jboss4.ide.ui.JBPluginUtils; import org.openide.ErrorManager; @@ -99,20 +101,44 @@ 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.4 and lower and JBoss Application Server 5.0 + File dom404 = new File(serverRoot + "/lib/dom4j.jar"); // NOI18N // dom4j.jar library for JBoss Application Server 4.0.5 - File dom405 = new File(domainRoot + "/lib/dom4j.jar"); + File dom405 = new File(domainRoot + "/lib/dom4j.jar"); // NOI18N - 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()); + // jboss-common-client.jar JBoss Application Server 4.x + File client40 = new File(serverRoot + "/client/jboss-common-client.jar"); // NOI18N + + // jboss-client.jar JBoss Application Server 5.0 + File client50 = new File(serverRoot + "/client/jboss-client.jar"); // NOI18N + + // jboss-common-core.jar for JBoss Application Server 5.0 + File core50 = new File(serverRoot + "/client/jboss-common-core.jar"); // NOI18N + + // jboss-logging-spi.jar for JBoss Application Server 5.0 + File logging50 = new File(serverRoot + "/client/jboss-logging-spi.jar"); // NOI18N + + List urlList = new ArrayList(); + + urlList.add(new File(serverRoot + "/client/jbossall-client.jar").toURI().toURL()); //NOI18N + urlList.add(new File(serverRoot + "/client/jboss-deployment.jar").toURI().toURL()); //NOI18N + urlList.add(new File(serverRoot + "/client/jnp-client.jar").toURI().toURL()); //NOI18N + urlList.add((dom404.exists()) ? (dom404.toURI().toURL()) : (dom405.toURI().toURL())); //NOI18N + + if(client40.exists()) + urlList.add(client40.toURI().toURL()); + + if(client50.exists()) + urlList.add(client50.toURI().toURL()); + + if(core50.exists()) + urlList.add(core50.toURI().toURL()); + + if(logging50.exists()) + urlList.add(logging50.toURI().toURL()); + + URLClassLoader loader = new JBClassLoader(urlList.toArray(new URL[] {}), JBDeploymentFactory.class.getClassLoader()); return loader; } catch (Exception e) { ErrorManager.getDefault().notify(ErrorManager.EXCEPTION, e); @@ -231,13 +257,15 @@ String serverLocation = getDefaultInstallLocation(); String domainLocation = serverLocation + File.separator + "server" + File.separator + "default"; // NOI18N setRemovability(serverInstanceDir, domainLocation); - if (JBPluginUtils.isGoodJBServerLocation(new File(serverLocation))) { - if (JBPluginUtils.isGoodJBInstanceLocation(new File(domainLocation))) { - if (!isAlreadyRegistered(serverInstanceDir, domainLocation)) { - String host = "localhost"; // NOI18N - String port = JBPluginUtils.getHTTPConnectorPort(domainLocation); // NOI18N - register(serverInstanceDir, serverLocation, domainLocation, host, port); - } + if (JBPluginUtils.isGoodJBServerLocation4x(new File(serverLocation)) && + JBPluginUtils.isGoodJBInstanceLocation4x(new File(domainLocation)) || + JBPluginUtils.isGoodJBServerLocation5x(new File(serverLocation)) && + JBPluginUtils.isGoodJBInstanceLocation5x(new File(domainLocation))) + { + if (!isAlreadyRegistered(serverInstanceDir, domainLocation)) { + String host = "localhost"; // NOI18N + String port = JBPluginUtils.getHTTPConnectorPort(domainLocation); // NOI18N + register(serverInstanceDir, serverLocation, domainLocation, host, port); } } } Index: src/org/netbeans/modules/j2ee/jboss4/JBDeploymentManager.java =================================================================== RCS file: /cvs/serverplugins/jboss4/src/org/netbeans/modules/j2ee/jboss4/JBDeploymentManager.java,v retrieving revision 1.6.8.4.2.10.14.2 diff -u -r1.6.8.4.2.10.14.2 JBDeploymentManager.java --- src/org/netbeans/modules/j2ee/jboss4/JBDeploymentManager.java 8 Jan 2007 11:03:06 -0000 1.6.8.4.2.10.14.2 +++ src/org/netbeans/modules/j2ee/jboss4/JBDeploymentManager.java 20 Feb 2007 14:53:57 -0000 @@ -42,6 +42,7 @@ import javax.enterprise.deploy.spi.exceptions.InvalidModuleException; import javax.enterprise.deploy.spi.exceptions.TargetException; import javax.enterprise.deploy.spi.status.ProgressObject; +import javax.management.MBeanServerConnection; import javax.naming.Context; import javax.naming.InitialContext; import org.netbeans.modules.j2ee.jboss4.config.CarDeploymentConfiguration; @@ -58,7 +59,7 @@ private DeploymentManager dm; private String realUri; - private Object rmiServer; + private MBeanServerConnection rmiServer; private int debuggingPort = 8787; @@ -109,7 +110,7 @@ return instanceProperties; } - public synchronized Object getRMIServer() { + public synchronized MBeanServerConnection getRMIServer() { if(rmiServer == null) { try { InstanceProperties ip = this.getInstanceProperties(); @@ -121,20 +122,27 @@ Hashtable env = new Hashtable(); // Sets the jboss naming environment - env.put(Context.INITIAL_CONTEXT_FACTORY, "org.jboss.security.jndi.LoginInitialContextFactory"); + env.put(Context.INITIAL_CONTEXT_FACTORY, "org.jboss.naming.NamingContextFactory"); env.put(Context.PROVIDER_URL, "jnp://localhost:"+JBPluginUtils.getJnpPort(ip.getProperty(JBPluginProperties.PROPERTY_SERVER_DIR))); - env.put(Context.SECURITY_PRINCIPAL, props.getUsername()); - env.put(Context.SECURITY_CREDENTIALS, props.getPassword()); env.put(Context.OBJECT_FACTORIES, "org.jboss.naming"); env.put(Context.URL_PKG_PREFIXES, "org.jboss.naming:org.jnp.interfaces" ); env.put("jnp.disableDiscovery", Boolean.TRUE); - // set the java.security.auth.login.config system property needed by InitialContext final String JAVA_SEC_AUTH_LOGIN_CONF = "java.security.auth.login.config"; // NOI18N String oldAuthConf = System.getProperty(JAVA_SEC_AUTH_LOGIN_CONF); - System.setProperty(JAVA_SEC_AUTH_LOGIN_CONF, props.getRootDir() + "/client/auth.conf"); // NOI18N + + File securityConf = new File(props.getRootDir(), "/client/auth.conf"); + if (securityConf.exists()) { + env.put(Context.INITIAL_CONTEXT_FACTORY, "org.jboss.security.jndi.LoginInitialContextFactory"); + env.put(Context.SECURITY_PRINCIPAL, props.getUsername()); + env.put(Context.SECURITY_CREDENTIALS, props.getPassword()); + System.setProperty(JAVA_SEC_AUTH_LOGIN_CONF, securityConf.getAbsolutePath()); // NOI18N + } + // Gets naming context InitialContext ctx = new InitialContext(env); + + //restore java.security.auth.login.config system property if (oldAuthConf != null) { System.setProperty(JAVA_SEC_AUTH_LOGIN_CONF, oldAuthConf); } else { @@ -142,7 +150,7 @@ } // Lookup RMI Adaptor - rmiServer = ctx.lookup("/jmx/invoker/RMIAdaptor"); + rmiServer = (MBeanServerConnection)ctx.lookup("/jmx/invoker/RMIAdaptor"); } catch (NameNotFoundException ex) { } catch (NamingException ex) {} // Nothing to do } @@ -150,7 +158,7 @@ return rmiServer; } - public synchronized Object refreshRMIServer() { + public synchronized MBeanServerConnection refreshRMIServer() { rmiServer = null; return getRMIServer(); } Index: src/org/netbeans/modules/j2ee/jboss4/ide/JBJ2eePlatformFactory.java =================================================================== RCS file: /cvs/serverplugins/jboss4/src/org/netbeans/modules/j2ee/jboss4/ide/JBJ2eePlatformFactory.java,v retrieving revision 1.5.8.4.2.11 diff -u -r1.5.8.4.2.11 JBJ2eePlatformFactory.java --- src/org/netbeans/modules/j2ee/jboss4/ide/JBJ2eePlatformFactory.java 22 Aug 2006 08:01:01 -0000 1.5.8.4.2.11 +++ src/org/netbeans/modules/j2ee/jboss4/ide/JBJ2eePlatformFactory.java 20 Feb 2007 14:53:57 -0000 @@ -61,7 +61,7 @@ assert JBDeploymentManager.class.isAssignableFrom(dm.getClass()) : this + " cannot create platform for unknown deployment manager:" + dm; // Ensure that for each server instance will be always used the same instance of the J2eePlatformImpl JBDeploymentManager manager = (JBDeploymentManager) dm; - InstanceProperties ip = ((JBDeploymentManager) manager).getInstanceProperties(); + InstanceProperties ip = manager.getInstanceProperties(); if (ip == null) { throw new RuntimeException("Cannot create J2eePlatformImpl instance for " + manager.getUrl()); // NOI18N } @@ -101,7 +101,7 @@ } public Set getSupportedSpecVersions() { - if (properties.isJavaEE5()) { + if (properties.supportsJavaEE5ejb3() && properties.supportsJavaEE5web()) { return SPEC_VERSIONS_5; } else { return SPEC_VERSIONS; @@ -109,14 +109,17 @@ } public Set getSupportedSpecVersions(Object moduleType) { - // JavaEE5 web and app client modules are not supported - if (properties.isJavaEE5() && !(J2eeModule.WAR.equals(moduleType) || J2eeModule.CLIENT.equals(moduleType))) { + // JavaEE5 app client is not supported for JBoss 5.x + if (properties.supportsJavaEE5ejb3() && properties.supportsJavaEE5web() && !J2eeModule.CLIENT.equals(moduleType)) { + return SPEC_VERSIONS_5; + } + // JavaEE5 web and app client modules are not supported for JBoss 4.x + if (properties.supportsJavaEE5ejb3() && !(J2eeModule.WAR.equals(moduleType) || J2eeModule.CLIENT.equals(moduleType))) { return SPEC_VERSIONS_5; } else { return SPEC_VERSIONS; } } - public Set getSupportedModuleTypes() { return MODULE_TYPES; Index: src/org/netbeans/modules/j2ee/jboss4/ide/JBLogWriter.java =================================================================== RCS file: /cvs/serverplugins/jboss4/src/org/netbeans/modules/j2ee/jboss4/ide/JBLogWriter.java,v retrieving revision 1.3.42.12 diff -u -r1.3.42.12 JBLogWriter.java --- src/org/netbeans/modules/j2ee/jboss4/ide/JBLogWriter.java 25 Aug 2006 12:50:08 -0000 1.3.42.12 +++ src/org/netbeans/modules/j2ee/jboss4/ide/JBLogWriter.java 20 Feb 2007 14:53:57 -0000 @@ -181,23 +181,28 @@ */ private void checkStartProgress(String line) { - if (line.indexOf("Starting JBoss (MX MicroKernel)") > -1) { + if (line.indexOf("Starting JBoss (MX MicroKernel)") > -1 || // JBoss 4.x message // NOI18N + line.indexOf("Starting JBoss (Microcontainer)") > -1) // JBoss 5.0 message // NOI18N + { if (VERBOSE) { - System.out.println("STARTING message fired"); + System.out.println("STARTING message fired"); // NOI18N } - fireStartProgressEvent(StateType.RUNNING, createProgressMessage("MSG_START_SERVER_IN_PROGRESS")); + fireStartProgressEvent(StateType.RUNNING, createProgressMessage("MSG_START_SERVER_IN_PROGRESS")); // NOI18N } else - if (line.indexOf("JBoss (MX MicroKernel)") > -1 && line.indexOf("Started in") > -1) {//NOI18N + if ((line.indexOf("JBoss (MX MicroKernel)") > -1 || // JBoss 4.x message // NOI18N + line.indexOf("JBoss (Microcontainer)") > -1) && // JBoss 5.0 message // NOI18N + line.indexOf("Started in") > -1) // NOI18N + { if (VERBOSE) { - System.out.println("STARTED message fired"); + System.out.println("STARTED message fired"); // NOI18N } checkStartProgress = false; actionStatus = JBStartServer.ACTION_STATUS.SUCCESS; notifyStartupThread(); } else - if (line.indexOf("Shutdown complete") > -1) { + if (line.indexOf("Shutdown complete") > -1) { // NOI18N checkStartProgress = false; actionStatus = JBStartServer.ACTION_STATUS.FAILURE; notifyStartupThread(); Index: src/org/netbeans/modules/j2ee/jboss4/ide/JBStartServer.java =================================================================== RCS file: /cvs/serverplugins/jboss4/src/org/netbeans/modules/j2ee/jboss4/ide/JBStartServer.java,v retrieving revision 1.17.8.5.2.13 diff -u -r1.17.8.5.2.13 JBStartServer.java --- src/org/netbeans/modules/j2ee/jboss4/ide/JBStartServer.java 24 Aug 2006 15:36:24 -0000 1.17.8.5.2.13 +++ src/org/netbeans/modules/j2ee/jboss4/ide/JBStartServer.java 20 Feb 2007 14:53:57 -0000 @@ -203,8 +203,8 @@ result = false; } - Object serverName = Util.getMBeanParameter(dm, "ServerName", "jboss.system:type=ServerConfig", String.class); - Object serverHome = Util.getMBeanParameter(dm, "ServerHomeDir", "jboss.system:type=ServerConfig", String.class); + Object serverName = Util.getMBeanParameter(dm, "ServerName", "jboss.system:type=ServerConfig"); + Object serverHome = Util.getMBeanParameter(dm, "ServerHomeDir", "jboss.system:type=ServerConfig"); if(serverName == null || serverHome == null) { result = false; Index: src/org/netbeans/modules/j2ee/jboss4/ide/ui/AddServerLocationPanel.java =================================================================== RCS file: /cvs/serverplugins/jboss4/src/org/netbeans/modules/j2ee/jboss4/ide/ui/AddServerLocationPanel.java,v retrieving revision 1.3.18.1.2.1 diff -u -r1.3.18.1.2.1 AddServerLocationPanel.java --- src/org/netbeans/modules/j2ee/jboss4/ide/ui/AddServerLocationPanel.java 1 Jul 2006 05:25:09 -0000 1.3.18.1.2.1 +++ src/org/netbeans/modules/j2ee/jboss4/ide/ui/AddServerLocationPanel.java 20 Feb 2007 14:53:57 -0000 @@ -80,16 +80,18 @@ public boolean isValid() { String locationStr = ((AddServerLocationVisualPanel)getComponent()).getInstallLocation(); File location = new File(locationStr); - if (!JBPluginUtils.isGoodJBServerLocation(location)) { + if (!JBPluginUtils.isGoodJBServerLocation4x(location) && + !JBPluginUtils.isGoodJBServerLocation5x(location)) + { wizard.putProperty(PROP_ERROR_MESSAGE, NbBundle.getMessage(AddServerLocationPanel.class, "MSG_InvalidServerLocation")); // NOI18N return false; - } else { - wizard.putProperty(PROP_ERROR_MESSAGE, null); - JBPluginProperties.getInstance().setInstallLocation(((AddServerLocationVisualPanel)getComponent()).getInstallLocation()); - JBPluginProperties.getInstance().saveProperties(); - instantiatingIterator.setInstallLocation(locationStr); - return true; } + + wizard.putProperty(PROP_ERROR_MESSAGE, null); + JBPluginProperties.getInstance().setInstallLocation(((AddServerLocationVisualPanel)getComponent()).getInstallLocation()); + JBPluginProperties.getInstance().saveProperties(); + instantiatingIterator.setInstallLocation(locationStr); + return true; } public void removeChangeListener(ChangeListener l) { Index: src/org/netbeans/modules/j2ee/jboss4/ide/ui/AddServerPropertiesPanel.java =================================================================== RCS file: /cvs/serverplugins/jboss4/src/org/netbeans/modules/j2ee/jboss4/ide/ui/AddServerPropertiesPanel.java,v retrieving revision 1.3.18.1.2.3.24.1 diff -u -r1.3.18.1.2.3.24.1 AddServerPropertiesPanel.java --- src/org/netbeans/modules/j2ee/jboss4/ide/ui/AddServerPropertiesPanel.java 8 Jan 2007 11:03:07 -0000 1.3.18.1.2.3.24.1 +++ src/org/netbeans/modules/j2ee/jboss4/ide/ui/AddServerPropertiesPanel.java 20 Feb 2007 14:53:58 -0000 @@ -58,7 +58,9 @@ if(panel.isLocalServer()){ // wrong domain path String path = panel.getDomainPath(); - if (!JBPluginUtils.isGoodJBInstanceLocation(new File(path))){ + if (!JBPluginUtils.isGoodJBInstanceLocation4x(new File(path)) && + !JBPluginUtils.isGoodJBInstanceLocation5x(new File(path))) + { wizard.putProperty(PROP_ERROR_MESSAGE,NbBundle.getMessage(AddServerPropertiesPanel.class, "MSG_WrongDomainPath")); return false; } Index: src/org/netbeans/modules/j2ee/jboss4/ide/ui/Bundle.properties =================================================================== RCS file: /cvs/serverplugins/jboss4/src/org/netbeans/modules/j2ee/jboss4/ide/ui/Bundle.properties,v retrieving revision 1.3.8.1.2.5 diff -u -r1.3.8.1.2.5 Bundle.properties --- src/org/netbeans/modules/j2ee/jboss4/ide/ui/Bundle.properties 1 Jul 2006 05:25:09 -0000 1.3.8.1.2.5 +++ src/org/netbeans/modules/j2ee/jboss4/ide/ui/Bundle.properties 20 Feb 2007 14:53:58 -0000 @@ -31,7 +31,7 @@ LBL_BrowseButton=Br&owse... -MSG_InvalidServerLocation=Provide a valid JBoss Application Server 4 Installation Location +MSG_InvalidServerLocation=Provide a valid JBoss Application Server 4 or 5 Installation Location LBL_ChooserName=Choose JBoss Server's Installation Location Index: src/org/netbeans/modules/j2ee/jboss4/ide/ui/JBPluginProperties.java =================================================================== RCS file: /cvs/serverplugins/jboss4/src/org/netbeans/modules/j2ee/jboss4/ide/ui/JBPluginProperties.java,v retrieving revision 1.2.18.2.2.1.24.1 diff -u -r1.2.18.2.2.1.24.1 JBPluginProperties.java --- src/org/netbeans/modules/j2ee/jboss4/ide/ui/JBPluginProperties.java 8 Jan 2007 11:03:07 -0000 1.2.18.2.2.1.24.1 +++ src/org/netbeans/modules/j2ee/jboss4/ide/ui/JBPluginProperties.java 20 Feb 2007 14:53:58 -0000 @@ -143,7 +143,9 @@ public boolean isCurrentServerLocationValid(){ if (getInstallLocation()!=null) - return (JBPluginUtils.isGoodJBServerLocation(new File(getInstallLocation()))); + return + JBPluginUtils.isGoodJBServerLocation4x(new File(getInstallLocation())) || + JBPluginUtils.isGoodJBServerLocation5x(new File(getInstallLocation())); else return false; } Index: src/org/netbeans/modules/j2ee/jboss4/ide/ui/JBPluginUtils.java =================================================================== RCS file: /cvs/serverplugins/jboss4/src/org/netbeans/modules/j2ee/jboss4/ide/ui/JBPluginUtils.java,v retrieving revision 1.2.18.3.2.3 diff -u -r1.2.18.3.2.3 JBPluginUtils.java --- src/org/netbeans/modules/j2ee/jboss4/ide/ui/JBPluginUtils.java 1 Jul 2006 05:25:10 -0000 1.2.18.3.2.3 +++ src/org/netbeans/modules/j2ee/jboss4/ide/ui/JBPluginUtils.java 20 Feb 2007 14:53:58 -0000 @@ -24,10 +24,12 @@ import java.io.IOException; import java.io.InputStream; import java.net.ServerSocket; -import java.util.Collection; import java.util.Hashtable; import java.util.Iterator; +import java.util.LinkedList; +import java.util.List; import javax.xml.parsers.DocumentBuilderFactory; +import org.netbeans.modules.j2ee.jboss4.JBDeploymentManager; import org.openide.ErrorManager; import org.w3c.dom.Document; import org.w3c.dom.Element; @@ -54,7 +56,9 @@ Hashtable result = new Hashtable(); // String domainListFile = File.separator+"common"+File.separator+"nodemanager"+File.separator+"nodemanager.domains"; // NOI18N - if (isGoodJBServerLocation(new File(serverLocation))){ + if (isGoodJBServerLocation4x(new File(serverLocation)) || + isGoodJBServerLocation5x(new File(serverLocation))) + { File file = new File(serverLocation + File.separator + "server"); // NOI18N String[] files = file.list(new FilenameFilter(){ @@ -67,7 +71,9 @@ for(int i =0; i domainRequirements4x = new LinkedList(); + static { + domainRequirements4x.add("conf"); // NOI18N + domainRequirements4x.add("deploy"); // NOI18N + domainRequirements4x.add("lib"); // NOI18N + domainRequirements4x.add("conf/jboss-service.xml"); // NOI18N + domainRequirements4x.add("lib/jboss-j2ee.jar"); // NOI18N + domainRequirements4x.add("lib/jboss.jar"); // NOI18N + domainRequirements4x.add("lib/jbosssx.jar"); // NOI18N + domainRequirements4x.add("lib/jboss-transaction.jar"); // NOI18N + domainRequirements4x.add("lib/jmx-adaptor-plugin.jar"); // NOI18N + domainRequirements4x.add("lib/jnpserver.jar"); // NOI18N + domainRequirements4x.add("lib/log4j.jar"); // NOI18N + domainRequirements4x.add("lib/xmlentitymgr.jar"); // NOI18N + domainRequirements4x.add("deploy/jmx-invoker-service.xml"); // NOI18N + } + + private static List domainRequirements5x = new LinkedList(); + static { - serverFileColl.add("conf"); // NOI18N - serverFileColl.add("deploy"); // NOI18N - serverFileColl.add("lib"); // NOI18N - serverFileColl.add("conf/jboss-service.xml"); // NOI18N - serverFileColl.add("lib/jboss-j2ee.jar"); // NOI18N - serverFileColl.add("lib/jboss.jar"); // NOI18N - serverFileColl.add("lib/jbosssx.jar"); // NOI18N - serverFileColl.add("lib/jboss-transaction.jar"); // NOI18N - serverFileColl.add("lib/jmx-adaptor-plugin.jar"); // NOI18N - serverFileColl.add("lib/jnpserver.jar"); // NOI18N - serverFileColl.add("lib/log4j.jar"); // NOI18N - serverFileColl.add("lib/xmlentitymgr.jar"); // NOI18N - serverFileColl.add("deploy/jmx-invoker-service.xml"); // NOI18N + domainRequirements5x.add("conf"); // NOI18N + domainRequirements5x.add("deploy"); // NOI18N + domainRequirements5x.add("lib"); // NOI18N + domainRequirements5x.add("conf/jboss-service.xml"); // NOI18N + domainRequirements5x.add("lib/jboss-j2ee.jar"); // NOI18N + domainRequirements5x.add("lib/jboss.jar"); // NOI18N + domainRequirements5x.add("lib/jbosssx.jar"); // NOI18N + domainRequirements5x.add("lib/jboss-transaction.jar"); // NOI18N + domainRequirements5x.add("lib/jmx-adaptor-plugin.jar"); // NOI18N + domainRequirements5x.add("lib/jnpserver.jar"); // NOI18N + domainRequirements5x.add("lib/log4j.jar"); // NOI18N + domainRequirements5x.add("deploy/jmx-invoker-service.xml"); // NOI18N } - public static boolean isGoodJBInstanceLocation(File candidate){ + private static boolean isGoodJBInstanceLocation(File candidate, List requirements){ if (null == candidate || !candidate.exists() || !candidate.canRead() || !candidate.isDirectory() || - !hasRequiredChildren(candidate, serverFileColl)) { + !hasRequiredChildren(candidate, requirements)) { return false; } return true; } + public static boolean isGoodJBInstanceLocation4x(File candidate){ + return isGoodJBInstanceLocation(candidate, domainRequirements4x); + } + + public static boolean isGoodJBInstanceLocation5x(File candidate){ + return isGoodJBInstanceLocation(candidate, domainRequirements5x); + } + //--------------- checking for possible server directory ------------- - private static Collection fileColl = new java.util.ArrayList(); + private static List serverRequirements4x = new LinkedList(); static { - fileColl.add("bin"); // NOI18N - fileColl.add("client"); // NOI18N - fileColl.add("lib"); // NOI18N - fileColl.add("server"); // NOI18N - fileColl.add("lib/jboss-common.jar"); // NOI18N - fileColl.add("lib/endorsed/resolver.jar"); // NOI18N + serverRequirements4x.add("bin"); // NOI18N + serverRequirements4x.add("client"); // NOI18N + serverRequirements4x.add("lib"); // NOI18N + serverRequirements4x.add("server"); // NOI18N + serverRequirements4x.add("lib/jboss-common.jar"); // NOI18N + serverRequirements4x.add("lib/endorsed/resolver.jar"); // NOI18N } - public static boolean isGoodJBServerLocation(File candidate){ + private static List serverRequirements5x = new LinkedList(); + + static { + serverRequirements5x.add("bin"); // NOI18N + serverRequirements5x.add("client"); // NOI18N + serverRequirements5x.add("lib"); // NOI18N + serverRequirements5x.add("server"); // NOI18N + serverRequirements5x.add("lib/jboss-common-core.jar"); // NOI18N + serverRequirements5x.add("lib/endorsed/resolver.jar"); // NOI18N + } + + private static boolean isGoodJBServerLocation(File candidate, List requirements){ if (null == candidate || !candidate.exists() || !candidate.canRead() || !candidate.isDirectory() || - !hasRequiredChildren(candidate, fileColl)) { + !hasRequiredChildren(candidate, requirements)) { return false; } return true; } - private static boolean hasRequiredChildren(File candidate, Collection requiredChildren) { + public static boolean isGoodJBServerLocation4x(File candidate){ + return isGoodJBServerLocation(candidate, serverRequirements4x); + } + + public static boolean isGoodJBServerLocation4x(JBDeploymentManager dm){ + String installDir = dm.getInstanceProperties().getProperty(JBPluginProperties.PROPERTY_ROOT_DIR); + return isGoodJBServerLocation4x(new File(installDir)); + } + + public static boolean isGoodJBServerLocation5x(File candidate){ + return isGoodJBServerLocation(candidate, serverRequirements5x); + } + + private static boolean hasRequiredChildren(File candidate, List requiredChildren) { if (null == candidate) return false; String[] children = candidate.list(); @@ -146,6 +201,7 @@ return true; } + //-------------------------------------------------------------------- /** * Index: src/org/netbeans/modules/j2ee/jboss4/nodes/JBEarApplicationsChildren.java =================================================================== RCS file: /cvs/serverplugins/jboss4/src/org/netbeans/modules/j2ee/jboss4/nodes/JBEarApplicationsChildren.java,v retrieving revision 1.1.4.5 diff -u -r1.1.4.5 JBEarApplicationsChildren.java --- src/org/netbeans/modules/j2ee/jboss4/nodes/JBEarApplicationsChildren.java 1 Jul 2006 05:25:11 -0000 1.1.4.5 +++ src/org/netbeans/modules/j2ee/jboss4/nodes/JBEarApplicationsChildren.java 20 Feb 2007 14:53:58 -0000 @@ -19,14 +19,14 @@ package org.netbeans.modules.j2ee.jboss4.nodes; -import java.lang.reflect.InvocationTargetException; import java.util.Iterator; import java.util.Set; import java.util.Vector; -import javax.management.MalformedObjectNameException; import javax.management.ObjectInstance; import javax.management.ObjectName; import javax.management.QueryExp; +import org.netbeans.modules.j2ee.jboss4.JBDeploymentManager; +import org.netbeans.modules.j2ee.jboss4.ide.ui.JBPluginUtils; import org.netbeans.modules.j2ee.jboss4.nodes.actions.Refreshable; import org.openide.ErrorManager; import org.openide.nodes.Children; @@ -44,6 +44,7 @@ private Lookup lookup; private Boolean remoteManagementSupported = null; + private Boolean isJB4x = null; JBEarApplicationsChildren(Lookup lookup) { this.lookup = lookup; @@ -60,7 +61,7 @@ // Query to the jboss4 server ObjectName searchPattern; String propertyName; - if (isRemoteManagementSupported()) { + if (isRemoteManagementSupported() && isJB4x()) { searchPattern = new ObjectName("jboss.management.local:j2eeType=J2EEApplication,*"); // NOI18N propertyName = "name"; // NOI18N } @@ -79,7 +80,7 @@ ObjectName elem = ((ObjectInstance) it.next()).getObjectName(); String name = elem.getKeyProperty(propertyName); - if (isRemoteManagementSupported()) { + if (isRemoteManagementSupported() && isJB4x) { if (name.endsWith(".sar")) { // NOI18N continue; } @@ -128,6 +129,14 @@ remoteManagementSupported = Util.isRemoteManagementSupported(lookup); } return remoteManagementSupported; + } + + private boolean isJB4x() { + if (isJB4x == null) { + JBDeploymentManager dm = (JBDeploymentManager)lookup.lookup(JBDeploymentManager.class); + isJB4x = JBPluginUtils.isGoodJBServerLocation4x(dm); + } + return isJB4x; } } Index: src/org/netbeans/modules/j2ee/jboss4/nodes/JBEarModulesChildren.java =================================================================== RCS file: /cvs/serverplugins/jboss4/src/org/netbeans/modules/j2ee/jboss4/nodes/JBEarModulesChildren.java,v retrieving revision 1.1.4.8 diff -u -r1.1.4.8 JBEarModulesChildren.java --- src/org/netbeans/modules/j2ee/jboss4/nodes/JBEarModulesChildren.java 12 Jul 2006 11:54:33 -0000 1.1.4.8 +++ src/org/netbeans/modules/j2ee/jboss4/nodes/JBEarModulesChildren.java 20 Feb 2007 14:53:58 -0000 @@ -74,7 +74,7 @@ else if(elem.getKeyProperty("j2eeType").equals("WebModule")) { String url = "http://"+dm.getHost()+":"+dm.getPort(); String context = Util.getWebContextRoot((String)Util.getMBeanParameter(dm, "jbossWebDeploymentDescriptor", - elem.getCanonicalName(), String.class)); + elem.getCanonicalName())); keys.add(new JBWebModuleNode(name, lookup, (context == null) ? null : url+context)); } } catch (Exception ex) { Index: src/org/netbeans/modules/j2ee/jboss4/nodes/JBEjbModulesChildren.java =================================================================== RCS file: /cvs/serverplugins/jboss4/src/org/netbeans/modules/j2ee/jboss4/nodes/JBEjbModulesChildren.java,v retrieving revision 1.1.4.6 diff -u -r1.1.4.6 JBEjbModulesChildren.java --- src/org/netbeans/modules/j2ee/jboss4/nodes/JBEjbModulesChildren.java 1 Jul 2006 05:25:11 -0000 1.1.4.6 +++ src/org/netbeans/modules/j2ee/jboss4/nodes/JBEjbModulesChildren.java 20 Feb 2007 14:53:58 -0000 @@ -26,6 +26,8 @@ import javax.management.ObjectInstance; import javax.management.ObjectName; import javax.management.QueryExp; +import org.netbeans.modules.j2ee.jboss4.JBDeploymentManager; +import org.netbeans.modules.j2ee.jboss4.ide.ui.JBPluginUtils; import org.netbeans.modules.j2ee.jboss4.nodes.actions.Refreshable; import org.openide.ErrorManager; import org.openide.nodes.Children; @@ -42,6 +44,8 @@ public class JBEjbModulesChildren extends Children.Keys implements Refreshable { private Lookup lookup; + private Boolean remoteManagementSupported = null; + private Boolean isJB4x = null; public JBEjbModulesChildren(Lookup lookup) { this.lookup = lookup; @@ -68,7 +72,7 @@ try { String propertyName; Object searchPattern; - if (Util.isRemoteManagementSupported(lookup)) { + if (isRemoteManagementSupported() && isJB4x()) { propertyName = "name"; // NOI18N searchPattern = new ObjectName("jboss.management.local:j2eeType=EJBModule,J2EEApplication=null,*"); // NOI18N } @@ -134,4 +138,20 @@ return null; } + + private boolean isRemoteManagementSupported() { + if (remoteManagementSupported == null) { + remoteManagementSupported = Util.isRemoteManagementSupported(lookup); + } + return remoteManagementSupported; + } + + private boolean isJB4x() { + if (isJB4x == null) { + JBDeploymentManager dm = (JBDeploymentManager)lookup.lookup(JBDeploymentManager.class); + isJB4x = JBPluginUtils.isGoodJBServerLocation4x(dm); + } + return isJB4x; + } + } Index: src/org/netbeans/modules/j2ee/jboss4/nodes/JBWebApplicationsChildren.java =================================================================== RCS file: /cvs/serverplugins/jboss4/src/org/netbeans/modules/j2ee/jboss4/nodes/JBWebApplicationsChildren.java,v retrieving revision 1.1.4.7 diff -u -r1.1.4.7 JBWebApplicationsChildren.java --- src/org/netbeans/modules/j2ee/jboss4/nodes/JBWebApplicationsChildren.java 1 Jul 2006 05:25:12 -0000 1.1.4.7 +++ src/org/netbeans/modules/j2ee/jboss4/nodes/JBWebApplicationsChildren.java 20 Feb 2007 14:53:58 -0000 @@ -19,6 +19,7 @@ package org.netbeans.modules.j2ee.jboss4.nodes; +import java.io.File; import java.util.Iterator; import java.util.Set; import java.util.Vector; @@ -26,6 +27,8 @@ import javax.management.ObjectName; import javax.management.QueryExp; import org.netbeans.modules.j2ee.jboss4.JBDeploymentManager; +import org.netbeans.modules.j2ee.jboss4.ide.ui.JBPluginProperties; +import org.netbeans.modules.j2ee.jboss4.ide.ui.JBPluginUtils; import org.netbeans.modules.j2ee.jboss4.nodes.actions.Refreshable; import org.openide.ErrorManager; import org.openide.nodes.Children; @@ -43,6 +46,7 @@ private Lookup lookup; private Boolean remoteManagementSupported = null; + private Boolean isJB4x = null; public JBWebApplicationsChildren(Lookup lookup) { this.lookup = lookup; @@ -53,13 +57,12 @@ RequestProcessor.getDefault().post(new Runnable() { Vector keys = new Vector(); - JBDeploymentManager dm = (JBDeploymentManager)lookup.lookup(JBDeploymentManager.class); public void run() { try { - // Query to the jboss4 server + // Query to the jboss server ObjectName searchPattern; - if (isRemoteManagementSupported()) { + if (isRemoteManagementSupported() && isJB4x()) { searchPattern = new ObjectName("jboss.management.local:j2eeType=WebModule,J2EEApplication=null,*"); // NOI18N } else { @@ -71,6 +74,8 @@ Iterator it = managedObj.iterator(); + JBDeploymentManager dm = (JBDeploymentManager)lookup.lookup(JBDeploymentManager.class); + // Query results processing while(it.hasNext()) { try { @@ -78,25 +83,27 @@ String name = elem.getKeyProperty("name"); String url = "http://" + dm.getHost() + ":" + dm.getPort(); String context = ""; - if (isRemoteManagementSupported()) { + if (isRemoteManagementSupported() && isJB4x()) { if("jmx-console.war".equals(name)) { // Excluding it. It's system package continue; } - String descr = (String)Util.getMBeanParameter(dm, "jbossWebDeploymentDescriptor", elem.getCanonicalName(), String.class); // NOI18N + String descr = (String)Util.getMBeanParameter(dm, "jbossWebDeploymentDescriptor", elem.getCanonicalName()); // NOI18N context = Util.getWebContextRoot(descr); } else { if (name.startsWith("//localhost/")) { // NOI18N name = name.substring("//localhost/".length()); // NOI18N } - if("".equals(name) || "jmx-console".equals(name) || "jbossws".equals(name)) { // Excluding it. It's system package + // excluding system packages + if("".equals(name) || "jmx-console".equals(name) || "jbossws".equals(name) || + "web-console".equals(name) || "invoker".equals(name)) { continue; } name += ".war"; // NOI18N - context = (String)Util.getMBeanParameter(dm, "path", elem.getCanonicalName(), String.class); // NOI18N + context = (String)Util.getMBeanParameter(dm, "path", elem.getCanonicalName()); // NOI18N } - keys.add(new JBWebModuleNode(name, lookup, url + context)); + keys.add(new JBWebModuleNode(name, lookup, (context == null ? null : url + context))); } catch (Exception ex) { ErrorManager.getDefault().notify(ErrorManager.INFORMATIONAL, ex); } @@ -136,5 +143,13 @@ } return remoteManagementSupported; } - + + private boolean isJB4x() { + if (isJB4x == null) { + JBDeploymentManager dm = (JBDeploymentManager)lookup.lookup(JBDeploymentManager.class); + isJB4x = JBPluginUtils.isGoodJBServerLocation4x(dm); + } + return isJB4x; + } + } Index: src/org/netbeans/modules/j2ee/jboss4/nodes/JBWebModuleNode.java =================================================================== RCS file: /cvs/serverplugins/jboss4/src/org/netbeans/modules/j2ee/jboss4/nodes/JBWebModuleNode.java,v retrieving revision 1.1.4.8 diff -u -r1.1.4.8 JBWebModuleNode.java --- src/org/netbeans/modules/j2ee/jboss4/nodes/JBWebModuleNode.java 12 Jul 2006 11:54:33 -0000 1.1.4.8 +++ src/org/netbeans/modules/j2ee/jboss4/nodes/JBWebModuleNode.java 20 Feb 2007 14:53:58 -0000 @@ -24,6 +24,8 @@ import javax.swing.Action; import org.netbeans.modules.j2ee.deployment.plugins.api.UISupport; import org.netbeans.modules.j2ee.deployment.plugins.api.UISupport.ServerIcon; +import org.netbeans.modules.j2ee.jboss4.JBDeploymentManager; +import org.netbeans.modules.j2ee.jboss4.ide.ui.JBPluginUtils; import org.netbeans.modules.j2ee.jboss4.nodes.actions.OpenURLAction; import org.netbeans.modules.j2ee.jboss4.nodes.actions.OpenURLActionCookie; import org.netbeans.modules.j2ee.jboss4.nodes.actions.UndeployModuleAction; @@ -40,12 +42,14 @@ public class JBWebModuleNode extends AbstractNode { final boolean isRemoteManagementSupported; + final boolean isJB4x; public JBWebModuleNode(String fileName, Lookup lookup, String url) { super(new JBServletsChildren(fileName, lookup)); setDisplayName(fileName.substring(0, fileName.indexOf('.'))); isRemoteManagementSupported = Util.isRemoteManagementSupported(lookup); - if (isRemoteManagementSupported) { + isJB4x = JBPluginUtils.isGoodJBServerLocation4x((JBDeploymentManager)lookup.lookup(JBDeploymentManager.class)); + if (isRemoteManagementSupported && isJB4x) { // we cannot find out the .war name w/o the management support, thus we cannot enable the Undeploy action getCookieSet().add(new UndeployModuleCookieImpl(fileName, ModuleType.WAR, lookup)); } @@ -61,7 +65,7 @@ }; } else { - if (isRemoteManagementSupported) { + if (isRemoteManagementSupported && isJB4x) { return new SystemAction[] { SystemAction.get(OpenURLAction.class), SystemAction.get(UndeployModuleAction.class) Index: src/org/netbeans/modules/j2ee/jboss4/nodes/Util.java =================================================================== RCS file: /cvs/serverplugins/jboss4/src/org/netbeans/modules/j2ee/jboss4/nodes/Util.java,v retrieving revision 1.1.2.9.18.1 diff -u -r1.1.2.9.18.1 Util.java --- src/org/netbeans/modules/j2ee/jboss4/nodes/Util.java 8 Jan 2007 11:03:08 -0000 1.1.2.9.18.1 +++ src/org/netbeans/modules/j2ee/jboss4/nodes/Util.java 20 Feb 2007 14:53:58 -0000 @@ -22,19 +22,19 @@ import java.io.ByteArrayInputStream; import java.io.IOException; import java.lang.reflect.InvocationTargetException; -import java.lang.reflect.Method; -import java.net.URLClassLoader; import java.util.Set; import javax.enterprise.deploy.shared.ModuleType; +import javax.management.AttributeNotFoundException; +import javax.management.InstanceNotFoundException; +import javax.management.MBeanException; +import javax.management.MBeanServerConnection; import javax.management.MalformedObjectNameException; import javax.management.ObjectName; import javax.management.QueryExp; +import javax.management.ReflectionException; import javax.xml.parsers.DocumentBuilderFactory; import javax.xml.parsers.ParserConfigurationException; -import org.netbeans.modules.j2ee.deployment.plugins.api.InstanceProperties; -import org.netbeans.modules.j2ee.jboss4.JBDeploymentFactory; import org.netbeans.modules.j2ee.jboss4.JBDeploymentManager; -import org.netbeans.modules.j2ee.jboss4.ide.ui.JBPluginProperties; import org.openide.ErrorManager; import org.openide.nodes.AbstractNode; import org.openide.nodes.Children; @@ -55,14 +55,14 @@ /** * Lookup a JBoss4 RMI Adaptor */ - public static Object getRMIServer(Lookup lookup) { + public static MBeanServerConnection getRMIServer(Lookup lookup) { return getRMIServer((JBDeploymentManager)lookup.lookup(JBDeploymentManager.class)); } /** * Lookup a JBoss4 RMI Adaptor */ - public static Object getRMIServer(JBDeploymentManager manager) { + public static MBeanServerConnection getRMIServer(JBDeploymentManager manager) { return manager.getRMIServer(); } @@ -172,43 +172,27 @@ * * @return MBean attribute */ - public static Object getMBeanParameter(JBDeploymentManager dm, String name, String targetObject, Class paramClass) { - ClassLoader oldLoader = null; - InstanceProperties ip = dm.getInstanceProperties(); - - 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(); - - Class objectName = loader.loadClass("javax.management.ObjectName"); // NOI18N - Method getInstance = objectName.getMethod("getInstance", new Class[] {String.class} ); // NOI18N - Object target = getInstance.invoke(null, new Object[]{targetObject}); // NOI18N - Class[] params = new Class[]{loader.loadClass("javax.management.ObjectName"), paramClass}; // NOI18N - Method getAttribute = srv.getClass().getMethod("getAttribute", params); // NOI18N - return getAttribute.invoke(srv, new Object[]{target, name}); // NOI18N - + public static Object getMBeanParameter(JBDeploymentManager dm, String name, String targetObject) { + MBeanServerConnection server = dm.refreshRMIServer(); + try { + return server.getAttribute(new ObjectName(targetObject), name); + } catch (InstanceNotFoundException ex) { + ErrorManager.getDefault().notify(ErrorManager.INFORMATIONAL, ex); + } catch (AttributeNotFoundException ex) { + ErrorManager.getDefault().notify(ErrorManager.INFORMATIONAL, ex); + } catch (MalformedObjectNameException ex) { + ErrorManager.getDefault().notify(ErrorManager.INFORMATIONAL, ex); } catch (NullPointerException ex) { - // It's normal behaviour when the server is off - return null; - } catch (IllegalAccessException ex) { + // it's normal behaviour when the server is not running + } catch (IllegalArgumentException ex) { + // it's normal behaviour when the server is not running + } catch (ReflectionException ex) { ErrorManager.getDefault().notify(ErrorManager.INFORMATIONAL, ex); - } catch (ClassNotFoundException ex) { + } catch (MBeanException ex) { ErrorManager.getDefault().notify(ErrorManager.INFORMATIONAL, ex); - } catch (NoSuchMethodException ex) { + } catch (IOException ex) { ErrorManager.getDefault().notify(ErrorManager.INFORMATIONAL, ex); - } catch (InvocationTargetException ex) { - // It's normal behaviour when the server is off - return null; - } finally{ - if (oldLoader != null) { - Thread.currentThread().setContextClassLoader(oldLoader); - } - } + } return null; } @@ -219,6 +203,11 @@ * @return context-root of web application */ public static String getWebContextRoot(String dd) { + + if (dd == null) { + return null; + } + Document doc = null; try { Index: src/org/netbeans/modules/j2ee/jboss4/resources/Bundle.properties =================================================================== RCS file: /cvs/serverplugins/jboss4/src/org/netbeans/modules/j2ee/jboss4/resources/Bundle.properties,v retrieving revision 1.2.46.2 diff -u -r1.2.46.2 Bundle.properties --- src/org/netbeans/modules/j2ee/jboss4/resources/Bundle.properties 21 Aug 2006 16:51:53 -0000 1.2.46.2 +++ src/org/netbeans/modules/j2ee/jboss4/resources/Bundle.properties 20 Feb 2007 14:53:58 -0000 @@ -17,7 +17,7 @@ # Microsystems, Inc. All Rights Reserved. # -OpenIDE-Module-Name=JBoss Application Server 4.0 +OpenIDE-Module-Name=JBoss Application Server OpenIDE-Module-Display-Category=Java EE -OpenIDE-Module-Short-Description=Plugin for JBoss Application Server 4.0 -OpenIDE-Module-Long-Description=The plugin enables J2EE development modules to configure and deploy J2EE components on JBoss Application Server 4.0. +OpenIDE-Module-Short-Description=Plugin for JBoss Application Server +OpenIDE-Module-Long-Description=The plugin enables J2EE development modules to configure and deploy J2EE components on JBoss Application Server. Index: src/org/netbeans/modules/j2ee/jboss4/util/JBProperties.java =================================================================== RCS file: /cvs/serverplugins/jboss4/src/org/netbeans/modules/j2ee/jboss4/util/JBProperties.java,v retrieving revision 1.1.2.4.20.1 diff -u -r1.1.2.4.20.1 JBProperties.java --- src/org/netbeans/modules/j2ee/jboss4/util/JBProperties.java 3 Jan 2007 19:24:18 -0000 1.1.2.4.20.1 +++ src/org/netbeans/modules/j2ee/jboss4/util/JBProperties.java 20 Feb 2007 14:53:58 -0000 @@ -39,7 +39,6 @@ import org.openide.ErrorManager; import org.openide.filesystems.FileUtil; import org.openide.modules.InstalledFileLocator; -import org.openide.util.Enumerations; /** * Helper class that makes it easier to access and set JBoss instance properties. @@ -83,8 +82,13 @@ ip = manager.getInstanceProperties(); } - public boolean isJavaEE5() { - return new File(getServerDir(), "deploy/ejb3.deployer").exists(); // NOI18N + public boolean supportsJavaEE5ejb3() { + return new File(getServerDir(), "deploy/ejb3.deployer").exists() || // JBoss 4 // NOI18N + new File(getServerDir(), "deployers/ejb3.deployer").exists(); // JBoss 5 // NOI18N + } + + public boolean supportsJavaEE5web() { + return new File(getServerDir(), "deployers/jbossweb.deployer").exists(); // JBoss 5 // NOI18N } public File getServerDir() { @@ -139,17 +143,25 @@ File rootDir = getRootDir(); File serverDir = getServerDir(); list.add(fileToUrl(new File(rootDir, "client/jboss-j2ee.jar"))); // NOI18N - if (isJavaEE5()) { - File wsClientLib = new File(rootDir, "client/jbossws-client.jar"); // NOI18N - if (wsClientLib.exists()) { - list.add(fileToUrl(wsClientLib)); - } + + File wsClientLib = new File(rootDir, "client/jbossws-client.jar"); // NOI18N + if (wsClientLib.exists()) { + list.add(fileToUrl(wsClientLib)); } + addFiles(new File(rootDir, "lib"), list); //NOI18N addFiles(new File(serverDir, "/lib"), list); //NOI18N - if (isJavaEE5()) { - addFiles(new File(serverDir, "/deploy/ejb3.deployer/"), list); // NOI18N + if (supportsJavaEE5ejb3()) { + File ejb3deployer = new File(serverDir, "/deploy/ejb3.deployer/"); // NOI18N + if (ejb3deployer.exists()) { + addFiles(ejb3deployer, list); + } + else + if ((ejb3deployer = new File(serverDir, "/deployers/ejb3.deployer/")).exists()) { // NOI18N + addFiles(ejb3deployer, list); + } } + File jsfAPI = new File(serverDir, "/deploy/jbossweb-tomcat55.sar/jsf-libs/myfaces-api.jar"); // NOI18N if (jsfAPI.exists()) { try { @@ -158,8 +170,25 @@ ErrorManager.getDefault().notify(ErrorManager.INFORMATIONAL, e); } } + else + if ((jsfAPI = new File(serverDir, "/deployers/jbossweb.deployer/jsf-libs/jsf-api.jar")).exists()) { // NOI18N + try { + list.add(fileToUrl(jsfAPI)); + } catch (MalformedURLException e) { + ErrorManager.getDefault().notify(ErrorManager.INFORMATIONAL, e); + } + } + File jsfIMPL = new File(serverDir, "/deploy/jbossweb-tomcat55.sar/jsf-libs/myfaces-impl.jar"); // NOI18N if (jsfIMPL.exists()) { + try { + list.add(fileToUrl(jsfIMPL)); + } catch (MalformedURLException e) { + ErrorManager.getDefault().notify(ErrorManager.INFORMATIONAL, e); + } + } + else + if ((jsfIMPL = new File(serverDir, "/deployers/jbossweb.deployer/jsf-libs/jsf-impl.jar")).exists()) { // NOI18N try { list.add(fileToUrl(jsfIMPL)); } catch (MalformedURLException e) { Index: test/qa-functional/src/org/netbeans/modules/j2ee/jboss4/test/JBoss4TestSuite.java =================================================================== RCS file: /cvs/serverplugins/jboss4/test/qa-functional/src/org/netbeans/modules/j2ee/jboss4/test/JBoss4TestSuite.java,v retrieving revision 1.8.2.1.2.4 diff -u -r1.8.2.1.2.4 JBoss4TestSuite.java --- test/qa-functional/src/org/netbeans/modules/j2ee/jboss4/test/JBoss4TestSuite.java 24 Jul 2006 15:21:47 -0000 1.8.2.1.2.4 +++ test/qa-functional/src/org/netbeans/modules/j2ee/jboss4/test/JBoss4TestSuite.java 20 Feb 2007 14:53:58 -0000 @@ -55,7 +55,7 @@ */ public class JBoss4TestSuite extends NbTestCase { - private static final String DISPLAY_NAME = "JBoss Application Server 4"; + private static final String DISPLAY_NAME = "JBoss Application Server"; private static final String EJB_PROJECT_NAME = "JBoss4EjbTest"; private static final String WEB_PROJECT_NAME = "JBoss4WebTest"; private static final String EJB_PROJECT_PATH = System.getProperty("xtest.tmpdir") + File.separator + EJB_PROJECT_NAME; Index: test/qa-functional/src/org/netbeans/test/j2ee/jboss4/JBossValidation.java =================================================================== RCS file: /cvs/serverplugins/jboss4/test/qa-functional/src/org/netbeans/test/j2ee/jboss4/JBossValidation.java,v retrieving revision 1.1.4.2.2.2 diff -u -r1.1.4.2.2.2 JBossValidation.java --- test/qa-functional/src/org/netbeans/test/j2ee/jboss4/JBossValidation.java 1 Jul 2006 05:25:16 -0000 1.1.4.2.2.2 +++ test/qa-functional/src/org/netbeans/test/j2ee/jboss4/JBossValidation.java 20 Feb 2007 14:53:58 -0000 @@ -100,7 +100,7 @@ Node node = new Node(new RuntimeTabOperator().getRootNode(),Bundle.getStringTrimmed("org.netbeans.modules.j2ee.deployment.impl.ui.Bundle", "SERVER_REGISTRY_NODE")); node.performPopupActionNoBlock(Bundle.getStringTrimmed("org.netbeans.modules.j2ee.deployment.impl.ui.actions.Bundle", "LBL_Add_Server_Instance")); NbDialogOperator dialog = new NbDialogOperator(Bundle.getStringTrimmed("org.netbeans.modules.j2ee.deployment.impl.ui.wizard.Bundle", "LBL_ASIW_Title")); - new JComboBoxOperator(dialog).selectItem("JBoss Application Server 4"); + new JComboBoxOperator(dialog).selectItem("JBoss Application Server"); new JButtonOperator(dialog,Bundle.getStringTrimmed("org.openide.Bundle", "CTL_NEXT")).push(); new JTextFieldOperator(dialog).setText(""); new JTextFieldOperator(dialog).typeText(path); @@ -134,7 +134,7 @@ Node serverNode = new Node(runtimeTab.getRootNode(), Bundle.getStringTrimmed("org.netbeans.modules.j2ee.deployment.impl.ui.Bundle", "SERVER_REGISTRY_NODE") +"|JBoss"); serverNode.performPopupAction(Bundle.getStringTrimmed("org.netbeans.modules.j2ee.deployment.impl.ui.Bundle", "LBL_Stop")); - org.netbeans.test.j2ee.lib.ProgressOperator.waitFinished("Stopping JBoss Application Server 4.0",300000); + org.netbeans.test.j2ee.lib.ProgressOperator.waitFinished("Stopping JBoss Application Server",300000); new org.netbeans.jemmy.EventTool().waitNoEvent(2000); } @@ -234,7 +234,7 @@ +"|JBoss"); serverNode.performPopupAction(Bundle.getStringTrimmed("org.netbeans.modules.j2ee.deployment.impl.ui.Bundle", "LBL_Start")); - org.netbeans.test.j2ee.lib.ProgressOperator.waitFinished("Starting JBoss Application Server 4.0",300000); + org.netbeans.test.j2ee.lib.ProgressOperator.waitFinished("Starting JBoss Application Server",300000); new org.netbeans.jemmy.EventTool().waitNoEvent(2000); }