Olga Vashchenko
Olga Vashchenko

Reputation: 45

org.apache.camel.NoSuchLanguageException: No language could be found for: simple

I have the following exception: org.apache.camel.NoSuchLanguageException: No language could be found for: simple when calling DefaultCamelContext.start();

In my route I need to use .recipientList(exchangeProperty("name")) and that's why I've migrated from Camel 2.12.0 to Camel 3.4.0 and now I can't even start the context.

pom.xml relevant dependencies:

  <dependencies>
      <dependency>
        <groupId>org.apache.camel</groupId>
        <artifactId>camel-api</artifactId>
        <version>3.4.0</version>
    </dependency>
    <dependency>
        <groupId>org.apache.camel</groupId>
        <artifactId>camel-base</artifactId>
        <version>3.4.0</version>
    </dependency>
    <dependency>
        <groupId>org.apache.camel</groupId>
        <artifactId>camel-language</artifactId>
        <version>3.4.0</version>
    </dependency>    
    <dependency>
        <groupId>org.apache.camel</groupId>
        <artifactId>camel-jetty</artifactId>
        <version>3.4.0</version>
    </dependency>
    <dependency>
        <groupId>org.apache.camel</groupId>
        <artifactId>camel-http</artifactId>
        <version>3.4.0</version>
    </dependency>   
  </dependencies>

I added camel-language just in case.

I know about the module system, I've already tried the dependencyManagement block from the tutorial (https://camel.apache.org/releases/release-3.4.0/) and got the same error. So I decided not to include unnecessary jars.

I develop in Eclipse IDE (version 2021-03). Maven automatically choses J2SE-1.5 system library (however my default JRE is 1.8) and I can't change it: after updating maven project it gets back to 1.5.

Here's the full stackTrace with some DEBUG messages:

[                          main] ResolverHelper                 DEBUG Lookup Language with name simple in registry. Found: null
[                          main] ResolverHelper                 DEBUG Lookup Language with name simple-language in registry. Found: null
org.apache.camel.NoSuchLanguageException: No language could be found for: simple
    at org.apache.camel.impl.engine.DefaultLanguageResolver.noSpecificLanguageFound(DefaultLanguageResolver.java:92)
    at org.apache.camel.impl.engine.DefaultLanguageResolver.resolveLanguage(DefaultLanguageResolver.java:68)
    at org.apache.camel.impl.engine.AbstractCamelContext.resolveLanguage(AbstractCamelContext.java:1730)
    at org.apache.camel.impl.engine.AbstractCamelContext.doStartStandardServices(AbstractCamelContext.java:3205)
    at org.apache.camel.impl.DefaultCamelContext.doStartStandardServices(DefaultCamelContext.java:297)
    at org.apache.camel.impl.engine.AbstractCamelContext.forceLazyInitialization(AbstractCamelContext.java:3148)
    at org.apache.camel.impl.engine.AbstractCamelContext.doInit(AbstractCamelContext.java:2550)
    at org.apache.camel.support.service.BaseService.init(BaseService.java:83)
    at org.apache.camel.impl.engine.AbstractCamelContext.init(AbstractCamelContext.java:2435)
    at org.apache.camel.support.service.BaseService.start(BaseService.java:111)
    at org.apache.camel.impl.engine.AbstractCamelContext.start(AbstractCamelContext.java:2452)
    at my.camel.MainApp.main(MainApp.java:16)

Any help will be appreciated :)

Upvotes: 3

Views: 4815

Answers (1)

Philip Wrage
Philip Wrage

Reputation: 1559

I don't see camel-core as one of your dependencies, as documented at the URL you provided.

According to the documentation on expression languages, the Simple language is provided as part of the camel-core-languages artifact, which is a compile dependency of camel-core.

I would suggest trying the Camel POM for dependency management again, making sure to explicitly include the camel-core artifact as a dependency. If camel-core alone doesn't solve your issue, then consider adding camel-core-languages as well.

<dependencyManagement>
  <dependencies>
    <dependency>
      <groupId>org.apache.camel</groupId>
      <artifactId>camel-bom</artifactId>
      <version>3.4.0</version>
      <type>pom</type>
      <scope>import</scope>
    </dependency>
  </dependencies>
</dependencyManagement>

<dependencies>
  <dependency>
    <groupId>org.apache.camel</groupId>
    <artifactId>camel-core</artifactId>
  </dependency>
  <dependency>
    <groupId>org.apache.camel</groupId>
    <artifactId>camel-core-languages</artifactId>
  </dependency>
</dependencies>

Upvotes: 4

Related Questions