This content has been marked as final.
Show 4 replies
-
1. Re: jmx-console depends on generic named ear-file
mawenzel Oct 28, 2009 12:48 PM (in response to mawenzel)Ok, what I try is:
<depends>jboss.j2ee:service=EARDeployment,url='test*'</depends>
And the error, starting the jboss, is:java.lang.Error: Invalid ObjectName: jboss.j2ee:service=EARDeployment,url='test*'; javax.management.MalformedObjectNameException: Invalid character '*' in value part of property at org.jboss.mx.util.ObjectNameFactory.create(ObjectNameFactory.java:52) at org.jboss.metadata.WebMetaData.importJBossWebXml(WebMetaData.java:1261) at org.jboss.metadata.WebMetaData.importXml(WebMetaData.java:851) ....
What is the reason for this error? I am using JBoss AS 4.2.3GA. -
2. Re: jmx-console depends on generic named ear-file
dimitris Oct 28, 2009 1:42 PM (in response to mawenzel)What you've put there is not a valid JMX 1.2 ObjectName pattern.
But even if you make it a valid ObjectName pattern, it won't work as you would like it. AFAIK, it will only accept a simple ObjectName, i.e. it won't dynamically try to resolve the pattern and establish potentially multiple dependencies. -
3. Re: jmx-console depends on generic named ear-file
jaikiran Oct 29, 2009 1:41 AM (in response to mawenzel)"mawenzel" wrote:
The problem is: the ear-file has a dynamically-given name (like test_010.ear, test_020.ear,...)
How dynamic is the name? I mean do you know the name of the ear when the server is starting? If yes, then you can do something like this:<depends>jboss.j2ee:service=EARDeployment,url='${myEarName}'</depends>
Notice the use of ${myEarName}. You can then pass -DmyEarName as a system property while starting the server:./run.sh -DmyEarName=test_010.ear
The property in the xml will then be replaced by this value during xml parsing by the JBoss server. You could even add the -D part into the JAVA_OPTS section within the run.sh/run.bat script instead of typing from the command line. -
4. Re: jmx-console depends on generic named ear-file
mawenzel Oct 29, 2009 3:14 PM (in response to mawenzel)Thank you, jaikiran! This is the searched solution. It works.
I have written a small function, placed in the run-script, which gives me the name of the dynamic-named ear-file and assigns this to a variable.
Thanks.