Can not access root app module in nested one

I am using Jdeveloper 11g R2 (11.1.2.3) & Weblogic 10.3.5.0
I have a root application module and few nested application modules nested under root one in my ADF application
I have few common methods under root application module Impl class and try to access them in nested Impl classes
like this (This code is in nestedAppModuleImpl class):
RootAppModuleImpl root = (RootAppModuleImpl)someViewObject.getDBTransaction().getRootApplicationModule();
root.doSomething();
when I execute above code this excepton is thrown:
oracle.jbo.server.ApplicationModuleImpl cannot be cast to mypackage.RootAppModuleImpl
Any comment or workaround?
What is the proper solution?
Regards
Mohsen

Mohsen, there is something terribly wrong with your code.
//(This code is in nestedAppModuleImpl class):
RootAppModuleImpl root = (RootAppModuleImpl)someViewObject.getDBTransaction().getRootApplicationModule();
root.doSomething();doesn't make sense. Does doSomething() really return an RootAppModuleImpl? You can access the root application module from the nested application module by
RootAppModuleImpl root = (RootAppModuleImpl)getRootApplicationModule();If you get a class cast exception it means that there is something wrong with your RooAppModuleImpl. Does it extend ApplicationModuleImpl? If yes the cast should be possible.
Is the root application module of the type RootAppModuleImpl? only then you can access the common methods after getting the root application module.
the next method
private ViewObject getAccountExistsView(DBTransaction t) {
ApplicationModule root = t.getRootApplicationModule();
ViewObject vo = root.findViewObject("MemberExistsView");
if (vo == null) {
vo = root.createViewObject("MemberExistsView","model.MemberExistsView");
return vo;
}doesn't make sense to me. Where does this method reside? in the RootAppModuleImpl? if yes, why do you call getRootApplicationModule? You are in the root application Module. I can' comment on the createViewObject you are calling, but my feeling is that you don't need it either. The view you are creating should be there already if your application module are setup correctly.
And you are right, you should not call createRootApplicationModule if it is not needed. In your case it's not!
Timo

Similar Messages

  • JBO-25301: Application module ... is not a root app module but has no..

    Hello,
    Tools:_
    Jdeveloper 10.1.2
    JPDK 10.1.2
    ADF
    Portal version 10.1.2 (repository upgrade 10.1.4)
    Problem:_
    I have an application that calls other application module from it's own application module. Some times it gives error (not every time):
    •     JBO-29000: Unexpected exception caught: oracle.jbo.JboException, msg=JBO-29000: Unexpected exception caught: oracle.jbo.InvalidOwnerException, msg=JBO-25301: Application module FormHistoryServiceLocal is not a root app module but has no parent
    •        JBO-29000: Unexpected exception caught: oracle.jbo.InvalidOwnerException, msg=JBO-25301: Application module FormHistoryServiceLocal is not a root app module but has no parent
    •           JBO-25301: Application module FormHistoryServiceLocal is not a root app module but has no parent
    Code that application uses to call other application module:_
    public ApplicationHandler( ApplicationModule rootModule )
        try
          if(rootModule != null)
            formHistory = (FormHistoryService)rootModule.findApplicationModule(FORMHISTORYSERVICE_LOCAL);
            if(formHistory == null){
              formHistory = (FormHistoryService)rootModule.createApplicationModule( FORMHISTORYSERVICE_LOCAL, FORMHISTORYSERVICE_DEF );
            userInfoDAO.connect();
          }else System.out.println("Application Module was NULL");
        }catch(Exception e)
          e.printStackTrace();
    (calls: formHistory.addToHistory())
    The other application module:+
    public void addToHistory( Number formId, Number status, Number type, Number userId, String event )
        FormhistoryDefImpl defImpl = (FormhistoryDefImpl)EntityDefImpl.findDefObject("com.mysite.app.Formhistory");
        FormhistoryImpl fh = (FormhistoryImpl)defImpl.CreateFormhistory( this.getDBTransaction(), new NameValuePairs() ); //************ Exception is thrown from here! ************
        fh.setFormid(formId);
        fh.setStatus(status);
        fh.setType(type);
        fh.setUserid(userId);
        fh.setEvent(event);
        oracle.jbo.domain.Date eventTimestamp = new oracle.jbo.domain.Date((new java.sql.Timestamp(new java.util.Date().getTime())));
        fh.setEventtimestamp(eventTimestamp);
        this.getTransaction().commit();
    What's wrong here?
    JBO description:+
    JBO-25301: InvalidOwnerException
    Cause: While traversing the parenthood chain for application modules, a child application module was found with no container (parent) application module.
    Action: If this application has added custom business component classes, it may be that the application code is attempting to access a child application module before it is fully initialized. If this is not the case, this error probably represents some internal error in BC4J framework, in which case contact BC4J Technical Support.
    How can i ensure that child application module is already initialized?

    Anyone?

  • "Application module  is not a root app module but has no parent"

    This is to follow up on my answered question on rootAN substitution
    Re: "login session has expired" after am substitution
    I am working on an OAF extension.
    I have a new LOV region. I extended (to be substituted) the seeded VO, call it xxVO. And I have three custom methods using this xxVO that are called from processFormRequest of my controller which extends the seeded controller.
    So putting these methods in rootAM and AM substitution didn't work as some folks pointed out.
    So I created xxAM (extends root AM), put xxVO in xxAM’s data model and put my methods in xxAM, set this xxAM as AMDefinition for my custom LOV region.
    In my controller I do
    OAApplicationModule xxAM = new xxprg.oracle.apps.icx.por.req.server.xxprgRequisitionAMImpl();
    But I am getting
    => oracle.apps.fnd.framework.OAException: oracle.jbo.InvalidOwnerException: JBO-25301: Application module is not a root app module but has no parent
    at
    xxAM.invokeMethod("handleChangeRequester", parameters);
    I found a few posts on the same topic. One advise was to not instantiate ‘new’ AM but do something like this
    Xo2cAcctOviewExtAMImpl amExt = (Xo2cAcctOviewExtAMImpl )pageContext.getApplicationModule(webBean);
    In this example I am confused about the fact that ‘getApplicationModule(webBean);’ which is used in the signature of the processFormRequest will return a ‘rootAM’, is this correct?
    There was another workaround mentioned in other posts to not use xxAM at all but build a class to mimic an xxAM passing all needed values that custom methods require. In which case how(or better where) do I instantiate xxVO since now xxVO won’t be part of any AM data model?
    Can someone please clarify.
    Thank you
    Anatoliy

    Pratap,
    Thank you for the response.
    The reason I need to use new xxCO on the page is this.
    Seeded page CheckoutLinesPG.
    It has advanced table on it where every column has it's one external region.
    The new LOV region xxRN is put on a page also under this table new column.
    1. When a requester (seeded region on the seeded page) is changed then my xxLOV should reflect the change and be populated according to what is selected in the Requester LOV.
    2. When one-time address is added (another seeded region on the seeded page) my xxLOV should be disabled, when one time address taken out - enabled again.
    So xxCO should apply to the whole page.
    The VO behind advanced table PoRequisitionLinesVO is extended with 2 additional attributes and will substitute, the new xxVO is under xxAM data model.
    All works fine with my methods in the seeded RequisitionAM which I get a handle to in the xxCO. But I don;t know how to get the handle to the xxAM if I put my methods there.
    Thanks,
    Anatoliy
    P.S. just fyi - I know it is not the recommended approach but what I did for now I put all calls into the controller - in the controller I can get a handle to root AM, through that I am getting a handle to xxVO which (!) is substituted during runtime with my xxVO. But if you can figure out how to get a handle to xxAM in my case it will be great.
    Edited by: asmirnov on Mar 24, 2009 2:04 PM

  • About 1 year ago, I can not access the App Store. The message that appears is: "One Moment Please. Connecting to the iTunes Store. Loading ... I've tried all the aids presented in this and other forums and nothing solves. iTunes connects normaly...

    About 1 year ago, I can not access the App Store. The message that appears is: "One Moment Please. Connecting to the iTunes Store. Loading ... " I've tried all the aids presented in this and other forums and nothing solves. iTunes connects normaly...

    Your profile indicates your Mac is running v10.7.2
    If that is correct, updating your system software may help.
    Click Software Update from the Apple menu.
    Restart your Mac after updates are installed then try the App Store.
    If you can't update that way, there's a workaround.
    Install the OS X Lion Update 10.7.5 (Client Combo)
    Then restart your Mac and try the App Store.
    messaged edited by:  cs

  • My ipod touch 4G got problem after update to iOS 6, it can not access the Apps store ,can not access safari,map, weather and so on, could someone help me to solve the problem, thanks in advance~~~

    My ipod touch 4G got problem after update to iOS 6, it can not access the Apps store ,can not access safari,map, weather and so on, could someone help me to solve the problem, thanks in advance~~~

    Force close the App Store app and reset the iPad. No data will be lost when you reset the device.
    In order to close apps, you have to drag the app up from the multitasking display. Double tap the home button and you will see apps lined up going left to right across the screen. Swipe to get to the app that you want to close and then swipe "up" on the app preview thumbnail to close it.
    Next, reset the iPad by holding down on the sleep and home buttons at the same time for about 10-15 seconds until the Apple Logo appears - ignore the red slider if it appears on the screen - let go of the buttons. Let the iPad start up.

  • I can not access the app from itunes

    Hi, can someone help me solve this problem?
    I have an iPhone 4 with iOS 7.0.3 with iTunes 11.1.2 and when I want my iPhone to sync from iTunes can not access the iTunes app tab I close iTunes without possibility of doing something.
    this only happens to me with the iPhone, I have also an iPad 2 and it works ok.

    Hi tankard77,
    Thanks for visiting Apple Support Communities.
    If iTunes is quitting unexpectedly when you try to sync your iPhone, start with the troubleshooting information in this article:
    iTunes for Windows Vista or Windows 7: Troubleshooting unexpected quits, freezes, or launch issues
    http://support.apple.com/kb/ts1717
    Best Regards,
    Jeremy

  • I can not access purchased apps on ios 6

    I updated ipad 3 to ios 6, I am now unable to access purchased apps. The screen shows "loading", then just a blank screen. Same on iPhone 5. Any help?

    HI Robyn ..
    Try reseetting your password using the iforgot link here >  Apple ID: "This Apple ID has been disabled for security reasons" alert appears

  • Java Error Application module is not a root app module ...

    Hi
    I am calling from APPAmImpl.java program's Method from APPPhaseListener.Java (on pageload) program.
    PriceMgmtModuleImpl pmImpObj = new PriceMgmtModuleImpl();
    call is going to the method inwhich I am making DB call with below statment
    st = getDBTransaction().createCallableStatement(stmt,0);
    Application is throwing error here. Is it problem with object initialization? Any pointer on this issue.

    Hi,
    don't see if your AM is getting initialized at all. So how do you create the reference to the AM?
    Frank

  • Can not update iPhone APPs. Message that one APP no longer available.

    Hi,
    Last night I tried to update APPS in iTunes... showed 9 updates available. I tried to update them but at the beginning of the process I got a message that one of the APPs was no longer available ( didn't say which one) and the process stopped. None of the APPs was updated. Tried a number of times with same result. What can I do? Anyone else seen this?
    Iphone was NOT attached at the time.

    I have a similar problem, I can't update on my iPhone either. Have you recently updated/ changed your iPhone account? If so you'll have to report it to apple (provide feedback) as no one here can help (tried for weeks.)

  • Can Not Access Apps?

    I can not access the App store?  I have tried everything even update and all I get is a grey Apps screen?

    Launch the Console application in any of the following ways:
    ☞ Enter the first few letters of its name into a Spotlight search. Select it in the results (it should be at the top.)
    ☞ In the Finder, select Go ▹ Utilities from the menu bar, or press the key combination shift-command-U. The application is in the folder that opens.
    ☞ Open LaunchPad. Click Utilities, then Console in the icon grid.
    Make sure the title of the Console window is All Messages. If it isn't, select All Messages from the SYSTEM LOG QUERIES menu on the left. If you don't see that menu, select
    View ▹ Show Log List
    from the menu bar.
    Click the Clear Display icon in the toolbar. Then try the action that you're having trouble with again. Select any messages that appear in the Console window. Copy them to the Clipboard by pressing the key combination command-C. Paste into a reply to this message (command-V).
    When posting a log extract, be selective. In most cases, a few dozen lines are more than enough.
    Please do not indiscriminately dump thousands of lines from the log into this discussion.
    Important: Some private information, such as your name, may appear in the log. Anonymize before posting.

  • Application module AppModuleImpl_1 is not root app module but has no parent

    Dear all
    every time i am trying to run any script on appmodule level i am getting this error Application module AppModuleImpl_1 is not a root app module but has no parent
    what is wrong i write every time in my code that causes this error ?
    Many Thanks

    This is the method inside the backing bean :
        public String cb2_action() {    
                DemoImpl demo = new DemoImpl();
            demo.prop(getLocid().toString(),getHoldesc().toString());
    return null;
    }This method "prop" is written inside the AM called "Demo" :
        public void prop(String locid, String holdesc) {
    CallableStatement st = null ;
                try {
                StringBuffer str = new StringBuffer();
                str.append(" BEGIN ");
                str.append(" test_package.prop( ");
                str.append("       locid           => :1, ");
                str.append("       holdesc         => :2  ");
                str.append("    ); ");
                str.append(" END; ");
              st =getDBTransaction().createCallableStatement(str.toString(), 1);
                  st.setInt(1, Integer.parseInt(locid));
                st.setString(2, holdesc);
                st.execute();
            } catch (SQLException sqle) {
                // TODO: Add catch code
                sqle.printStackTrace();
            } catch (NumberFormatException nfe) {
                // TODO: Add catch code
                nfe.printStackTrace();
            }

  • Hi, I can not access my iTunes and send messages send the iMensage, but I can access my email and browse the internet, what should I do?

    I bought some apps in the app store, then installed it on my iPod touch (5th generation), from this day I can not access the app store (which appears when you try you can not connect to iTunes store), what should I do?

    Withut more information:
    Can't connect to the iTunes Store
    iOS: Troubleshooting Messages

  • URGENT: My iPad doesn't have an app store at all, there is no icon for it, and searching it on my iPad doesn't come up with any results. How can I access the app store?

    HELP! I don't know why my iPad doesn't have an app store, or maybe someone uninstalled it, but how do you access the app store? My iPad doesn't even have an app for it!

    restricted? as after my ios 8 update  I get this msg "can not access the app store" for my ipad 4

  • I accidentally deleted some drivers from my macbook air and now i can not access app store and system preferences as it says the following message (You can't open the application System Preferences because it may be damaged or incomplete)

    i accidentally deleted some drivers from my macbook air and now i can not access app store and system preferences as it says the following message (You can't open the application System Preferences because it may be damaged or incomplete)

    Repair the Hard Drive and Permissions - Lion/Mountain Lion
    Boot to the Recovery HD:
    Restart the computer and after the chime press and hold down the COMMAND and R keys until the menu screen appears. Alternatively, restart the computer and after the chime press and hold down the OPTION key until the boot manager screen appears. Select the Recovery HD and click on the downward pointing arrow button.
    Repair
    When the recovery menu appears select Disk Utility. After DU loads select your hard drive entry (mfgr.'s ID and drive size) from the the left side list.  In the DU status area you will see an entry for the S.M.A.R.T. status of the hard drive.  If it does not say "Verified" then the hard drive is failing or failed. (SMART status is not reported on external Firewire or USB drives.) If the drive is "Verified" then select your OS X volume from the list on the left (sub-entry below the drive entry,) click on the First Aid tab, then click on the Repair Disk button. If DU reports any errors that have been fixed, then re-run Repair Disk until no errors are reported. If no errors are reported then click on the Repair Permissions button. When the process is completed, then quit DU and return to the main menu. Select Restart from the Apple menu.

  • Security photo - does not show any apps that have requested access. I can not access photos via apps. How to fix it?

    Apps can not access photos.
    Apps never asked if they could access photos.
    Security>Photos  - there are no apps on the list.
    I have restarted.
    Backed up, restored.
    No improvement.
    Thanks.
    ps my iphone allows access, so I know 'how' to do it usually.

    Found the answer:
    Go to settings/general/restrictions/photos and allow the apps to have access to photos

Maybe you are looking for

  • Problem in OIM Installation in Linux-64 bit environment

    Hi, Components used 1. Oracle Database11gR1 2. Weblogic Application server 10.3.0(installed in non clustered mode) 3. OIM 9.1.0.1 Also ensured the above three are compatible. I'm facing problem at the end of OIM installation in RedHat Linux-64 bit en

  • Imac to Ipad Air

    I now have been able to load my photos from my IPad2 to my Imac - but now if I buy an Ipad Air how can I download those same photos to the new IPad?

  • Database control won't run in secure mode

    I'm following the instructions displayed by the database configuration manager after creating a database. These instructions configure the database control to run in secure mode using https. I get an error with the following command run from the OS c

  • Changing the order that pages print

    how do i change the order that document pages print? I want to print the last page first. This question was solved. View Solution.

  • C/C++ version of LDAP SDK 4.1 for Linux platform

    Hi All, I am looking for C/C++ version of LDAP SDK 4.1 for Linux platform. Do you have any pointer from where I could download this library? Thanks in Advance, Shyam Shukla