小编use*_*581的帖子

Spring 5.0.2 中的 Log4jConfigurer

我使用的是 Spring 4.XX 并使用以下设置来配置 Log4j。现在正在将它升级到 Spring 5.0.2,其中Log4jConfigurer该类已被删除。我如何在 Spring 5.0.2 中做到这一点?

<bean
    class="org.springframework.beans.factory.config.MethodInvokingFactoryBean">
    <property name="targetClass" value="org.springframework.util.Log4jConfigurer"/>
    <property name="targetMethod" value="initLogging"/>
    <property name="arguments">
        <list>
            <value>classpath:log4j.properties</value>
        </list>
    </property>
</bean>
Run Code Online (Sandbox Code Playgroud)

java spring log4j slf4j

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

如何解决 org.codehaus.cargo.container.ContainerException

每当我通过 CMD 启动应用程序时,它都会启动,但是如果我通过 eclipse 运行相同的代码,则会出现下面提到的错误...

[DEBUG] [URLDeployableMonitor] Checking URL [http://localhost:8080/cargocpc/index.html] for status using a timeout of [120000] ms...
[DEBUG] [URLDeployableMonitor] URL [http://localhost:8080/cargocpc/index.html] is not responding: 400 Cycle Detected
[DEBUG] [URLDeployableMonitor] Notifying monitor listener [org.codehaus.cargo.container.spi.deployer.DeployerWatchdog@a55f49]
[INFO] [yer.DeployerWatchdog] Deployable [http://localhost:8080/cargocpc/index.html] failed to finish deploying within the timeout period [120000]. The Deployable state is thus unknown.
[INFO] ------------------------------------------------------------------------
[ERROR] FATAL ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Failed to start the Tomcat 6.x container.
Deployable [http://localhost:8080/cargocpc/index.html] failed to finish deploying within the timeout period [120000]. The …
Run Code Online (Sandbox Code Playgroud)

java eclipse maven-cargo maven

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

NoClassDefFoundError com/fasterxml/jackson/core/TreeNode -- json 模式验证

在 json-schema-validator 2.1.7 jar 中获取以下提到的异常:

java.lang.NoClassDefFoundError: com/fasterxml/jackson/core/TreeNode
    at java.lang.ClassLoader.defineClass1(Native Method)
    at java.lang.ClassLoader.defineClass(ClassLoader.java:621)
    at java.lang.ClassLoader.defineClass(ClassLoader.java:466)
Run Code Online (Sandbox Code Playgroud)

我在用:

  • json-schema-validator 2.1.7 jar
  • json-schema-core 1.1.8 jar
  • jackson-coreutils 1..0 jar
  • jackson-databind-2.2.2 jar

代码片段如下:

            System.out.println(" inside json validation -- 0");
            JsonNode data = JsonLoader.fromString(responseString);
            System.out.println(" inside json validation -- 1");
            JsonNode jsonSchema = JsonLoader.fromResource(schemafilePath);
            System.out.println(" inside json validation -- 2");
            JsonSchemaFactory factory = JsonSchemaFactory.byDefault();
            System.out.println(" inside json validation -- 3");
            JsonSchema schema = factory.getJsonSchema(jsonSchema);
            System.out.println(" inside json validation -- 4");
            ProcessingReport report = schema.validate(data);
Run Code Online (Sandbox Code Playgroud)

java json jsonschema

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

如何在插件动作类中获取当前文件名

在IntelliJ IDEA插件操作类中,我想获取用户当前正在查看的Java类文件名.我怎么会这样?

在IntelliJ IDEA中,如果我们单击Analyse -> Inspect Code,它将显示一个选择范围的窗口,因为它还将显示当前文件名.与该视图类似,我想在插件动作类中获取当前文件名.我怎么能这样做?

java plugins intellij-idea intellij-plugin

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

如何将空参数传递给从主Perl脚本调用的Perl脚本[backtics]

我想调用一个perl脚本(B.pl),它将通过传递多个可选参数来列出主要perl脚本(A.pl)中远程服务器上可用的文件。

由于参数是可选的,因此如果我使用反引号,则会将参数分配给B.pl中的错误变量。

如果我使用的@list=system(B.pl, argv0, argv1, argv2);话,尽管某些参数是undef的,但它已在B.pl中正确分配,但STDOUT未在调用脚本中分配给@list。

我是perl的新手,请在这种情况下进行指导。有没有办法通过反引号传递空参数?

在A.pl中:

my @filelist = system( B.pl, $argv0, $argv1, $argv2, $argv3);
my @filelist1 = `B.pl $argv0 $argv1 $argv2 $argv3`;
Run Code Online (Sandbox Code Playgroud)

在B.pl中:

my $loc   = uc( $ARGV[0] );
my $msk   = uc( $ARGV[1] );
my $usr   = $ARGV[2];
my $usr1  = $ARGV[3];
Run Code Online (Sandbox Code Playgroud)

unix perl

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