ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Pass a properties file in runtime to build file

Post new topic  Reply to topic
 Pass a properties file in runtime to build file « View previous topic :: View next topic » 
Author Message
ganesh
PostPosted: Mon Oct 25, 2010 8:17 pm    Post subject: Pass a properties file in runtime to build file Reply with quote

Master

Joined: 18 Jul 2010
Posts: 294

I want to pass runtime values to a java class which i am calling from a ant script.
Code:
<project name="Deploy" default="deploybar">
<target name="deploybar" description="">
<java fork="true" failonerror="yes" classname="DeployBar" classpath="${ant}.bin"/>
</target>
</project>

This java class takes values at runtime. I have the values for them in a environment specific properties file, I want to pass the properties file at runtime, could anyone guide me on how to attain this?
Back to top
View user's profile Send private message
Vitor
PostPosted: Tue Oct 26, 2010 2:37 am    Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

Do a search. This has been discussed many times in here, along with a number of better ways of providing environment specific data.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
ganesh
PostPosted: Tue Oct 26, 2010 5:32 am    Post subject: Reply with quote

Master

Joined: 18 Jul 2010
Posts: 294

I know there is a better way, but i would like to try it this way. This java class has the mqsideploy utility in it and i would like to pass the env. specific broker name, EG.... etc. The broker name, EG.. are all stored in a .properties file which has to be passed at runtime and the script has to parse it and pass it to the java class as a runtime value.
Back to top
View user's profile Send private message
mqjeff
PostPosted: Tue Oct 26, 2010 5:57 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

So you need to figure out how to pass data into a java runtime, such that your Java class can read it?

Or you need to figure out how to pass data into an ant script, such that your ant script can read it?

Neither of these have anything to do with Broker.
Back to top
View user's profile Send private message
ganesh
PostPosted: Tue Oct 26, 2010 6:09 am    Post subject: Reply with quote

Master

Joined: 18 Jul 2010
Posts: 294

mqjeff wrote:
So you need to figure out how to pass data into a java runtime, such that your Java class can read it?

Or you need to figure out how to pass data into an ant script, such that your ant script can read it?

Neither of these have anything to do with Broker.


I posted it here because i am trying to automate bar file deployment and the scripts and java classes are doing that for me.
Back to top
View user's profile Send private message
WMBDEV1
PostPosted: Tue Oct 26, 2010 8:19 am    Post subject: Reply with quote

Sentinel

Joined: 05 Mar 2009
Posts: 888
Location: UK

ganesh wrote:

I posted it here because i am trying to automate bar file deployment and the scripts and java classes are doing that for me.


The point being that this forum is more committed to broker / MQ questions than specific ant questions and so you may get a better response in a dedicated ant / java forum

That aside, a very quick search for ant and java arguments led me here:
http://www.java-tips.org/other-api-tips/ant/how-to-use-java-task.html which should answer your question (assuming option 1 from Jeffs list). With a little bit more effort you could nail option 2 also.

Did you try searching before posting?
Back to top
View user's profile Send private message
ganesh
PostPosted: Tue Oct 26, 2010 9:14 am    Post subject: Reply with quote

Master

Joined: 18 Jul 2010
Posts: 294

WMBDEV1 wrote:
ganesh wrote:

I posted it here because i am trying to automate bar file deployment and the scripts and java classes are doing that for me.


The point being that this forum is more committed to broker / MQ questions than specific ant questions and so you may get a better response in a dedicated ant / java forum

That aside, a very quick search for ant and java arguments led me here:
http://www.java-tips.org/other-api-tips/ant/how-to-use-java-task.html which should answer your question (assuming option 1 from Jeffs list). With a little bit more effort you could nail option 2 also.

Did you try searching before posting?


Thanks first and yes i did search before posting. I came across this link while i was searching, anyways i will try searching and exploring further.
Back to top
View user's profile Send private message
WMBDEV1
PostPosted: Tue Oct 26, 2010 10:32 am    Post subject: Reply with quote

Sentinel

Joined: 05 Mar 2009
Posts: 888
Location: UK

From that site: "Use nested <arg> and <jvmarg> elements to specify arguments for the Java class and the forked VM respectively."

What more are you looking for?
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Pass a properties file in runtime to build file
Jump to:  



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.