小编hel*_*ete的帖子

java.lang.ClassNotFoundException: org.junit.platform.engine.ConfigurationParameters Junit5 与 eclipse

我收到以下异常:

java.lang.NoClassDefFoundError: org/junit/platform/engine/ConfigurationParameters
    at org.eclipse.jdt.internal.junit5.runner.JUnit5TestLoader.<init>(JUnit5TestLoader.java:34)
    at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:64)
    at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:500)
    at java.base/java.lang.reflect.ReflectAccess.newInstance(ReflectAccess.java:128)
    at java.base/jdk.internal.reflect.ReflectionFactory.newInstance(ReflectionFactory.java:350)
    at java.base/java.lang.Class.newInstance(Class.java:645)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.createRawTestLoader(RemoteTestRunner.java:371)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.createLoader(RemoteTestRunner.java:366)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.defaultInit(RemoteTestRunner.java:310)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.init(RemoteTestRunner.java:225)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:209)
Caused by: java.lang.ClassNotFoundException: org.junit.platform.engine.ConfigurationParameters
    at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:606)
    at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:168)
    at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522)
    ... 13 more
Run Code Online (Sandbox Code Playgroud)

在 Eclipse 项目(无 Maven)中运行 JUnit 5。有谁知道导致这个问题的原因是什么?Eclipse 版本:2020-12 JUnit 版本:5

我期望 JUnit 5 能够在 Eclipse 上运行,而无需采取进一步行动。

java eclipse junit

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

如何在 Angular 中使用第三方库动态创建组件?

使用角度 10

\n

SO 上有很多与此类似的问题,但我还没有找到一个可以回答我的情况的问题。

\n

我希望有人能指导我。

\n

我正在使用第三方库来显示 360\xc2\xb0 照片。这个第三方库有一个内置的API来显示场景中的热点。只需向库提供您想要成为热点的元素,它就会处理其余的事情。

\n

我的大部分内容都按预期工作,但有一些部分没有按预期工作。

\n

到目前为止,我正在动态生成我的组件,如下所示:

\n
this._hotspotFactory = this.resolver.resolveComponentFactory(HotspotComponent);\nconst component = this._hotspotFactory.create(this.injector);\n\n//Hydrate component with  bunch of data\ncomponent.instance.id = data.id;\n...\n\n// Create the Hotspot with Third Party\n// Calling this third party method injects the native element into the DOM. \n// Passing the nativeElement in. Looks great at first glance. \nconst hotspot = this._scene.createHotspot(data, component.location.nativeElement);\n\nthis.appRef.attachView(component.hostView);\ncomponent.hostView.detectChanges();\n\nif(component.instance.over.observers.length) {\n  hotspot.on(\'over\', (evt) => {\n    this.zone.run(() => {\n      component.instance.over.emit(evt);\n    });\n  });\n}\n\nif(component.instance.out.observers.length) {\n  hotspot.on(\'out\', (evt) => {\n    this.zone.run(() => …
Run Code Online (Sandbox Code Playgroud)

javascript angular angular-changedetection

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

是否可以在 docker hub 的自动构建中添加环境变量?

我想自动化我的构建过程,并且需要传递一个环境变量来运行Dockerfile. 我想知道在 Dockerhub 中是否有任何方法可以做到这一点。我知道 docker cloud 有这样的东西,但我想知道 Dockerhub 中是否有这个功能,因为--build-args在正常构建的 cli 中有参数。

automated-deploy build-settings docker

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

highcharts列标签

我创建了一个包含分组和堆叠列的Highcharts图表,如下面的示例所示:http://www.highcharts.com/demo/column-stacked-and-grouped.该示例显示了按性别分组的5个不同人的水果.我在这个例子中遗漏的是一个x轴标签,显示每组下面的组(男性或女性)的名称.是否可以将其添加到图表中?

这是我想要制作的图表的简化版本:http://jsfiddle.net/WQjVP/66/.它显示了案件处理系统中三个位置的开放(蓝色)和过期(红色)问题的数量.每组中的左列显示7月份该位置的数字,每组中的右列显示同一单位的8月份数字.我想要做的是显示每列下的月份,以便第一列将具有"Jul",第二列将具有"Aug",第三列将具有"Jul",依此类推,在列和之间位置标签.

chart = new Highcharts.Chart({
    chart: {
        renderTo: 'container',
        type: 'column'
    },
    title: {
         text: ''
    },
    subtitle: {
        text: ''
    },
    xAxis: {
        categories: ["Location A","Location B","Location C"],
        title: {
            text: "Location"
        }
    },
    yAxis: {
        allowDecimals: false

    },
    plotOptions: {
        series: {
            dataLabels: {
                enabled: true,
                formatter: function() {
                    if (this.y === 0) {
                        return null;
                    }
                    return this.y;
                },
                style: {
                    color: 'white'
                }
            }
        },
        column: { …
Run Code Online (Sandbox Code Playgroud)

highcharts

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

深度克隆后未创建Doctrine2 ManyToMany记录

我遇到了以下问题.应用程序需要能够克隆Season具有所有相关实体的实体.我在这个伟大的问题上受到启发- 一切都按照它应有的方式运作,但ManyToMany在路上存在关系问题.

请查看附图,其中显示了数据库图表的一小部分,显示了我遇到问题的部分.

数据库图表段 - 多对多关系

我想达到的状态是有一个克隆一个的Price绑定到实体的现有 Offer实体.说清楚 - 我不能也绝不能克隆Offer实体,实体的新克隆实例Price必须绑定到主Price实体实例绑定的同一个实例.

offer_price克隆之前表的示例内容

 offer_id | price_id                                                        
----------+----------                                                       
       47 |       77                                                        
Run Code Online (Sandbox Code Playgroud)

offer_price克隆后表的预期内容

 offer_id | price_id                                                        
----------+----------                                                       
       47 |       77                                                        
       47 |       79                                                        
Run Code Online (Sandbox Code Playgroud)

...假设PriceID 77是主记录Price,ID 79是绑定到同一Offer记录的新克隆实例.

实体定义 - 尽可能简化

价钱

/**                                                                         
 * @Entity                                                                  
 */                                                                         
class Price                                                                 
{                                                                           
    ...                                                                     

    /**                                                                     
     * @var \Doctrine\Common\Collections\Collection of Offer                
     * @ManyToMany(targetEntity="Offer", mappedBy="prices", cascade={"persist"})
     *                                                                      
     * @get …
Run Code Online (Sandbox Code Playgroud)

php doctrine-orm

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

如何通过回调清除破折号

我有一个图表,我想将其重置为原始状态,如图所示: 原始状态

我尝试了这个,就好像我打印了图形的初始状态,它说“无”。

app.layout = html.Div([
    html.Div(
        dcc.Graph(id = 'graph')
    )
])
           
@app.callback(
    Output('graph', 'figure'),
    [Input('click', 'clickedData')])
def myfun(x): 
    ...
    return None
Run Code Online (Sandbox Code Playgroud)

但我收到错误:无法读取 null 的属性“布局”

我应该返回什么以便我的新图表返回到原始的空状态?

python python-3.x plotly-dash

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

Doctrine ORM 2.9同时使用AnnotationDriver和AttributeDriver来解析实体元数据

最近我们将应用程序升级到 PHP8。

由于PHP8引入了属性doctrine/orm从版本开始支持它们,2.9因此利用此功能增量(即不是一次所有实体)将实体元数据更新为属性格式似乎是个好主意。

为此,我需要以某种方式注册两者Doctrine\ORM\Mapping\Driver\AnnotationDriverDoctrine\ORM\Mapping\Driver\AttributeDriver解析元数据。

棘手的部分是为一组使用注释或属性修饰的实体注册两个解析器。从这一点来看,Doctrine\ORM\Configuration我所需要的似乎是不可能的。

我是否正确(假设这无法合理实现)或者可以通过某种不太黑客的方式来完成吗?

php doctrine-orm php-8 php-attributes

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