-
1. Re: The replacement of system properties in *-ds.xml is done only for elements of string value type
jeff.zhang Dec 31, 2010 1:21 AM (in response to rhanus)Please fetch latest branch_5_1 and try it.
And it also apply some code patch into AS 6 Final, It could handle String type.
-
2. Re: The replacement of system properties in *-ds.xml is done only for elements of string value type
rhanus Jan 1, 2011 6:19 PM (in response to jeff.zhang)wow so the implementation is here as I suggested :-) I really didn't take notice of subversion commits in the issue
it took me a while to build JBPAPP_5_1 on windoze without patch utility because simply setting build.unsecure= in build.properties is not enought
but that's a different story
ok your fix is working but only for integer and long fields of ManagedConnectionFactoryDeploymentMetaData and its succesors
why not booleans ?
while trying to apply your fix I encounter following problem:
- in a separate deploy dir I have myapp.ear and myprops-service.xml where the property myapp.db.maxPoolSize is defined
- descriptor myapp.ear/my-ds.xml is parsed by JAXB before myprops-service.xml is fully deployed so that myapp.db.maxPoolSize is not a system property when trying to replace it
I don't see a way how to define the dependency to the property service in myapp.ear/my-ds.xml, datasources/local-tx-datasource/depends simply cannot help in that case
-
3. Re: The replacement of system properties in *-ds.xml is done only for elements of string value type
jaikiran Jan 2, 2011 1:19 AM (in response to rhanus)Radim Hanus wrote:
while trying to apply your fix I encounter following problem:
- in a separate deploy dir I have myapp.ear and myprops-service.xml where the property myapp.db.maxPoolSize is defined
- descriptor myapp.ear/my-ds.xml is parsed by JAXB before myprops-service.xml is fully deployed so that myapp.db.maxPoolSize is not a system property when trying to replace it
I don't see a way how to define the dependency to the property service in myapp.ear/my-ds.xml, datasources/local-tx-datasource/depends simply cannot help in that case
-
4. Re: The replacement of system properties in *-ds.xml is done only for elements of string value type
rhanus Jan 2, 2011 8:35 AM (in response to jaikiran)Thanks for hint!
I want to maintain single jboss installation as well as single deployment and several versions of myprops-service.xml. So I rejected placing property service into conf/jboss-service.xml.
I tried to define <depends>jboss:type=Service,name=MyAppSystemProperties</depends> dependency to:
- ManagedConnectionFactoryParserDeployer in jboss-jca.deployer
- JBossAppParsingDeployer in ear-deployer-jboss-beans.xml
but no success. What did I wrong ?
-
5. Re: The replacement of system properties in *-ds.xml is done only for elements of string value type
rhanus Jan 3, 2011 4:56 AM (in response to jaikiran)I also played a bit with supply/demand mc feature but still no sucess
I walked through trace logs and I think this is connected with general deployer's architecure: metadata object are instanced by jaxb when main deployer parses deployments and obviously it's not good idea to depends on mail deployer
-
6. Re: The replacement of system properties in *-ds.xml is done only for elements of string value type
alesj Jan 3, 2011 7:29 AM (in response to rhanus)How exactly are you seeing the "but no success"?
As the deployers are again just plain beans in MC/AS,
so same "service" sort of functionality applies.
It just might be an issue of missing dependency,
as we check for completness after each phase: boot, deployers/ and deploy/.
Placing your property service into deployers/ should work.
-
7. Re: The replacement of system properties in *-ds.xml is done only for elements of string value type
rhanus Jan 3, 2011 8:57 AM (in response to alesj)Hi Ales
Thanks for answer!
>> How exactly are you seeing the "but no success"?
I've rewritten properties-service.xml to properties-jboss-bean.xml to be able to define supply:
<bean name="SystemProperties" class="org.jboss.varia.property.SystemPropertiesService"> <annotation>@org.jboss.aop.microcontainer.aspects.jmx.JMX(name="jboss:type=Properties,name=MyAppSystemProperties",exposedInterface=org.jboss.varia.property.SystemPropertiesServiceMBean.class</annotation>
<property name="properties" replace="false">
myapp.db.maxPoolSize=150
myapp.db.idleTimeout=60
</property>
<supply>SystemProperties</supply>
</bean>and I placed demand into ear CL deployer:
<bean name="EARClassLoaderDeployer" class="org.jboss.deployment.EarClassLoaderDeployer">
<!-- A flag indicating if ear deployments should have their own scoped
class loader to isolate their classes from other deployments.
-->
<property name="isolated">false</property><demand>SystemProperties</demand>
</bean>but JAXB started to unmarshal ds descriptor before "configured" of system properties
may be I'm completely wrong but as I had some time during christmas to dive into source codes I'm really curious about solution :-)
>> Placing your property service into deployers/ should work.
and it really works !!!
-
8. Re: The replacement of system properties in *-ds.xml is done only for elements of string value type
alesj Jan 3, 2011 9:16 AM (in response to rhanus)>> Placing your property service into deployers/ should work.
and it really works !!!
Cool. :-)
Anything else?
-
9. Re: The replacement of system properties in *-ds.xml is done only for elements of string value type
rhanus Jan 3, 2011 11:40 AM (in response to alesj)yeah great thanx again
>> Anything else?
why the usage of supply/demand above doesn't wotk ?
-
10. Re: The replacement of system properties in *-ds.xml is done only for elements of string value type
alesj Jan 3, 2011 11:56 AM (in response to rhanus)>> Anything else?
why the usage of supply/demand above doesn't work ?
Didn't you use this at the end?
-
11. Re: The replacement of system properties in *-ds.xml is done only for elements of string value type
rhanus Jan 3, 2011 4:13 PM (in response to alesj)No
when myproperties-jboss-beans.xml are placed in deployers dir they are available before the ear gets deployed
ok it finally works somehow :-)
I supposed to use the supply/demand scenario with both myproperties-jboss-beans.xml and myapp.ear in deploy dir but it doesn't work since JAXB unmarshals myapp.ear/my-ds.xml descriptor before SystemPropertiesService reaches its configured state and thus
- would like to use <max-pool-size>${myapp.db.maxPoolSize}</max-pool-size> in myapp.ear/my-ds.xml
- ends up with maxPoolSize == 0
2011-01-03 14:45:56,810 DEBUG (main)[org.jboss.system.ServiceConfigurator] MaxSize set to 0 in jboss.jca:service=ManagedConnectionPool,name=Ora11DS
-
12. Re: The replacement of system properties in *-ds.xml is done only for elements of string value type
alesj Jan 3, 2011 4:40 PM (in response to rhanus)Ah, now I actually see/understand your problem -- at least I think so. :-)
My previous suggestion is wrong.
What you need is the following, in theory at the moment.
* deployment myapp.ear must depend on SystemPropertiesService, but in PARSE stage
** this way ear' -ds.xml will be parsed with required system properties
We already have proper mechanism in place for this,
see jboss-dependency.xml (http://community.jboss.org/wiki/JBoss5custommetadatafiles),
but it will need minor adjustments.
See dependency-deployers-jboss-beans.xml in deployers/,
all three jboss-dependency.xml related deployers need a change of stage.
<property name="stage">DeploymentStages.PRE_PARSE</property> <--- pseudo code
Then adding proper jboss-dependency.xml into ear' META-INF should do the trick.
-
13. Re: The replacement of system properties in *-ds.xml is done only for elements of string value type
rhanus Jan 4, 2011 12:03 PM (in response to alesj)I tried my best but it still doesn't work for me please help ;-)
fixed deployers/dependency-deployers-jboss-beans.xml
<bean name="DependenciesParserDeployer" class="org.jboss.deployers.vfs.plugins.dependency.DependenciesParserDeployer">
<property name="stage"><inject bean="PreParseStage"/></property>
</bean>
<bean name="DependenciesMDDeployer" class="org.jboss.deployers.vfs.plugins.dependency.DependenciesMetaDataDeployer">
<property name="stage"><inject bean="PreParseStage"/></property>
</bean>
<bean name="DeploymentDependenciesDeployer" class="org.jboss.deployers.vfs.plugins.dependency.DeploymentDependencyDeployer">
<property name="stage"><inject bean="PreParseStage"/></property>
</bean><bean name="PreParseStage" class="org.jboss.deployers.spi.deployer.DeploymentStage">
<constructor>
<parameter class="java.lang.String">PreParse</parameter>
<parameter class="java.lang.String">Not Installed</parameter>
</constructor>
</bean>new deploy/myapp.ear/META-INF/jboss-dependency.xml:
<dependency xmlns="urn:jboss:dependency:1.0">
<item whenRequired="PreParse" dependentState="Create">istep:type=Properties,name=SystemProperties</item>
</dependency>I've tried a plenty of both whenRequired and dependentState combinations but no luck
-
14. Re: The replacement of system properties in *-ds.xml is done only for elements of string value type
alesj Jan 4, 2011 12:13 PM (in response to rhanus)I tried my best but it still doesn't work for me please help ;-)
I've tried a plenty of both whenRequired and dependentState combinations but no luckGood attempt, seriously!
You need to change this:
<item whenRequired="PreParse" dependentState="Create">istep:type=Properties,name=SystemProperties</item>
whenRequired cannot be PreParse, as we're there right now - when parsing - hence already past it.
Change it to Parse. And you can drop the dependantState attribute, by default it should be Installed, which is fine.
Let me know if this works then.
Otherwise I'll give it a try. ;-)