I'm trying to create a custom module for Magento 2. when I try to inject the ThreadRepositoryInterface into the controller constructor the code fails.
This is the error:
Fatal error: Uncaught Error: Cannot instantiate interface Mycompany\Tickets\Api\ThreadRepositoryInterface in /var/www/html2/magento2.local/lib/internal/Magento/Framework/ObjectManager/Factory/Dynamic/Developer.php on line 73
this is the structure of the module:
.
├── Api
│ ├── AttachmentRepositoryInterface.php
│ ├── CategoryRepositoryInterface.php
│ ├── Data
│ │ ├── AttachmentInterface.php
│ │ ├── AttachmentSearchResultsInterface.php
│ │ ├── CategoryInterface.php
│ │ ├── CategorySearchResultsInterface.php
│ │ ├── StatusInterface.php
│ │ ├── StatusSearchResultsInterface.php
│ │ ├── ThreadInterface.php
│ │ ├── ThreadSearchResultsInterface.php
│ │ ├── TicketsInterface.php
│ │ └── TicketsSearchResultsInterface.php
│ ├── StatusRepositoryInterface.php
│ ├── ThreadRepositoryInterface.php
│ └── TicketsRepositoryInterface.php
├── Block
│ ├── Create
│ │ └── Form.php
│ ├── Index
│ │ └── Tickets.php
│ └── Reply
│ └── Index.php
├── composer.json
├── Controller
│ ├── Create
│ │ └── Index.php
│ ├── Index
│ │ ├── Fastlink.php
│ │ └── Index.php
│ └── Reply
│ └── Index.php
├── etc
│ ├── acl.xml
│ ├── adminhtml
│ │ ├── menu.xml
│ │ ├── routes.xml
│ │ └── system.xml
│ ├── config.xml
│ ├── di.xml
│ ├── email_templates.xml
│ ├── frontend
│ │ └── routes.xml
│ ├── module.xml
│ └── webapi.xml
├── Helper
│ ├── AbstractData.php
│ └── Data.php
├── LICENSE.txt
├── Model
│ ├── Attachment
│ │ └── DataProvider.php
│ ├── Attachment.php
│ ├── AttachmentRepository.php
│ ├── Category
│ │ └── DataProvider.php
│ ├── Category.php
│ ├── CategoryRepository.php
│ ├── Config
│ │ └── Source
│ │ └── Tickets
│ │ └── Status.php
│ ├── ResourceModel
│ │ ├── Attachment
│ │ │ └── Collection.php
│ │ ├── Attachment.php
│ │ ├── Category
│ │ │ └── Collection.php
│ │ ├── Category.php
│ │ ├── Status
│ │ │ └── Collection.php
│ │ ├── Status.php
│ │ ├── Thread
│ │ │ └── Collection.php
│ │ ├── Thread.php
│ │ ├── Tickets
│ │ │ └── Collection.php
│ │ └── Tickets.php
│ ├── Sendmail.php
│ ├── Status
│ │ └── DataProvider.php
│ ├── Status.php
│ ├── StatusRepository.php
│ ├── Thread
│ │ └── DataProvider.php
│ ├── Thread.php
│ ├── ThreadRepository.php
│ ├── Tickets
│ │ └── DataProvider.php
│ ├── Tickets.php
│ ├── TicketsRepository.php
│ └── TicketsSearchResult.php
├── registration.php
├── Setup
│ ├── InstallData.php
│ └── InstallSchema.php
└── view
└── frontend
├── email
│ └── ticket_new.html
├── layout
│ ├── customer_account.xml
│ ├── tickets_create_index.xml
│ ├── tickets_index_fastlink.xml
│ ├── tickets_index_index.xml
│ └── tickets_reply_index.xml
└── templates
├── form
│ ├── register.phtml
│ └── reply.phtml
└── list.phtml
36 directories, 76 files
Any idea?