Ant with jDeveloper, reading the environment

I should like to use Ant to build and deploy our J2EE applications.
The main reason is to get better control of what's put inside the WAR and EAR files eg. correct application.xml/orion-application.xml, correct property-files which might exist in different versions for development, test, production etc.
The best solution is perhaps to use standalone Ant, but since we use jDeveloper we'll try to use ant from jdev 903.
To control the behaviour of Ant I was planning to read the environment in the build script.
When running in jDev, I have problems with reading the environmet settings, like:
<property environment="env" />
<property name="oc4j.home" value="${env.OC4J_HOME}"/>
Anyone that has a solution?
thanks, Trond R.

Trond,
One way to handle this situation is to put all of your developer properties in a separate properties file, then load this file using the file attribute of the Ant property task. For example, you could create a file named build.properties, which contains the following line:
oc4j.home = c:\oc4j
Then, in your Ant buildfile, use:
<property file="build.properties"/>
This allows the developer to customize the build.properties file for their specific machine, but still use the standard build.xml file from the source control.
Using this mechanism, the developer can also override properties on the Ant command line for a specific build using the -D option. For example,
ant -Doc4j.home=d:\oc4j
This would override the value in the build.properties file for this build. You can specify Ant command line options in JDeveloper using the Ant panel under Project Properties.
Using a properties file instead of environment variables makes your Ant buildfile more portable. It can be used within an IDE such as JDeveloper, and can be run on any platform.
-Matt Hawkins, JDeveloper Team

Similar Messages

  • When printing a signed document with Adobe Reader, the comment icons appear.  How do I prevent this

    When printing a signed document with Adobe Reader, the comment icons appear.  How do I prevent this ?

    When printing from Reader, select Document instead of Document and Markups:

  • How to use ant with Jdeveloper 11g

    Hello, as we develop our app with ADF Faces & EJB 3.0 we are using tomcat 6.x + openEJB 3.0 as a sort of app server. So we need to build application archive 2 differrent methods (collapsed war for tomcat and ear for Jdev's integrated WLS). Besides, some xml files need to be modificated depending on target server. So we are going to use ant to build archives.
    My questions:
    - Where should I copy built archive for deployment on integrated WLS (should I copy it in ant's target or Jdev can do it for me)? Or there is another way to do the following: when one presses Run button on a page ant builds an archive for local WLS and then app is deployed and the page is opened in a new browser tab (just like default Jdev behaviour)?
    - Where can I find tutorial on integration of Jdev & ant?

    Here is a good example [http://biemond.blogspot.com/2009/04/weblogic-jdeveloper-ant-tasks.html]

  • How to create a view with parameters; read the documentation but nothing!

    Hello!
    I'm new to the Oracle world but together with my coworkers we need to very quickly study Oracle to figure out whether we'll add Oracle to our list of supported databases or not.
    Question: How do I create a view with parameters?
    I've read the documentation but I could not find this! I found the sql syntax to create a view but no parameters whatsoever...
    I have found on the web some very complicated way of doing this, but doesn't Oracle support Views with parameters?
    The goal here is to return a recordset, don't forget, so,please don't speak about stored procedures unless you are going to tell me how to get a recordset out of a stored procedure! ;)
    Thanks for all your help and attention!
    Jorge C.

    You can set up a parameterized view via context as follows:
    1. Set up a procedure to set your context values:
    create or replace procedure p_set_context (p_context IN VARCHAR2,p_param_name IN VARCHAR2,p_value IN VARCHAR2)
    as
    BEGIN
    sys.dbms_session.set_context(p_context,p_param_name,p_value);
    END;
    2. Create your context using the procedure you just created
    create or replace context my_ctx using p_set_context
    3. This is the test table I'll use
    create table my_table(col1 number)
    and populate it:
    begin
    for v_index in 1..10
    loop
    insert into my_table values(v_index);
    end loop;
    end;
    and the view that will be parameterised
    create or replace view v_my_table as select col1 from my_table where col1 between sys_context('my_ctx','start_range') and sys_context('my_ctx','end_range')
    4. Now set the parameters using the procedure above.
    begin
    p_set_context('my_ctx','start_range','1');
    p_set_context('my_ctx','end_range','5');
    end;
    5. Selecting from my_table will give you 1 to 10 (no surprise there :-) )
    selectng from v_my_table will give you 1 to 5
    You can use the context to set formats etc using the same principle. A common gotcha to watch for is trying to set the context directly using DBMS_SESSION.SET_CONTEXT instead of creating a procedure. This belongs to SYS and SYS won't have the privileges to set your context so you get an insufficient privileges result leading to much headscratching and unnecessary grants (at least that's my understanding of it).
    Sorry Jorge, as you're new to Oracle I should also have pointed out for completeness sake, that you can change the parameters at any time through recalling the p_set_context, for example, following on from above, after your "select * from v_my_table" and seeing 1 to 5, you could then do
    begin
    p_set_context('my_ctx','start_range','3');
    end;
    and when you requery 'Select * from v_my_table' you will now see rows 3 to 5.
    Bit of a simplistic example, but you can see how easy it is. :-)
    Message was edited by:
    ian512

  • Issue with applet reading the zero-length string values

    In my application the javascript function is setting the values read from the text fields to an applet. If the text fields are blank the javascript is setting blank value only but in the applet the values have become null. Please can any one let me know what exactly is the problem here?
    Its working fine in jdk 1.6.0 I upgraded it to 1.6.0_12 update and facing this problem.

    In the applet class its checking the same way but there i m getting the value as 'null' for the parameter set from javascript.
    But in the javascript if i try to alert the value its giving me blank i.e., zero-length string.
    When i tried to google it I found the following information,
    In JDK 1.1 the Java language specification was loose in dealing with null and zero-length strings in the class libraries. Some APIs may treat a zero-length string as null, while other APIs may treat null as it is. In Java SE, the Java language specification has been tightened up to specify what the exact behavior should be.
    This issue is not fixable. Thus, in Java SE an applet that relies on the APIs to treat null as a zero-length string may result in an exception.
    Is there anything to do with this?
    The strange thing is it working fine in 1.6.0 i mean i m getting the value of parameter as blank in applet which is same set from javascript.
    But if the same is not working in 1.6.0_12 inspite of javascript setting the blank value, the applet is reading it has 'null'.

  • Can his PC with Powerpoint read the Keynote file (not video) I send to him?

    My friend is going to upload his Powerpoint presentation (made on his PC) to my Public Folder in my iDisk. Then I am going to convert the PP presentation to a Keynote presentation, which will subsequently be uploaded as video to his website and to Youtube.
    QUESTION: If I send him the finished product, remade in my Keynote, but Not in video form, can he then run that program in his PC? If so, would he need a Keypoint Reader? Or is it impossible?
    ~ Lorna in Southern California

    Tulse, I been wondering how I might solve a problem with keynote my presenter's notes are going to the screen via my projector and my slide presentation is sitting on my macbook screen how do I reverse this, must be a toggle or something?

  • Problem with Jdeveloper and the Web Object Manager

    I am trying to register a servlet through the web object manager.
    As soon as click the web object manager menu pick I get the following
    error: Could not load servlet information from web server.
    On other peoples machines here it works fine and they can register
    servlets. What am I missing!

    hmmmm, wondering if I understood you correctly:
    first try the file association - right click on one of the movie files (you should tell as well with extension) then 'open with' menu then go to 'choose program' and then choose one of them and coach the box "always use the selected program to open this kind of file" in your example 'window media player'.
    the other point I understood is that in download directly into your browser, well there is a settin for this in the option, don't know where exactly, but you can avoid this by right clicking on the movie/file link and choose 'save target as ...' this forces it to download it on your disk and then you can open it.
    hope this kinda helps
    Cheers
    Slarti

  • Runtime Error setting the 'Environment' when running with TWO executables

    Hello,
    I'm using XML DB for the very first time, so this problem may be easy to solve.
    I'm currently running a test with TWO separate C# Console executables.
    One executable correctly sets up the Xml Environment, Manager, and Container and simply adds XML documents to the database.
    The second executable simply is supposed to run some XQuery commands. I use the same Environment, Manager, and Container code to do the initialization. However, I'm having trouble with setting up the 'Environment' in this executable. I get the following error:
    DbEnv::open: DB_RUNRECOVERY: Fatal error, run database recovery, exception code = DATABASE_ERROR
    On this line of code:
    Sleepycat.Db.Environment env = new Sleepycat.Db.Environment(envdir, envconf);
    I've only seen code examples that run in a SINGLE executable. I'd really like to access the XML DB from multiple threads/executables, but am having trouble.
    Can there be multiple 'Environments' and 'Managers' for the one XML Db?
    Will provide more data if needed, and thanks for any help!
    Matt

    I guess you addressing this in the wrong forum. I see tags like "sleepycat" and "C#", probably thats why nobody replied.

  • Error after deploying a JSP Application developed with jdeveloper

    Hi there
    Running Oracle Enterpride Edition 8.1.7
    including Oracle Http webserver
    I'm trying to run a JSP application developed with Jdeveloper
    through the oracle http server included in
    Oracle Enterpride Edition 8.1.7
    Think I have modified alle the .conf files correctly
    I get the message :
    "Error Message: java.lang.RuntimeException: JSP Registry could not locate runtime property file:ORDERS_ORDERS_PKG_ORDERS_PKGModule.properties"
    Of course I know ,this file should be deployed as well. I have done this.
    Any ideas what's wrong ?
    Or can anyone point me to a (proper) document that decribes (correctly and completely) alle the steps that need to be done ?
    Many Thanxs
    Regards TJ
    null

    Yep, I had the same problem deploying from JDeveloper 9.3.1, followed:
    http://www.oracle.com/technology/products/jdev/howtos/10g/adf_runtime_update_howto.html
    and it works! thanks for the clue! (now I only have to find out what ADF is now!)
    Carlos.

  • Variable substitution in the environment.plist file

    I want an additional item in the PATH environment variable for GUI-launched apps. I've created the ~/.MacOSX/environment.plist file and added an entry to create a PATH variable. I have initially tried to set the value of this to
    "$(PATH):/usr/local"
    in an attempt to append the /usr/local folder to the path. However, the PATH value appears to be exactly what I've set it to - without the substitution.
    1) Is there a way to get the existing value substituted in?
    2) As I'm always out to learn new things, is there a better way of achieving this?
    (My fundamental problem is that I have written a plugin for XCode and I'm trying to not hard code the location of a compiler into it. Therefore I thought I'd use the PATH variable to let me find it. However the default PATH value doesn't include /usr/local which is where the compiler is located. So I'm looking for a way to add this folder into the PATH value, and the ~/.MacOSX/environment.plist seemed to be what I wanted - as long as I can get the substitution going. Otherwise I have to hard code the path into THAT file which I feel is just as bad!).
    Thanks
    Susan

    Hi Susan,
       I'm sorry; I didn't mean to imply that this is the wrong place to ask the question. I hope that it's the best place. I was just trying to explain, mostly to myself, why everyone assumes that the part of the system that reads the environment.plist will behave like a shell.
       If you were worried about hard-coding the path on your own machine, I would say that you needn't worry. The only path that exists prior to the setting of environment variables from the environment.plist is hard-coded into the system somewhere. A while back someone found it but that's not really important. If you want to start with that default, you can. If you need to know what it is, I'm sure that we can find it for you somewhere. I assume it's along the lines of:
    /usr/bin:/bin:/usr/sbin:/sbin
       While I'm not telling you to not do it, I suggest that you rethink setting the user's path an environment.plist. Changing the environment of every last one of a user's processes "behind the back" of the user seems a bit presumptuous. It wouldn't be a problem if you set a variable that no other app could recognize but if you added something to my path, my first thought would be to look there for a trojan horse. I would eventually realize that it was misguided instead of malicious but I wouldn't like it. It also stands some chance of changing the behavior of a user's UNIX applications.
       If you distribute an environment.plist file with your plugin, you would also have to address the issue of users that already have such files. Thus, it would seem that you would need to do a little checking in an install script. That being the case, you could evaluate the user's PATH variable in that script and use it to hard-code the path in an environment.plist that you generate programmatically from the install script at runtime. Such a script would also give you the opportunity to ask the user if he wants an environment.plist file.
       Of course that approach would make it difficult for a user to remove an element from his path; it wouldn't be sufficient to cease adding the element to the path in the user's shell startup scripts. You would probably be better off using the default path. That might not interfere with changes the user makes in his shell startup scripts but it would mine. You added /usr/local/bin to the end of a user's path. My startup scripts only add path elements if they aren't already there. However, I want /usr/local/bin in front of the default part of my path so your change would alter the behavior of my system.
       If you want to change the environment of a single application, it is common to "wrap" its invocation in a script that sets the environment before invoking the application. However, I'm not sure how that would work with an Xcode plugin.
    Gary
    ~~~~
       There are only 10 kinds of people in the world. Those
       who understand binary numbers and those who don't.

  • How to create a stand alone app with Jdeveloper?

    Hi,
    I have a created an application with JDeveloper using the ADF framework. It's a simple frontend to some database tables giving the user the possibility to create and update records.
    Is it possible to create a stand-alone application from JDeveloper without having to install any application server? I have tried to follow the documentation but somehow I only find descriptions of web enabled applications.
    That's not what I want. I want a (windows) application that can 'talk' to the database. Would be great to have just a .jar file to deploy to the users computer.
    Is this possible with JDeveloper? Or am I totally wrong?
    Thanks for any help!
    Bruno

    You don't need an OC4J.
    You just need to make sure the ADF libraries you are using are on the classpath of your application. (Your default JAR won't contain them).
    Have a look at the command line that JDeveloper uses to run your project (it is in the log file) - copy paste this into a command line and you should be able to run your code from outside JDeveloper.
    Read more on this in the online help under the deployment to JAR file chapter and possibly the webstart part.
    http://www.oracle.com/webapps/online-help/jdeveloper/10.1.3/state/content/navId.4/navSetId._/vtTopicFile.deploying%7Cbasic%7Cdep_pways_basicdep~html/

  • While saving a pdf file opened by foxit reader, the filename will be some strings

    '''''i opened a pdf file in firefox with foxit reader, the filename was ,for
    example, ol20120327.pdf, and i click the save and i got i file , the filename just some strings , not the real name. It really bothers me for a long time. ps: while in ie, maxhon ,they got the right name.
    i don't want change my default browser; i love firefox. i hope the problem would be solved. Thanks a lot''.'''

    try adobe reader

  • J2ee naming services with JDeveloper

    I am trying to use the JNDI services of the j2ee specs with JDeveloper and the Oracle Application server (9iAs). Doing this we have the problem that JDeveloper do not support the java.naming package. We have added the package to JDeveloper but we do not know ik Oracle 9iAs will work with this package added.
    Can someone give me some information about the use of JNDI within JDeveloper and Oracle 9iAs

    One solution to this problem is to make sure that the complex type you are using in yous service interface do implement the JAVA Bean as per the spec (at least Oracle's interpretation of it).
    You need to have getter/setter for all members and you need to have an empty ctor() to create new instances of your objects. In some cases, the design time let you get by, but the runtime fails in the code generation.
    In your case, the 'Task' class may have some issue.
    Hope it helps,
    -eric

  • Build report with Jdeveloper

    Hi all
    I'm using Jdeveloper 10.1.2 and I would like to build reports .
    Is there any way to do with ADF. Otherwise can you advise me how to do ?
    thanks

    It all depends on how you define a report and what are your specific needs.
    You can look at Oracle Reports at - http://otn.oracle.com/products/reports for a full blown reporting engine and development tool.
    You can also integrate the open-source Jasper Reports with JDeveloper (search the forum for previous posts that will show you how).
    And there is also the XML Publisher here:
    http://www.oracle.com/technology/products/applications/publishing/index.html

  • Is there a detailed tutorial about using Subversion with JDeveloper?

    Hi,
    My project is currently in my single-user repository, and I have checked out, modified, and checked in my files. All that works fine, but there is much more functionality available. At the moment, I am going through some YouTube videos by Stuart Fleming, but I was hoping that someone might suggest an article that I could keep as a searchable reference.
    Thanks.
    James

    Hi Timo,
    Using Subversion with JDeveloper is the only way I use it. Would you explain what you mean below?
    You just need a couple of method which are not dependant on jdev.
    Thanks.
    James

Maybe you are looking for