Symfony2.0-InvalidArgumentException [英] Symfony2.0 - InvalidArgumentException

查看:85
本文介绍了Symfony2.0-InvalidArgumentException的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在使用symfony 2.3时遇到了一些麻烦,希望您能帮助我.

I'm having a little bit of trouble with symfony 2.3 and am hoping you can help me out.

我真的不知道我做错了什么,但是突然间我得到了这些错误,现在我无法摆脱它们.

I don't really know what i did wrong but out of the sudden I got these errors and now i can't get rid of them.

错误1:

InvalidArgumentException: [WARNING 1549] failed to load external entity "file:///C:/wamp/www/Symfony/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Loader/schema/dic/services/services-1.0.xsd" (in n/a - line 0, column 0)
[WARNING 3084] Element '{http://www.w3.org/2001/XMLSchema}import': Failed to locate a schema at location 'file:///C:/wamp/www/Symfony/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Loader/schema/dic/services/services-1.0.xsd'. Skipping the import. (in in_memory_buffer - line 8, column 0)
[ERROR 1845] Element '{http://symfony.com/schema/dic/services}container': No matching global declaration available for the validation root. (in file:///C:/wamp/www/Symfony/web/ - line 5, column 0)

错误2:

InvalidArgumentException: Unable to parse file "C:\wamp\www\Symfony\vendor\symfony\symfony\src\Symfony\Bundle\FrameworkBundle\DependencyInjection/../Resources/config\web.xml".

我试图消除导致这些错误的原因(我也尝试清除缓存),但是没有一个起作用.

I've tried to remove what i thought was causing these errors (i tried to clean the cache also) but none of that worked.

我猜我在树枝或xlf文件中肯定有问题,因为这些错误仅在我修改了那些文件后出现,但无法找出我在那些文件中做错了(对我来说,我的所作所为看起来不错)

I am guessing that i must have something wrong in a twig or xlf file, as these errors appeared after i modified only those files, but can't find out what i'm doing wrong in those files (to me all of what i did looks fine)

如果你们需要我可以发布文件.

I can post the files if u guys need them.

细枝文件:

{%  extends '::base.html.twig' %}

{% block title %}{{ 'myAccount'|trans }}{% endblock %}
{% block stylesheets %}
    {{ parent() }}
    <link href="{{ asset('bundles/account/css/myProfile.css') }}" rel="stylesheet">
{% endblock %}
{% block content %}
<div class="profile-hor-nav">
    <ul class="nav nav-pills profile-menu-font">
        <li class="active profile-hor-nav-element">
            <a href="#">{{ 'gameInfo'|trans }}</a>
        </li>
        <li class="profile-hor-nav-element">
            <a href="#">{{ 'accountInfo'|trans }}</a>
        </li>
    </ul>
</div>
<div class="profile-ver-nav">
    <ul class="nav nav-pills nav-stacked profile-menu-font">
        <li class="active profile-ver-nav-element">
            <a href="#">{{ 'matchHistory'|trans }}</a>
        </li>
        <li class="profile-ver-nav-element">
            <a href="#">{{ 'statistics'|trans }}</a>
        </li>
        <li class="profile-ver-nav-element">
            <a href="#">{{ 'charObj'|trans }}</a>
        </li>
    </ul>
</div>
{% endblock %}

en.xlf:

<?xml version="1.0" encoding="UTF-8"?>
<xliff version="1.2" xmlns="urn:oasis:names:tc:xliff:document:1.2">
    <file source-language="en" datatype="plaintext" original="file.ext">
        <body>
            <trans-unit id="1">
                <source>registrationMessage</source>
                <target>Enroll and fight for glory on the battlefields.</target>
            </trans-unit>
            <trans-unit id="2">
                <source>registrationSuccessMessage</source>
                <target>You will receive an email to finish your registration</target>
            </trans-unit>
            <trans-unit id="3">
                <source>gameInfo</source>
                <target>Game information</target>
            </trans-unit>
            <trans-unit id="4">
                <source>accountInfo</source>
                <target>Account information</target>
            </trans-unit>
            <trans-unit id="5">
                <source>matchHistory</source>
                <target>Match history</target>
            </trans-unit>
            <trans-unit id="6">
                <source>statistics</source>
                <target>Statistics</target>
            </trans-unit>
            <trans-unit id="7">
                <source>charObj</source>
                <target>Characters and Objects</target>
            </trans-unit>
        </body>
    </file>
</xliff>

fr.xlf:

<?xml version="1.0" encoding="UTF-8"?>
<xliff version="1.2" xmlns="urn:oasis:names:tc:xliff:document:1.2">
    <file source-language="en" datatype="plaintext" original="file.ext">
        <body>
            <trans-unit id="1">
                <source>registrationMessage</source>
                <target>Inscrivez-vous et combattez pour la gloire sur les champs de bataille.</target>
            </trans-unit>
            <trans-unit id="2">
                <source>registrationSuccessMessage</source>
                <target>Vous allez recevoir un email pour completer votre inscription</target>
            </trans-unit>
            <trans-unit id="3">
                <source>gameInfo</source>
                <target>Informations en jeu</target>
            </trans-unit>
            <trans-unit id="4">
                <source>accountInfo</source>
                <target>Informations du compte</target>
            </trans-unit>
            <trans-unit id="5">
                <source>matchHistory</source>
                <target>Historique des parties</target>
            </trans-unit>
            <trans-unit id="6">
                <source>statistics</source>
                <target>Statistiques</target>
            </trans-unit>
            <trans-unit id="7">
                <source>charObj</source>
                <target>Personnages et Objets</target>
            </trans-unit>
        </body>
    </file>
</xliff>

所以检查之后,我实际上有了symfony的2.4.0 BETA1版本

So after checking, I actually have the version 2.4.0 BETA1 of symfony

我正在使用Apache 2.4.4,php 5.4.16和mysql 5.6.12运行wampserver

I'm running wampserver with apache 2.4.4, php 5.4.16 and mysql 5.6.12

希望你能帮助我

预先感谢您的帮助.

推荐答案

我不知道为什么,但是在重新启动计算机(也包括wampserver)之后,问题就消失了. 如果你们知道为什么会这样,我将很高兴听到它.

I don't know why but after restaring the computer (so wampserver as well) the problem was gone. If you guys have any idea why is that, I would be glad to hear it.

这篇关于Symfony2.0-InvalidArgumentException的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆