Path

ez projects / ezxajax / forum / general / can't get xajax to work wit...


Can't get xajax to work with eZ 4.0.1

You need to be logged in to post messages in the forums. New users may register here.

Nabil Imran

Member since:
19 May 2009

Posts: 6

Tuesday 19 May 2009 3:05:34 pm

I'm using eZ 4.0.1 and downloaded xajax from the following url ("Downloads" in the main menu of this site):

http://projects.ez.no/ezxajax/downloads/xajax1_0_0_5_beta_4

I followed steps 1-5 of the install.txt exactly. The xajax_javascript() operator in the pagelout works fine. I can see the xajax javascript in the generated html file. But when I now access a site, wich actually uses xajax (in this case it's the starrating extension), I get the following error:

Fatal error: Cannot redeclare class xajaxRequestPlugin in C:\ws\myproject\extension\xajax\lib\xajax\xajax_core\xajaxPlugin.inc.php on line 102
Fatal error: eZ Publish did not finish its request

The execution of eZ Publish was abruptly ended, the debug output is present below.

I also tried to regenerate autoloads and clear cache several times. And I also tried to use the latest version from the svn (http://svn.projects.ez.no/ezxajax/trunk/extension/ezxajax/) It is named ezxajax instead of xajax, but generated the same error.

I'm not sure if this might be a problem the starrating extension, but It looks more like a xajax problem to me.

Thank you for any help!!
Up

Bruce Morrison

Member since:
07 March 2003

Posts: 37

Monday 01 June 2009 8:41:29 am

Hi Nabil

I've installed starrating and ezxajax from the svn of the projects site have have not been able to reproduce your error.

Given the nature of the error it would appear that an xajax library is being included twice. I'm wondering if this is an issue with autoload and possibly having multiple copies of xajax on the system. I'm thinking this may be something either specific to your particular installation or to php/eZpublish/xajax under windows.

Are you able to check if there are multiple files hat define the xajaxRequestPlugin class?

The Star Rating extension does not include any xajax files - it simply checks to see if it is available and utilises it if it can.

Kristof has supplied some patches to the Star Rating extension but they do not appear to address your specific error.

What other extensions do you have enabled?

Cheers
Bruce
Up

Nabil Imran

Member since:
19 May 2009

Posts: 6

Wednesday 10 June 2009 9:57:10 am

Sorry for answering so late, I have been ill for 2 weeks :(

Back to the problem:

multiple libs
I don't have multiple copies of the xajax libs. I greped for "xajaxRequestPlugin" in the whole project, and found only one file where its defined. So it seems that the same file is included twice for some reason.

Patches
I tried the patches by Kristof, but they don't solve problem.

Other Extensions

I have the following extensions:

ActiveExtensions[]=data_import
ActiveExtensions[]=ezodf
ActiveExtensions[]=ezoe
ActiveExtensions[]=ezwebin
ActiveExtensions[]=ezxajax
ActiveExtensions[]=googlesitemapgenerator
ActiveExtensions[]=starrating
ActiveExtensions[]=str_replace

And also a few extensions developed by myself, but none of them uses xajax, or should conflict with it in any way

Windows
I'll try if it works under linux later and report that. When I find time, I'll also try it on a totally fresh eZ installation
Up

Nabil Imran

Member since:
19 May 2009

Posts: 6

Tuesday 16 June 2009 1:40:06 pm

Hi,

I tried on a linux server and the error does not occur there!! So it really seems to be windows specific! The "Cannot redeclare class xajaxRequestPlugin" error does NOT happen under linux. Starrating + xajax work perfectly now.

But for development I'am using Windows Vista + xampp 1.6.6a + php 5.2.5.
On that system the error still exists!!

I also noticed that the error only happens with the starrating extension. The xajax hello world example works well under linux and windows.

But the combination windows/xampp + ezxajax + starrating breaks the whole thing resulting in the "Cannot redeclare class xajaxRequestPlugin" error.

I have been developing on that system for almost a year now, but I never had any platform specific problems with any extensions or autoload issues before, so I don't think my xampp configuration is messed up.

So far I can ignore the error as I know that it will work on the production system, but of course it would be nice if we could solve that.

I hope this helps. Thank you!
Up

You need to be logged in to post messages in the forums. New users may register here.