You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@camel.apache.org by lb <lb...@gmail.com> on 2016/03/02 17:24:28 UTC

yaml dataformat

Hi,

I'm writing a yaml dataformat which is implemented like the json
dataformat so with the possibility to choose the library to use (even
as today there is only one implementation) and I've an issue as my
component fails to install because of the following error:

Error loading dataformat model from camel-core. Reason:
java.io.FileNotFoundException:
/opt/maven-repo/org/apache/camel/camel-core/2.17-SNAPSHOT/camel-core-2.17-SNAPSHOT.jar/org/apache/camel/model/dataformat/yaml-snakeyaml.json
(Not a directory)


If I change the service defintion name in META-INF from yaml-snakeyaml
to yaml it works however for json like data-formats, the service name
is - as example - json-gson.

You can find my code here:
https://github.com/lburgazzoli/apache-camel/commit/b3d1e1b81fc599cf536091d9108974f229b4fd61


Am I missing something ?


Best regards,
Luca

Re: yaml dataformat

Posted by lb <lb...@gmail.com>.
Hi,

I've finally managed to solve this issue by including yaml-snakeyaml
in org.apache.camel.maven.packaging.PackageDataFormatMojo's special
data formats handling:


private static String asModelName(String name) {
    // special for some data formats
    if ("json-gson".equals(name) || "json-jackson".equals(name) ||
"json-xstream".equals(name)) {
        return "json";
    } else if ("bindy-csv".equals(name) || "bindy-fixed".equals(name)
|| "bindy-kvp".equals(name)) {
        return "bindy";
    } else if ("zipfile".equals(name)) {
        // darn should have been lower case
        return "zipFile";
    } else if ("yaml-snakeyaml".equals(name)) {
        return "yaml";
    }
    return name;
}




On Wed, Mar 2, 2016 at 5:24 PM, lb <lb...@gmail.com> wrote:
> Hi,
>
> I'm writing a yaml dataformat which is implemented like the json
> dataformat so with the possibility to choose the library to use (even
> as today there is only one implementation) and I've an issue as my
> component fails to install because of the following error:
>
> Error loading dataformat model from camel-core. Reason:
> java.io.FileNotFoundException:
> /opt/maven-repo/org/apache/camel/camel-core/2.17-SNAPSHOT/camel-core-2.17-SNAPSHOT.jar/org/apache/camel/model/dataformat/yaml-snakeyaml.json
> (Not a directory)
>
>
> If I change the service defintion name in META-INF from yaml-snakeyaml
> to yaml it works however for json like data-formats, the service name
> is - as example - json-gson.
>
> You can find my code here:
> https://github.com/lburgazzoli/apache-camel/commit/b3d1e1b81fc599cf536091d9108974f229b4fd61
>
>
> Am I missing something ?
>
>
> Best regards,
> Luca