3 Replies Latest reply: Apr 30, 2012 1:39 PM by 802190 RSS

    DataBindings.cpx cannot find model package

    802190
      After refactoring a number of files in both my Model and ViewController projects I am unable to map or remap any of my data controls because I get messages complaining that the ViewController is not able to find the App Modules containing my Data Controls. Looking at my DataBindings.cpx file, I noticed in the dataControlUsages/BC4jDataControl node that it cannot find the package refering to where my App Modules are located in my Model project.

      I didn't move any of the App Module files nor the DataBindings file while refactoring other files in my application, so how has the reference changed?
      The package containing the App Modules was com.model before refactoring and is still com.model afterwards, my DataBindings.cpx file hasn't been moved either.

      I have added the Model output as a dependency for my ViewController and tried the other things mentioned in this thread like cleaning my class folders and rebuilding everything:
      AppModuleLocal reference not found in DataBindings.cpx JDev 1.1.1.2
      I also tried many other things the last 2 days trying to get my App Module package to be recognized by my DataBindings file with no luck whatsoever.

      Looking at a backup of my application before refactoring, the DataBindings file has no warnings about not being able to find my App Modules before, and the package name has not changed after refactoring.

      Does anybody know what setting in the ViewController allows the DataBindings file to reference the App Modules in my Model project? is it just from adding my Model project output as a dependency? Because I've done that and it still can't find it.
        • 1. Re: DataBindings.cpx cannot find model package
          Frank Nimphius-Oracle
          Hi,

          what if you create a blank ViewController project, drag and drop a collection from the AM on a page and then copy the content of the DataBinsings.cpx fie to the current one that - as you say - doesn't work. If you only copy the DC part then it should work after that

          Frank
          • 2. Re: DataBindings.cpx cannot find model package
            802190
            Thanks for replying Frank,

            I did what you mentioned, and the BC4JDataControl entry created in the new ViewController project works in the new project (finds my model without problems). The entry is even identical to the entry created in the DataBindings page that doesn't work so copying it into the non-working page still doesn't work.

            Is there a setting that is wrong elsewhere then, like in the ViewController.jpr file?
            • 3. Re: DataBindings.cpx cannot find model package
              802190
              ok I finally figured it out, it only took about 3 days!

              Frank, if you are able to give any insight to what the ViewController/src/com/view/ViewController.jpx file does or how it is configured I would greatly appreciate it (and probably other forum users would too)
              It is also pretty much identical to the Model/src/com/model/Model.jpx file.

              Here is what I discovered to fix the issue I was having:

              In my ViewController project src/com/view folder, there is a file called ViewController.jpx I noticed that in my backed up project (of before I did any refactoring of file and package names) that this file had paths to my model packages and AppModules and my newly refactored project didn't have these references anymore. I also noticed that this file is pretty much identical to the src/com/model/Model.jpx file in my Model project, except that the ViewController.jpx has a specific attribute pointing to the location of the package in my Model/src folder:
              <Attr Name="_LocationURL" Value="../../Model/src/"/>

              So here is a sample of what my ViewController.jpx should look like in order for my ViewController project to be able to reference my models and AppModules:

              <?xml version="1.0" encoding="windows-1252" ?>
              <!DOCTYPE JboProject SYSTEM "jbo_03_01.dtd">
              <!---->
              <JboProject
              xmlns="http://xmlns.oracle.com/bc4j"
              Name="ViewController"
              Version="11.1.2.60.81"
              SeparateXMLFiles="true"
              PackageName="com.view">
              <DesignTime>
              <Attr Name="_jprName" Value="../../../ViewController.jpr"/>
              <Attr Name="_appModuleNames0" Value="com.model.PatientModule"/>
              <Attr Name="_appModuleNames1" Value="com.model.PatientProductUsageModule"/>
              <Attr Name="_appModuleNames2" Value="com.model.UserModule"/>
              <Attr Name="_appModuleNames3" Value="com.model.PatientSummaryModule"/>
              </DesignTime>
              <Containee
              Name="model"
              PackageName="com.model"
              ObjectType="JboPackage">
              <DesignTime>
              <Attr Name="_LocationURL" Value="../../Model/src/"/>
              <Attr Name="_AM" Value="true"/>
              </DesignTime>
              </Containee>
              <Containee
              Name="charting"
              PackageName="com.patient.charting"
              ObjectType="JboPackage">
              <DesignTime>
              <Attr Name="_LocationURL" Value="../../Model/src/"/>
              <Attr Name="_EO" Value="true"/>
              <Attr Name="_AS" Value="true"/>
              <Attr Name="_VO" Value="true"/>
              <Attr Name="_VL" Value="true"/>
              </DesignTime>
              </Containee>
              </JboProject>

              So after refactoring my files in my application, I don't know why most of these entries were not updated, but simply removed, this is why I couldn't reference my model package in my DataBindings.cpx
              Hope this helps whoever else that may run into this issue after refactoring files in their Model.

              Edited by: tnology on 30-Apr-2012 11:39