Re: beanshell using wrong case when looking for class

Brad Mace <[email protected]> Mon, 29 Oct 2012 11:39:21 -0500
Newsgroups gmane.comp.java.beanshell.user
Message-ID <[email protected]>
Thanks for the suggestion, that doesn't appear to be it though.  I added 
these two lines right before the eval:

             logger.trace("Plugin class exists? {}", 
bs.getClassManager().classExists("com.callmeyer.commons.plugin.Plugin"));
             logger.trace("plugin class exists? {}", 
bs.getClassManager().classExists("com.callmeyer.commons.plugin.plugin"));

The first prints "true", while the second causes the exception I 
reported. Something must be causing it to deliberately look for the 
lowercase version, but a global search of my code base didn't find 
anything that could cause it. My suspicion is that it's something 
related to BSHAmbiguousName in the stack trace. For some reason it 
thinks there's an ambiguity, and it's attempted to resolve it 
incorrectly. Not sure what to do about it though.

On 10/29/2012 10:12 AM, David Lee wrote:
> Looks like it found "plugin" while looking for "Plugin"
> Check to see if you might have a lower case file lying around in the directory or jar file(s)
>
> ----------------------------------------
> David A. Lee
> [email protected]
> http://www.xmlsh.org
>
> -----Original Message-----
> From: Brad Mace [mailto:[email protected]]
> Sent: Monday, October 29, 2012 11:00 AM
> To: beanshell-users-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
> Subject: [Beanshell-users] beanshell using wrong case when looking for class
>
> I've spent days trying to locate the cause of this problem. The actual
> class is com.example.commons.plugin.Plugin, but it appears to be looking
> for .plugin. Has anyone seen this before? Do you know what causes it to
> look for the wrong name?
>
> A class required by class: com.example.commons.plugin.plugin could not
> be loaded:
> java.lang.NoClassDefFoundError: com/example/commons/plugin/plugin (wrong
> name: com/example/commons/plugin/Plugin)  at
> bsh.BshClassManager.noClassDefFound
>     at bsh.BshClassManager.plainClassForName
>     at bsh.BshClassManager.classForName
>     at bsh.NameSpace.classForName
>     at bsh.NameSpace.getImportedClassImpl
>     at bsh.NameSpace.getClassImpl
>     at bsh.NameSpace.getClass
>     at bsh.Name.consumeNextObjectField
>     at bsh.Name.toObject
>     at bsh.BSHAmbiguousName.toObject
>     at bsh.BSHAllocationExpression.objectAllocation
>     at bsh.BSHAllocationExpression.eval
>     at bsh.BSHPrimaryExpression.eval
>     at bsh.BSHPrimaryExpression.eval
>     at bsh.Interpreter.eval
>     at bsh.Interpreter.eval
>     at bsh.Interpreter.eval
>
> ------------------------------------------------------------------------------
> The Windows 8 Center - In partnership with Sourceforge
> Your idea - your app - 30 days.
> Get started!
> http://windows8center.sourceforge.net/
> what-html-developers-need-to-know-about-coding-windows-8-metro-style-apps/
> _______________________________________________
> Beanshell-users mailing list
> Beanshell-users-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
> https://lists.sourceforge.net/lists/listinfo/beanshell-users
>
>


------------------------------------------------------------------------------
The Windows 8 Center - In partnership with Sourceforge
Your idea - your app - 30 days.
Get started!
http://windows8center.sourceforge.net/
what-html-developers-need-to-know-about-coding-windows-8-metro-style-apps/