question-mark
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.

No TypeSerializer found for the specified column

See original GitHub issue

Adding a custom TypeMapper results in runtime exception at code generation.

I’ve tried both, adding the TypeMapper as a component, and directly to the typeMappers section of the pom file. I can confirm that the TypeMapper is in the class path it’s available under the TypeMapperComponent in the GUI.

This is the TypeMapper in question:

public class Vector2Mapper implements TypeMapper<String, Vector2> {
    public String getLabel() {
        return "String to Vector2";
    }

    public Type getJavaType(Column column) {
        return Vector2.class;
    }

    public Category getJavaTypeCategory(Column column) {
        return Category.REFERENCE;
    }

    public Vector2 toJavaType(Column column, Class<?> entityType, String value) {
        if (value == null) {
            return null;
        }

        return new Vector2(value);
    }

    public String toDatabaseType(Vector2 value) {
        if (value == null) {
            return null;
        }

        return value.toString();
    }

    public Ordering getOrdering() {
        return Ordering.RETAIN;
    }
}

This is my pom file:

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">

    <modelVersion>4.0.0</modelVersion>

    <groupId>com.example</groupId>
    <artifactId>demo</artifactId>
    <version>1.0.0-SNAPSHOT</version>
    <packaging>pom</packaging>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <maven.compiler.source>1.10</maven.compiler.source>
        <maven.compiler.target>1.10</maven.compiler.target>
        <speedment.enterprise.version>1.1.17</speedment.enterprise.version>
    </properties>

    <dependencies>
        <dependency>
            <groupId>org.mariadb.jdbc</groupId>
            <artifactId>mariadb-java-client</artifactId>
            <version>2.2.1</version>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>com.speedment.enterprise</groupId>
            <artifactId>virtualcolumn-runtime</artifactId>
            <version>${speedment.enterprise.version}</version>
        </dependency>
        <dependency>
            <groupId>com.speedment.enterprise</groupId>
            <artifactId>datastore-runtime</artifactId>
            <version>${speedment.enterprise.version}</version>
        </dependency>
        <dependency>
            <groupId>com.speedment</groupId>
            <artifactId>runtime</artifactId>
            <version>3.0.22</version>
            <type>pom</type>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>com.speedment.enterprise</groupId>
                <artifactId>speedment-enterprise-maven-plugin</artifactId>
                <version>${speedment.enterprise.version}</version>

                <configuration>
                    <typeMappers>
                        <typeMapper>
                            <databaseType>java.lang.String</databaseType>
                            <implementation>com.manulaiko.kalaazu.persistence.database.Vector2Mapper</implementation>
                        </typeMapper>
                    </typeMappers>
                    <components>
                        <component>com.speedment.enterprise.virtualcolumn.tool.VirtualColumnToolBundle</component>
                        <component>com.speedment.enterprise.datastore.tool.DataStoreToolBundle</component>
                    </components>
                    <parameters>
                        <parameter>
                            <name>licenseKey</name>
                            <value>omited</value>
                        </parameter>
                    </parameters>
                </configuration>
            </plugin>
        </plugins>
    </build>

    <repositories>
        <repository>
            <id>speedment-enterprise</id>
            <name>Speedment Enterprise Repositories</name>
            <url>https://repo.speedment.com/nexus/content/repositories/releases/</url>
        </repository>
    </repositories>

    <pluginRepositories>
        <pluginRepository>
            <id>speedment-enterprise</id>
            <name>Speedment Enterprise Repositories</name>
            <url>https://repo.speedment.com/nexus/content/repositories/releases/</url>
        </pluginRepository>
    </pluginRepositories>
</project>

This is the output of speedment:generate:

[INFO] Scanning for projects...
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building demo 1.0.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] --- speedment-enterprise-maven-plugin:1.1.17:generate (default-cli) @ demo ---
MavenProject: com.example:demo:1.0.0-SNAPSHOT @ /home/manulaiko/Programming/Java/b/pom.xml
MavenProject: com.example:demo:1.0.0-SNAPSHOT @ /home/manulaiko/Programming/Java/b/pom.xml
MavenProject: com.example:demo:1.0.0-SNAPSHOT @ /home/manulaiko/Programming/Java/b/pom.xml
2018-04-23T19:57:48.246873Z INFO  [main] (LICENSE) - License: 99c7c95aeeb28e8f for [datastore, db2, mssql, oracle, virtual-columns], valid 2018-04-23 to 2018-05-23
2018-04-23T19:57:48.425323Z INFO  [main] (c.s.c.i.i.InjectorBuilderImpl) - No configuration file '/home/manulaiko/Programming/Java/b/settings.properties' found.
2018-04-23T19:57:51.174836Z INFO  [main] (LICENSE) - License: 99c7c95aeeb28e8f for [datastore, db2, mssql, oracle, virtual-columns], valid 2018-04-23 to 2018-05-23
[INFO] Starting speedment:generate
MavenProject: com.example:demo:1.0.0-SNAPSHOT @ /home/manulaiko/Programming/Java/b/pom.xml
[INFO] Generating code using JSON configuration file: '/home/manulaiko/Programming/Java/b/src/main/json/speedment.json'.
MavenProject: com.example:demo:1.0.0-SNAPSHOT @ /home/manulaiko/Programming/Java/b/pom.xml
Generating code:
....................................................................................
Clearing existing files
Checking write-once classes:
............................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................
Writing write-always classes:
2018-04-23T19:58:05.648823Z ERROR [main] (c.s.m.a.AbstractGenerateMojo) - Error parsing configFile file.
java.lang.RuntimeException: No TypeSerializer found for the specified column 'ColumnImpl {"autoIncrement": false, "biDirectional": false, "databaseType": "java.lang.String", "enabled": true, "expanded": true, "id": "position", "lowCardinality": false, "name": "position", "nameProtected": true, "nullable": false, "nullableImplementation": "OPTIONAL", "ordinalPosition": 5, "typeMapper": "com.manulaiko.kalaazu.persistence.database.Vector2Mapper", "unindexed": false}' table 'accounts_ships'.
	at com.speedment.enterprise.datastore.generator.component.TypeSerializerComponent.lambda$getOrThrow$0(TypeSerializerComponent.java:49)
	at java.base/java.util.Optional.orElseThrow(Optional.java:397)
	at com.speedment.enterprise.datastore.generator.component.TypeSerializerComponent.getOrThrow(TypeSerializerComponent.java:47)
	at com.speedment.common.mapstream.MapStream.lambda$fromValues$1(MapStream.java:147)
	at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:195)
	at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:195)
	at java.base/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:177)
	at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:195)
	at java.base/java.util.Spliterators$ArraySpliterator.tryAdvance(Spliterators.java:958)
	at java.base/java.util.stream.ReferencePipeline.forEachWithCancel(ReferencePipeline.java:127)
	at java.base/java.util.stream.AbstractPipeline.copyIntoWithCancel(AbstractPipeline.java:502)
	at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:488)
	at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474)
	at java.base/java.util.stream.MatchOps$MatchOp.evaluateSequential(MatchOps.java:230)
	at java.base/java.util.stream.MatchOps$MatchOp.evaluateSequential(MatchOps.java:196)
	at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
	at java.base/java.util.stream.ReferencePipeline.allMatch(ReferencePipeline.java:533)
	at com.speedment.enterprise.datastore.generator.internal.code.GeneratedEntityStoreSerializerTranslator.lambda$makeCodeGenModel$19(GeneratedEntityStoreSerializerTranslator.java:112)
	at com.speedment.generator.translator.AbstractJavaClassTranslator$BuilderImpl.lambda$wrap$0(AbstractJavaClassTranslator.java:264)
	at com.speedment.generator.translator.AbstractJavaClassTranslator$BuilderImpl.lambda$act$2(AbstractJavaClassTranslator.java:286)
	at java.base/java.util.concurrent.CopyOnWriteArrayList.forEach(CopyOnWriteArrayList.java:804)
	at com.speedment.generator.translator.AbstractJavaClassTranslator$BuilderImpl.act(AbstractJavaClassTranslator.java:285)
	at com.speedment.generator.translator.AbstractJavaClassTranslator$BuilderImpl.lambda$build$6(AbstractJavaClassTranslator.java:302)
	at java.base/java.util.Optional.ifPresent(Optional.java:172)
	at com.speedment.generator.translator.AbstractJavaClassTranslator$BuilderImpl.build(AbstractJavaClassTranslator.java:302)
	at com.speedment.generator.translator.AbstractJavaClassTranslator$BuilderImpl.build(AbstractJavaClassTranslator.java:192)
	at com.speedment.enterprise.datastore.generator.internal.code.GeneratedEntityStoreSerializerTranslator.makeCodeGenModel(GeneratedEntityStoreSerializerTranslator.java:474)
	at com.speedment.enterprise.datastore.generator.internal.code.GeneratedEntityStoreSerializerTranslator.makeCodeGenModel(GeneratedEntityStoreSerializerTranslator.java:63)
	at com.speedment.generator.translator.AbstractJavaClassTranslator.get(AbstractJavaClassTranslator.java:144)
	at com.speedment.generator.translator.AbstractJavaClassTranslator.get(AbstractJavaClassTranslator.java:62)
	at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:195)
	at java.base/java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1492)
	at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:484)
	at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474)
	at java.base/java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:913)
	at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
	at java.base/java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:578)
	at com.speedment.generator.core.internal.translator.TranslatorManagerHelper.accept(TranslatorManagerHelper.java:142)
	at com.speedment.generator.core.translator.AbstractTranslatorManager.accept(AbstractTranslatorManager.java:54)
	at com.speedment.enterprise.virtualcolumn.generator.internal.VirtualColumnTranslatorManager.accept(VirtualColumnTranslatorManager.java:53)
	at com.speedment.maven.abstractmojo.AbstractGenerateMojo.execute(AbstractGenerateMojo.java:68)
	at com.speedment.maven.abstractmojo.AbstractSpeedmentMojo.execute(AbstractSpeedmentMojo.java:123)
	at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:207)
	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
	at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
	at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
	at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
	at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
	at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307)
	at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193)
	at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106)
	at org.apache.maven.cli.MavenCli.execute(MavenCli.java:863)
	at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:288)
	at org.apache.maven.cli.MavenCli.main(MavenCli.java:199)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:564)
	at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
	at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
	at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
	at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
	at org.codehaus.classworlds.Launcher.main(Launcher.java:47)

[ERROR] Error parsing configFile file.
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 24.132 s
[INFO] Finished at: 2018-04-23T21:58:05+02:00
[INFO] Final Memory: 18M/64M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.speedment.enterprise:speedment-enterprise-maven-plugin:1.1.17:generate (default-cli) on project demo: Error parsing configFile file. No TypeSerializer found for the specified column 'ColumnImpl {"autoIncrement": false, "biDirectional": false, "databaseType": "java.lang.String", "enabled": true, "expanded": true, "id": "position", "lowCardinality": false, "name": "position", "nameProtected": true, "nullable": false, "nullableImplementation": "OPTIONAL", "ordinalPosition": 5, "typeMapper": "com.manulaiko.kalaazu.persistence.database.Vector2Mapper", "unindexed": false}' table 'accounts_ships'. -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException

I’ve tried with different versions of the plugins since the generated pom file in the website seems outdated.

I’m running Java 10 and the error persists with JDK 8.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:22 (14 by maintainers)

github_iconTop GitHub Comments

1reaction
minborgcommented, Apr 23, 2018

Ok. I will try to reproduce on my end.

0reactions
minborgcommented, Apr 24, 2018

Ops. Not my day today apparently. speedment-enterprise is a private repository.

Please mail me: minborg (at) speedment.com

Read more comments on GitHub >

github_iconTop Results From Across the Web

speedment/speedment - Gitter
Hi I'm trying to query via speedment, when executed i'm getting this error. Error executing SELECT id, agent, channelId FROM playground.sample WHERE ...
Read more >
change data structure of dynamodb data - python
I've to ingest dynamodb data to elastic search. But I'm getting dynamodb data in the format. If I ingest this format to ES...
Read more >
JsonTypeInfo is ignored when serializing a list of annotated ...
It seems that JsonTypeInfo is somehow ignored when serializing a list of annotated object. The following is some piece of code describing the...
Read more >
StreamTableEnvironment (Flink : 1.13-SNAPSHOT API)
Converts the given DataStream into a Table with specified field names. ... BigDecimal > // === EXAMPLE 1 === // no physical columns...
Read more >
squalor - Go Packages
An error expression is created if no columns are specified. func (*Table) Delete ¶. func (t *Table) Delete(tables ...*Table) ...
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 Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found