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

Ask Your Question
0

Location for common data source

Both my mirror service and external data source uses the same database, Hibernate mapping files and therefore same Hibernate data source. I'm trying to avoid duplicating the same section of xml in different places. Is there a way to do it? JNDI maybe?

Thanks,

Simon

{quote}This thread was imported from the previous forum. For your reference, the original is [available here|http://forum.openspaces.org/thread.jspa?threadID=1920]{quote}

asked 2008-04-03 13:18:30 -0500

noiseba gravatar image

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

jaissefsfex gravatar image
edit retag flag offensive close merge delete

6 Answers

Sort by ยป oldest newest most voted
0

You can use system property to accommodate the relevant value(s) and have ${system property} as part of the pu.xml file that includes the mirror or the external data source settings.
Shay

answered 2008-04-05 15:29:57 -0500

shay hassidim gravatar image
edit flag offensive delete link more
0

It seems that the problem is in org.openspaces.pu.sla.config.HostRequirementBeanDefinitionParser:

protected void doParse(Element element, BeanDefinitionBuilder builder) {
    String ip = element.getAttribute("ip");
    builder.addPropertyValue("ip", ip);
}

Shouldn't it use org.w3c.dom.Attr.getValue() instead of Element.getAttribute() so that the entity references will be replaced by their values?

Thanks,

Simon

answered 2008-04-15 18:39:16 -0500

noiseba gravatar image
edit flag offensive delete link more
0

Nobody knows what's going on here? It's driving me crazy. I created a sub class of HostRequirement so that I can get the properties myself and cache them. But not it gives me ClassNotFoundException when I try to deploy it.

answered 2008-04-16 13:05:34 -0500

noiseba gravatar image
edit flag offensive delete link more

Comments

Where do you place your sub class? I would try to place it under GigaSpaces root/lib/ext or within the PU shared-lib folder.

Shay

shay hassidim gravatar imageshay hassidim ( 2008-04-16 13:11:25 -0500 )edit

The sub class solution seems too troublesome to work. I'll probably just give up on this one. At lease I was able to have all my database settings in the properties file. I'll just keep using the .template approach for the sla files.

Thanks,

Simon

noiseba gravatar imagenoiseba ( 2008-04-16 14:16:07 -0500 )edit
0

Can I provide my own properties file using "locations" property when I use PropertyPlaceholderConfigurer? It doesn't seem to be working.

answered 2008-04-15 11:21:40 -0500

noiseba gravatar image
edit flag offensive delete link more

Comments

It's not PropertyPlaceholderConfigurer that has problem. It seems that "os-sla" tag doesn't parse the system property I passed to it. I switched to use the bean directly.

noiseba gravatar imagenoiseba ( 2008-04-15 11:59:25 -0500 )edit
0

I have the following section in my pu.xml:

<bean id="hostRequirement" class="org.openspaces.pu.sla.requirement.HostRequirement">
    <property name="ip">
        <value>${myip}</value>
    </property>
    <property name="instanceId" value="1" />
</bean>

It seems that ${myip} could not be resolved no matter where I set it.

Edited by: Simon Lin on Apr 15, 2008 7:16 PM

answered 2008-04-15 18:16:39 -0500

noiseba gravatar image
edit flag offensive delete link more
0

Spoke too soon. It still doesn't work. The original question remains:

Can I provide my own properties file using "locations" property when I use PropertyPlaceholderConfigurer?

Thanks,

Simon

answered 2008-04-15 18:10:23 -0500

noiseba 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

Stats

Asked: 2008-04-03 13:18:30 -0500

Seen: 100 times

Last updated: Apr 16 '08