7 Replies Latest reply on Feb 27, 2013 1:53 PM by Shiva Shankar

    Deployment of Jar using Ant with OJDeploy as packaging

    Shiva Shankar
      I'm trying to Deploy a Jar File from an ANT script (with OjDeploy), which compiles successfully. But when I run the main project (Which has the Jar dependency), I get a huge incident, when I analysed the incident log, it says

      "Caused by: java.sql.SQLSyntaxErrorException: ORA-00942: table or view does not exist"

      I analysed both the jar files (One generated by the ANT script and the other generated from Jdev). I couldn't find any difference b/w Manifest of those two jars. The other folders are also same, In other words, both are almost same, or I'm not able to figure out the difference between the two jar files generated.

      Isn't the ANT script generated jar file be same as the one that is deployed from Jdev??

      I know, I'm missing something, config of build.xml or something, but not able to figure out the exact problem.


      Thanks,
      Shiva Shankar
        • 1. Re: Deployment of Jar using Ant with OJDeploy as packaging
          Timo Hahn
          Shiva, have yo ucompare the folder structure only?
          You have to look into the files as well. The error is pointing to a missing db connection or the use of hte wrong db connection. In your jar you are trying to access a tabel from another schema.
          Have you used the ant ojdeploy target of called ojdeploy to create the jar?

          Timo
          1 person found this helpful
          • 2. Re: Deployment of Jar using Ant with OJDeploy as packaging
            Shiva Shankar
            Thanks for quick reply Timo.

            I've checked out all the files , the files by content are one and the same in both the jars (I have cross checked the manifest folder many number of times). The table is in the same schema.

            The "Caused by: java.sql.SQLSyntaxErrorException: ORA-00942: table or view does not exist" might be one of the results of the some other issue which could be the root cause for the whole thing. I'm using the default ant script provided by JDev to generate the profile (Jar file in my case)

            <taskdef name="ojdeploy"
            classname="oracle.jdeveloper.deploy.ant.OJDeployAntTask"
            uri="oraclelib:OJDeployAntTask"
            classpath="${oracle.jdeveloper.ant.library}"/>
            <ora:ojdeploy xmlns:ora="oraclelib:OJDeployAntTask"
            executable="${oracle.jdeveloper.ojdeploy.path}"
            ora:buildscript="${oracle.jdeveloper.deploy.dir}/ojdeploy-build.xml"
            ora:statuslog="${oracle.jdeveloper.deploy.dir}/ojdeploy-statuslog.xml">
            <ora:deploy>
            <ora:parameter name="workspace"
            value="${oracle.jdeveloper.workspace.path}"/>
            <ora:parameter name="project"
            value="${oracle.jdeveloper.project.name}"/>
            <ora:parameter name="profile"
            value="${oracle.jdeveloper.deploy.profile.name}"/>
            <ora:parameter name="nocompile" value="true"/>
            <ora:parameter name="outputfile"
            value="${oracle.jdeveloper.deploy.outputfile}"/>
            </ora:deploy>
            </ora:ojdeploy>


            I'm not overriding the default commands provided except for the Profile Output path, and hence I'm not able to figure out why the code is deviating from the expected behavior. Do I need to add additional configurations?? I strongly feel that issue with might be the path/ permissions or need to have additional configurations in one these adfm.xml or weblogic-application.xml, although I'm not sure.

            Thanks,
            Shiva Shankar
            • 3. Re: Deployment of Jar using Ant with OJDeploy as packaging
              Timo Hahn
              Have you checked the other folders content too? The manifest file is not the vital part.
              Have you found out which tabel or view is missing?


              TImo
              • 4. Re: Deployment of Jar using Ant with OJDeploy as packaging
                Shiva Shankar
                Timo,

                The query was thrown up as a part of the incident, and I was able to figure of the VO for the query. Tried to run from the Application Module and all the VOs are running well. The other contents in the jar are the View Objects, View Links is same. However, I was able see the sizes of the following files were different.

                1. xyzAMImpl.class
                2. xyzAM.xml
                3. xyzModel.jpx

                Some of the major files which were unchanged

                1. bc4j.xml
                2. xyzAM.class
                3. Resource Bundles

                Is it possible to suggest some file I need to check which might have possibly gone wrong? Because this is a scenario where the table/View is existing and I've permissions to access it.

                Thanks,
                Shiva Shankar
                • 5. Re: Deployment of Jar using Ant with OJDeploy as packaging
                  Timo Hahn
                  Check hte content of the xyzAM.xml and xyzModel.jpx files. The jpx file holds a pointer to the used db connection.

                  Timo
                  • 6. Re: Deployment of Jar using Ant with OJDeploy as packaging
                    989753
                    check it
                    may it's useful
                    bit.ly/11rRYn9

                    for more java development http://bit.ly/anDrwb

                    Edited by: 986750 on Feb 7, 2013 3:57 AM
                    1 person found this helpful
                    • 7. Re: Deployment of Jar using Ant with OJDeploy as packaging
                      Shiva Shankar
                      I figured out a way to solve the problem. Not sure what was the cause of this issue, but a couple of changes made both to JAR/EAR build scripts set the things right

                      While building JAR files:

                      1. Uncheck "Make this the project build file" while creating the ANT build file, while the "Include Packaging Tasks (uses OjDeploy)" must be checked.
                      2. Remove "nocompile" parameter from <ora:. > tag in the OjDeploy.

                      While Building EAR files:

                      1. Create EAR in the view controller project.
                      2. Go to the View Controller Project Properties-> Project Source Path -> Resources, remove the newly created build file dependency, which specifies that the build file is for the whole project and not for the individual project.
                      3. Remove "Project" parameter from <ora:. > tag in the OjDeploy. (Ensures to build for the whole application)
                      4. Remove "nocompile" parameter from <ora:. > tag in the OjDeploy.

                      These are the exhaustive set of changes, which I made to ensure the ANT files are building correctly, if you get any other errors after this EAR is deployed, then its definitely due to code, EO/VO or DB related.

                      Thanks for all the help!!

                      Shiva Shankar