cannot access com.fasterxml.jackson.core.ObjectCodec

Answered

I am running into a problem in Intellij IDEA 2018.1.5. Running on Debian Jessie.

I have a Java Spring project with a pom.xml file and I can successfully do both 'mvn clean' and 'mvn compile' on the command line and get no errors. I can also run these same commands through the Intellij Maven UI.

However, in Intellij, the editor complains "cannot access com.fasterxml.jackson.core.ObjectCodec" on the 'asset = jackson.readValue' line

 

 ObjectMapper jackson = null;
CcBoAsset asset = null;
BoMailRoomAssociate user = null;
InterfaceBs service = null;
String objAsJson = null;

//
jackson = new ObjectMapper();
logger.info ("inJson = " + inJson);

try
{
//
asset = jackson.readValue(inJson, CcBoCleveronAsset.class);
logger.info ("assetId = " + asset.getAssetId() );
logger.info ("clientName = " + asset.getClientName() );
logger.info ("hStatus = " + asset.getHStatus() );

//objAsJson = mapper.writeValueAsString(user);
}
catch (Exception e)

 

Should I just ignore this error?

Is there a way to clear it?

 

I have deleted the ~/.m2 directory and let maven rebuild it but that did not change anything.

0
1 comment

Please try File | Invalidate Caches | Invalidate and Restart.

If it doesn't help, delete .idea directory and reimport from pom.xml.

1

Please sign in to leave a comment.