[QFJ-665] "Dangling meta character '*' near index 0" Exception when trying to use new ReconnectInterval syntax from QFJ-419 Created: 30/Jan/12  Updated: 24/Aug/12  Resolved: 25/Jul/12

Status: Resolved
Project: QuickFIX/J
Component/s: Engine
Affects Version/s: 1.5.2
Fix Version/s: 1.5.3

Type: Bug Priority: Default
Reporter: Andy Faibishenko Assignee: Christoph John
Resolution: Fixed Votes: 0
Labels: None
Environment:

Solaris x86


Issue Links:
Relates
is related to QFJ-419 Reconnect Interval: set different int... Closed

 Description   

I set ReconnectInterval in the DEFAULT section to the same string as the example in QFJ-419
ReconnectInterval=6*5;5*15;60

When I run the program I get the following stack trace

quickfix.ConfigError: java.util.regex.PatternSyntaxException: Dangling meta character '*' near index 0
*
^
at quickfix.DefaultSessionFactory.getLogonIntervalsInSeconds(DefaultSessionFactory.java:339)
at quickfix.DefaultSessionFactory.create(DefaultSessionFactory.java:176)
at quickfix.mina.SessionConnector.createSession(SessionConnector.java:140)
at quickfix.mina.initiator.AbstractSocketInitiator.createSessions(AbstractSocketInitiator.java:160)
at quickfix.mina.initiator.AbstractSocketInitiator.createSessionInitiators(AbstractSocketInitiator.java:81)
at quickfix.SocketInitiator.initialize(SocketInitiator.java:85)
at quickfix.SocketInitiator.start(SocketInitiator.java:65)
at com.cboe.driver.LogonDOSApplication.main(LogonDOSApplication.java:104)
Caused by: java.util.regex.PatternSyntaxException: Dangling meta character '*' near index 0
*
^
at java.util.regex.Pattern.error(Pattern.java:1713)
at java.util.regex.Pattern.sequence(Pattern.java:1878)
at java.util.regex.Pattern.expr(Pattern.java:1752)
at java.util.regex.Pattern.compile(Pattern.java:1460)
at java.util.regex.Pattern.<init>(Pattern.java:1133)
at java.util.regex.Pattern.compile(Pattern.java:823)
at java.lang.String.split(String.java:2292)
at java.lang.String.split(String.java:2334)
at quickfix.SessionSettings.parseSettingReconnectInterval(SessionSettings.java:742)
at quickfix.DefaultSessionFactory.getLogonIntervalsInSeconds(DefaultSessionFactory.java:336)
... 7 more



 Comments   
Comment by Christoph John [ 31/Jan/12 ]

Could you try if it works when specifying "x" as the multiplier character?
Anyway, there seems to be a bug when using "*" as multiplier.

Comment by Christoph John [ 31/Jan/12 ]
Index: core/src/main/java/quickfix/SessionSettings.java
===================================================================
--- core/src/main/java/quickfix/SessionSettings.java	(revision 1061)
+++ core/src/main/java/quickfix/SessionSettings.java	(working copy)
@@ -735,7 +735,7 @@
         if (raw == null || raw.length() == 0) {
             return null;
         }
-        final String multiplierCharacter = raw.contains("*") ? "*" : "x";
+        final String multiplierCharacter = raw.contains("*") ? "\\*" : "x";
         final String[] data = raw.split(";");
         final List<Integer> result = new ArrayList<Integer>();
         for (final String multi : data) {

Seems it was forgotten to escape the asterisk when parsing the parameters. But as said, it should also work with "x" as separator.

Generated at Sat Nov 23 09:03:35 UTC 2024 using JIRA 7.5.2#75007-sha1:9f5725bb824792b3230a5d8716f0c13e296a3cae.