[Design of JBoss Deployment Framework] - Datasource deployer does not substitute system properties
by scotto
We use system property substitution to assist with the configuration of our JBoss installations. This was working fine with JBoss 4.2.3.GA, however it appears to be broken in 5.0.0.CR1.
Specifically, it appears that system properties are not being substituted when deploying datasources.
For example, consider this default-ds.xml:
| <?xml version="1.0" encoding="UTF-8"?>
| <datasources>
| <local-tx-datasource>
| <jndi-name>DefaultDS</jndi-name>
| <connection-url>${vieo.datasource.url}</connection-url>
| <driver-class>${vieo.datasource.driver}</driver-class>
| <user-name>${vieo.datasource.user}</user-name>
| <password>${vieo.datasource.password}</password>
| <!-- corresponding type-mapping in the standardjbosscmp-jdbc.xml (optional) -->
| <metadata>
| <type-mapping>PostgreSQL 8.0</type-mapping>
| </metadata>
| <!-- minimum connection pool size -->
| <min-pool-size>${vieo.datasource.poolsize.min}</min-pool-size>
| <!-- maximum connection pool size -->
| <max-pool-size>${vieo.datasource.poolsize.max}</max-pool-size>
| </local-tx-datasource>
| </datasources>
|
With JBoss 4.2.3.GA we are successfully able to configure the datasource using properties supplied by the SystemPropertiesService. With JBoss 5.0.0.CR1 it appears the property substitution is not performed, and the datasource fails to deploy correctly.
To confirm this, we changed the jndi-name property line to the following:
| <jndi-name>${vieo.datasource.name}</jndi-name>
|
and then added -Dvieo.datasource.name=DefaultDS to the JVM command line.
The server log confirms that the system property is not being substituted:
anonymous wrote :
| 2008-09-17 16:31:00,948 41048 INFO [org.jboss.resource.connectionmanager.ConnectionFactoryBindingService] (main:) Bound Connection
| Manager 'jboss.jca:service=DataSourceBinding,name=${vieo.datasource.name}' to JNDI name 'java:${vieo.datasource.name}'
|
The strange thing is that this same system property substitution DOES work for all other deployment files types (other than datasources), including mail-service.xml, jbossweb.sar/server.xml, messaging/messaging-service.xml, etc.
Is this behaviour to be expected, or is it a bug with the datasource deployer?
Thanks
Scott
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4177022#4177022
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4177022
17 years, 6 months
[Design of EJB 3.0] - Re: JNDI Bindings
by ALRubinger
"scott.stark(a)jboss.org" wrote : Additive meaning create duplicate bindings? The metadata processing should already be treating mappedName annotation as being overriden by the jboss jndi-name. We don't have an xml form for @RemoteBinding.jndiName do we?
Ah, I wasn't aware jboss.xml "jndi-name" overrides spec "mappedName".
No, we've got no XML @RemoteBinding equiv, or way of specifying more than one (ie JNDI Name) in XML. This was probably not the original intent, but @RemoteBinding as it stands tangles:
* JNDI Targets
* clientBindUrl (invokerLocator and protocol)
* Interceptor Stack
* Proxy Factory
TBH, I'm not even sure which of those are currently supported.
...so I'm starting to wonder about this notion of creating duplicate bindings. The waters get murky and confusing either way, and I want to provide the most intuitive mechanism we can (with much better logging). JNDI problems are at the top of the gripes of new users.
Also related (noted before) is the absence of LocalBindingMetaData/LocalBindingsMetaData.
S,
ALR
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4176999#4176999
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4176999
17 years, 6 months