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

Failed to generate CSV file after upgrading from 2.12.4 to 2.17.1 #478

Closed
maliksajidhussain opened this issue Jun 3, 2024 · 3 comments
Closed

Comments

@maliksajidhussain
Copy link

I am using jackson-dataformat-csv to generate CSV file.. previously I was using 2.12.4 version and this code to generate CSV.
FileWriter outputCpFile = new FileWriter(csvCpFile, true); PrintWriter cpWriter = new PrintWriter(outputCpFile); CsvMapper csvMapper = new CsvMapper(); CsvSchema csvSchema = csvMapper.schemaFor(CpTransactionLogs.class).withHeader(); csvMapper.enable(CsvGenerator.Feature.ALWAYS_QUOTE_EMPTY_STRINGS); String csvString = csvMapper.writer(csvSchema).writeValueAsString(transLogs); cpWriter.write(csvString);

After upgrading to 2.17.1 I'm getting following exception:
(java.lang.NoSuchMethodError) java.lang.NoSuchMethodError: 'void com.fasterxml.jackson.core.base.GeneratorBase.<init>(int, com.fasterxml.jackson.core.ObjectCodec, com.fasterxml.jackson.core.io.IOContext)'

Any workaround how to fix this issue.

Thanks in advance

@maliksajidhussain
Copy link
Author

maliksajidhussain commented Jun 3, 2024

java.lang.NoSuchMethodError: 'void com.fasterxml.jackson.core.base.GeneratorBase.<init>(int, com.fasterxml.jackson.core.ObjectCodec, com.fasterxml.jackson.core.io.IOContext)' at com.fasterxml.jackson.dataformat.csv.CsvGenerator.<init>(CsvGenerator.java:274) at com.fasterxml.jackson.dataformat.csv.CsvFactory._createGenerator(CsvFactory.java:442) at com.fasterxml.jackson.dataformat.csv.CsvFactory._createGenerator(CsvFactory.java:417) at com.fasterxml.jackson.dataformat.csv.CsvFactory.createGenerator(CsvFactory.java:360) at com.fasterxml.jackson.dataformat.csv.CsvFactory.createGenerator(CsvFactory.java:14) at com.fasterxml.jackson.databind.ObjectWriter.createGenerator(ObjectWriter.java:751) at com.fasterxml.jackson.databind.ObjectWriter.writeValue(ObjectWriter.java:1114)

@yawkat
Copy link
Member

yawkat commented Jun 3, 2024

You are using an outdated version of jackson-core.

@maliksajidhussain
Copy link
Author

maliksajidhussain commented Jun 3, 2024

@yawkat Thanks for the help. The jackson-databind 2.17.1 by default adding older version of core and annotation dependencies.

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