Page 1 of 1

Fatal error: Uncaught exception 'WURFL_Storage_Exception'

Posted: Mon Jan 14, 2013 5:58 pm
by jacktang
Fatal error: Uncaught exception 'WURFL_Storage_Exception' with message 'Couldn't show tables from database 202 (You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '202 LIKE 'wurfl_object_cache'' at line 1)' in E:\dwbet\3rd-parties\wurfl\WURFL\Storage\Mysql.php:72 Stack trace: #0 E:\dwbet\3rd-parties\wurfl\WURFL\Storage\Mysql.php(51): WURFL_Storage_Mysql->initialize() #1 E:\dwbet\3rd-parties\wurfl\WURFL\Storage\Factory.php(43): WURFL_Storage_Mysql->__construct(Array) #2 E:\dwbet\3rd-parties\wurfl\WURFL\WURFLManagerFactory.php(142): WURFL_Storage_Factory::create(Array) #3 E:\dwbet\3rd-parties\wurfl\WURFL\WURFLManagerFactory.php(57): WURFL_WURFLManagerFactory::persistenceStorage(Array) #4 E:\dwbet\3rd-parties\wurfl\includes\header_config_inc.php(15): WURFL_WURFLManagerFactory->__construct(Object(WURFL_Configuration_ArrayConfig)) #5 E:\dwbet\tracking202\includes\devices_detect_inc.php(19): include_once('E:\dwbet\3rd-pa...') #6 E:\dwbet\tracking in E:\dwbet\3rd-parties\wurfl\WURFL\Storage\Mysql.php on line 72

Re: Fatal error: Uncaught exception 'WURFL_Storage_Exception

Posted: Mon Jan 14, 2013 6:04 pm
by jacktang
throw new WURFL_Storage_Exception("Couldn't show tables from database $this->db (".mysql_error($this->link).")");

Re: Fatal error: Uncaught exception 'WURFL_Storage_Exception

Posted: Mon Jan 14, 2013 8:18 pm
by kamermans
Thanks for the report, we are trying to reproduce it now. Perhaps the problem is that your database name is a number, and is not escaped properly in the API.

Re: Fatal error: Uncaught exception 'WURFL_Storage_Exception

Posted: Mon Jan 14, 2013 11:54 pm
by kamermans
I have reproduced the bug and as I expected it is due to the way numeric database names are handled (or not handled) in SQL statements. The solution is to explicitly escape the database name in the database abstraction layer. We have fixed the bug in the upstream version, but this issue is so narrowly-focused, that we will not be releasing a new version for this issue. In the meantime, please put the attached Mysql.php file (inside the ZIP file) in your WURFL/Storage folder and the problem will be resolved.

Re: Fatal error: Uncaught exception 'WURFL_Storage_Exception

Posted: Tue Jan 15, 2013 1:30 am
by jacktang
kamermans wrote:I have reproduced the bug and as I expected it is due to the way numeric database names are handled (or not handled) in SQL statements. The solution is to explicitly escape the database name in the database abstraction layer. We have fixed the bug in the upstream version, but this issue is so narrowly-focused, that we will not be releasing a new version for this issue. In the meantime, please put the attached Mysql.php file (inside the ZIP file) in your WURFL/Storage folder and the problem will be resolved.
thanks you very much

but then i put the attached Mysql.php,

It appears the new error:

Warning: XMLReader::open() [xmlreader.open]: Unable to open source data in E:\dwbet\3rd-parties\wurfl\WURFL\Xml\AbstractIterator.php on line 90

Warning: XMLReader::read() [xmlreader.read]: Load Data before trying to read in E:\dwbet\3rd-parties\wurfl\WURFL\Xml\VersionIterator.php on line 29

Warning: XMLReader::open() [xmlreader.open]: Unable to open source data in E:\dwbet\3rd-parties\wurfl\WURFL\Xml\AbstractIterator.php on line 90

Warning: XMLReader::read() [xmlreader.read]: Load Data before trying to read in E:\dwbet\3rd-parties\wurfl\WURFL\Xml\DeviceIterator.php on line 58

Fatal error: Call to a member function getCapabilities() on a non-object in E:\dwbet\3rd-parties\wurfl\WURFL\CustomDeviceRepository.php on line 72

Re: Fatal error: Uncaught exception 'WURFL_Storage_Exception

Posted: Tue Jan 15, 2013 3:59 pm
by kamermans
This error seems to be related to file permissions. Are you using Apache on Windows or some other webserver?

Re: Fatal error: Uncaught exception 'WURFL_Storage_Exception

Posted: Tue Jan 15, 2013 9:29 pm
by jacktang
kamermans wrote:This error seems to be related to file permissions. Are you using Apache on Windows or some other webserver?
i use windows2003 on vps ,it is not apache ,it is Internet Information Services

Re: Fatal error: Uncaught exception 'WURFL_Storage_Exception

Posted: Wed Jan 16, 2013 1:00 am
by kamermans
Perhaps the issue now is that the data is not being uncompressed properly from the ZIP file, and that is causing the XML parser to fail parsing. Can you please unzip the resources/wurfl.zip file to that same directory, then point your config at that wurfl.xml file? Sorry for the difficulty - IIS/Windows is supported, but since it is rather uncommon to use the PHP API on IIS, the setup can be a little challenging.