Uploaded image for project: 'Camel'
  1. Camel
  2. CAMEL-8748

DozerBeanMapper cannot instantiate DozerThreadContextClassLoader

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.15.3
    • Fix Version/s: 2.16.0, 2.15.4
    • Component/s: camel-dozer
    • Labels:
      None
    • Estimated Complexity:
      Unknown

      Description

      15:26:16,518 SEVERE [org.jboss.arquillian.protocol.jmx.JMXTestRunner] (pool-2-thread-1) Failed: org.wildfly.camel.test.csv.CSVIntegrationTest.testMarshal: org.dozer.MappingException: java.lang.InstantiationException: org.apache.camel.converter.dozer.DozerThreadContextClassLoader
      	at org.dozer.util.MappingUtils.throwMappingException(MappingUtils.java:82) [dozer-5.5.1.jar:]
      	at org.dozer.util.ReflectionUtils.newInstance(ReflectionUtils.java:366) [dozer-5.5.1.jar:]
      	at org.dozer.DozerInitializer.registerClassLoader(DozerInitializer.java:118) [dozer-5.5.1.jar:]
      	at org.dozer.DozerInitializer.initialize(DozerInitializer.java:98) [dozer-5.5.1.jar:]
      	at org.dozer.DozerInitializer.init(DozerInitializer.java:79) [dozer-5.5.1.jar:]
      	at org.dozer.DozerInitializer.init(DozerInitializer.java:64) [dozer-5.5.1.jar:]
      	at org.dozer.DozerBeanMapper.init(DozerBeanMapper.java:173) [dozer-5.5.1.jar:]
      	at org.dozer.DozerBeanMapper.<init>(DozerBeanMapper.java:99) [dozer-5.5.1.jar:]
      	at org.apache.camel.converter.dozer.DozerTypeConverterLoader.createDozerBeanMapper(DozerTypeConverterLoader.java:232) [camel-dozer-2.16-SNAPSHOT.jar:2.16-SNAPSHOT]
      	at org.apache.camel.converter.dozer.DozerTypeConverterLoader.<init>(DozerTypeConverterLoader.java:118) [camel-dozer-2.16-SNAPSHOT.jar:2.16-SNAPSHOT]
      	at org.wildfly.camel.test.csv.CSVIntegrationTest.testMarshal(CSVIntegrationTest.java:68) [csv-dataformat-tests:]
      ...
      Caused by: java.lang.InstantiationException: org.apache.camel.converter.dozer.DozerThreadContextClassLoader
      	at java.lang.Class.newInstance(Class.java:423) [rt.jar:1.8.0_31]
      	at org.dozer.util.ReflectionUtils.newInstance(ReflectionUtils.java:364) [dozer-5.5.1.jar:]
      	... 150 more
      Caused by: java.lang.NoSuchMethodException: org.apache.camel.converter.dozer.DozerThreadContextClassLoader.<init>()
      	at java.lang.Class.getConstructor0(Class.java:3074) [rt.jar:1.8.0_31]
      	at java.lang.Class.newInstance(Class.java:408) [rt.jar:1.8.0_31]
      	... 151 more
      

      The org.dozer.DozerInitializer does

        private void registerClassLoader(GlobalSettings globalSettings, ClassLoader classLoader, BeanContainer beanContainer) {
          String classLoaderName = globalSettings.getClassLoaderName();
          if (!DozerConstants.DEFAULT_CLASS_LOADER_BEAN.equals(classLoaderName)) {
            DefaultClassLoader defaultClassLoader = new DefaultClassLoader(classLoader);
            Class<? extends DozerClassLoader> classLoaderType = loadBeanType(classLoaderName, defaultClassLoader, DozerClassLoader.class);
            DozerClassLoader classLoaderBean = ReflectionUtils.newInstance(classLoaderType);
            beanContainer.setClassLoader(classLoaderBean);
          }
        }
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                davsclaus Claus Ibsen
                Reporter:
                tdiesler Thomas Diesler
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: