简体   繁体   English

QuickFixJ session 配置为 null。SessionSettings InputStream InputStreamReader TokenizerToken 生成 null

[英]QuickFixJ session config is null. The SessionSettings InputStream InputStreamReader TokenizerToken produces null

In QuickFixJ the config file is not read, causing session settings to be null, but the initiator still starts, but doesn't connect anywhere.在 QuickFixJ 中,配置文件未被读取,导致 session 设置为 null,但启动器仍会启动,但不会连接到任何地方。 There are no log or store directories produced and no error given.没有生成日志或存储目录,也没有给出错误。

Using the normal config file loading process set out in the docs, the config file is read under the hood by the SessionSettings.java class. It uses the following code:使用文档中规定的正常配置文件加载过程,配置文件由SessionSettings.java class 在后台读取。它使用以下代码:

private void load(InputStream inputStream) throws ConfigError {
    try { 
        Properties currentSection = null;
        String currentSectionId = null;
        final Tokenizer tokenizer = new Tokenizer();
        final Reader reader = new InputStreamReader(inputStream);
        Tokenizer.Token token = tokenizer.getToken(reader);
        while (token != null) {
        ...

This is my inputStream这是我的inputStream

在此处输入图像描述

It looks like a good inputStream but the tokenizer is consistently producing null .它看起来像一个很好的 inputStream,但分词器始终生成null

在此处输入图像描述

There's nothing wrong with the QuickFix config file FIX.cfg that I can see.我看到的 QuickFix 配置文件FIX.cfg没有任何问题。 I am using JDK11.我正在使用 JDK11。

The issue was that my config file was saved with Character Encoding UTF-8 with BOM by Notepad which was very unexpected.问题是我的配置文件被记事本保存为UTF-8 with BOM这是非常意外的。

贸易网

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM