diff --git a/j2ee.jboss4/src/org/netbeans/modules/j2ee/jboss4/util/JBProperties.java b/j2ee.jboss4/src/org/netbeans/modules/j2ee/jboss4/util/JBProperties.java --- a/j2ee.jboss4/src/org/netbeans/modules/j2ee/jboss4/util/JBProperties.java +++ b/j2ee.jboss4/src/org/netbeans/modules/j2ee/jboss4/util/JBProperties.java @@ -185,12 +185,16 @@ List list = new ArrayList(); try { File rootDir = getRootDir(); - File serverDir = getServerDir(); + File serverDir = getServerDir(); + File commonLibDir = new File(rootDir, "common" + File.separator + "lib"); - File javaEE = new File(rootDir, "client/jboss-j2ee.jar"); // NOI18N - if (!javaEE.exists()) { - // jboss 5 - javaEE = new File(rootDir, "client/jboss-javaee.jar"); // NOI18N + File javaEE = new File(commonLibDir, "jboss-javaee.jar"); + if(!javaEE.exists()) { + javaEE = new File(rootDir, "client/jboss-j2ee.jar"); // NOI18N + if (!javaEE.exists()) { + // jboss 5 + javaEE = new File(rootDir, "client/jboss-javaee.jar"); // NOI18N + } } if (javaEE.exists()) { @@ -209,14 +213,22 @@ addFiles(new File(rootDir, "lib"), list); // NOI18N addFiles(new File(serverDir, "lib"), list); // NOI18N + + // Add common libs for JBoss 5.x + String[] commonLibs = {"servlet-api.jar", + "jsp-api.jar", "el-api.jar", "mail.jar", "jboss-jsr77.jar", + "ejb3-persistence.jar", "jbossws-native-jaxws.jar", + "jbossws-native-jaxws-ext.jar", "jbossws-native-jaxrpc.jar", + "jbossws-native-saaj.jar"}; - // FIXME shouldn't we use whole cmmon in JB5 - File jspAPI = new File(rootDir, "common" + File.separator + "lib" + File.separator + "jsp-api.jar"); - if (jspAPI.exists()) { - list.add(fileToUrl(jspAPI)); + for(int i = 0; i < commonLibs.length; i++) { + File libJar = new File(commonLibDir, commonLibs[i]); + + if(libJar.exists()) { + list.add(fileToUrl(libJar)); + } } - if (supportsJavaEE5ejb3()) { File ejb3deployer = new File(serverDir, "/deploy/ejb3.deployer/"); // NOI18N if (ejb3deployer.exists()) { @@ -266,6 +278,27 @@ } catch (MalformedURLException e) { LOGGER.log(Level.INFO, null, e); } + } + + File jstlImpl = new File(serverDir, "/deploy/jbossweb.sar/jstl.jar"); // NOI18N + if (jstlImpl.exists()) { + try { + list.add(fileToUrl(jstlImpl)); + } catch (MalformedURLException e) { + LOGGER.log(Level.INFO, null, e); + } + } else if ((jstlImpl = new File(serverDir, "/deploy/jboss-web.deployer/jstl.jar")).exists()) { // NOI18N + try { + list.add(fileToUrl(jstlImpl)); + } catch (MalformedURLException e) { + LOGGER.log(Level.INFO, null, e); + } + } else if ((jstlImpl = new File(serverDir, "/deploy/jbossweb-tomcat55.sar/jsf-libs/jstl.jar")).exists()) { // NOI18N + try { + list.add(fileToUrl(jstlImpl)); + } catch (MalformedURLException e) { + LOGGER.log(Level.INFO, null, e); + } } } catch (MalformedURLException e) { LOGGER.log(Level.INFO, null, e); @@ -277,8 +310,8 @@ public boolean accept(File dir, String name) { return name.endsWith(".jar") || new File(dir, name).isDirectory(); // NOI18N } - } - + } + private void addFiles(File folder, List l) { File files [] = folder.listFiles(new FF()); if (files == null)