org.json.JSONException: A JSONObject text must begin with '{' at 1 [character 2 line 1]

Searched on Google with the first line of a JAVA stack trace?

We can recommend more relevant solutions and speed up debugging when you paste your entire stack trace with the exception message. Try a sample exception.

Recommended solutions based on your search

Samebug tips

,

The json is invalid or you try to map to a different model.

Solutions on the web

via MuleSoft JIRA by Natalia Garcia, 1 year ago
A JSONObject text must begin with '{' at 1 [character 2 line 1]
via MuleSoft JIRA by Natalia Garcia, 1 year ago
A JSONObject text must begin with '{' at 1 [character 2 line 1]
via Liferay Issues by Anthony Chu, 3 months ago
A JSONArray text must start with '[' at 1 [character 2 line 1]
via atlassian.net by Unknown author, 1 year ago
via GitHub by benallenallen
, 1 year ago
A JSONObject text must begin with '{' at character 0
via GitHub by benallenallen
, 1 year ago
A JSONObject text must begin with '{' at character 0
org.json.JSONException: A JSONObject text must begin with '{' at 1 [character 2 line 1]
at org.json.JSONTokener.syntaxError(JSONTokener.java:433)
at org.json.JSONObject.(JSONObject.java:194)
at org.json.JSONObject.(JSONObject.java:321)
at org.mule.common.metadata.JSONSchemaMetadataModelFactory.buildModel(JSONSchemaMetadataModelFactory.java:33)
at org.mule.common.metadata.JSONSchemaMetadataModelFactory.buildModel(JSONSchemaMetadataModelFactory.java:82)
at org.mule.tooling.apikit.metadata.resolver.APIkitRouterInvokerMetadataResolver.addBody(APIkitRouterInvokerMetadataResolver.java:113)
at org.mule.tooling.apikit.metadata.resolver.APIkitRouterInvokerMetadataResolver.access$0(APIkitRouterInvokerMetadataResolver.java:109)
at org.mule.tooling.apikit.metadata.resolver.APIkitRouterInvokerMetadataResolver$2$1.getRamlMetaData(APIkitRouterInvokerMetadataResolver.java:204)
at org.mule.tooling.apikit.metadata.resolver.APIkitRouterInvokerMetadataResolver$AbstractMetaDataResolver.getMetadata(APIkitRouterInvokerMetadataResolver.java:246)
at org.mule.tooling.apikit.metadata.resolver.APIkitRouterInvokerMetadataResolver$2.call(APIkitRouterInvokerMetadataResolver.java:211)
at org.mule.tooling.apikit.metadata.resolver.APIkitRouterInvokerMetadataResolver$2.call(APIkitRouterInvokerMetadataResolver.java:1)
at org.mule.tooling.utils.SilentRunner.run(SilentRunner.java:10)
at org.mule.tooling.apikit.metadata.resolver.APIkitRouterInvokerMetadataResolver.getOutputMetadata(APIkitRouterInvokerMetadataResolver.java:165)
at org.mule.tooling.ui.modules.core.metadata.resolver.FlowMetadataResolver.getInnerOutputMetadata(FlowMetadataResolver.java:82)
at org.mule.tooling.ui.modules.core.metadata.MetadataPropagationManager$4.call(MetadataPropagationManager.java:163)
at org.mule.tooling.ui.modules.core.metadata.MetadataPropagationManager$4.call(MetadataPropagationManager.java:1)
at org.mule.tooling.utils.SilentRunner.run(SilentRunner.java:10)
at org.mule.tooling.ui.modules.core.metadata.MetadataPropagationManager.getExpectedOutputMetadata(MetadataPropagationManager.java:153)
at org.mule.tooling.ui.modules.core.metadata.resolver.VoidContainerMetadataResolver.getInnerOutputMetadata(VoidContainerMetadataResolver.java:49)
at org.mule.tooling.ui.modules.core.metadata.MetadataPropagationManager$4.call(MetadataPropagationManager.java:163)
at org.mule.tooling.ui.modules.core.metadata.MetadataPropagationManager$4.call(MetadataPropagationManager.java:1)
at org.mule.tooling.utils.SilentRunner.run(SilentRunner.java:10)
at org.mule.tooling.ui.modules.core.metadata.MetadataPropagationManager.getExpectedOutputMetadata(MetadataPropagationManager.java:153)
at org.mule.tooling.ui.modules.core.metadata.explorer.MetadataTreeExplorer$4.call(MetadataTreeExplorer.java:184)
at org.mule.tooling.ui.modules.core.metadata.explorer.MetadataTreeExplorer$4.call(MetadataTreeExplorer.java:1)
at org.mule.tooling.utils.SilentRunner.run(SilentRunner.java:10)
at org.mule.tooling.ui.modules.core.metadata.explorer.MetadataTreeExplorer.refresh(MetadataTreeExplorer.java:157)
at org.mule.tooling.ui.modules.core.metadata.explorer.MetadataTreeExplorer.show(MetadataTreeExplorer.java:153)
at org.mule.tooling.properties.views.MulePropertiesView.showMetadataViewer(MulePropertiesView.java:363)
at org.mule.tooling.properties.views.MulePropertiesView.open(MulePropertiesView.java:319)
at org.mule.tooling.properties.views.MulePropertiesView.showSelection(MulePropertiesView.java:225)
at org.mule.tooling.properties.views.MulePropertiesView.showSelection(MulePropertiesView.java:191)
at org.mule.tooling.properties.views.MulePropertiesView$MuleSelectionListener.selectionChanged(MulePropertiesView.java:742)
at org.eclipse.ui.internal.e4.compatibility.SelectionService.notifyListeners(SelectionService.java:218)
at org.eclipse.ui.internal.e4.compatibility.SelectionService.handlePostSelectionChanged(SelectionService.java:122)
at org.eclipse.ui.internal.e4.compatibility.SelectionService.access$1(SelectionService.java:112)
at org.eclipse.ui.internal.e4.compatibility.SelectionService$3.selectionChanged(SelectionService.java:80)
at org.eclipse.e4.ui.internal.workbench.SelectionAggregator.notifyPostListeners(SelectionAggregator.java:163)
at org.eclipse.e4.ui.internal.workbench.SelectionAggregator.access$8(SelectionAggregator.java:160)
at org.eclipse.e4.core.contexts.RunAndTrack.runExternalCode(RunAndTrack.java:56)
at org.eclipse.e4.core.internal.contexts.TrackableComputationExt.update(TrackableComputationExt.java:110)
at org.eclipse.e4.core.internal.contexts.EclipseContext.processScheduled(EclipseContext.java:338)
at org.eclipse.e4.core.internal.contexts.EclipseContext.set(EclipseContext.java:352)
at org.eclipse.ui.internal.e4.compatibility.CompatibilityPart$3.selectionChanged(CompatibilityPart.java:126)
at org.eclipse.ui.part.MultiPageSelectionProvider$1.run(MultiPageSelectionProvider.java:113)
at org.eclipse.ui.part.MultiPageSelectionProvider.fireEventChange(MultiPageSelectionProvider.java:110)
at org.eclipse.ui.part.MultiPageSelectionProvider.firePostSelectionChanged(MultiPageSelectionProvider.java:104)
at org.eclipse.ui.part.MultiPageEditorSite.handlePostSelectionChanged(MultiPageEditorSite.java:497)
at org.eclipse.gef.ui.parts.AbstractEditPartViewer.fireSelectionChanged(AbstractEditPartViewer.java:247)
at org.eclipse.gef.ui.parts.AbstractEditPartViewer$1.run(AbstractEditPartViewer.java:131)
at org.eclipse.gef.SelectionManager.fireSelectionChanged(SelectionManager.java:144)
at org.eclipse.gef.SelectionManager.appendSelection(SelectionManager.java:83)
at org.eclipse.gef.ui.parts.AbstractEditPartViewer.appendSelection(AbstractEditPartViewer.java:190)
at org.eclipse.gef.ui.parts.AbstractEditPartViewer.select(AbstractEditPartViewer.java:599)
at org.eclipse.gef.tools.SelectEditPartTracker.performSelection(SelectEditPartTracker.java:221)
at org.eclipse.gef.tools.SelectEditPartTracker.performConditionalSelection(SelectEditPartTracker.java:167)
at org.eclipse.gef.tools.SelectEditPartTracker.handleButtonDown(SelectEditPartTracker.java:92)
at org.eclipse.gef.tools.AbstractTool.mouseDown(AbstractTool.java:1091)
at org.eclipse.gef.tools.SelectionTool.mouseDown(SelectionTool.java:514)
at org.eclipse.gef.EditDomain.mouseDown(EditDomain.java:245)
at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:192)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4188)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1467)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1490)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1475)
at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:1279)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4031)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:382)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:648)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:603)

Users with the same issue

Samebug visitor profile picture
Unknown user
Once, 1 year ago
Samebug visitor profile picture
Unknown user
Once, 2 years ago
Samebug visitor profile picture
Unknown user
Once, 1 year ago
Samebug visitor profile picture
Unknown user
Once, 1 year ago
88 times, 7 months ago
86 more bugmates

Know the solutions? Share your knowledge to help other developers to debug faster.