Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

created a standard jfr file using amazon corretto 17, unable to open #14

Open
NimChimpsky opened this issue Mar 6, 2023 · 2 comments
Open

Comments

@NimChimpsky
Copy link

Exception in thread "main" java.sql.SQLException: com.fasterxml.jackson.databind.JsonMappingException: Unrecognized character escape 'S' (code 83)
at [Source: (String)"{
version: '1.0',
defaultSchema: 'JFR',
schemas: [
{
name: 'JFR',
type: 'custom',
factory: 'org.moditect.jfranalytics.JfrSchemaFactory',
operand: {
file: 'myfile'
}
}
]
}"; line: 10, column: 20] (through reference chain: org.apache.calcite.model.JsonRoot["schemas"]->java.util.ArrayList[0]->org.apache.calcite.model.JsonCustomSchema["operand"])
at org.apache.calcite.jdbc.Driver$1.onConnectionInit(Driver.java:103)
at org.apache.calcite.avatica.UnregisteredDriver.connect(UnregisteredDriver.java:139)
at java.sql/java.sql.DriverManager.getConnection(DriverManager.java:683)
at java.sql/java.sql.DriverManager.getConnection(DriverManager.java:191)
at org.moditect.jfranalytics.myclass.main(myclass.java:15)
Caused by: com.fasterxml.jackson.databind.JsonMappingException: Unrecognized character escape 'S' (code 83)
at [Source: (String)"{
version: '1.0',
defaultSchema: 'JFR',
schemas: [
{
name: 'JFR',
type: 'custom',
factory: 'org.moditect.jfranalytics.JfrSchemaFactory',
operand: {
file: 'myfile'
}
}
]
}"; line: 10, column: 20] (through reference chain: org.apache.calcite.model.JsonRoot["schemas"]->java.util.ArrayList[0]->org.apache.calcite.model.JsonCustomSchema["operand"])
at com.fasterxml.jackson.databind.JsonMappingException.wrapWithPath(JsonMappingException.java:402)
at com.fasterxml.jackson.databind.JsonMappingException.wrapWithPath(JsonMappingException.java:361)
at com.fasterxml.jackson.databind.deser.BeanDeserializerBase.wrapAndThrow(BeanDeserializerBase.java:1826)
at com.fasterxml.jackson.databind.deser.BeanDeserializer._deserializeWithErrorWrapping(BeanDeserializer.java:566)
at com.fasterxml.jackson.databind.deser.BeanDeserializer._deserializeUsingPropertyBased(BeanDeserializer.java:439)
at com.fasterxml.jackson.databind.deser.BeanDeserializerBase.deserializeFromObjectUsingNonDefault(BeanDeserializerBase.java:1405)
at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserializeFromObject(BeanDeserializer.java:352)
at com.fasterxml.jackson.databind.deser.BeanDeserializer._deserializeOther(BeanDeserializer.java:220)
at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:187)
at com.fasterxml.jackson.databind.jsontype.impl.AsPropertyTypeDeserializer._deserializeTypedForId(AsPropertyTypeDeserializer.java:144)
at com.fasterxml.jackson.databind.jsontype.impl.AsPropertyTypeDeserializer.deserializeTypedFromObject(AsPropertyTypeDeserializer.java:110)
at com.fasterxml.jackson.databind.deser.AbstractDeserializer.deserializeWithType(AbstractDeserializer.java:263)
at com.fasterxml.jackson.databind.deser.std.CollectionDeserializer._deserializeFromArray(CollectionDeserializer.java:361)
at com.fasterxml.jackson.databind.deser.std.CollectionDeserializer.deserialize(CollectionDeserializer.java:244)
at com.fasterxml.jackson.databind.deser.std.CollectionDeserializer.deserialize(CollectionDeserializer.java:28)
at com.fasterxml.jackson.databind.deser.impl.FieldProperty.deserializeAndSet(FieldProperty.java:138)
at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:278)
at com.fasterxml.jackson.databind.deser.BeanDeserializer._deserializeUsingPropertyBased(BeanDeserializer.java:463)
at com.fasterxml.jackson.databind.deser.BeanDeserializerBase.deserializeFromObjectUsingNonDefault(BeanDeserializerBase.java:1405)
at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserializeFromObject(BeanDeserializer.java:352)
at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:185)
at com.fasterxml.jackson.databind.deser.DefaultDeserializationContext.readRootValue(DefaultDeserializationContext.java:323)
at com.fasterxml.jackson.databind.ObjectMapper._readMapAndClose(ObjectMapper.java:4730)
at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:3677)
at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:3645)
at org.apache.calcite.model.ModelHandler.(ModelHandler.java:101)
at org.apache.calcite.jdbc.Driver$1.onConnectionInit(Driver.java:101)
... 4 more

@gunnarmorling
Copy link
Member

Thx for reporting. Could you share your connection string too? Are you on Windows by any chance? If I had to guess, I'd say this is related to backslashes in Windows paths (I'm on macOS and Linux, so never tested JFR Analytics on Windows up to this point).

@NimChimpsky
Copy link
Author

String fileStr = JfrSchemaFactory.INLINE_MODEL.formatted(jfrFile);
String cleaned = fileStr.replace("\", "/");

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants