<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Developing A Simple Pluggable Java Application</title>
	<atom:link href="http://solitarygeek.com/java/a-simple-pluggable-java-application/feed" rel="self" type="application/rss+xml" />
	<link>http://solitarygeek.com/java/a-simple-pluggable-java-application</link>
	<description>James Selvakumar&#039;s Blog</description>
	<lastBuildDate>Sat, 22 Oct 2011 13:54:09 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
	<item>
		<title>By: Xavier</title>
		<link>http://solitarygeek.com/java/a-simple-pluggable-java-application/comment-page-1#comment-28533</link>
		<dc:creator>Xavier</dc:creator>
		<pubDate>Sat, 10 Sep 2011 12:40:26 +0000</pubDate>
		<guid isPermaLink="false">http://www.solitarygeek.com/java/a-simple-pluggable-java-application/#comment-28533</guid>
		<description>Hi, very usefull post. I use it in my java simple executable app, it work so good. But when I want to use it in servlet in Tomcat, ClassCastException is throw by ServiceLoader when getting iterator (getPlugins). Have you heared something that ?
I thought it&#039;s same thing that a tomcat Classloader  bord effect... Please help me ! 

Sorry for my frenlish :)

Xavier</description>
		<content:encoded><![CDATA[<p>Hi, very usefull post. I use it in my java simple executable app, it work so good. But when I want to use it in servlet in Tomcat, ClassCastException is throw by ServiceLoader when getting iterator (getPlugins). Have you heared something that ?<br />
I thought it&#8217;s same thing that a tomcat Classloader  bord effect&#8230; Please help me ! </p>
<p>Sorry for my frenlish <img src='http://solitarygeek.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Xavier</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: uyalap</title>
		<link>http://solitarygeek.com/java/a-simple-pluggable-java-application/comment-page-1#comment-28453</link>
		<dc:creator>uyalap</dc:creator>
		<pubDate>Fri, 09 Sep 2011 08:06:33 +0000</pubDate>
		<guid isPermaLink="false">http://www.solitarygeek.com/java/a-simple-pluggable-java-application/#comment-28453</guid>
		<description>Thanks James. Very useful post.</description>
		<content:encoded><![CDATA[<p>Thanks James. Very useful post.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Adam</title>
		<link>http://solitarygeek.com/java/a-simple-pluggable-java-application/comment-page-1#comment-28196</link>
		<dc:creator>Adam</dc:creator>
		<pubDate>Sun, 04 Sep 2011 07:20:53 +0000</pubDate>
		<guid isPermaLink="false">http://www.solitarygeek.com/java/a-simple-pluggable-java-application/#comment-28196</guid>
		<description>James,
I know this is quite an old post, but I am having the same problem as Sathish. I get &quot;No plugins were found&quot; when I run Main. I have all the files set up the way mentioned in this article, but it would not compile so I moved in dependancies and built the plugin jar, copied it to the plugins folder, I have the META/services file in place (in fact I copied it to the main app project as well to test that as well). I copied all the code and pasted directly from this webpage. Nothing works. Any ideas?

Here is a screenshot of my project files and the Files list:
http://i.imgur.com/4BPFi.jpg</description>
		<content:encoded><![CDATA[<p>James,<br />
I know this is quite an old post, but I am having the same problem as Sathish. I get &#8220;No plugins were found&#8221; when I run Main. I have all the files set up the way mentioned in this article, but it would not compile so I moved in dependancies and built the plugin jar, copied it to the plugins folder, I have the META/services file in place (in fact I copied it to the main app project as well to test that as well). I copied all the code and pasted directly from this webpage. Nothing works. Any ideas?</p>
<p>Here is a screenshot of my project files and the Files list:<br />
<a href="http://i.imgur.com/4BPFi.jpg" rel="nofollow">http://i.imgur.com/4BPFi.jpg</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: James</title>
		<link>http://solitarygeek.com/java/a-simple-pluggable-java-application/comment-page-1#comment-8197</link>
		<dc:creator>James</dc:creator>
		<pubDate>Tue, 21 Dec 2010 03:41:10 +0000</pubDate>
		<guid isPermaLink="false">http://www.solitarygeek.com/java/a-simple-pluggable-java-application/#comment-8197</guid>
		<description>@Suchitto Palit

&lt;cite&gt;1&gt; The class StandardPluginService.java is a Singleton, isn’t it ?&lt;/cite&gt;

 - Yes the StandardPluginService is a singleton.

&lt;cite&gt;2&gt; In the Main.java line 10 we do not need that line of code
“private static Logger logger = Logger.getLogger(Main.class.getName());”Isn’t it?&lt;/cite&gt;

  - Logging is upto you and is not mandatory but it&#039;s a good practice to log.

&lt;cite&gt; 3&gt; In ClasspathUtils.java line 59 I changed “Class sysclass = URLClassLoader.class;” to “Class sysclass = URLClassLoader.class;” .&lt;/cite&gt;

 - Sorry, I don&#039;t understand what do you mean here.</description>
		<content:encoded><![CDATA[<p>@Suchitto Palit</p>
<p><cite>1> The class StandardPluginService.java is a Singleton, isn’t it ?</cite></p>
<p> &#8211; Yes the StandardPluginService is a singleton.</p>
<p><cite>2> In the Main.java line 10 we do not need that line of code<br />
“private static Logger logger = Logger.getLogger(Main.class.getName());”Isn’t it?</cite></p>
<p>  &#8211; Logging is upto you and is not mandatory but it&#8217;s a good practice to log.</p>
<p><cite> 3> In ClasspathUtils.java line 59 I changed “Class sysclass = URLClassLoader.class;” to “Class sysclass = URLClassLoader.class;” .</cite></p>
<p> &#8211; Sorry, I don&#8217;t understand what do you mean here.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: James</title>
		<link>http://solitarygeek.com/java/a-simple-pluggable-java-application/comment-page-1#comment-8196</link>
		<dc:creator>James</dc:creator>
		<pubDate>Tue, 21 Dec 2010 03:35:54 +0000</pubDate>
		<guid isPermaLink="false">http://www.solitarygeek.com/java/a-simple-pluggable-java-application/#comment-8196</guid>
		<description>@Kevin Thanks for the nice suggestion. Yes, I&#039;m aware of the issues associated with the system class loader.</description>
		<content:encoded><![CDATA[<p>@Kevin Thanks for the nice suggestion. Yes, I&#8217;m aware of the issues associated with the system class loader.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: James</title>
		<link>http://solitarygeek.com/java/a-simple-pluggable-java-application/comment-page-1#comment-8195</link>
		<dc:creator>James</dc:creator>
		<pubDate>Tue, 21 Dec 2010 03:32:36 +0000</pubDate>
		<guid isPermaLink="false">http://www.solitarygeek.com/java/a-simple-pluggable-java-application/#comment-8195</guid>
		<description>@Satish Did you create the respective files in &quot;META-INF&quot; folder?</description>
		<content:encoded><![CDATA[<p>@Satish Did you create the respective files in &#8220;META-INF&#8221; folder?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sathish</title>
		<link>http://solitarygeek.com/java/a-simple-pluggable-java-application/comment-page-1#comment-7899</link>
		<dc:creator>Sathish</dc:creator>
		<pubDate>Thu, 16 Dec 2010 07:16:32 +0000</pubDate>
		<guid isPermaLink="false">http://www.solitarygeek.com/java/a-simple-pluggable-java-application/#comment-7899</guid>
		<description>Hi I got the following output. But I placed the plugin-jar files in proper folder. I don&#039;t know where the mistake is..

16 Dec, 2010 12:41:18 PM com.pluggableapp.StandardPluginService initPlugins
INFO: No plugins were found!

Regards,
Sathish</description>
		<content:encoded><![CDATA[<p>Hi I got the following output. But I placed the plugin-jar files in proper folder. I don&#8217;t know where the mistake is..</p>
<p>16 Dec, 2010 12:41:18 PM com.pluggableapp.StandardPluginService initPlugins<br />
INFO: No plugins were found!</p>
<p>Regards,<br />
Sathish</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bruce</title>
		<link>http://solitarygeek.com/java/a-simple-pluggable-java-application/comment-page-1#comment-5292</link>
		<dc:creator>Bruce</dc:creator>
		<pubDate>Tue, 16 Nov 2010 21:13:35 +0000</pubDate>
		<guid isPermaLink="false">http://www.solitarygeek.com/java/a-simple-pluggable-java-application/#comment-5292</guid>
		<description>James,

I have followed your example to the T, but get this error when I run it:
Nov 16, 2010 2:03:29 PM pluggableapp.StandardPluginService initPlugins
INFO: No plugins were found!

Any ideas?

TIA,

Bruce</description>
		<content:encoded><![CDATA[<p>James,</p>
<p>I have followed your example to the T, but get this error when I run it:<br />
Nov 16, 2010 2:03:29 PM pluggableapp.StandardPluginService initPlugins<br />
INFO: No plugins were found!</p>
<p>Any ideas?</p>
<p>TIA,</p>
<p>Bruce</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kevin</title>
		<link>http://solitarygeek.com/java/a-simple-pluggable-java-application/comment-page-1#comment-489</link>
		<dc:creator>Kevin</dc:creator>
		<pubDate>Thu, 08 Jul 2010 10:09:17 +0000</pubDate>
		<guid isPermaLink="false">http://www.solitarygeek.com/java/a-simple-pluggable-java-application/#comment-489</guid>
		<description>Hi, very useful indead, thanks a lot;
but don&#039;t you prefer this version:
&lt;code&gt;
    public static ClassLoader addDirToClasspath(File directory) throws IOException {
        MyURLClassLoader cl = new MyURLClassLoader() ;
        if (directory.exists())
            for (File file : directory.listFiles())
                if (file.getName().endsWith(&quot;.jar&quot;)) &lt;strong&gt;cl.addURL(file.toURI().toURL())&lt;/strong&gt;;
        return cl ;
    }

    private static class MyURLClassLoader extends URLClassLoader {
        public MyURLClassLoader() {
            super(new URL[]{}) ;
        }
        @Override
        public void addURL(URL url) {
            super.addURL(url);
        }
    }
&lt;/code&gt;
which doesn&#039;t rely on the System classloader to to an URLClassLoader, doesn&#039;t use reflection to access illegaly addURL, and also doesn&#039;t create a class &lt;a href=&quot;http://www.freshblurbs.com/explaining-java-lang-outofmemoryerror-permgen-space&quot; rel=&quot;nofollow&quot;&gt;leak&lt;/a&gt; when you unload you app? (please let me know if you see any drawback, it&#039;s just an open suggestion)</description>
		<content:encoded><![CDATA[<p>Hi, very useful indead, thanks a lot;<br />
but don&#8217;t you prefer this version:<br />
<code><br />
    public static ClassLoader addDirToClasspath(File directory) throws IOException {<br />
        MyURLClassLoader cl = new MyURLClassLoader() ;<br />
        if (directory.exists())<br />
            for (File file : directory.listFiles())<br />
                if (file.getName().endsWith(".jar")) <strong>cl.addURL(file.toURI().toURL())</strong>;<br />
        return cl ;<br />
    }</p>
<p>    private static class MyURLClassLoader extends URLClassLoader {<br />
        public MyURLClassLoader() {<br />
            super(new URL[]{}) ;<br />
        }<br />
        @Override<br />
        public void addURL(URL url) {<br />
            super.addURL(url);<br />
        }<br />
    }<br />
</code><br />
which doesn&#8217;t rely on the System classloader to to an URLClassLoader, doesn&#8217;t use reflection to access illegaly addURL, and also doesn&#8217;t create a class <a href="http://www.freshblurbs.com/explaining-java-lang-outofmemoryerror-permgen-space" rel="nofollow">leak</a> when you unload you app? (please let me know if you see any drawback, it&#8217;s just an open suggestion)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: tugalsan</title>
		<link>http://solitarygeek.com/java/a-simple-pluggable-java-application/comment-page-1#comment-455</link>
		<dc:creator>tugalsan</dc:creator>
		<pubDate>Tue, 15 Jun 2010 07:38:46 +0000</pubDate>
		<guid isPermaLink="false">http://www.solitarygeek.com/java/a-simple-pluggable-java-application/#comment-455</guid>
		<description>- I takes to much time to configure for every program man;
- I am using javascript to &quot;plug in&quot; some code in my program, it basicly changes whole program into another.
- I know it highly risky, but highly configurable. with one exe(jar) file and directing &quot;target directory&quot; to some other directory with &quot;plugins js files&quot; in it, i solved great deal. I am searching same style plug in framework with java-class files now.</description>
		<content:encoded><![CDATA[<p>- I takes to much time to configure for every program man;<br />
- I am using javascript to &#8220;plug in&#8221; some code in my program, it basicly changes whole program into another.<br />
- I know it highly risky, but highly configurable. with one exe(jar) file and directing &#8220;target directory&#8221; to some other directory with &#8220;plugins js files&#8221; in it, i solved great deal. I am searching same style plug in framework with java-class files now.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

