From: <do...@hy...> - 2007-05-24 02:32:50
|
Author: dougm Date: 2007-05-23 19:32:47 -0700 (Wed, 23 May 2007) New Revision: 4522 URL: http://svn.hyperic.org/?view=rev&root=Hyperic+HQ&revision=4522 Modified: trunk/plugins/weblogic/etc/hq-plugin.xml trunk/plugins/weblogic/src/org/hyperic/hq/plugin/weblogic/WeblogicDetector.java trunk/plugins/weblogic/src/org/hyperic/hq/plugin/weblogic/WeblogicFinder.java trunk/plugins/weblogic/src/org/hyperic/hq/plugin/weblogic/WeblogicProductPlugin.java Log: [HHQ-905] Adjust classpath during auto-discovery for wl services installed after HQ agent has been started Modified: trunk/plugins/weblogic/etc/hq-plugin.xml =================================================================== --- trunk/plugins/weblogic/etc/hq-plugin.xml 2007-05-24 00:27:52 UTC (rev 4521) +++ trunk/plugins/weblogic/etc/hq-plugin.xml 2007-05-24 02:32:47 UTC (rev 4522) @@ -27,6 +27,18 @@ <plugin name="weblogic" class="WeblogicProductPlugin"> + <classpath> + <!-- look for service pack jar as weblogic does in their scripts. --> + <include name="server/lib/weblogic_sp.jar"/> + <include name="server/lib/weblogic.jar"/> + <include name="server/lib/wlcipher.jar"/> + <include name="server/lib/webservices.jar"/> + <!-- 9.x+ssl --> + <include name="server/lib/jsafe.jar"/> + <!-- 6.1 --> + <include name="lib/weblogic.jar"/> + </classpath> + <!-- appended to every template --> <property name="template-config" value="admin.url=%admin.url%,admin.username=%admin.username%,admin.password=%admin.password%"/> Modified: trunk/plugins/weblogic/src/org/hyperic/hq/plugin/weblogic/WeblogicDetector.java =================================================================== --- trunk/plugins/weblogic/src/org/hyperic/hq/plugin/weblogic/WeblogicDetector.java 2007-05-24 00:27:52 UTC (rev 4521) +++ trunk/plugins/weblogic/src/org/hyperic/hq/plugin/weblogic/WeblogicDetector.java 2007-05-24 02:32:47 UTC (rev 4522) @@ -102,6 +102,11 @@ return new File(dir, scripts[0]); } } + + //just here to override protected access. + void adjustWeblogicClassPath(String installpath) { + adjustClassPath(installpath); + } public List getServerResources(ConfigResponse platformConfig, String path) throws PluginException { Modified: trunk/plugins/weblogic/src/org/hyperic/hq/plugin/weblogic/WeblogicFinder.java =================================================================== --- trunk/plugins/weblogic/src/org/hyperic/hq/plugin/weblogic/WeblogicFinder.java 2007-05-24 00:27:52 UTC (rev 4521) +++ trunk/plugins/weblogic/src/org/hyperic/hq/plugin/weblogic/WeblogicFinder.java 2007-05-24 02:32:47 UTC (rev 4522) @@ -187,6 +187,13 @@ WeblogicService service = (WeblogicService)services.get(i); paths.add(new File(service.getExecDir())); + + //adjust classpath to cover the case of weblogic service + //be installed after the HQ agent has been started. + File installpath = getInstallRoot(service.getBinaryPath()); + if (installpath != null) { + plugin.adjustWeblogicClassPath(installpath.getPath()); + } } return paths; } Modified: trunk/plugins/weblogic/src/org/hyperic/hq/plugin/weblogic/WeblogicProductPlugin.java =================================================================== --- trunk/plugins/weblogic/src/org/hyperic/hq/plugin/weblogic/WeblogicProductPlugin.java 2007-05-24 00:27:52 UTC (rev 4521) +++ trunk/plugins/weblogic/src/org/hyperic/hq/plugin/weblogic/WeblogicProductPlugin.java 2007-05-24 02:32:47 UTC (rev 4522) @@ -142,6 +142,9 @@ System.setProperty(key, (String)entry.getValue()); } + //the jars relative to installpath + String[] classpath = super.getClassPath(manager); + if (installpath == null) { File path = null; @@ -161,7 +164,7 @@ } if (path == null) { - return new String[0]; + return classpath; //can be adjusted later } else { installpath = path.getAbsolutePath(); @@ -194,14 +197,10 @@ } } catch (IOException e) { } - return new String[] { - //look for service pack jar as weblogic does in their scripts. - installpath + "/server/lib/weblogic_sp.jar", - installpath + "/server/lib/weblogic.jar", - installpath + "/server/lib/wlcipher.jar", - installpath + "/server/lib/webservices.jar", - installpath + "/server/lib/jsafe.jar", //9.x+ssl - installpath + "/lib/weblogic.jar" //6.1 - }; + for (int i=0; i<classpath.length; i++) { + classpath[i] = installpath + "/" + classpath[i]; + } + + return classpath; } } |