日日操夜夜添-日日操影院-日日草夜夜操-日日干干-精品一区二区三区波多野结衣-精品一区二区三区高清免费不卡

公告:魔扣目錄網為廣大站長提供免費收錄網站服務,提交前請做好本站友鏈:【 網站目錄:http://www.ylptlb.cn 】, 免友鏈快審服務(50元/站),

點擊這里在線咨詢客服
新站提交
  • 網站:51998
  • 待審:31
  • 小程序:12
  • 文章:1030137
  • 會員:747

本文介紹了無法使字段私有最終的java.util.Compator java.util.TreeMap.Compator可訪問:java.base不會向未命名的模塊打開java.util(&q;)的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

問題描述

我已經創建了一個Cucumber特征文件和STEP文件,然后我點擊了&Run Configurations&for Feature文件,我在控制臺中看到了以下內容。我如何解決此問題?

*Feature: Login into account
  Existing user should be able to login to account using correct credentials
  
Scenario: Login into account with correct credentials     # C:/Users/MI/Desktop/CucumberFramework/CucumberFramework/src/test/java/CucumberFramework/featureFiles/Login.feature:4
    
Given User navigates to stackoverflow website           # LoginSteps.user_navigates_to_stackoverflow_website()
      java.lang.ExceptionInInitializerError
        at cucumber.deps.com.thoughtworks.xstream.XStream.setupConverters(XStream.java:820)
        at cucumber.deps.com.thoughtworks.xstream.XStream.<init>(XStream.java:574)
        at cucumber.deps.com.thoughtworks.xstream.XStream.<init>(XStream.java:530)
        at cucumber.runtime.xstream.LocalizedXStreams$LocalizedXStream.<init>(LocalizedXStreams.java:50)
        at cucumber.runtime.xstream.LocalizedXStreams.newXStream(LocalizedXStreams.java:37)
        at cucumber.runtime.xstream.LocalizedXStreams.get(LocalizedXStreams.java:29)
        at cucumber.runtime.StepDefinitionMatch.runStep(StepDefinitionMatch.java:37)
        at cucumber.runtime.Runtime.runStep(Runtime.java:300)
        at cucumber.runtime.model.StepContainer.runStep(StepContainer.java:44)
        at cucumber.runtime.model.StepContainer.runSteps(StepContainer.java:39)
        at cucumber.runtime.model.CucumberScenario.run(CucumberScenario.java:44)
        at cucumber.runtime.model.CucumberFeature.run(CucumberFeature.java:165)
        at cucumber.runtime.Runtime.run(Runtime.java:122)
        at cucumber.api.cli.Main.run(Main.java:36)
        at cucumber.api.cli.Main.main(Main.java:18)
        at ?.Given User navigates to stackoverflow website(C:/Users/MI/Desktop/CucumberFramework/CucumberFramework/src/test/java/CucumberFramework/featureFiles/Login.feature:5)
     
 Caused by: java.lang.reflect.InaccessibleObjectException: Unable to make field private final java.util.Comparator java.util.TreeMap.comparator accessible: module java.base does not "opens java.util" to unnamed module @5afa04c
        at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:357)
        at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:297)
        at java.base/java.lang.reflect.Field.checkCanSetAccessible(Field.java:177)
        at java.base/java.lang.reflect.Field.setAccessible(Field.java:171)
        at cucumber.deps.com.thoughtworks.xstream.core.util.Fields.locate(Fields.java:39)
        at cucumber.deps.com.thoughtworks.xstream.converters.collections.TreeMapConverter.<clinit>(TreeMapConverter.java:50)
        at cucumber.deps.com.thoughtworks.xstream.XStream.setupConverters(XStream.java:820)
        at cucumber.deps.com.thoughtworks.xstream.XStream.<init>(XStream.java:574)
        at cucumber.deps.com.thoughtworks.xstream.XStream.<init>(XStream.java:530)
        at cucumber.runtime.xstream.LocalizedXStreams$LocalizedXStream.<init>(LocalizedXStreams.java:50)
        at cucumber.runtime.xstream.LocalizedXStreams.newXStream(LocalizedXStreams.java:37)
        at cucumber.runtime.xstream.LocalizedXStreams.get(LocalizedXStreams.java:29)
        at cucumber.runtime.StepDefinitionMatch.runStep(StepDefinitionMatch.java:37)
        at cucumber.runtime.Runtime.runStep(Runtime.java:300)
        at cucumber.runtime.model.StepContainer.runStep(StepContainer.java:44)
        at cucumber.runtime.model.StepContainer.runSteps(StepContainer.java:39)
        at cucumber.runtime.model.CucumberScenario.run(CucumberScenario.java:44)
        at cucumber.runtime.model.CucumberFeature.run(CucumberFeature.java:165)
        at cucumber.runtime.Runtime.run(Runtime.java:122)
        at cucumber.api.cli.Main.run(Main.java:36)
        at cucumber.api.cli.Main.main(Main.java:18)
    
And User clicks on the login button on homepage         # LoginSteps.user_clicks_on_the_login_button_on_homepage()
    
And User enters a valid username                        # LoginSteps.user_enters_a_valid_username()
    
And User enters a valid password                        # LoginSteps.user_enters_a_valid_password()
    
When User clicks on the login button                    # LoginSteps.user_clicks_on_the_login_button()
    
Then User should be taken to the successfull login page # LoginSteps.user_should_be_taken_to_the_successfull_login_page()

Failed scenarios:
C:/Users/MI/Desktop/CucumberFramework/CucumberFramework/src/test/java/CucumberFramework/featureFiles/Login.feature:4 # Scenario: Login into account with correct credentials
1 Scenarios (1 failed)
6 Steps (1 failed, 5 skipped)
0m0,357s

java.lang.ExceptionInInitializerError
    at cucumber.deps.com.thoughtworks.xstream.XStream.setupConverters(XStream.java:820)
    at cucumber.deps.com.thoughtworks.xstream.XStream.<init>(XStream.java:574)
    at cucumber.deps.com.thoughtworks.xstream.XStream.<init>(XStream.java:530)
    at cucumber.runtime.xstream.LocalizedXStreams$LocalizedXStream.<init>(LocalizedXStreams.java:50)
    at cucumber.runtime.xstream.LocalizedXStreams.newXStream(LocalizedXStreams.java:37)
    at cucumber.runtime.xstream.LocalizedXStreams.get(LocalizedXStreams.java:29)
    at cucumber.runtime.StepDefinitionMatch.runStep(StepDefinitionMatch.java:37)
    at cucumber.runtime.Runtime.runStep(Runtime.java:300)
    at cucumber.runtime.model.StepContainer.runStep(StepContainer.java:44)
    at cucumber.runtime.model.StepContainer.runSteps(StepContainer.java:39)
    at cucumber.runtime.model.CucumberScenario.run(CucumberScenario.java:44)
    at cucumber.runtime.model.CucumberFeature.run(CucumberFeature.java:165)
    at cucumber.runtime.Runtime.run(Runtime.java:122)
    at cucumber.api.cli.Main.run(Main.java:36)
    at cucumber.api.cli.Main.main(Main.java:18)
    at ?.Given User navigates to stackoverflow website(C:/Users/MI/Desktop/CucumberFramework/CucumberFramework/src/test/java/CucumberFramework/featureFiles/Login.feature:5)

Caused by: java.lang.reflect.InaccessibleObjectException: Unable to make field private final java.util.Comparator java.util.TreeMap.comparator accessible: module java.base does not "opens java.util" to unnamed module @5afa04c
    at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:357)
    at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:297)
    at java.base/java.lang.reflect.Field.checkCanSetAccessible(Field.java:177)
    at java.base/java.lang.reflect.Field.setAccessible(Field.java:171)
    at cucumber.deps.com.thoughtworks.xstream.core.util.Fields.locate(Fields.java:39)
    at cucumber.deps.com.thoughtworks.xstream.converters.collections.TreeMapConverter.<clinit>(TreeMapConverter.java:50)
    at cucumber.deps.com.thoughtworks.xstream.XStream.setupConverters(XStream.java:820)
    at cucumber.deps.com.thoughtworks.xstream.XStream.<init>(XStream.java:574)
    at cucumber.deps.com.thoughtworks.xstream.XStream.<init>(XStream.java:530)
    at cucumber.runtime.xstream.LocalizedXStreams$LocalizedXStream.<init>(LocalizedXStreams.java:50)
    at cucumber.runtime.xstream.LocalizedXStreams.newXStream(LocalizedXStreams.java:37)
    at cucumber.runtime.xstream.LocalizedXStreams.get(LocalizedXStreams.java:29)
    at cucumber.runtime.StepDefinitionMatch.runStep(StepDefinitionMatch.java:37)
    at cucumber.runtime.Runtime.runStep(Runtime.java:300)
    at cucumber.runtime.model.StepContainer.runStep(StepContainer.java:44)
    at cucumber.runtime.model.StepContainer.runSteps(StepContainer.java:39)
    at cucumber.runtime.model.CucumberScenario.run(CucumberScenario.java:44)
    at cucumber.runtime.model.CucumberFeature.run(CucumberFeature.java:165)
    at cucumber.runtime.Runtime.run(Runtime.java:122)
    at cucumber.api.cli.Main.run(Main.java:36)
    at cucumber.api.cli.Main.main(Main.java:18)*

推薦答案

您的黃瓜版本與您的Java版本不兼容。升級黃瓜或降級Java。

由于您正在測試的場景,我猜您遵循的是一個舊教程。此版本是最新的:

https://cucumber.io/docs/guides/10-minute-tutorial/

這篇關于無法使字段私有最終的java.util.Compator java.util.TreeMap.Compator可訪問:java.base不會向未命名的模塊打開java.util(&q;)的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,

分享到:
標簽:會向 字段 打開 未命名 模塊 私有 訪問
用戶無頭像

網友整理

注冊時間:

網站:5 個   小程序:0 個  文章:12 篇

  • 51998

    網站

  • 12

    小程序

  • 1030137

    文章

  • 747

    會員

趕快注冊賬號,推廣您的網站吧!
最新入駐小程序

數獨大挑戰2018-06-03

數獨一種數學游戲,玩家需要根據9

答題星2018-06-03

您可以通過答題星輕松地創建試卷

全階人生考試2018-06-03

各種考試題,題庫,初中,高中,大學四六

運動步數有氧達人2018-06-03

記錄運動步數,積累氧氣值。還可偷

每日養生app2018-06-03

每日養生,天天健康

體育訓練成績評定2018-06-03

通用課目體育訓練成績評定