小编RE3*_*350的帖子

如何在Apache Benchmark中传递多个头文件

我需要传递多个标头Apache benchmark.

我搜索过SO并用google搜索,但到目前为止还没有运气.

ab -n200 -c100 -H 'clientId:test-client;token:93e6acff-2ef9-4c85-9d0b-c9948a8ee93b' http://127.0.0.1/oauth2/user/client/
Run Code Online (Sandbox Code Playgroud)

rest header apachebench

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

worker_connections是不够的

我正在尝试kibana部署的访问应用程序nginx,但在下面

网址: - http://127.0.0.1/kibana-3.1.2

2015/02/01 23:05:05 [alert] 3919#0: *766 768 worker_connections are not enough while connecting to upstream, client: 127.0.0.1, server: , request: "GET /kibana-3.1.2 HTTP/1.0", upstream: "http://127.0.0.1:80/kibana-3.1.2", host: "127.0.0.1"
Run Code Online (Sandbox Code Playgroud)

Kibana部署在 /var/www/kibana-3.1.2

worker_connections在这种情况下,我试图增加但仍然没有运气.

2015/02/01 23:02:27 [alert] 3802#0: accept4() failed (24: Too many open files)
2015/02/01 23:02:27 [alert] 3802#0: accept4() failed (24: Too many open files)
2015/02/01 23:02:27 [alert] 3802#0: accept4() failed (24: Too many open files)
2015/02/01 23:02:27 [alert] 3802#0: accept4() failed (24: Too many …
Run Code Online (Sandbox Code Playgroud)

nginx kibana

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

java.lang.Exception:回复和密钥库中的公钥不匹配

我必须访问在443端口托管的Web服务.服务提供商与我们共享了三个证书.

  1. ABCD.cer
  2. CA_Certificate.cer
  3. CCA_Certificate.cer

我必须通过为SSL通信创建表单链将它们添加到密钥库.我已按照以下步骤操作.

  1. keytool -keystore npci_keystore_test.jks -genkey -alias npci_client_testore

       Result :- keystore npci_keystore_test.jks created.
    
    Run Code Online (Sandbox Code Playgroud)
  2. keytool -import -keystore npci_keystore_test.jks -file CA_Certificate.cer -alias theCARoot

       Result :- certificate CA_Certificate.cer is added to keystore.
    
    Run Code Online (Sandbox Code Playgroud)
  3. keytool -import -keystore npci_keystore_test.jks -file CCA_Certificate.cer -alias theCCARoot

       Result :- certificate CCA_Certificate.cer is added to keystore.
    
    Run Code Online (Sandbox Code Playgroud)
  4. keytool -import -keystore npci_keystore_test.jks -file ABCD.cer -alias npci_client_testore

    在第4步,我有以下例外

    输入密钥库密码:(当我输入密码时,我有以下异常)

    keytool错误:java.lang.Exception:回复中的公钥和密钥库不匹配

我已经在SO中进行了搜索,但到目前为止还没有运气.

我按照以下来源创建商店并导入证书. JKS Keystore

编辑: - -

我通过更改证书的导入顺序对其进行了测试,但到目前为止还没有运气.

java ssl https keytool

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

Spring Batch Item Reader 仅执行一次

尝试实现Spring批处理,但面临一个奇怪的问题,我们的 ItemReader类只执行一次。

下面是详细信息。

  1. 如果数据库中有 1000 行。
  2. 我们的 Item reader 从数据库中获取 1000 行,并将列表传递给ItemWriter
  3. ItemWriter成功删除所有项目。
  4. 现在ItemReader再次尝试从DB中获取数据,但没有找到,因此返回NULL,因此执行停止。
  5. 但是我们已经将批处理配置为使用调度程序执行Quartz,即每分钟执行一次。
  6. 现在,如果我们通过转储导入在数据库中插入 1000 行,批处理作业应该在下一次执行中选择这些数据,但它甚至没有执行,尽管 JobLauncher正在执行。

配置 : -

1.我们有 ItemReader、ItemWriter,提交间隔等于 1。

<batch:job id="csrfTokenBatchJob">
    <batch:step id="step1">
      <tasklet>
        <chunk reader="csrfTokenReader" writer="csrfTokenWriter" commit-interval="1"></chunk>
      </tasklet>
    </batch:step>
  </batch:job>
Run Code Online (Sandbox Code Playgroud)

2.Job定时每分钟触发一次。

<bean class="org.springframework.scheduling.quartz.SchedulerFactoryBean">
    <property name="triggers">
      <bean id="cronTrigger" class="org.springframework.scheduling.quartz.CronTriggerBean">
        <property name="jobDetail" ref="jobDetail" />
        <property name="cronExpression" value="0 0/1 * * * ?" />
      </bean>
    </property>
  </bean>
Run Code Online (Sandbox Code Playgroud)

3.作业配置

<bean id="jobDetail" class="org.springframework.scheduling.quartz.JobDetailBean">
    <property name="jobClass" value="com.tavant.oauth.batch.job.CSRFTokenJobLauncher" />
    <property name="jobDataAsMap">
        <map>
            <entry key="jobName" …
Run Code Online (Sandbox Code Playgroud)

java spring spring-batch

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

@PathParam注释中的可选参数

我们面临与使路径参数可选相关的问题.

原始网址 /expire/{token}

我们要做的是为下面的URL提供相同的服务工作.

   1. /expire/{token}
   2. /expire

Ex:- @Path("/expire/{token}")
Run Code Online (Sandbox Code Playgroud)

我们已经应用了SO的其他解决方案,但到目前为止还没有运气.

java rest jersey

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

如何在Spring中使用@ImportResource批注从类路径中加载多个配置文件

我不知道如何在春季使用@ImportResource从类路径中加载多个配置文件。到目前为止,我已经通过了Spring 3 @ImportResource链接, 其中包含多个文件,但到目前为止还没有运气。我的代码如下。

@Configuration
@PropertySource("classpath:apis.application.properties")
@ComponentScan(basePackages = {"org.surfnet.oaaas.resource", "org.surfnet.oaaas.service"})
@ImportResource({"classpath:spring-repositories.xml,classpath:commonApplicationContext.xml"})
@EnableTransactionManagement
public class SpringConfiguration {

}
Run Code Online (Sandbox Code Playgroud)

我面临的例外是

java.io.FileNotFoundException: class path resource [spring-repositories.xml,classpath:commonApplicationContext.xml] cannot be opened because it does not exist
    at org.springframework.core.io.ClassPathResource.getInputStream(ClassPathResource.java:157)
    at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:328)
    at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:302)
Run Code Online (Sandbox Code Playgroud)

但是当我尝试加载单个文件时,如下所示。它对两个文件都适用。但是我不能ImportResource在Java类中包含两个注释。

    @ImportResource("classpath:spring-repositories.xml"})
Run Code Online (Sandbox Code Playgroud)

java spring-mvc

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

找不到任何支持AES/GCM/NoPadding的提供商

我们正在尝试进行加密,支持java 7中的 AES/GCM/NoPadding 获得以下异常.

找不到任何支持AES/GCM/NoPadding的提供商

用于生成密码实例的代码示例如下.

SecretKeySpec eks = new SecretKeySpec(k, "AES");
Cipher c = Cipher.getInstance("AES/GCM/NoPadding");
c.init(Cipher.ENCRYPT_MODE, eks, new GCMParameterSpec(128, iv));
Run Code Online (Sandbox Code Playgroud)

java encryption aes-gcm

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