Fatal error: Uncaught exception 'Exception' with message 'Th

yita33
Posts: 2
Joined: Fri Nov 02, 2012 6:16 am

Fatal error: Uncaught exception 'Exception' with message 'Th

Postby yita33 » Fri Nov 02, 2012 6:22 am

Hello,
the WURFL API works fine in my local server (xampp), but on my web it appears:

Fatal error: Uncaught exception 'Exception' with message 'There is no device with ID [generic] in the loaded WURFL Data' in /hosting/www/rewindthecity.es/public/wurfl/WURFL/CustomDeviceRepository.php:104 Stack trace: #0 /hosting/www/rewindthecity.es/public/wurfl/WURFL/CustomDeviceRepository.php(70): WURFL_CustomDeviceRepository->getDevice('generic') #1 /hosting/www/rewindthecity.es/public/wurfl/WURFL/CustomDeviceRepository.php(63): WURFL_CustomDeviceRepository->init() #2 /hosting/www/rewindthecity.es/public/wurfl/WURFL/DeviceRepositoryBuilder.php(91): WURFL_CustomDeviceRepository->__construct(Object(WURFL_Storage_File), Array) #3 /hosting/www/rewindthecity.es/public/wurfl/WURFL/WURFLManagerFactory.php(150): WURFL_DeviceRepositoryBuilder->build('/hosting/www/re...', NULL) #4 /hosting/www/rewindthecity.es/public/wurfl/WURFL/WURFLManagerFactory.php(134): WURFL_WURFLManagerFactory->deviceRepository(Object(WURFL_Storage_File), Object(WURFL_UserAgentHandlerChain)) #5 /hosting/www/rewindthecity.es/public/wurfl/WURFL/WURFLManager in /hosting/www/rewindthecity.es/public/wurfl/WURFL/CustomDeviceRepository.php on line 104

After reading another post below, I changed the chmod and made the folder writable, but the error message hasn't gone.
What can the problem be?
Thanks a lot and sorry about my english

kamermans
Posts: 393
Joined: Mon Jun 06, 2011 9:50 am

Re: Fatal error: Uncaught exception 'Exception' with message

Postby kamermans » Fri Nov 02, 2012 9:24 pm

Hi,

Can you post your WURFL configuration please? Also, you should delete your cache and persistence directories from the server so they can be recreated.
Thanks,

Steve Kamerman
ScientiaMobile

Make sure you check out our WURFL Cloud, WURFL InSight and WURFL InFuze products!

yita33
Posts: 2
Joined: Fri Nov 02, 2012 6:16 am

Re: Fatal error: Uncaught exception 'Exception' with message

Postby yita33 » Mon Nov 05, 2012 5:49 am

Hello, thanks for your help.
I've tried deleting cache and persistence. I've refresh the page and WURFL creates the directories again, but still doesn't work.
Here is my wurfl_config.php, is the same as in the demo, just changed the path to de directories.
I have two directories, WURFL with de API, and data with the wurfl.zip file, wurfl_config.php and storage directory.
I've also tried changing the paths from '../../WURFL' to '/../WURFL' (relative) but is the same, it works in my local server but not on the web.

Code: Select all

<?php
// Enable all error logging while in development
ini_set('display_errors', 'on');
error_reporting(E_ALL);

$wurflDir = dirname(__FILE__) . '../../WURFL';
$resourcesDir = dirname(__FILE__) . '../../data';

require_once $wurflDir.'/Application.php';

$persistenceDir = $resourcesDir.'/storage/persistence';
$cacheDir = $resourcesDir.'/storage/cache';

// Create WURFL Configuration
$wurflConfig = new WURFL_Configuration_InMemoryConfig();

// Set location of the WURFL File
$wurflConfig->wurflFile($resourcesDir.'../wurfl.zip');

// Set the match mode for the API ('performance' or 'accuracy')
$wurflConfig->matchMode('performance');

// Automatically reload the WURFL data if it changes
$wurflConfig->allowReload(true);

// Setup WURFL Persistence
$wurflConfig->persistence('file', array('dir' => $persistenceDir));

// Setup Caching
$wurflConfig->cache('file', array('dir' => $cacheDir, 'expiration' => 36000));

// Create a WURFL Manager Factory from the WURFL Configuration
$wurflManagerFactory = new WURFL_WURFLManagerFactory($wurflConfig);

// Create a WURFL Manager
/* @var $wurflManager WURFL_WURFLManager */
$wurflManager = $wurflManagerFactory->create();
?>
Last edited by kamermans on Mon Nov 05, 2012 5:13 pm, edited 1 time in total.
Reason: added code tags

kamermans
Posts: 393
Joined: Mon Jun 06, 2011 9:50 am

Re: Fatal error: Uncaught exception 'Exception' with message

Postby kamermans » Mon Nov 05, 2012 5:13 pm

I'm looking over the config now, but one immediate thing I spotted was this:

Code: Select all

// Set location of the WURFL File
$wurflConfig->wurflFile($resourcesDir.'../wurfl.zip');
I think you need a "/" in the beginning of the path, like this:

Code: Select all

// Set location of the WURFL File
$wurflConfig->wurflFile($resourcesDir.'/../wurfl.zip');
Thanks,

Steve Kamerman
ScientiaMobile

Make sure you check out our WURFL Cloud, WURFL InSight and WURFL InFuze products!


Who is online

Users browsing this forum: No registered users and 27 guests