Projekt w Symfony2 i dwa różne serwery - Kubuntu

Problemy dotyczące innych systemów operacyjnych
Awatar użytkownika
bagsiur
Beginner
Posty: 132
Rejestracja: 01 czerwca 2008, 22:12
Lokalizacja: Będzin

Projekt w Symfony2 i dwa różne serwery - Kubuntu

Post autor: bagsiur »

Witam serdecznie drogich użytkowników.

Tworzę webowy kalendarz przy użyciu frameworka symfony2, i napotkałem problem, z którym nie mogę sobie poradzić.

Na lokalnej maszynie przygotowuję środowisko z domeną calendar.lh. Tworzę projekt w symfony, generuję bundle, edytuję widoki, dodaję trzy kontrolery, wszystko działa że aż miło. Czyszczę katalog pamięci podręcznej i za pomocą rsync eksportuję pliki na serwer docelowy, który znajduje się pod adresem nazwa.pl:

Kod: Zaznacz cały

rsync -avc --delete /home/bagsiur/www/calendar ja_jako_user@fundacjadro.nazwa.pl:~/
Eksport kończy się sukcesem, ale niestety na serwerze docelowym mój projekt nie działa. Błędy, które otrzymuję znajdują się tutaj: http://www.calendar.fundacjadroga.pl/app_dev.php

Kod: Zaznacz cały

InvalidArgumentException: Unable to parse file "/home/fundacjadro/ftp/calendar/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/../Resources/config/web.xml".

Kod: Zaznacz cały

   in /home/fundacjadro/ftp/calendar/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Loader/XmlFileLoader.php line 213
    at XmlFileLoader->parseFile('/home/fundacjadro/ftp/calendar/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/../Resources/config/web.xml') in /home/fundacjadro/ftp/calendar/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Loader/XmlFileLoader.php line 42
    at XmlFileLoader->load('web.xml') in /home/fundacjadro/ftp/calendar/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php line 42
    at FrameworkExtension->load(array(array('secret' => 'ThisTokenIsNotSoSecretChangeIt', 'router' => array('resource' => '/home/fundacjadro/ftp/calendar/app/config/routing.yml', 'strict_requirements' => true), 'form' => null, 'csrf_protection' => null, 'validation' => array('enable_annotations' => true), 'templating' => array('engines' => array('twig')), 'default_locale' => 'en', 'trusted_proxies' => null, 'session' => null, 'fragments' => null), array('router' => array('resource' => '/home/fundacjadro/ftp/calendar/app/config/routing_dev.yml'), 'profiler' => array('only_exceptions' => false))), object(ContainerBuilder)) in /home/fundacjadro/ftp/calendar/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Compiler/MergeExtensionConfigurationPass.php line 50
    at MergeExtensionConfigurationPass->process(object(ContainerBuilder)) in /home/fundacjadro/ftp/calendar/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/DependencyInjection/MergeExtensionConfigurationPass.php line 39
    at MergeExtensionConfigurationPass->process(object(ContainerBuilder)) in /home/fundacjadro/ftp/calendar/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Compiler/Compiler.php line 119
    at Compiler->compile(object(ContainerBuilder)) in /home/fundacjadro/ftp/calendar/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/ContainerBuilder.php line 558
    at ContainerBuilder->compile() in /home/fundacjadro/ftp/calendar/app/bootstrap.php.cache line 657
    at Kernel->buildContainer() in /home/fundacjadro/ftp/calendar/app/bootstrap.php.cache line 593
    at Kernel->initializeContainer() in /home/fundacjadro/ftp/calendar/app/bootstrap.php.cache line 378
    at Kernel->boot() in /home/fundacjadro/ftp/calendar/app/bootstrap.php.cache line 409
    at Kernel->handle(object(Request)) in /home/fundacjadro/ftp/calendar/web/app_dev.php line 19

Kod: Zaznacz cały

InvalidArgumentException: [ERROR 3070] complex type 'service': The content model is not determinist. (in file:////home/fundacjadro/ftp/calendar/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Loader/schema/dic/services/services-1.0.xsd - line 75, column 0)
[ERROR 3070] complex type 'argument': The content model is not determinist. (in file:////home/fundacjadro/ftp/calendar/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Loader/schema/dic/services/services-1.0.xsd - line 131, column 0)
[ERROR 3070] complex type 'call': The content model is not determinist. (in file:////home/fundacjadro/ftp/calendar/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Loader/schema/dic/services/services-1.0.xsd - line 144, column 0)

Kod: Zaznacz cały

  in /home/fundacjadro/ftp/calendar/vendor/symfony/symfony/src/Symfony/Component/Config/Util/XmlUtils.php line 90
    at XmlUtils::loadFile('/home/fundacjadro/ftp/calendar/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/../Resources/config/web.xml', array(object(XmlFileLoader), 'validateSchema')) in /home/fundacjadro/ftp/calendar/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Loader/XmlFileLoader.php line 211
    at XmlFileLoader->parseFile('/home/fundacjadro/ftp/calendar/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/../Resources/config/web.xml') in /home/fundacjadro/ftp/calendar/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Loader/XmlFileLoader.php line 42
    at XmlFileLoader->load('web.xml') in /home/fundacjadro/ftp/calendar/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php line 42
    at FrameworkExtension->load(array(array('secret' => 'ThisTokenIsNotSoSecretChangeIt', 'router' => array('resource' => '/home/fundacjadro/ftp/calendar/app/config/routing.yml', 'strict_requirements' => true), 'form' => null, 'csrf_protection' => null, 'validation' => array('enable_annotations' => true), 'templating' => array('engines' => array('twig')), 'default_locale' => 'en', 'trusted_proxies' => null, 'session' => null, 'fragments' => null), array('router' => array('resource' => '/home/fundacjadro/ftp/calendar/app/config/routing_dev.yml'), 'profiler' => array('only_exceptions' => false))), object(ContainerBuilder)) in /home/fundacjadro/ftp/calendar/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Compiler/MergeExtensionConfigurationPass.php line 50
    at MergeExtensionConfigurationPass->process(object(ContainerBuilder)) in /home/fundacjadro/ftp/calendar/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/DependencyInjection/MergeExtensionConfigurationPass.php line 39
    at MergeExtensionConfigurationPass->process(object(ContainerBuilder)) in /home/fundacjadro/ftp/calendar/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Compiler/Compiler.php line 119
    at Compiler->compile(object(ContainerBuilder)) in /home/fundacjadro/ftp/calendar/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/ContainerBuilder.php line 558
    at ContainerBuilder->compile() in /home/fundacjadro/ftp/calendar/app/bootstrap.php.cache line 657
    at Kernel->buildContainer() in /home/fundacjadro/ftp/calendar/app/bootstrap.php.cache line 593
    at Kernel->initializeContainer() in /home/fundacjadro/ftp/calendar/app/bootstrap.php.cache line 378
    at Kernel->boot() in /home/fundacjadro/ftp/calendar/app/bootstrap.php.cache line 409
    at Kernel->handle(object(Request)) in /home/fundacjadro/ftp/calendar/web/app_dev.php line 19

Rozumiem co oznacza ten błąd ale nie wiem dlaczego występuje i jak można go naprawić. Pomożecie?

System na jakim pracuje to Kubuntu, pracuję w środowisku NetBeans.
fnmirk
Senior Member
Posty: 8273
Rejestracja: 03 grudnia 2007, 06:37

Post autor: fnmirk »

&quot pisze:Rozumiem co oznacza ten błąd ale nie wiem dlaczego występuje
To jak go rozumiesz?
Awatar użytkownika
bagsiur
Beginner
Posty: 132
Rejestracja: 01 czerwca 2008, 22:12
Lokalizacja: Będzin

Post autor: bagsiur »

Ok, problem można uznać za rozwiązany, choć w moim przypadku nie do końca. Error spowodowany jest błędem biblioteki libxml w wersji 2.6.26 a nie samego kodu frameworka, choć na pierwszy rzut oka problem jest związany z funkcją schemaValidate() występującą w XmlFileLoader.php - stanowiący część składową aplikacji Symfony2.

Jakie mamy rozwiązanie? Pierwsze moim zdaniem jest przyznaniem się do porażki i za-komentowanie poniższego fragmentu kodu w XmlFileLoader.php:

Kod: Zaznacz cały

//if (!$dom->schemaValidate(__DIR__.'/schema/dic/constraint-mapping/constraint-mapping-1.0.xsd')) {
 //throw new MappingException(implode("\n", $this->getXmlErrors($internalErrors)));
//}

Drugi bardziej elegancki sposób to upgrade biblioteki libxml do gałęzi 2.8 lub nowszej.

Mam nadzieję że w przyszłości komuś się przyda...

Pzdr
ODPOWIEDZ