11 Replies Latest reply: Jun 20, 2012 7:32 AM by John Stegeman RSS

    How to create an  EAR file using build.xml

    876464
      Hello all,
      How do I create an EAR file using build.xml...?????? I have an ADF application. The model and ViewController contain jar and war files respectively. How do I use them to create an EAR file using build.xml. How do I also deploy the EAR to a standalone WLS.
        • 1. Re: How to create an  EAR file using build.xml
          876464
          I am using Jdeveloper 11.1.1.5.0 .
          • 2. Re: How to create an  EAR file using build.xml
            Timo Hahn
            For this you need ojdeploy which genereates the war ans ear files togewther with the correct deployment descriptors.
            When you select to create a build.xml from an existing project you should see a checkbox at the bottom "Include Packaging Tasks" which generates the targets for you (if checked).

            Deploying the ear to the WLS is a different story all together. If you google for deploy ear using wlst you should find some info.

            Timo
            • 3. Re: How to create an  EAR file using build.xml
              876464
              Hello,
              Could you provide me with links to documents or tutorials involving ojdeploy???
              • 4. Re: How to create an  EAR file using build.xml
                Arunkumar Ramamoorthy-Oracle
                How do I also deploy the EAR to a standalone WLS.
                For which, you would use wldeploy task.

                http://docs.oracle.com/cd/E13222_01/wls/docs90/programming/wldeploy.html#1000506

                -Arun
                • 5. Re: How to create an  EAR file using build.xml
                  876464
                  Could you kindly guide me through my first question...... How do I actually create a ear file from jar and war files using ojdeploy??
                  • 6. Re: How to create an  EAR file using build.xml
                    John Stegeman
                    Now that you know "ojdeploy" is the way to go, let me introduce you to Google.

                    http://adfhowto.blogspot.com/2011/03/jdeveloper-deployment-is-built-around.html
                    • 7. Re: How to create an  EAR file using build.xml
                      dvohra21
                      Create a Deployment profile in JDeveloper.
                      • 8. Re: How to create an  EAR file using build.xml
                        876464
                        Hello,
                        I read the document
                        http://adfhowto.blogspot.in/2011/03/jdeveloper-deployment-is-built-around.html

                        However couldnot implement the following instructions

                        "It is a best practice to generate an .ear file from JDeveloper for the application. The .ear file will be generated with all the right class dependencies required to deploy it. Deploying with Ant by referring to an application directly without generating an .ear file may require that dependencies for the classes and jars files must be resolved manually."

                        I created the war file.....using ojdeploy.......deployed the war file.

                        I created the ear file .......Right click on the application -> Deployment profile - > create Ear-> Applied the application assembly (selected the jar and war file of Model and ViewController) -> Platform Weblogic10.3 , Target -the name of the standalone Server...
                        Now that the Ear file has been created it is easy to deploy it to a standalone WLS from jdev.... But I wish to deploy the Ear to a WLS using ANT....How to I do that????
                        • 9. Re: How to create an  EAR file using build.xml
                          Timo Hahn
                          Arun gave you the link to the doc. Here it is again http://docs.oracle.com/cd/E13222_01/wls/docs90/programming/wldeploy.html#1000506


                          Timo
                          • 10. Re: How to create an  EAR file using build.xml
                            876464
                            Hello ,
                            My build.properties file is as follows

                            # build file for LogHelloWorldComposite
                            composite.name=ADFAnt

                            # revision of the composite

                            composite.revision=8.18

                            # Simply specify Java Home

                            java.home=C:\AG\11GInstall\NEWINSTALLERS\jdk160_24\bin

                            #common components home

                            # common.components.home=C:\AG\11GInstall\Middleware\oracle_common

                            # mw.home=C:\AG\11GInstall\Middleware

                            # Set oracle.home to <JDEV_HOME>/jdeveloper, where <JDEV_HOME> is JDEV # installation directory

                            oracle.home=C:/AG/11GInstall/Middleware/jdeveloper

                            # soa-server side oracle home directory - needed for deployment plans

                            # and the weblogic sca library deployment

                            # soa.server.oracle.home=C:\AG\11GInstall\Middleware\jdeveloper

                            ###### Deployment server connection information

                            # the admin server connection information

                            admin.server.host=localhost

                            admin.server.port=8001

                            # the domain where soa infra is installed

                            server.domain.name=soa_domain

                            # connection information for the managed server, used for soa-deployment

                            #managed.server.host=localhost

                            #managed.server.port=8001

                            # User and credentials for the servers

                            server.user=weblogic

                            server.password=welcome1

                            # wls server where soa is targeted.

                            server.targets=SOA_Server

                            #server.partition=testPartition




                            Here is my build.xml

                            <?xml version="1.0" encoding="UTF-8"?>
                            <project name="ADFAnt">
                            <!-- build.properties -->
                            <property file="build.properties"/>
                            <property name="deploy.dir" value="/../deploy"/>
                            <target name="deploy" >

                            <wldeploy
                            action="deploy" verbose="true" debug="true"
                            name="DeployExample" source="/AntEarFile.ear"
                            user="${server.user}" password="${server.password}"
                            adminurl="http://${admin.server.host}:${admin.server.port}" targets="SOA_Server"/>

                            </target>
                            </project>


                            I have the ear file in the same directory..When I run the prompt> ant it shows BUILD SUCCESSFUL. However when I type ant deploy the error is as follows

                            BUILD FAILED
                            C:\AG\11GInstall\Middleware\user_projects\domains\soa_domain\build.xml:16: Probl
                            em: failed to create task or type wldeploy
                            Cause: The name is undefined.
                            Action: Check the spelling.
                            Action: Check that any custom tasks/types have been declared.
                            Action: Check that any <presetdef>/<macrodef> declarations have taken place.


                            What is the solution ???
                            Thanks
                            • 11. Re: How to create an  EAR file using build.xml
                              John Stegeman
                              Action: Check that any custom tasks/types have been declared.
                              The document that Arun linked for you explains how to do this.