php bin/magento setup:di:compile throws Source class “-------” for “-------” generation does not...
I have added a Repository interface in my Api directory and it's implementation in located under Models directory.
I have setup the preference for the interface in etc/di.xml.
When I run bin/magento setup:di:compile the following error is thrown in the console.
Source class "NamespaceModuleModelPostInterface" for "NamespaceModuleModelPostRepository" generation does not exist.
I have no idea why the system is searching for "NamespaceModuleModelPostInterface" while I have mentioned clearly the location of the implementation class in di.xml.
Any suggestions are welcome with thanks !!
More Info:
When I remove the Repository implementation file i.e; app/code/Namespace/Module/Model/PostRepository.php (imlpements app/code/Namespace/Module/Api/PostRepositoryInterface.php), the error disappears.
Also, when I rename the file from app/code/Namespace/Module/Model/PostRepository.php to app/code/Namespace/Module/Model/PostRepositoryy.php, the error disappears.
Is there any conventions that needs to be followed while using Repositories ?
magento-2.1
add a comment |
I have added a Repository interface in my Api directory and it's implementation in located under Models directory.
I have setup the preference for the interface in etc/di.xml.
When I run bin/magento setup:di:compile the following error is thrown in the console.
Source class "NamespaceModuleModelPostInterface" for "NamespaceModuleModelPostRepository" generation does not exist.
I have no idea why the system is searching for "NamespaceModuleModelPostInterface" while I have mentioned clearly the location of the implementation class in di.xml.
Any suggestions are welcome with thanks !!
More Info:
When I remove the Repository implementation file i.e; app/code/Namespace/Module/Model/PostRepository.php (imlpements app/code/Namespace/Module/Api/PostRepositoryInterface.php), the error disappears.
Also, when I rename the file from app/code/Namespace/Module/Model/PostRepository.php to app/code/Namespace/Module/Model/PostRepositoryy.php, the error disappears.
Is there any conventions that needs to be followed while using Repositories ?
magento-2.1
I get the same error and removing or renaming the file does not help. It's crazy.
– Matt Cosentino
Sep 18 '17 at 15:25
add a comment |
I have added a Repository interface in my Api directory and it's implementation in located under Models directory.
I have setup the preference for the interface in etc/di.xml.
When I run bin/magento setup:di:compile the following error is thrown in the console.
Source class "NamespaceModuleModelPostInterface" for "NamespaceModuleModelPostRepository" generation does not exist.
I have no idea why the system is searching for "NamespaceModuleModelPostInterface" while I have mentioned clearly the location of the implementation class in di.xml.
Any suggestions are welcome with thanks !!
More Info:
When I remove the Repository implementation file i.e; app/code/Namespace/Module/Model/PostRepository.php (imlpements app/code/Namespace/Module/Api/PostRepositoryInterface.php), the error disappears.
Also, when I rename the file from app/code/Namespace/Module/Model/PostRepository.php to app/code/Namespace/Module/Model/PostRepositoryy.php, the error disappears.
Is there any conventions that needs to be followed while using Repositories ?
magento-2.1
I have added a Repository interface in my Api directory and it's implementation in located under Models directory.
I have setup the preference for the interface in etc/di.xml.
When I run bin/magento setup:di:compile the following error is thrown in the console.
Source class "NamespaceModuleModelPostInterface" for "NamespaceModuleModelPostRepository" generation does not exist.
I have no idea why the system is searching for "NamespaceModuleModelPostInterface" while I have mentioned clearly the location of the implementation class in di.xml.
Any suggestions are welcome with thanks !!
More Info:
When I remove the Repository implementation file i.e; app/code/Namespace/Module/Model/PostRepository.php (imlpements app/code/Namespace/Module/Api/PostRepositoryInterface.php), the error disappears.
Also, when I rename the file from app/code/Namespace/Module/Model/PostRepository.php to app/code/Namespace/Module/Model/PostRepositoryy.php, the error disappears.
Is there any conventions that needs to be followed while using Repositories ?
magento-2.1
magento-2.1
edited 13 mins ago
Amit Naraniwal
40227
40227
asked Mar 22 '17 at 14:30
N. Karthic KannanN. Karthic Kannan
570415
570415
I get the same error and removing or renaming the file does not help. It's crazy.
– Matt Cosentino
Sep 18 '17 at 15:25
add a comment |
I get the same error and removing or renaming the file does not help. It's crazy.
– Matt Cosentino
Sep 18 '17 at 15:25
I get the same error and removing or renaming the file does not help. It's crazy.
– Matt Cosentino
Sep 18 '17 at 15:25
I get the same error and removing or renaming the file does not help. It's crazy.
– Matt Cosentino
Sep 18 '17 at 15:25
add a comment |
3 Answers
3
active
oldest
votes
After a lot of Code analysis and Google searches, I found the fix for this problem. Adding the following to the di.xml fixed this issue.
<type name="MagentoFrameworkModelEntityRepositoryFactory">
<arguments>
<argument name="entities" xsi:type="array">
<item name="NamespaceModuleApiDataPostInterface" xsi:type="string">NamespaceModuleApiDataPostRepositoryInterface
</item>
</argument>
</arguments>
</type>
add a comment |
This is an old post now, but for anyone else that's still experiencing this, a fix that seems to work is rather than defining the repository interface as a use
statement, add its fully qualified name, for example:
use VendorModuleInterface;
class MyClass implements Interface
Becomes:
class MyClass implements VendorModuleInterface
This fixed this for us when compiling repositories on M2 2.2.3
add a comment |
Remove var/generation and var/di folders
Then try again with command
php bin/magento setup:upgrade
php bin/magento setup:di:compile
php bin/magento setup:static-content:deploy
I have followed these steps and the error still appears.
– N. Karthic Kannan
Mar 23 '17 at 6:46
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "479"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e) {
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom)) {
StackExchange.using('gps', function() { StackExchange.gps.track('embedded_signup_form.view', { location: 'question_page' }); });
$window.unbind('scroll', onScroll);
}
};
$window.on('scroll', onScroll);
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f165630%2fphp-bin-magento-setupdicompile-throws-source-class-for-gen%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
3 Answers
3
active
oldest
votes
3 Answers
3
active
oldest
votes
active
oldest
votes
active
oldest
votes
After a lot of Code analysis and Google searches, I found the fix for this problem. Adding the following to the di.xml fixed this issue.
<type name="MagentoFrameworkModelEntityRepositoryFactory">
<arguments>
<argument name="entities" xsi:type="array">
<item name="NamespaceModuleApiDataPostInterface" xsi:type="string">NamespaceModuleApiDataPostRepositoryInterface
</item>
</argument>
</arguments>
</type>
add a comment |
After a lot of Code analysis and Google searches, I found the fix for this problem. Adding the following to the di.xml fixed this issue.
<type name="MagentoFrameworkModelEntityRepositoryFactory">
<arguments>
<argument name="entities" xsi:type="array">
<item name="NamespaceModuleApiDataPostInterface" xsi:type="string">NamespaceModuleApiDataPostRepositoryInterface
</item>
</argument>
</arguments>
</type>
add a comment |
After a lot of Code analysis and Google searches, I found the fix for this problem. Adding the following to the di.xml fixed this issue.
<type name="MagentoFrameworkModelEntityRepositoryFactory">
<arguments>
<argument name="entities" xsi:type="array">
<item name="NamespaceModuleApiDataPostInterface" xsi:type="string">NamespaceModuleApiDataPostRepositoryInterface
</item>
</argument>
</arguments>
</type>
After a lot of Code analysis and Google searches, I found the fix for this problem. Adding the following to the di.xml fixed this issue.
<type name="MagentoFrameworkModelEntityRepositoryFactory">
<arguments>
<argument name="entities" xsi:type="array">
<item name="NamespaceModuleApiDataPostInterface" xsi:type="string">NamespaceModuleApiDataPostRepositoryInterface
</item>
</argument>
</arguments>
</type>
answered Mar 24 '17 at 7:07
N. Karthic KannanN. Karthic Kannan
570415
570415
add a comment |
add a comment |
This is an old post now, but for anyone else that's still experiencing this, a fix that seems to work is rather than defining the repository interface as a use
statement, add its fully qualified name, for example:
use VendorModuleInterface;
class MyClass implements Interface
Becomes:
class MyClass implements VendorModuleInterface
This fixed this for us when compiling repositories on M2 2.2.3
add a comment |
This is an old post now, but for anyone else that's still experiencing this, a fix that seems to work is rather than defining the repository interface as a use
statement, add its fully qualified name, for example:
use VendorModuleInterface;
class MyClass implements Interface
Becomes:
class MyClass implements VendorModuleInterface
This fixed this for us when compiling repositories on M2 2.2.3
add a comment |
This is an old post now, but for anyone else that's still experiencing this, a fix that seems to work is rather than defining the repository interface as a use
statement, add its fully qualified name, for example:
use VendorModuleInterface;
class MyClass implements Interface
Becomes:
class MyClass implements VendorModuleInterface
This fixed this for us when compiling repositories on M2 2.2.3
This is an old post now, but for anyone else that's still experiencing this, a fix that seems to work is rather than defining the repository interface as a use
statement, add its fully qualified name, for example:
use VendorModuleInterface;
class MyClass implements Interface
Becomes:
class MyClass implements VendorModuleInterface
This fixed this for us when compiling repositories on M2 2.2.3
answered Jul 18 '18 at 11:44
Daniel DoyleDaniel Doyle
11
11
add a comment |
add a comment |
Remove var/generation and var/di folders
Then try again with command
php bin/magento setup:upgrade
php bin/magento setup:di:compile
php bin/magento setup:static-content:deploy
I have followed these steps and the error still appears.
– N. Karthic Kannan
Mar 23 '17 at 6:46
add a comment |
Remove var/generation and var/di folders
Then try again with command
php bin/magento setup:upgrade
php bin/magento setup:di:compile
php bin/magento setup:static-content:deploy
I have followed these steps and the error still appears.
– N. Karthic Kannan
Mar 23 '17 at 6:46
add a comment |
Remove var/generation and var/di folders
Then try again with command
php bin/magento setup:upgrade
php bin/magento setup:di:compile
php bin/magento setup:static-content:deploy
Remove var/generation and var/di folders
Then try again with command
php bin/magento setup:upgrade
php bin/magento setup:di:compile
php bin/magento setup:static-content:deploy
edited 24 mins ago
Ashish Viradiya
747622
747622
answered Mar 22 '17 at 16:21
RizwanRizwan
784326
784326
I have followed these steps and the error still appears.
– N. Karthic Kannan
Mar 23 '17 at 6:46
add a comment |
I have followed these steps and the error still appears.
– N. Karthic Kannan
Mar 23 '17 at 6:46
I have followed these steps and the error still appears.
– N. Karthic Kannan
Mar 23 '17 at 6:46
I have followed these steps and the error still appears.
– N. Karthic Kannan
Mar 23 '17 at 6:46
add a comment |
Thanks for contributing an answer to Magento Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e) {
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom)) {
StackExchange.using('gps', function() { StackExchange.gps.track('embedded_signup_form.view', { location: 'question_page' }); });
$window.unbind('scroll', onScroll);
}
};
$window.on('scroll', onScroll);
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f165630%2fphp-bin-magento-setupdicompile-throws-source-class-for-gen%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e) {
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom)) {
StackExchange.using('gps', function() { StackExchange.gps.track('embedded_signup_form.view', { location: 'question_page' }); });
$window.unbind('scroll', onScroll);
}
};
$window.on('scroll', onScroll);
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e) {
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom)) {
StackExchange.using('gps', function() { StackExchange.gps.track('embedded_signup_form.view', { location: 'question_page' }); });
$window.unbind('scroll', onScroll);
}
};
$window.on('scroll', onScroll);
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e) {
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom)) {
StackExchange.using('gps', function() { StackExchange.gps.track('embedded_signup_form.view', { location: 'question_page' }); });
$window.unbind('scroll', onScroll);
}
};
$window.on('scroll', onScroll);
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
I get the same error and removing or renaming the file does not help. It's crazy.
– Matt Cosentino
Sep 18 '17 at 15:25