Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Backward compatibility issue in class org.springframework.beans.factory.config.PropertyPlaceholderConfigurer [SPR-6514] #11180

Closed
spring-projects-issues opened this issue Dec 3, 2009 · 8 comments
Assignees
Labels
in: core Issues in core modules (aop, beans, core, context, expression) type: bug A general bug
Milestone

Comments

@spring-projects-issues
Copy link
Collaborator

spring-projects-issues commented Dec 3, 2009

Aleš Najmann opened SPR-6514 and commented

There was class org.springframework.beans.factory.config.PropertyPlaceholderConfigurer in Spring 3.0 M4 with method

       /**
        * Parse the given String value recursively, to be able to resolve
        * nested placeholders (when resolved property values in turn contain
        * placeholders again).
        * @param strVal the String value to parse
        * @param props the Properties to resolve placeholders against
        * @param visitedPlaceholders the placeholders that have already been visited
        * during the current resolution attempt (used to detect circular references
        * between placeholders). Only non-null if we're parsing a nested placeholder.
        * @throws BeanDefinitionStoreException if invalid values are encountered
        * @see #resolvePlaceholder(String, java.util.Properties, int)
        */
       protected String parseStringValue(String strVal, Properties props,
Set visitedPlaceholders)
           throws BeanDefinitionStoreException {...}

class is still there, but was refactored quite a lot since M4 and above method with other methods were removed. But in more specific environments, like in Gigaspace in our case, there is problem with instanciation of the container because it relies on the method.

With no known workaround for it it's show stopper for deployment project on Gigaspace platform. It hits all releases since M4.
(...And I welcome any ideas.)


Affects: 3.0 RC1, 3.0 RC2, 3.0 RC3

Issue Links:

Referenced from: commits ad29a23

@spring-projects-issues
Copy link
Collaborator Author

spring-projects-issues commented Dec 8, 2009

Kenny MacLeod commented

Duplicate of #10981

@spring-projects-issues
Copy link
Collaborator Author

spring-projects-issues commented Dec 8, 2009

Juergen Hoeller commented

Indeed, this is the same issue as in #10981. However, Aleš, what exactly are you doing with that protected method? Are you overriding its use in PropertyPlaceholderConfigurer? Or are you calling it from outside in some way? Would be great if you could post your custom version of it, then I could suggest an appropriate solution...

Juergen

@spring-projects-issues
Copy link
Collaborator Author

spring-projects-issues commented Dec 8, 2009

Aleš Najmann commented

Gigaspace (7.0.1) is extending this class, so the problem is in Gigaspace 3rd party code initializing code. Gigaspace container is running with Spring 2.5.6 and for sure works with that version correctly, but I'm using new Spring MVC stuff and needed Spring 3.x for that reason. We're running the webapp outside the container, but it can't use the Gigaspace failover abilities and most of the scalability. I've seen #11016 and it's exactly the case. I also get through Gigaspace forum, but there is probably nobody testing new Spring codebase with the current version of Gigaspace.

This is probably not very helpful info for the treatment, but also I have not much more to offer here. Take it as for the moment as the report of incompatibility. Thank you for the response.

Aleš

@spring-projects-issues
Copy link
Collaborator Author

Juergen Hoeller commented

Can you point me to the specific GigaSpaces class that is extending PropertyPlaceholderConfigurer? Would be good to review what exactly they are doing there...

Juergen

@spring-projects-issues
Copy link
Collaborator Author

Aleš Najmann commented

Sorry, of course I can (after some communication with my colleague):

org.openspaces.core.properties.BeanLevelPropertyPlaceholderConfigurer

Cheers

@spring-projects-issues
Copy link
Collaborator Author

Juergen Hoeller commented

Hmm, according to the GigaSpaces 7.0 javadoc at

http://www.gigaspaces.com/docs/JavaDoc7.0/org/openspaces/core/properties/BeanLevelPropertyPlaceholderConfigurer.html

BeanLevelPropertyPlaceholderConfigurer overrides processProperties, not parseStringValue. This should work fine against Spring 3.0 as well, since the processProperties signature hasn't changed.

Please double-check what exactly breaks there, and how parseStringValue actually gets involved...

Juergen

@spring-projects-issues
Copy link
Collaborator Author

Aleš Najmann commented

I proceed with communication with deployment guys to take real stacktrace of the problem:
{{
2009-12-03 19:11:23,581 WebBot [1] SEVERE
[org.springframework.web.context.ContextLoader] - Context
initialization failed; Caused by: java.lang.NoSuchMethodError:
org.openspaces.core.properties.BeanLevelPropertyPlaceholderConfigurer.parseStringValue(Ljava/lang/String;Ljava/util/Properties;Ljava/util/Set;)Ljava/lang/String;
at org.openspaces.core.properties.BeanLevelPropertyPlaceholderConfigurer.access$000(BeanLevelPropertyPlaceholderConfigurer.java:45)
at org.openspaces.core.properties.BeanLevelPropertyPlaceholderConfigurer$PlaceholderResolvingBeanDefinitionVisitor.resolveStringValue(BeanLevelPropertyPlaceholderConfigurer.java:125)
at org.springframework.beans.factory.config.BeanDefinitionVisitor.visitBeanClassName(BeanDefinitionVisitor.java:100)
at org.springframework.beans.factory.config.BeanDefinitionVisitor.visitBeanDefinition(BeanDefinitionVisitor.java:77)
at org.openspaces.core.properties.BeanLevelPropertyPlaceholderConfigurer.processProperties(BeanLevelPropertyPlaceholderConfigurer.java:104)
at org.springframework.beans.factory.config.PropertyResourceConfigurer.postProcessBeanFactory(PropertyResourceConfigurer.java:75)
at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:624)
at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:573)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:398)
at org.openspaces.pu.container.jee.context.ProcessingUnitContextLoader.createWebApplicationContext(ProcessingUnitContextLoader.java:146)
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:192)
at org.openspaces.pu.container.jee.context.ProcessingUnitContextLoader.initWebApplicationContext(ProcessingUnitContextLoader.java:59)
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:47)
at org.mortbay.jetty.handler.ContextHandler.startContext(ContextHandler.java:548)
at org.mortbay.jetty.servlet.Context.startContext(Context.java:136)
at org.mortbay.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1250)
at org.mortbay.jetty.handler.ContextHandler.doStart(ContextHandler.java:517)
at org.mortbay.jetty.webapp.WebAppContext.doStart(WebAppContext.java:467)
at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
at org.openspaces.pu.container.jee.jetty.JettyJeeProcessingUnitContainerProvider.createContainer(JettyJeeProcessingUnitContainerProvider.java:494)
at org.openspaces.pu.container.servicegrid.PUServiceBeanImpl.startPU(PUServiceBeanImpl.java:536)
at org.openspaces.pu.container.servicegrid.PUServiceBeanImpl.doStart(PUServiceBeanImpl.java:170)
at org.jini.rio.jsb.ServiceBeanAdapter$1.run(ServiceBeanAdapter.java:292)
at org.jini.rio.jsb.ServiceBeanAdapter.start(ServiceBeanAdapter.java:305)
at org.jini.rio.jsb.JSBLoader.create(JSBLoader.java:106)
at org.jini.rio.cybernode.ServiceBeanLoader.load(ServiceBeanLoader.java:278)
at org.jini.rio.cybernode.JSBDelegate.startServiceBean(JSBDelegate.java:457)
at org.jini.rio.cybernode.JSBDelegate.load(JSBDelegate.java:316)
at org.jini.rio.cybernode.JSBContainer.activate(JSBContainer.java:195)
at org.jini.rio.cybernode.CybernodeImpl.instantiate(CybernodeImpl.java:1034)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.gigaspaces.lrmi.LRMIRuntime.invoked(LRMIRuntime.java:360)
at com.gigaspaces.lrmi.nio.Pivot.consumeAndHandleRequest(Pivot.java:402)
at com.gigaspaces.lrmi.nio.Pivot.handleRequest(Pivot.java:490)
at com.gigaspaces.lrmi.nio.Pivot$ChannelEntryTask.run(Pivot.java:153)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:619)
}}

I'm a bit confused now, because I don't know exactly what's happening inside the class at the moment but make more investigation later.

Aleš

@spring-projects-issues
Copy link
Collaborator Author

Juergen Hoeller commented

I see, so the GigaSpaces subclass is calling that parseStringValue method, not overriding it.

As a workaround, I've reintroduced parseStringValue in deprecated form now, delegating to our new Spring 3.0 PropertyPlaceholderHelper and PlaceholderResolver infrastructure now. This should allow for calling it like GigaSpaces does; it does, however, not allow for overriding (which shouldn't matter in your case).

This will make tonight's nightly snapshot. Please give it a try once it is available. I'll let you know about the URL to get it from in a couple of hours...

Juergen

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: core Issues in core modules (aop, beans, core, context, expression) type: bug A general bug
Projects
None yet
Development

No branches or pull requests

2 participants