gpt4 book ai didi

php - Symfony2 AuthenticationCredentialsNotFoundException @Route

转载 作者:行者123 更新时间:2023-12-04 16:55:58 25 4
gpt4 key购买 nike

enter image description here

AuthenticationCredentialsNotFoundException in classes.php line 2876:

The token storage contains no authentication token. One possible reason may be that there is no firewall configured for this URL.



我尝试了所有可以在 Stack Overflow、GitHub 和 Google 上找到的东西。没有任何效果。

经验教训:始终检查日志文件。
tail -f app/logs/dev.log

发现这个:

...[Semantical Error] The annotation \"@Route\" in method Ambry\TumorNextAPIBundle\Controller\DefaultController::indexAction() was never imported. Did you maybe forget to add a \"use\" statement for this annotation?...



我错过了以下使用语句:
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Method;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;

在以下代码中:
<?php

namespace Ambry\TumorNextAPIBundle\Controller;

use Symfony\Component\HttpFoundation\Request;

use Ambry\BioToolsBundle\Controller\ApplicationController;

class DefaultController extends ApplicationController
{
/**
* @Route("/", name="tumornext" )
* @Method({"GET","POST"})
* @Template
*/
public function indexAction(Request $request)
{
return array();
}
}

最佳答案

经验教训:始终检查日志文件。

tail -f app/logs/dev.log
tail -f app/logs/dev.log | grep CRIT
tail -f app/logs/dev.log | grep ERROR
tail -f app/logs/dev.log | grep INFO

在这种情况下,您缺少 use 语句:
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Method;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;

关于php - Symfony2 AuthenticationCredentialsNotFoundException @Route,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35924053/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com