Welcome, Guest
Username: Password: Remember me

TOPIC: [SOLVED] components class view not found error

components class view not found error 25 Jun 2013 22:19 #7673

  • dyoungers
  • dyoungers's Avatar
  • Offline
  • Premium Member
  • Posts: 123
  • Thank you received: 16
  • Karma: 0
My component installs and works in the sandbox (2.5) but when I try to install it on my servers (I've tried it on a local XAMPP server and a live server that I manage) and both give me the same error:
( ! ) Fatal error: Class 'JteammanagerClassView' not found in C:\xampp\htdocs\development\joomla25\components\com_jteammanager\views\cpanel\view.html.php on line 37
Call Stack
#	Time	Memory	Function	Location
1	0.0281	138472	{main}( )	..\index.php:0
2	6.3792	3699280	JSite->dispatch( ??? )	..\index.php:42
3	6.4111	3729928	JComponentHelper::renderComponent( ???, ??? )	..\application.php:197
4	6.4179	3759576	JComponentHelper::executeComponent( ??? )	..\helper.php:351
5	6.4187	3783832	require_once( 'C:\xampp\htdocs\development\joomla25\components\com_jteammanager\jteammanager.php' )	..\helper.php:383
6	6.5036	5090512	JController->execute( ??? )	..\jteammanager.php:44
7	6.5037	5090656	JteammanagerCkController->display( ???, ??? )	..\controller.php:761
8	6.5038	5090776	JteammanagerCkClassController->_parentDisplay( )	..\controller.php:59
9	6.5038	5090984	JController->display( ???, ??? )	..\controller.php:51
10	6.5048	5091600	JController->getView( ???, ???, ???, ??? )	..\controller.php:677
11	6.5049	5091792	JController->createView( ???, ???, ???, ??? )	..\controller.php:897
12	48.6204	5127552	require_once( 'C:\xampp\htdocs\development\joomla25\components\com_jteammanager\views\cpanel\view.html.php' )	..\controller.php:639

Assuming that the code generates the same code for download and the sandbox, I'm at a loss to explain this ... any help or ideas on where to start looking would be appreciated :)

Thanks!
Dave
The administrator has disabled public write access.

components class view not found error 26 Jun 2013 10:17 #7686

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 987
  • Karma: 140
It is working for me.
(I only can see an issue with language file, I will fix it)

I tried your component in local.
Wich version of Joomla ?
Coding is now a piece of cake
The administrator has disabled public write access.

components class view not found error 26 Jun 2013 14:10 #7696

  • dyoungers
  • dyoungers's Avatar
  • Offline
  • Premium Member
  • Posts: 123
  • Thank you received: 16
  • Karma: 0
yes, everything works for me in the 2.5 sandbox but I get the error on my local server which is running 2.5.11 and on a "live" server running 2.5.9

Is it possible that there is configuration problem/difference that would cause this?

My local server is running PHP 5.4.7 and the other server is running PHP 5.3.19

Thanks!
Dave
The administrator has disabled public write access.

components class view not found error 26 Jun 2013 14:21 #7698

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 987
  • Karma: 140
This is strange.

Can you open other pages of your component ?
Because your JteammanagerClassView is the base class for all your views.

It seems that your JLoader is not working.

Try to include manually this class file
[admin]/classes/view/view.php[code][code][admin]/classes/view/view.php[code]
Coding is now a piece of cake
The administrator has disabled public write access.

components class view not found error 26 Jun 2013 14:55 #7703

  • dyoungers
  • dyoungers's Avatar
  • Offline
  • Premium Member
  • Posts: 123
  • Thank you received: 16
  • Karma: 0
none of the other pages work either ... also just tried it on Joomla 3.1.1 and it works there so things are even more strange

where is the best place to manually include the [admin]/classes/view/view.php ?

Thanks!
Dave
The administrator has disabled public write access.

components class view not found error 26 Jun 2013 15:12 #7705

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 987
  • Karma: 140
helpers/loader.php

loader.php is the file where to place ALL your requirements. When I started to develop Cook I had no idea it was possible to do this.
Loading all your component does not mean loading in memory. You can try to check your memory and you will see ...
(Note : CkJLoader replace JLoader for cross compatibility)

It only register the path where to find the class. JLoader receive the Class name and path in parameters.
Then if you want to load physically in memory :
CkJLoader::load('Class name')

So in your example you can also try this possibility to optimize the performances.
CkJLoader::register('JteammanagerClassView', JPATH_ADMIN_JTEAMMANAGER .DS.'classes' .DS.'view'.DS. 'view.php', true);

If if does not work, try to load it in memory :
CkJLoader::register('JteammanagerClassView');

All this is loaded from MY memory ;-). Maybe syntax error.
Hope it helps.
I cannot help you more for the moment because I have a lot of others issues to fix.
Coding is now a piece of cake
The administrator has disabled public write access.

components class view not found error 26 Jun 2013 21:57 #7717

  • dyoungers
  • dyoungers's Avatar
  • Offline
  • Premium Member
  • Posts: 123
  • Thank you received: 16
  • Karma: 0
thanks for the direction ... while I'd like to resolve this, at least for now I can test/develop using 3.0

I went into loader.php and ending up adding the following lines to get my project's views to display, i.e. to get past the fatal error for "Class not found":
CkJLoader::register('JteammanagerClassView', JPATH_ADMIN_JTEAMMANAGER .DS.'classes' .DS.'view'.DS. 'view.php', true);
CkJLoader::register('JteammanagerClassModelList', JPATH_ADMIN_JTEAMMANAGER .DS.'classes' .DS.'model'.DS. 'list.php', true);
CkJLoader::register('JteammanagerClassModelItem', JPATH_ADMIN_JTEAMMANAGER .DS.'classes' .DS.'model'.DS. 'item.php', true);
CkJLoader::register('JteammanagerClassTable', JPATH_ADMIN_JTEAMMANAGER .DS.'classes' .DS.'table'.DS. 'table.php', true);
CkJLoader::register('JteammanagerClassFormField', JPATH_ADMIN_JTEAMMANAGER .DS.'classes' .DS.'form'.DS. 'field.php', true);
CkJLoader::register('JteammanagerHelperHtmlValidator', JPATH_ADMIN_JTEAMMANAGER .DS.'helpers' .DS.'html'.DS. 'validator.php', true);

Unfortunately none of the task buttons were displayed so I'm sure there is something else that needs to be registered but at this point, I'd just as soon try and figure out why the code isn't finding these classes on my local server since the code works in the sandbox.

Any more thoughts from admin and/or others here would be appreciated!

Thanks!
Dave
The administrator has disabled public write access.

components class view not found error 26 Jun 2013 22:06 #7718

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 987
  • Karma: 140
Maybe a conflict with something else.

Try :
- On a fresh Joomla 2.5.x
- With a new cook component (Hello World)

EDIT :
Search around CkJLoader::registerPrefix(....) I yours is not working for an unknown reason.

Register prefix is to automate the registering process using the class namespace conventions. It find the classes using the directory tree and files name.
Coding is now a piece of cake
Last Edit: 26 Jun 2013 22:10 by admin.
The administrator has disabled public write access.

components class view not found error 26 Jun 2013 22:42 #7721

  • dyoungers
  • dyoungers's Avatar
  • Offline
  • Premium Member
  • Posts: 123
  • Thank you received: 16
  • Karma: 0
Installed a fresh 2.5 on my local server and then created a test project (called Test Project - Debug), installed it successfully and the views work as they should

Then I installed the attendance project and the swim school project and the views in those both fail (with the same message as noted in my first post for this thread)

I will try a few more things but I'm really lost on this one ...

Dave
The administrator has disabled public write access.

components class view not found error 26 Jun 2013 23:13 #7722

  • dyoungers
  • dyoungers's Avatar
  • Offline
  • Premium Member
  • Posts: 123
  • Thank you received: 16
  • Karma: 0
I was playing around with things and figured out what was causing the problem ... turns out that putting an exclamation point in the Project name is not a good idea for Joomla 2.5

I still don't know why that would break things on my local server and not in the sandbox but I'm just going to change the name and move on :)

Thanks!
Dave
The administrator has disabled public write access.
Time to create page: 0.123 seconds

Get Started