Forum Stats

  • 3,826,405 Users
  • 2,260,641 Discussions
  • 7,896,932 Comments

Discussions

New methods in application module project not available to view project

492834
492834 Member Posts: 4
edited Sep 2, 2008 6:30AM in JDeveloper and ADF
Hi,

I've migrated from JDeveloper 10.1.2.3 to 10.1.3.4 and have got the application (Struts based) up and running fine.
But when I add methods to the ApplicationModule class, these aren't available in the action classes in the view project.

In the project settings for the view project, the model project is in the list of dependencies.
What must be done to get it work?

Regards,
Terje

Best Answer

  • Timo Hahn
    Timo Hahn Senior Principal Technical Consultant - Oracle ACE Director Member, Moderator Posts: 38,457 Red Diamond
    Answer ✓
    Hi,
    just my experience:
    you should delete the whole classes path (model and view controller) and then rebuild model and view controller. JDev sometimes leaves some old classes files and never build them new even if you changed the java file. I never really found out when this happens, so there is no test case to reproduce this. We are using an ant script to clear the classes path before rebuilding an application.

    If the error persists after this clean rebuild, debug the application and st a breakpoint in your action class where you get the application module. Then check the class of the returned application module. If you see a class of the type of your ApplicationModuleImpl you should be able to access your methods. If you don't see your ApplicationModuleImpl something is wrong in the configuration cpx-File to struts-config.xml.

    Timo

Answers

  • John Stegeman
    John Stegeman Member Posts: 24,269 Blue Diamond
    Terje,

    Did you expose the AM methods to the client interface?

    Double-click the AM, click the "Client Interface" section and add your methods to the client interface. You would add the methods to the ApplicationModuleImpl class (not the ApplicationModule class) and then use this technique to expose them.

    Best,

    john
  • 492834
    492834 Member Posts: 4
    John,

    Yes, I did, but it didn't help. In JDeveloper 10.1.2.3 I have just a handful of methods that are added to the client's interface, but all methods are still available to the application module (AppMain class).

    Regards,
    Terje
  • John Stegeman
    John Stegeman Member Posts: 24,269 Blue Diamond
    Hmm... did you rebuild the data model project?
  • 492834
    492834 Member Posts: 4
    John,

    I've rebuildt upto several times... Are there any files I could delete to make it rebuild?

    As an example I removed an obsolete parameter from a method in the application module, and removed the parameter it in the caller method as well. Then I got an error in the caller method. Then I added the "removed parameter" in the caller method (view side) and rebuilt it. The application would run, so I guess it was not changed in the source file at the model side in the first place.

    Regards,
    Terje
  • Timo Hahn
    Timo Hahn Senior Principal Technical Consultant - Oracle ACE Director Member, Moderator Posts: 38,457 Red Diamond
    Answer ✓
    Hi,
    just my experience:
    you should delete the whole classes path (model and view controller) and then rebuild model and view controller. JDev sometimes leaves some old classes files and never build them new even if you changed the java file. I never really found out when this happens, so there is no test case to reproduce this. We are using an ant script to clear the classes path before rebuilding an application.

    If the error persists after this clean rebuild, debug the application and st a breakpoint in your action class where you get the application module. Then check the class of the returned application module. If you see a class of the type of your ApplicationModuleImpl you should be able to access your methods. If you don't see your ApplicationModuleImpl something is wrong in the configuration cpx-File to struts-config.xml.

    Timo
  • 492834
    492834 Member Posts: 4
    Timo,

    Deleting the classes did the trick :-)

    Thanks a lot to you and all others that has contributed on this. This is my first time on this forum and I'm impressed on how quickly my problem was solved. Hopefully I'll contribute to the forum myself in the future.

    Again, thanks,
    Terje
This discussion has been closed.