Raffaele Castagno
Raffaele Castagno

Reputation: 341

Apache Camel: NoTypeConversionAvailableException when using jars in Coldfusion application

I'm trying to integrate Camel into our Coldfusion application.

I'm using a maven project to resolve dependencies, which I then copy with the dependency:copy-dependencies maven task.

It more or less works, but I'm having some issues with some parameters, in particular with the "delay" parameter, for example when using the "timer" or "pop3" endpoints.

The error I get is s

No type converter available to convert from type: java.lang.String to the required type: java.time.Duration with value 60000

I'm reading around that it's something related to

META-INF/services/org/apache/camel/TypeConverterLoader

https://github.com/apache/camel/blob/main/docs/user-manual/modules/ROOT/pages/type-converter.adoc

But it's usually cited as a problem when using fat-jars, but here I'm using granular jars.

May it be a problem related to the Coldfusion classloader?

What can I check?

Upvotes: 1

Views: 318

Answers (1)

Raffaele Castagno
Raffaele Castagno

Reputation: 341

I solved this issue using the official prepare-fatjar Maven plugin.

    <build>
    <plugins>
      <plugin>
        <groupId>org.apache.camel</groupId>
        <artifactId>camel-maven-plugin</artifactId>
        <version>${camel.version}</version>
        <executions>
          <execution>
            <goals>
              <goal>prepare-fatjar</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
    </plugins>
</build>

This plugin creates a UberTypeConverterLoader file appending all converters from the selected camel dependencies.

enter image description here

In my case I'm not really creating a fat-jar; I'm still copying all dependencies in a lib folder and using them in another application (I'm using Maven mainly for dependency resolution, long story...).

But I'm still releasing a project jar, so UberTypeConverterLoader is being released through this custom jar.

Now, my "timer" examples seem to be working fine, with the "delay" option and everything.

Upvotes: 1

Related Questions