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

JSON issue while creating connector instance #41

Open
Manikandan21 opened this issue Jan 26, 2023 · 2 comments
Open

JSON issue while creating connector instance #41

Manikandan21 opened this issue Jan 26, 2023 · 2 comments

Comments

@Manikandan21
Copy link

Subject of the issue

Getting A JSONObject text must begin with '{' at 1 [character 2 line 1] at org.json.JSONTokener.syntaxError(JSONTokener.java:505)
issue while creating a connector instances.

Your environment

Confluent Environment

Steps to reproduce

curl -s -X POST -H "Content-Type: application/json" --data '{  "name": "aep-sink-connector",  "config": {    "topics": "connect-test",    "tasks.max": 1,    "aep.flush.interval.seconds": 1,    "aep.flush.bytes.kb": 4,    "connector.class": "com.adobe.platform.streaming.sink.impl.AEPSinkConnector",    "key.converter.schemas.enable": "false",    "value.converter.schemas.enable": "false",    "aep.endpoint": "https://dcs.adobedc.net/collection/{DATA_INLET_ID}"  }}' http://localhost:8083/connectors

Expected behaviour

Instance should get created

Actual behaviour

ERROR [AEP-sink-dev-test|task-0] WorkerSinkTask{id=AEP-sink-dev-test-0} Task threw an uncaught and unrecoverable exception. Task is being killed and will not recover until manually restarted. Error: A JSONObject text must begin with '{' at 1 [character 2 line 1] (org.apache.kafka.connect.runtime.WorkerSinkTask:616)
org.json.JSONException: A JSONObject text must begin with '{' at 1 [character 2 line 1]
at org.json.JSONTokener.syntaxError(JSONTokener.java:505)
at org.json.JSONObject.(JSONObject.java:214)
at org.json.JSONObject.(JSONObject.java:357)
at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:195)
at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:195)
at java.base/java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1655)
at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:484)
at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474)
at java.base/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:150)
at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:173)
at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
at java.base/java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:497)
at com.adobe.platform.streaming.sink.impl.AEPPublisher.publishData(AEPPublisher.java:66)
at com.adobe.platform.streaming.sink.impl.AEPSinkTask.publishData(AEPSinkTask.java:50)
at com.adobe.platform.streaming.sink.AbstractSinkTask.publishAndLogIfRequired(AbstractSinkTask.java:144)
at com.adobe.platform.streaming.sink.AbstractSinkTask.put(AbstractSinkTask.java:112)
at org.apache.kafka.connect.runtime.WorkerSinkTask.deliverMessages(WorkerSinkTask.java:584)
at org.apache.kafka.connect.runtime.WorkerSinkTask.poll(WorkerSinkTask.java:334)
at org.apache.kafka.connect.runtime.WorkerSinkTask.iteration(WorkerSinkTask.java:235)
at org.apache.kafka.connect.runtime.WorkerSinkTask.execute(WorkerSinkTask.java:204)
at org.apache.kafka.connect.runtime.WorkerTask.doRun(WorkerTask.java:200)
at org.apache.kafka.connect.runtime.WorkerTask.run(WorkerTask.java:255)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.lang.Thread.run(Thread.java:829)
[2023-01-24 21:05:15,670] ERROR [AEP-sink-dev-test|task-0] WorkerSinkTask{id=AEP-sink-dev-test-0} Task threw an uncaught and unrecoverable exception. Task is being killed and will not recover until manually restarted (org.apache.kafka.connect.runtime.WorkerTask:207)
org.apache.kafka.connect.errors.ConnectException: Exiting WorkerSinkTask due to unrecoverable exception.
at org.apache.kafka.connect.runtime.WorkerSinkTask.deliverMessages(WorkerSinkTask.java:618)
at org.apache.kafka.connect.runtime.WorkerSinkTask.poll(WorkerSinkTask.java:334)
at org.apache.kafka.connect.runtime.WorkerSinkTask.iteration(WorkerSinkTask.java:235)
at org.apache.kafka.connect.runtime.WorkerSinkTask.execute(WorkerSinkTask.java:204)
at org.apache.kafka.connect.runtime.WorkerTask.doRun(WorkerTask.java:200)
at org.apache.kafka.connect.runtime.WorkerTask.run(WorkerTask.java:255)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.lang.Thread.run(Thread.java:829)
Caused by: org.json.JSONException: A JSONObject text must begin with '{' at 1 [character 2 line 1]
at org.json.JSONTokener.syntaxError(JSONTokener.java:505)
at org.json.JSONObject.(JSONObject.java:214)
at org.json.JSONObject.(JSONObject.java:357)
at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:195)
at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:195)
at java.base/java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1655)
at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:484)
at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474)
at java.base/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:150)
at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:173)
at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
at java.base/java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:497)
at com.adobe.platform.streaming.sink.impl.AEPPublisher.publishData(AEPPublisher.java:66)
at com.adobe.platform.streaming.sink.impl.AEPSinkTask.publishData(AEPSinkTask.java:50)
at com.adobe.platform.streaming.sink.AbstractSinkTask.publishAndLogIfRequired(AbstractSinkTask.java:144)
at com.adobe.platform.streaming.sink.AbstractSinkTask.put(AbstractSinkTask.java:112)
at org.apache.kafka.connect.runtime.WorkerSinkTask.deliverMessages(WorkerSinkTask.java:584)

@OneCricketeer
Copy link
Contributor

Seems like the data in the topic is not a JSON Object, but this parser will change with #54

@OneCricketeer
Copy link
Contributor

The above PR has been merged, so this exception is no longer valid. Can you please try again?

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