Welcome to the new Gigaspaces XAP forum. To recover your account, please follow these instructions.

Ask Your Question

Property placeholders not resolved in "os-core:security"

Not sure where the problems is or if I am doing something wrong.

Using OpenSpaces and secured space. The idea is to have the user name and password externalized along with other space properties.

As the first step toward that and before moving them outside of the configuration file, the client configuration defines this:
<bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
&nbsp;&nbsp;<property name="properties">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<prop key="space.name">space</prop>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<prop key="space.username">gsadmin</prop>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<prop key="space.password">gsadmin</prop>

What my experience has been is that for some reason this does not work - the space.username and space.password properties are never replaced, while the space.name is properly resolved:
<os-core:space id="space" url="jini:////${space.name}">
&nbsp;&nbsp;<os-core:security username="${space.username}" password="${space.password}" />
Notice the use of namespace above.

But using plain XML does work:
<bean id="space" class="org.openspaces.core.space.UrlSpaceFactoryBean">
&nbsp;&nbsp;<property name="url" value="jini:////${space.name}" />
&nbsp;&nbsp;<property name="securityConfig">
&nbsp;&nbsp;&nbsp;&nbsp;<bean class="org.openspaces.core.space.SecurityConfig">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<property name="username" value="${space.username}" />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<property name="password" value="${space.password}" />

Yep, it took me awhile to find a solution to the problem.
Hope this might be helpful to somebody...


This thread was imported from the previous forum.
For your reference, the original is available here

asked 2008-04-16 08:27:06 -0500

vanio gravatar image

updated 2013-08-08 09:52:00 -0500

jaissefsfex gravatar image
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

Hi Vanio

There's seems to be an issue with post processing of property placeholders when using namespace handler.
We are looking into it and will update when the issue is resolved.
In the mean time please use non-namespace configuration when needed.

answered 2008-04-17 02:48:19 -0500

uri gravatar image
edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2008-04-16 08:27:06 -0500

Seen: 82 times

Last updated: Apr 17 '08