Error "Resource '...Component\...\Administrator\Registry' has not been registered with the container"

For Joomla! 4.x Coding related discussions, you could also use: http://groups.google.com/group/joomla-dev-general

Moderator: ooffick

Forum rules
Post Reply
User avatar
JurajB
Joomla! Guru
Joomla! Guru
Posts: 611
Joined: Fri Oct 02, 2015 3:28 pm

Error "Resource '...Component\...\Administrator\Registry' has not been registered with the container"

Post by JurajB » Fri Nov 25, 2022 2:49 pm

Hello!
I made some changes in code but it was running OK in my localhost. Now I tried it with online hosting and this error stops me:

Resource 'Ircchatroot\Component\Ircchat\Administrator\Registry' has not been registered with the container.

When I try to show component mainpage.
Thanks for help.

//edit: file updated
You do not have the required permissions to view the files attached to this post.
Last edited by toivo on Sat Nov 26, 2022 8:43 am, edited 2 times in total.
Reason: mod note: retitled - please read the forum rules about appropriate subject line!

User avatar
JurajB
Joomla! Guru
Joomla! Guru
Posts: 611
Joined: Fri Oct 02, 2015 3:28 pm

Re: Error message

Post by JurajB » Fri Nov 25, 2022 3:06 pm

When I ask here I have one more problem.
When I ask for com_ircchat in the frontend by index.php?option=com_ircchat&view=ircchat program says "The requested page can't be found."
Thanks!

User avatar
JurajB
Joomla! Guru
Joomla! Guru
Posts: 611
Joined: Fri Oct 02, 2015 3:28 pm

Re: Error message

Post by JurajB » Sat Nov 26, 2022 8:28 am

I dont want to make your life harder but why is this telling me registry is not registered.
There is no such thing as "Registry" in my code but why it is calling it?
In the second problem is also calling something with registry in frontend.
I need to have my frontend working in this extension so I can go for javascript and find some way to communicate with IRC.
Thanks all for helping me.

SharkyKZ
Joomla! Hero
Joomla! Hero
Posts: 2505
Joined: Fri Jul 05, 2013 10:35 am
Location: Parts Unknown

Re: Error "Resource '...Component\...\Administrator\Registry' has not been registered with the container"

Post by SharkyKZ » Sat Nov 26, 2022 10:27 am

Why don't you have debug enabled when developing?

User avatar
JurajB
Joomla! Guru
Joomla! Guru
Posts: 611
Joined: Fri Oct 02, 2015 3:28 pm

Re: Error "Resource '...Component\...\Administrator\Registry' has not been registered with the container"

Post by JurajB » Wed Nov 30, 2022 9:38 am

Hello guys, am here!
I need some help configuring debbuging.
I have xampp 8.1 with xdebug 3.2.0RC2 installed and running (phpinfo has xdebug affirmed).
I have vscode with phpdebug (xdebug extension).
I also have firefox and chrome with xdebug extension set to debug.
I expect that I will see the problem in vs code. But when I configure debugging (vscode) with run and debug it shows me "select debugger" list and I tried to click on PHP (I checked it and it is php debug extension) and chrome (web app) but nothing happens just the debugger panel with "run and debug" button refreshes.
I see nothing in my debug console which I must open manually.
Thanks in advance!

SharkyKZ
Joomla! Hero
Joomla! Hero
Posts: 2505
Joined: Fri Jul 05, 2013 10:35 am
Location: Parts Unknown

Re: Error "Resource '...Component\...\Administrator\Registry' has not been registered with the container"

Post by SharkyKZ » Wed Nov 30, 2022 2:24 pm

I was more thinking of Joomla's built-in debug. With it enabled you would see exactly where your issue comes from.

User avatar
ceford
Joomla! Ace
Joomla! Ace
Posts: 1496
Joined: Mon Feb 24, 2014 10:38 pm
Location: Edinburgh, Scotland
Contact:

Re: Error "Resource '...Component\...\Administrator\Registry' has not been registered with the container"

Post by ceford » Wed Nov 30, 2022 4:36 pm

Do you have a VS Code launch configuration in the root of your site as described here:

https://docs.joomla.org/Visual_Studio_Code_Primer

User avatar
JurajB
Joomla! Guru
Joomla! Guru
Posts: 611
Joined: Fri Oct 02, 2015 3:28 pm

Re: Error "Resource '...Component\...\Administrator\Registry' has not been registered with the container"

Post by JurajB » Thu Dec 01, 2022 10:48 am

Hello!
I've been able to fix administrator part via Joomla debug system.
Here is problem I have with site displaing:
joomla/index.php?option=com_ircchat&view=ircchat
"Compile Error: A void function must not return a value"

Code: Select all

	public function display($tpl = null): void
	{
		// Check for errors.
		/*
		if (count($errors = $this->get('Errors')))
		{
			throw new GenericDataException(implode("\n", $errors), 500);
		}
		*/
		return parent::display($tpl); ******** here is the error ********
	}
It is the site/src/view/ircchat/htmlview.php error with "return parent::display($tpl);"
You do not have the required permissions to view the files attached to this post.

User avatar
JurajB
Joomla! Guru
Joomla! Guru
Posts: 611
Joined: Fri Oct 02, 2015 3:28 pm

Re: Error "Resource '...Component\...\Administrator\Registry' has not been registered with the container"

Post by JurajB » Thu Dec 01, 2022 10:52 am

I have the .vscode dir in my file but I see nothing in the debug console.

User avatar
ceford
Joomla! Ace
Joomla! Ace
Posts: 1496
Joined: Mon Feb 24, 2014 10:38 pm
Location: Edinburgh, Scotland
Contact:

Re: Error "Resource '...Component\...\Administrator\Registry' has not been registered with the container"

Post by ceford » Thu Dec 01, 2022 10:53 am

Just remove the word 'return'

User avatar
ceford
Joomla! Ace
Joomla! Ace
Posts: 1496
Joined: Mon Feb 24, 2014 10:38 pm
Location: Edinburgh, Scotland
Contact:

Re: Error "Resource '...Component\...\Administrator\Registry' has not been registered with the container"

Post by ceford » Thu Dec 01, 2022 10:55 am

JurajB wrote:
Thu Dec 01, 2022 10:52 am
I have the .vscode dir in my file but I see nothing in the debug console.
In vscode you select Run / Start Debugging and then go to your browser and load the page you are working on. You need to set breakpoints where the errors occur.

User avatar
JurajB
Joomla! Guru
Joomla! Guru
Posts: 611
Joined: Fri Oct 02, 2015 3:28 pm

Re: Error "Resource '...Component\...\Administrator\Registry' has not been registered with the container"

Post by JurajB » Thu Dec 01, 2022 10:59 am

finally got it running
Thank you ceford.

User avatar
JurajB
Joomla! Guru
Joomla! Guru
Posts: 611
Joined: Fri Oct 02, 2015 3:28 pm

Re: Error "Resource '...Component\...\Administrator\Registry' has not been registered with the container"

Post by JurajB » Thu Dec 01, 2022 11:07 am

No luck with debugging:
- I simulate the error, open file in vscode from joomla / administrator / myextension / myfile.php .
I click the breakpoint in this file, than I run it with my browser the joomla on localhost.
Nothing happened. Thanks!

MarkRS
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 194
Joined: Thu Oct 29, 2009 8:28 am
Location: UK

Re: Error "Resource '...Component\...\Administrator\Registry' has not been registered with the container"

Post by MarkRS » Thu Dec 01, 2022 11:24 am

"Nothing happened" doesn't really help. With a bit more detail we can help better.

What you should see once you run the page under debugging is that execution stops at the first line of /index.php. Do you get that? If not, you've not got debugging set up properly.

If you do get that, and after continuing execution doesn't stop at the breakpoint you set, then single step through from that first point to find out what's going wrong. Yes, it's a bit laborious, but a) you'll learn a lot about how J! runs and b) you'll find out where things are going wrong.
It's a community, the more we all contribute, the better it will be.

User avatar
JurajB
Joomla! Guru
Joomla! Guru
Posts: 611
Joined: Fri Oct 02, 2015 3:28 pm

Re: Error "Resource '...Component\...\Administrator\Registry' has not been registered with the container"

Post by JurajB » Fri Dec 02, 2022 1:53 pm

my debug is still not working
when I click on my vscode debug console and press enter I get this message:
"Cannot evaluate code without a connection"
What I should be listening to ? it is the php xdebug extension?

MarkRS
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 194
Joined: Thu Oct 29, 2009 8:28 am
Location: UK

Re: Error "Resource '...Component\...\Administrator\Registry' has not been registered with the container"

Post by MarkRS » Fri Dec 02, 2022 6:36 pm

You need to pay attention to your webserver config files. You need to add some stuff to get it to listen to xdebug properly. I think there was a reference above to where to find that in the (J!) docs. If not, look in the Joomla docs, there's a detailed document about what to do where to make the link happen.
It's a community, the more we all contribute, the better it will be.


User avatar
JurajB
Joomla! Guru
Joomla! Guru
Posts: 611
Joined: Fri Oct 02, 2015 3:28 pm

Re: Error "Resource '...Component\...\Administrator\Registry' has not been registered with the container"

Post by JurajB » Sat Dec 03, 2022 7:37 am

Hello!
Its working!
Many thanks!

User avatar
JurajB
Joomla! Guru
Joomla! Guru
Posts: 611
Joined: Fri Oct 02, 2015 3:28 pm

Re: Error "Resource '...Component\...\Administrator\Registry' has not been registered with the container"

Post by JurajB » Sat Dec 03, 2022 3:48 pm

Hi again :)
As debuger goes it stops in databasedriver.php
I understand by that way that it is not able to follow and handle database queries of the system.
Is there a way that I use it with my extension?
Thanks!

User avatar
ceford
Joomla! Ace
Joomla! Ace
Posts: 1496
Joined: Mon Feb 24, 2014 10:38 pm
Location: Edinburgh, Scotland
Contact:

Re: Error "Resource '...Component\...\Administrator\Registry' has not been registered with the container"

Post by ceford » Sat Dec 03, 2022 5:41 pm

You look back through the call stack - find which function called the database driver. There is probably something wrong with the parameters you are passing.

User avatar
JurajB
Joomla! Guru
Joomla! Guru
Posts: 611
Joined: Fri Oct 02, 2015 3:28 pm

Re: Error "Resource '...Component\...\Administrator\Registry' has not been registered with the container"

Post by JurajB » Sun Dec 04, 2022 11:57 am

Hello again!

public function close(): void
{
// Before storing data to the session, we serialize and encode the Registry
$_SESSION['joomla'] = base64_encode(serialize(clone $this->data));

parent::close();
}
from JoomlaStorage.php
than it goes over databasedriver.php in which call this:
public function __destruct()
{
$this->disconnect();
}
and disconnects and I am no more able to move back, I think there is something weird because I can go in go out and step over only theese "movements" are working. I can't really take step back only theese three which everyone practically go forward.


Post Reply

Return to “Joomla! 4.x Coding”