Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8658147
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T15:41:38+00:00 2026-06-12T15:41:38+00:00

I got a problem loading a second model handling a database with a module.

  • 0

I got a problem loading a second model handling a database with a module.
I got 1 controller ValidateController and 2 Models Main that extends Mage_Core_Controller_Front_Action so I can’t communicate with the database, and Log that communicates with the database.

When I call $log = Mage::getModel('modulex/log'); it is fine it gives me the correct path for with get_class($log) but when I call $log->load($params['id']); it fails giving me this error:

Warning: include(Companyx/Modulex/Model/Resource/Main.php) [function.include]: failed to open stream: No such file or directory

I don’t see why it gives me this error, it should call Resource/Log.php that exists.

I show you my config.xml

<frontend>
    <routers>
        <modulex>
            <use>standard</use>
            <args>
                <module>Companyx_Modulex</module>
                <frontName>modulex</frontName>
            </args>
        </modulex>
    </routers>
</frontend>
<global>
    <models>
        <modulex>
            <class>Companyx_Modulex_Model</class>
            <resourceModel>modulex_resource</resourceModel>
        </modulex>
        <modulex_resource>
            <class>Companyx_Modulex_Model_Resource</class>
            <entities>
                    <log>
                            <table>companyx_modulex_logs</table>
                    </log>
            </entities>
        </modulex_resource>
    </models>
</global>

Thank you for your help !

==== EDIT SOLUTION ====
Create /resource/Main.php with this code

class Companyx_Modulex_Model_Resource_Main extends Mage_Core_Model_Resource_Db_Abstract
{
    protected function _construct()
    {
        $this->_init('modulex/log', 'id');
    }
}

My mistake was doing $this->_init('modulex/main', 'id');.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T15:41:39+00:00Added an answer on June 12, 2026 at 3:41 pm

    The error message that you are receiving i reasonably clear, the resource model isn’t found. Magento splits models into what is essentially a 2 layer system. One layer for dealing with business logic and the other layer for dealing with persistence / database interaction. When you call load on your model, this is proxied off to the resource model specified for you class. In your configuration this resource is being set-up as Companyx_Modulex_Model_Resource_Main.php, but you seemingly don’t have a file in the location the class is supposed to be defined – app/code/{codepool}/Companyx/Modulex/Model/Resource/Main.php.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've got a problem similar to,but subtly different from, that described here (Loading assemblies
i have a problem while loading a UITableView on UITabBarController, i got this error
I've got a bit of a problem with making my data loading and filtering
I've got problem with connecting to MySQL database on my freshly installed Windows 7
I got a problem with loading the google maps api. I got my own
I've got an iPhone app that need to be localized. No problem with strings,
i got a problem with loading code. customer wants when clicked an tag a
I got problem when loading Facebook Javascript SDK, it will causing my SSL connection
I've (actually my classmate) got a problem with loading local ZEND_AMF services on Windows
I have got a problem with Jquery UI dialog window. I am loading external

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.