Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

System properties and reading them in config files

 
Nishanth Alphonse
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 5852
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Nishanth Alphonse
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am using JBoss-5.1.0_jdk1.6

Thanks,

Nishanth
 
Peter Johnson
author
Bartender
Posts: 5852
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 5852
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Oh that's a shame. We have just migrated to this new version in our company.
 
Nishanth Alphonse
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 10447
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic