Plugin class loader problem

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Plugin class loader problem

Dawson, Lewis
I am currently developing a squirrel plug-in and I have run into an
issue that has me stumped. I am having an issue with the class loader
not being able to load my resource bundle. A stack trace of the issue:

java.util.MissingResourceException: Can't find bundle for base name
com.teradata.squirrel_sql.plugins.daogenerator.plugin.DAOGeneratorPlugin
Resources, locale en_US
        at
java.util.ResourceBundle.throwMissingResourceException(ResourceBundle.ja
va:836)
        at
java.util.ResourceBundle.getBundleImpl(ResourceBundle.java:805)
        at java.util.ResourceBundle.getBundle(ResourceBundle.java:699)
        at
net.sourceforge.squirrel_sql.fw.util.Resources.<init>(Resources.java:90)
        at
net.sourceforge.squirrel_sql.client.plugin.PluginResources.<init>(Plugin
Resources.java:26)
        .
        .

I am loading the resoure bundle as follows:

public class GeneratorPlugin extends DefaultSessionPlugin
{
public synchronized void initialize() throws PluginException
    {
        super.initialize();

        pluginResources = new GeneratorPluginResources(this);
    }
}

public final class GeneratorPluginResources extends PluginResources
{
    /**
     *
     * @param plugin
     */
    public GeneratorPluginResources(final IPlugin plugin)
    {
        super(GeneratorPluginResources.class.getName(), plugin);
    }

}

My Resource file resides in the same package as the GeneratorPlugin.java
and the GeneratorPluginResources.java classes and is named
GeneratorPluginResources.properties (hence the
GeneratorPluginResources.class.getName() call). I have traced through
the class loader code and I see that it is getting the correct name for
the .properties file. I see the .properties file in the .jar file that I
am copying to the /plugins directory of my squirrel install, so I know
the file does exsist. Any ideas/help would be greatly appreciated! Thank
you!


Lewis Dawson
[hidden email]

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Squirrel-sql-develop mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/squirrel-sql-develop
Reply | Threaded
Open this post in threaded view
|

Plugin class loader problem

Dawson, Lewis
I pasted the wrong stack trace in the previous email. Here is the
correct stack trace:

java.util.MissingResourceException: Can't find bundle for base name
com.teradata.squirrel_sql.plugins.generator.plugin.GeneratorPlugin
Resources, locale en_US
        at
java.util.ResourceBundle.throwMissingResourceException(ResourceBundle.ja
va:836)
        at
java.util.ResourceBundle.getBundleImpl(ResourceBundle.java:805)
        at java.util.ResourceBundle.getBundle(ResourceBundle.java:699)
        at
net.sourceforge.squirrel_sql.fw.util.Resources.<init>(Resources.java:90)
        at
net.sourceforge.squirrel_sql.client.plugin.PluginResources.<init>(Plugin
Resources.java:26)
        .
        .


Lewis Dawson
Viewpoint Development
[hidden email]
(858) 485-2481

-----Original Message-----
From: Dawson, Lewis
Sent: Tuesday, November 04, 2008 11:19 AM
To: [hidden email]
Subject: [Squirrel-sql-develop] Plugin class loader problem

I am currently developing a squirrel plug-in and I have run into an
issue that has me stumped. I am having an issue with the class loader
not being able to load my resource bundle. A stack trace of the issue:

java.util.MissingResourceException: Can't find bundle for base name
com.teradata.squirrel_sql.plugins.daogenerator.plugin.DAOGeneratorPlugin
Resources, locale en_US
        at
java.util.ResourceBundle.throwMissingResourceException(ResourceBundle.ja
va:836)
        at
java.util.ResourceBundle.getBundleImpl(ResourceBundle.java:805)
        at java.util.ResourceBundle.getBundle(ResourceBundle.java:699)
        at
net.sourceforge.squirrel_sql.fw.util.Resources.<init>(Resources.java:90)
        at
net.sourceforge.squirrel_sql.client.plugin.PluginResources.<init>(Plugin
Resources.java:26)
        .
        .

I am loading the resoure bundle as follows:

public class GeneratorPlugin extends DefaultSessionPlugin { public
synchronized void initialize() throws PluginException
    {
        super.initialize();

        pluginResources = new GeneratorPluginResources(this);
    }
}

public final class GeneratorPluginResources extends PluginResources {
    /**
     *
     * @param plugin
     */
    public GeneratorPluginResources(final IPlugin plugin)
    {
        super(GeneratorPluginResources.class.getName(), plugin);
    }

}

My Resource file resides in the same package as the GeneratorPlugin.java
and the GeneratorPluginResources.java classes and is named
GeneratorPluginResources.properties (hence the
GeneratorPluginResources.class.getName() call). I have traced through
the class loader code and I see that it is getting the correct name for
the .properties file. I see the .properties file in the .jar file that I
am copying to the /plugins directory of my squirrel install, so I know
the file does exsist. Any ideas/help would be greatly appreciated! Thank
you!


Lewis Dawson
[hidden email]

------------------------------------------------------------------------
-
This SF.Net email is sponsored by the Moblin Your Move Developer's
challenge Build the coolest Linux based applications with Moblin SDK &
win great prizes Grand prize is a trip for two to an Open Source event
anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Squirrel-sql-develop mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/squirrel-sql-develop

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Squirrel-sql-develop mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/squirrel-sql-develop
Reply | Threaded
Open this post in threaded view
|

Re: Plugin class loader problem

Robert Manning
GeneratorPluginResources.properties file should be in the package
com.teradata.squirrel_sql.plugins.generator.plugin in your "generator.jar" file.

Rob

On Tue, Nov 4, 2008 at 4:31 PM, Dawson, Lewis <[hidden email]> wrote:

> I pasted the wrong stack trace in the previous email. Here is the
> correct stack trace:
>
> java.util.MissingResourceException: Can't find bundle for base name
> com.teradata.squirrel_sql.plugins.generator.plugin.GeneratorPlugin
> Resources, locale en_US
>        at
> java.util.ResourceBundle.throwMissingResourceException(ResourceBundle.ja
> va:836)
>        at
> java.util.ResourceBundle.getBundleImpl(ResourceBundle.java:805)
>        at java.util.ResourceBundle.getBundle(ResourceBundle.java:699)
>        at
> net.sourceforge.squirrel_sql.fw.util.Resources.<init>(Resources.java:90)
>        at
> net.sourceforge.squirrel_sql.client.plugin.PluginResources.<init>(Plugin
> Resources.java:26)
>        .
>        .
>
>
> Lewis Dawson
> Viewpoint Development
> [hidden email]
> (858) 485-2481
>
> -----Original Message-----
> From: Dawson, Lewis
> Sent: Tuesday, November 04, 2008 11:19 AM
> To: [hidden email]
> Subject: [Squirrel-sql-develop] Plugin class loader problem
>
> I am currently developing a squirrel plug-in and I have run into an
> issue that has me stumped. I am having an issue with the class loader
> not being able to load my resource bundle. A stack trace of the issue:
>
> java.util.MissingResourceException: Can't find bundle for base name
> com.teradata.squirrel_sql.plugins.daogenerator.plugin.DAOGeneratorPlugin
> Resources, locale en_US
>        at
> java.util.ResourceBundle.throwMissingResourceException(ResourceBundle.ja
> va:836)
>        at
> java.util.ResourceBundle.getBundleImpl(ResourceBundle.java:805)
>        at java.util.ResourceBundle.getBundle(ResourceBundle.java:699)
>        at
> net.sourceforge.squirrel_sql.fw.util.Resources.<init>(Resources.java:90)
>        at
> net.sourceforge.squirrel_sql.client.plugin.PluginResources.<init>(Plugin
> Resources.java:26)
>        .
>        .
>
> I am loading the resoure bundle as follows:
>
> public class GeneratorPlugin extends DefaultSessionPlugin { public
> synchronized void initialize() throws PluginException
>    {
>        super.initialize();
>
>        pluginResources = new GeneratorPluginResources(this);
>    }
> }
>
> public final class GeneratorPluginResources extends PluginResources {
>    /**
>     *
>     * @param plugin
>     */
>    public GeneratorPluginResources(final IPlugin plugin)
>    {
>        super(GeneratorPluginResources.class.getName(), plugin);
>    }
>
> }
>
> My Resource file resides in the same package as the GeneratorPlugin.java
> and the GeneratorPluginResources.java classes and is named
> GeneratorPluginResources.properties (hence the
> GeneratorPluginResources.class.getName() call). I have traced through
> the class loader code and I see that it is getting the correct name for
> the .properties file. I see the .properties file in the .jar file that I
> am copying to the /plugins directory of my squirrel install, so I know
> the file does exsist. Any ideas/help would be greatly appreciated! Thank
> you!
>
>
> Lewis Dawson
> [hidden email]
>
> ------------------------------------------------------------------------
> -
> This SF.Net email is sponsored by the Moblin Your Move Developer's
> challenge Build the coolest Linux based applications with Moblin SDK &
> win great prizes Grand prize is a trip for two to an Open Source event
> anywhere in the world
> http://moblin-contest.org/redirect.php?banner_id=100&url=/
> _______________________________________________
> Squirrel-sql-develop mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/squirrel-sql-develop
>
> -------------------------------------------------------------------------
> This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
> Build the coolest Linux based applications with Moblin SDK & win great prizes
> Grand prize is a trip for two to an Open Source event anywhere in the world
> http://moblin-contest.org/redirect.php?banner_id=100&url=/
> _______________________________________________
> Squirrel-sql-develop mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/squirrel-sql-develop
>

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Squirrel-sql-develop mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/squirrel-sql-develop