AnsweredAssumed Answered

Issues with Plugin Spring context

Question asked by jsalam on Aug 7, 2014

I am working on tweaking a plugin that has been already written in an  organization that I work with. When I upload a plugin I am getting an error saying that

"Exactly one plugin of class %s must be specified in spring.xml"

 

I checked everything there is only one class for the plugin. This is happening only when I deploy the plugin through localhost. Its fine when we upload to a dev server. I put a debug point and I was stepping through it to find the root cause and the error is being thrown from a Spring configurator class

Below is the code where the error has been thrown...

 

if (!(plugin instanceof DummyPlugin)) {

                String[] strings = ctx.getBeanFactory().getBeanNamesForType(plugin.getClass());

                if (strings.length != 1) {

                    throw new PluginConfigurationException(String.format(

                            "Exactly one plugin of class %s must be specified in spring.xml",

                            plugin.getClass().getName()));

                }

                ctx.getBeanFactory().configureBean(metaData.getPlugin(), strings[0]);

            }

 

.

It looks like the Spring context is not being initialized properly. Anyone has any insight on this?

 

Thanks,

Jaffrin

Outcomes