标签: invalidargumentexception

InvalidArgumentException:消息:无效参数:用户数据目录已在使用错误使用 --user-data-dir 启动 Chrome 使用 Selenium

当我尝试让--user-data-dir当前用户使用 Selenium 启动 Chrome 时,出现以下错误:

  File "C:\Program Files (x86)\Python\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 321, in execute
    self.error_handler.check_response(response)
  File "C:\Program Files (x86)\Python\lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 242, in check_response
    raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.InvalidArgumentException: Message: invalid argument: user data directory is already in use, please specify a unique value for --user-data-dir argument, or don't use --user-data-dir
Run Code Online (Sandbox Code Playgroud)

我该如何解决这个错误?

python selenium google-chrome invalidargumentexception selenium-chromedriver

11
推荐指数
2
解决办法
2万
查看次数

NSInvalidArgumentException',原因:'无效的谓词:nil RHS,需要帮助搞清楚这一点

我已经阅读了有关此崩溃的其他帖子与谓词返回nil有关但我无法用我的应用程序解决这个问题.有人可以帮我这个吗?

static NSString *const KJMWorkoutCategorySectionKeyPath = @"workoutCategory";

- (NSFetchedResultsController *)fetchedResultsControllerWithSearchString:(NSString *)searchString {
    NSManagedObjectContext *sharedContext; // my NSManagedObjectContext instance...

    NSFetchRequest *request = [NSFetchRequest new];
    NSEntityDescription *entity = [NSEntityDescription entityForName:@"Workouts"
                                              inManagedObjectContext:sharedContext];
    request.entity = entity;
    request.predicate = [NSPredicate predicateWithFormat:@"(workoutName CONTAINS[cd] %@)", searchString];

    NSSortDescriptor *sortDescriptor = [[NSSortDescriptor alloc] initWithKey:KJMWorkoutCategorySectionKeyPath ascending:YES];
    request.sortDescriptors = @[sortDescriptor];

    NSFetchedResultsController *fetchedResultsController = [[NSFetchedResultsController alloc] initWithFetchRequest:request
                                                                                               managedObjectContext:sharedContext
                                                                                                 sectionNameKeyPath:KJMWorkoutCategorySectionKeyPath
                                                                                                          cacheName:nil];
    fetchedResultsController.delegate = self;

    NSError *error = nil;

    if (![fetchedResultsController performFetch:&error]) {
        NSLog(@"Unresolved error %@, %@", error, error.userInfo);
        abort();
    }

    return fetchedResultsController;
}
Run Code Online (Sandbox Code Playgroud)

nspredicate nsfetchedresultscontroller invalidargumentexception

10
推荐指数
1
解决办法
7270
查看次数

Laravel模型保存模型时的尾随数据

我有一些像这样的代码

    $editStuState = StuAtt::where('studentId' , '=' , $id)->first();
    $editStuState -> leave +=1;
    $editStuState -> present = $editStuState -> present-1;
    $editStuState->update();
                            //OR
    $editStuState->save();
    return 'this is good';
Run Code Online (Sandbox Code Playgroud)

我无法保存或更新我的数据,当我删除更新和保存相关行时,它可以打印文本.

这是dd($editStuState)数据

StuAtt {#382 ?
  #table: "stu_attendance"
  #connection: "mysql"
  #primaryKey: "id"
  #keyType: "int"
  +incrementing: true
  #with: []
  #withCount: []
  #perPage: 15
  +exists: true
  +wasRecentlyCreated: false
  #attributes: array:7 [?
    "id" => "7"
    "studentId" => "1"
    "present" => "2"
    "absent" => "1"
    "leave" => "10"
    "created_at" => "2018-04-16 11:17:41.176898"
    "updated_at" => "2018-04-16 06:47:41.000000"
  ] …
Run Code Online (Sandbox Code Playgroud)

php model trailing invalidargumentexception laravel-5

10
推荐指数
3
解决办法
6441
查看次数

nil,NULL和[NSNULL nil]之间有什么区别?

我得到了这样的错误 - *由于未捕获的异常'NSInvalidArgumentException'终止应用程序,原因:** - [NSCFDictionary initWithObjects:forKeys:count:]:尝试在对象[0]处插入nil值(键:搜索)'

然后我尝试了下面的代码

    if (Obj == (id)[NSNull null])  //Obj is an id 
{
    NSLog(@" Obj is (id)[NSNull null]");    
}
else if (Obj == nil)
{
    NSLog(@"Obj is nil");   
} 
else if (Obj == NULL)
{
    NSLog(@"Obj is NULL");  
} 
else
{
    NSLog(@"Obj is something else");
}

searchedDict = [NSDictionary dictionaryWithObject:Obj forKey:@"searched"];
Run Code Online (Sandbox Code Playgroud)

我得到的NSLog消息是'Obj is nil'.

但是当我使用相同的上述代码时Obj是NSString并且我的应用程序由于nil值而被终止,我得到了NSLog消息为'Obj is(id)[NSNull null]'.

nil,NULL和[NSNULL nil]之间有什么区别?

是否存在不同类型的Null值?如果是,如何检查这些空值

谢谢 :-)

iphone null objective-c invalidargumentexception

8
推荐指数
2
解决办法
2948
查看次数

Symfony:解析web.xml时出现InvalidArgumentException

最近我将Symfony系统移动到另一台服务器,从那以后就出现了错误.技术细节是:Windows服务器上的apache 2.4服务器2012文件服务器,可通过本地网络上的apache访问

当我移动Symfony页面时,我删除了缓存.现在发生的是,我收到这些错误消息:

InvalidArgumentException: Unable to parse file "\\FILESERVER\PAGEPATH\vendor\symfony\symfony\src\Symfony\Bundle\FrameworkBundle\DependencyInjection/../Resources/config\web.xml".
Run Code Online (Sandbox Code Playgroud)

InvalidArgumentException: [WARNING 1549] failed to load external entity "file://///FILESERVER/PAGEPATH/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://///FILESERVER/PAGEPATH/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 //FILESERVER/PAGEPATH/web/ - line 5, column 0)
Run Code Online (Sandbox Code Playgroud)

似乎是什么问题,在第一个错误中,路径中有斜杠和反斜杠的混合,但我不知道如何解决这个问题.

php symfony invalidargumentexception symfony-2.4

7
推荐指数
1
解决办法
2408
查看次数

无法识别的选择器发送到实例_UIAlertControllerAlertPresentationController

errors我的iOS应用程序中有几个实时场景.我无法理解这个Core Foundation影响我的应用程序中多个用户的特定错误.我的任何项目文件中的流程都没有中断,我不确定导致此崩溃的原因.

附加崩溃日志.任何建议或帮助都会给你很大的帮助.

CoreFoundation _CF_forwarding_prep_0

致命异常:NSInvalidArgumentException - [_ UIAlertControllerAlertPresentationController adaptivePresentationController]:无法识别的选择器发送到实例0x133e29870

Fatal Exception: NSInvalidArgumentException
0  CoreFoundation                 0x18ff391b8 __exceptionPreprocess
1  libobjc.A.dylib                0x18e97055c objc_exception_throw
2  CoreFoundation                 0x18ff40268 __methodDescriptionForSelector
3  CoreFoundation                 0x18ff3d270 ___forwarding___
4  CoreFoundation                 0x18fe3680c _CF_forwarding_prep_0
5  UIKit                          0x19689708c -[UISearchController _searchPresentationController]
6  UIKit                          0x19648f8cc -[_UISearchControllerTransplantSearchBarAnimator animateTransition:]
7  UIKit                          0x19613d464 __56-[UIPresentationController runTransitionForCurrentState]_block_invoke
8  UIKit                          0x19607ffdc _runAfterCACommitDeferredBlocks
9  UIKit                          0x196071d50 _cleanUpAfterCAFlushAndRunDeferredBlocks
10 UIKit                          0x195de10b4 _afterCACommitHandler
11 CoreFoundation                 0x18fee60c0 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__
12 CoreFoundation                 0x18fee3cf0 __CFRunLoopDoObservers
13 CoreFoundation                 0x18fee4180 __CFRunLoopRun
14 CoreFoundation                 0x18fe122b8 …
Run Code Online (Sandbox Code Playgroud)

selector core-foundation ios invalidargumentexception swift

7
推荐指数
1
解决办法
1355
查看次数

NSInvalidArgumentException-'JSON写入中的无效顶级类型'-Swift

如帖子标题中所述,尝试将字典快速转换为JSON数据时,我收到NSInvalidArgumentException-'JSON write中的无效顶级类型'

let userInfo: [String: String] = [
            "user_name" : username!,
            "password" : password!,
            "device_id" : DEVICE_ID!,
            "os_version" : OS_VERSION
        ]

let inputData = jsonEncode(object: userInfo)
Run Code Online (Sandbox Code Playgroud)

。。。

static private func jsonEncode(object:Any?) -> Data?
    {
        do{
            if let encoded = try JSONSerialization.data(withJSONObject: object, options:[]) as Data?  <- here occured NSInvalidArgumentException

            if(encoded != nil)
            {
                return encoded
            }
            else
            {
                return nil
            }
        }
        catch
        {
            return nil
        }

    }
Run Code Online (Sandbox Code Playgroud)

我将Dictionary作为参数传递,但没有出问题。请帮助我。

谢谢!

invalidargumentexception nsjsonserialization swift toplevel

5
推荐指数
1
解决办法
2315
查看次数

故障排除“没有扩展程序能够加载'knp_menu'的配置”

我正在运行Symfony 2.0.6,并且出现以下错误:

InvalidArgumentException:没有扩展能够加载“ knp_menu”的配置(在/home/www/Symfony/app/config/config.yml中)。寻找名称空间“ knp_menu”

它适用于DEV,但不适用于PROD环境。

symfony invalidargumentexception

4
推荐指数
1
解决办法
6143
查看次数

PHPUnit - 为 foreach() 提供的无效参数尽管预期但未被识别

一切......我的主题说明了一切。我正在尝试进行一个测试,实际上故意使“为 foreach() 提供的参数无效”发生。我试图让 PHPUnit 期待,但是......不,我的测试仍然突然停止。原因是:“为 foreach() 提供的参数无效”,就在我告诉它它将发生的确切位置。

在我的文件顶部有:

use PHPUnit\Framework\TestCase;
use PHPUnit\Framework\Error\Error;
use PHPUnit\Framework\Error\Notice;
use PHPUnit\Framework\Error\Warning;
Run Code Online (Sandbox Code Playgroud)

我的班级声明开头为:

Class flirzelkwerpTest extends TestCase {
Run Code Online (Sandbox Code Playgroud)

以下是测试文件中的行:

    // Let's try to add nothing.
    // (It should throw an error because of "Invalid argument supplied for foreach()" in barabajagal.php.)
    $this->expectException(\InvalidArgumentException::class);
    $this->expectExceptionMessage('Invalid argument supplied for foreach()');
    $resp = $barabajagal->add();
Run Code Online (Sandbox Code Playgroud)

错误发生在最后一行。前两行不应该告诉 PHPUnit,“嘿,小伙子,我预计这里会出现错误,这是您应该逐字得到的消息”?

我们使用 PHP 7.3.4 和 PHPUnit 8.3.2。

phpunit invalidargumentexception

1
推荐指数
1
解决办法
1417
查看次数

Symfony2.0 - InvalidArgumentException

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

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

错误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)
Run Code Online (Sandbox Code Playgroud)

误差2:

InvalidArgumentException: Unable to parse file "C:\wamp\www\Symfony\vendor\symfony\symfony\src\Symfony\Bundle\FrameworkBundle\DependencyInjection/../Resources/config\web.xml".
Run Code Online (Sandbox Code Playgroud)

我试图删除我认为导致这些错误的东西(我也尝试清理缓存),但没有一个工作.

我猜我在twig或xlf文件中一定有问题,因为这些错误出现在我修改了那些文件之后,却无法找出我在那些文件中做错了什么(对我来说,我所做的一切都是看起来很好)

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

编辑:

树枝文件:

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

{% block …
Run Code Online (Sandbox Code Playgroud)

symfony invalidargumentexception symfony-2.3

0
推荐指数
1
解决办法
4641
查看次数