Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ClassNotFoundException when mapping

See original GitHub issue

Whats your runtime?

  • Dozer version: 6.1.0
  • OS version: osx 10.12.6
  • JDK version: 1.8.144

Whats the problem?

Steps to reproduce:

  1. Create new dozer mapper
  2. (Optional) Create one custom converter with LocalDate and
  3. Call : LocalDate(), Timestamp.class)

Dozer is trying to load class:, which doesn’t exist in proto3 return MappingUtils.loadClass(StringUtils.join( getFullyQualifiedClassName(descriptor.getMessageType().getFile().getOptions(), descriptor.getMessageType().getName()), '.'), beanContainer);

Method: private static String[] getFullyQualifiedClassName(DescriptorProtos.FileOptions options, String name) { return new String[] { options.getJavaPackage(), options.getJavaOuterClassname(), name}; }

Observed Results:

Caused by: org.dozer.MappingException: java.lang.ClassNotFoundException: from [Module "xxx:main" from local module loader @768b970c (finder: local module finder @5a4041cc (roots: /apps/jboss/modules,/apps/jboss/modules/system/layers/base))] at org.dozer.util.MappingUtils.throwMappingException( [dozer-core-6.1.0.jar:6.1.0] at org.dozer.util.DefaultClassLoader.loadClass( [dozer-core-6.1.0.jar:6.1.0] at org.dozer.util.MappingUtils.loadClass( [dozer-core-6.1.0.jar:6.1.0] at com.github.dozermapper.protobuf.util.ProtoUtils.getJavaClassIgnoreRepeated( [dozer-proto-6.1.0.jar:] at com.github.dozermapper.protobuf.util.ProtoUtils.getJavaClass( [dozer-proto-6.1.0.jar:] at com.github.dozermapper.protobuf.propertydescriptor.ProtoFieldPropertyDescriptor.getPropertyType( [dozer-proto-6.1.0.jar:] at org.dozer.fieldmap.FieldMap.getSrcFieldType( [dozer-core-6.1.0.jar:6.1.0] at org.dozer.loader.MappingsParser.processMappings( [dozer-core-6.1.0.jar:6.1.0] at org.dozer.loader.CustomMappingsLoader.load( [dozer-core-6.1.0.jar:6.1.0] at org.dozer.DozerBeanMapper.loadCustomMappings( [dozer-core-6.1.0.jar:6.1.0] at org.dozer.DozerBeanMapper.initMappings( [dozer-core-6.1.0.jar:6.1.0] at org.dozer.DozerBeanMapper.getMappingProcessor( [dozer-core-6.1.0.jar:6.1.0] at [dozer-core-6.1.0.jar:6.1.0]

Expected Results:

To not load TimestampProto.Timestamp but use Timestamp. Dozer should be able to handle 2 cases, one where the class XXXProto encapsulates XXX, and other case when XXX and XXXProto are two files like Timestamp example.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:12 (3 by maintainers)

github_iconTop GitHub Comments

jbqcommented, Oct 23, 2017

Yes it is pretty obvious what should be done, I’m looking at it right now

garethahealycommented, Oct 18, 2017

@jbq ; do you understand what we’d need to do for: java_multiple_files ?

Read more comments on GitHub >

github_iconTop Results From Across the Web

NoSuchMethodException and NoClassDefFoundError in grpc ...
In this case you will find that is depending on ...
Read more >
getquill/quill - Gitter
If you create mapped using java long like below ... Long, ... ClassNotFoundException: jdk.internal.misc.Unsafe at
Read more > Class Hierarchy
Package Hierarchies: All Packages. Class Hierarchy. java.lang.Object. java.util.AbstractMap<K,V> (implements java.util.
Read more >
Protobuf Schema Serializer and Deserializer
For example, if the main schema references “ google/protobuf/timestamp.proto ” ... in the table under JSON Mapping in the Protocol Buffers Developer Guide....
Read more >
java.lang.ClassNotFoundException: ... - Re
lang.ClassNotFoundException: I do. I tried with protobuf-java-2.4.0a.jar that ships with HBase 0.94, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Post

No results found

github_iconTop Related Hashnode Post

No results found