wood burning stoves 2.0*
The moose likes JBoss/WildFly and the fly likes System properties and reading them in config files Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » JBoss/WildFly
Bookmark "System properties and reading them in config files" Watch "System properties and reading them in config files" New topic
Author

System properties and reading them in config files

Nishanth Alphonse
Greenhorn

Joined: Aug 13, 2010
Posts: 11
Hi There,

When I start-up JBoss server using the java command on run.jar file, I have the following command line option : -Dmyserver.jdbc.ds1.jnd-name="MYDSNAME".

In my datasource-ds.xml file, I have the following:

<local-tx-datasource>
<jndi-name>${myserver.jdbc.ds1.jndi-name}</jndi-name>

When I start-up the server and look at the logs, I find that this hasn't worked, i.e. the name MYDSNAME is not the JNDI name for the datasource.

Any ideas?

Thanks,
Johny
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5837
    
    7

Nishanth, welcome to Java Ranch!

What version of JBoss AS? The AS 6 betas seem to have problems with this, but it should work on 5.x and 4.2.x.


JBoss In Action
Nishanth Alphonse
Greenhorn

Joined: Aug 13, 2010
Posts: 11
I am using JBoss-5.1.0_jdk1.6

Thanks,

Nishanth
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5837
    
    7

I just now tried it in 5.1.0.GA, and you are right - it does not work. Must be a bug.
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5837
    
    7

It works fine in 4.2.3.GA.

It doesn't work in 5.0.1.GA

Not sure at what point it broke...
Nishanth Alphonse
Greenhorn

Joined: Aug 13, 2010
Posts: 11
Oh that's a shame. We have just migrated to this new version in our company.
Nishanth Alphonse
Greenhorn

Joined: Aug 13, 2010
Posts: 11
Peter Johnson wrote:It works fine in 4.2.3.GA.

It doesn't work in 5.0.1.GA

Not sure at what point it broke...


Thanks for your testing..
Jaikiran Pai
Marshal

Joined: Jul 20, 2005
Posts: 10222
    
166

Hmm, that's indeed a bug. There was this issue which is marked as fixed in AS-5.0.0. So I'm guessing that it got regressed after 5.0.0. Please create a new JIRA with the details.

P.S: Just an advice - don't downgrade to 5.0.0 from 5.1.0 just to get that fix. There are a lot many issues in 5.0.0 which you probably will run into.

[My Blog] [JavaRanch Journal]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: System properties and reading them in config files