简体   繁体   中英

Symfony2 Install Failing- Error 1866 (attribute 'path' is not allowed) / FileLoaderLoadException (Cannot import resource)

I'm trying to install a pre-made dev environment using vagrant. The last component is symfony2. The console is throwing up an error (given below). Any ideas on what the fix could be? I've tried googling them with no luck. Thanks for any insights!

Install Log:

==> default: 
==> default:                                                                                                                                                                        
==> default:   [Symfony\Component\Config\Exception\FileLoaderLoadException]                                                                                                         
==> default:   Cannot import resource "/srv/wealthbot/vendor/friendsofsymfony/jsrouting-bundle/Resources/config/routing/routing.xml" from "/srv/wealthbot/app/config/routing.yml".  
==> default:                                                                                                                                                                        
==> default: 
==> default:                                                                                                                                                                    
==> default:   [InvalidArgumentException]                                                                                                                                       
==> default:   [ERROR 1866] Element '{http://symfony.com/schema/routing}route', attribute 'path': The attribute 'path' is not allowed. (in /srv/wealthbot/ - line 6, column 0)  
==> default:                                                                                                                                                                    
==> default: 
==> default: cache:warmup [--no-optional-warmers]
==> default: Warming up the cache for the prod environment with debug false
==> default: 

The routing.xml from /srv/wealthbot/vendor/friendsofsymfony/jsrouting-bundle/Resources/config/routing/routing.xml:

<?xml version="1.0" encoding="UTF-8" ?>
<routes xmlns="http://symfony.com/schema/routing"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://symfony.com/schema/routing http://symfony.com/schema/routing/routing-1.0.xsd">

    <route id="fos_js_routing_js" path="/js/routing.{_format}">
        <default key="_controller">fos_js_routing.controller:indexAction</default>
        <default key="_format">js</default>
        <requirement key="_format">js|json</requirement>
    </route>
</routes>

The routing.yml from /srv/wealthbot/app/config/ :

# Internal routing configuration to handle ESI
#_internal:
#    resource: "@FrameworkBundle/Resources/config/routing/internal.xml"
#    prefix:   /_internal
fos_user_security:
    resource: "@FOSUserBundle/Resources/config/routing/security.xml"

fos_user_profile:
    resource: "@FOSUserBundle/Resources/config/routing/profile.xml"
    prefix: /profile

fos_user_register:
    resource: "@FOSUserBundle/Resources/config/routing/registration.xml"
    prefix: /register

fos_user_resetting:
    resource: "@FOSUserBundle/Resources/config/routing/resetting.xml"
    prefix: /resetting

fos_user_change_password:
    resource: "@FOSUserBundle/Resources/config/routing/change_password.xml"
    prefix: /profile

fos_user_group:
    resource: "@FOSUserBundle/Resources/config/routing/group.xml"
    prefix: /group

fos_js_routing:
    resource: "@FOSJsRoutingBundle/Resources/config/routing/routing.xml"

NelmioApiDocBundle:
    resource: "@NelmioApiDocBundle/Resources/config/routing.yml"
    prefix:   /api/doc

Symfony 2.1 (which by the way dropped support a long time ago) did not have the path attribute for routes. You had to use the pattern attribute then.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM