Running into TextualTSFactory class not found exception running DynamicDslWorkflow using maven

I am trying to execute the DynamicDslWorkflow which is located in the temporal samples Github.

I created a new project locally using maven and migrated the DSL section of the examples into the new project that I have set up along with the required resources. when I try to execute the workflow I get the below error.

Exception in thread "main" java.lang.NoClassDefFoundError: com/fasterxml/jackson/core/base/TextualTSFactory
	at java.lang.ClassLoader.defineClass1(Native Method)
	at java.lang.ClassLoader.defineClass(ClassLoader.java:756)
	at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
	at java.net.URLClassLoader.defineClass(URLClassLoader.java:473)
	at java.net.URLClassLoader.access$100(URLClassLoader.java:74)
	at java.net.URLClassLoader$1.run(URLClassLoader.java:369)
	at java.net.URLClassLoader$1.run(URLClassLoader.java:363)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.net.URLClassLoader.findClass(URLClassLoader.java:362)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:418)
	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:355)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:351)
	at workflow.StartWorkflow.dslWorkflow(StartWorkflow.java:64)
	at workflow.StartWorkflow.main(StartWorkflow.java:51)
Caused by: java.lang.ClassNotFoundException: com.fasterxml.jackson.core.base.TextualTSFactory
	at java.net.URLClassLoader.findClass(URLClassLoader.java:387)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:418)
	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:355)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:351)
	... 14 more

Here is my pom file & I am running the project on oracle jdk8

<?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.practice.workflow</groupId>
    <artifactId>sample-workflow</artifactId>
    <version>1.0-SNAPSHOT</version>

    <properties>
        <maven.compiler.source>1.8</maven.compiler.source>
        <maven.compiler.target>1.8</maven.compiler.target>
        <serverlessworkflow.version>4.0.3.Final</serverlessworkflow.version>
        <jackson.version>2.13.3</jackson.version>
        <temporal.sdk.version>1.11.0</temporal.sdk.version>
    </properties>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>com.google.code.gson</groupId>
                <artifactId>gson</artifactId>
                <version>2.9.0</version>
            </dependency>
            <dependency>
                <groupId>com.fasterxml.jackson</groupId>
                <artifactId>jackson-bom</artifactId>
                <version>${jackson.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <repositories>
        <repository>
            <id>oss.sonatype.org-snapshot</id>
            <url>https://oss.sonatype.org/content/repositories/snapshots</url>
            <releases>
                <enabled>false</enabled>
            </releases>
            <snapshots>
                <enabled>true</enabled>
            </snapshots>
        </repository>
    </repositories>

    <dependencies>
        <!--    Logger Dependency    -->
        <dependency>
            <groupId>ch.qos.logback</groupId>
            <artifactId>logback-classic</artifactId>
            <version>1.2.11</version>
        </dependency>

        <!--    Temporal Dependencies    -->
        <dependency>
            <groupId>io.temporal</groupId>
            <artifactId>temporal-sdk</artifactId>
            <version>${temporal.sdk.version}</version>
        </dependency>

        <!--    Serverless Workflow Dependencies    -->
        <dependency>
            <groupId>io.serverlessworkflow</groupId>
            <artifactId>serverlessworkflow-api</artifactId>
            <version>${serverlessworkflow.version}</version>
        </dependency>
        <dependency>
            <groupId>io.serverlessworkflow</groupId>
            <artifactId>serverlessworkflow-spi</artifactId>
            <version>${serverlessworkflow.version}</version>
        </dependency>
        <dependency>
            <groupId>io.serverlessworkflow</groupId>
            <artifactId>serverlessworkflow-validation</artifactId>
            <version>${serverlessworkflow.version}</version>
        </dependency>
        <dependency>
            <groupId>io.serverlessworkflow</groupId>
            <artifactId>serverlessworkflow-diagram</artifactId>
            <version>${serverlessworkflow.version}</version>
        </dependency>
        <dependency>
            <groupId>io.serverlessworkflow</groupId>
            <artifactId>serverlessworkflow-util</artifactId>
            <version>${serverlessworkflow.version}</version>
        </dependency>

        <!--    Lombok Dependencies    -->

        <dependency>
            <groupId>org.projectlombok</groupId>
            <artifactId>lombok</artifactId>
            <version>1.18.24</version>
            <scope>compile</scope>
        </dependency>

        <!--    Json Dependencies    -->
        <dependency>
            <groupId>net.thisptr</groupId>
            <artifactId>jackson-jq</artifactId>
            <version>1.0.0-preview.20210928</version>
        </dependency>

        <!--    Jackson Core Dependencies    -->
        <dependency>
            <groupId>com.fasterxml.jackson.core</groupId>
            <artifactId>jackson-databind</artifactId>
        </dependency>
        <dependency>
            <groupId>com.fasterxml.jackson.core</groupId>
            <artifactId>jackson-core</artifactId>
        </dependency>
    </dependencies>
</project>

Have set up the temporal server using the docker-composer project on git.

It would be great if someone can help me out as to what I am missing when running the project using maven.

Hi @pvs_praneeth

This pom worked for me:

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

	<groupId>io.myproject</groupId>
	<artifactId>temporal-java-project</artifactId>
	<version>1.0-SNAPSHOT</version>
	<name>temporal-java-project</name>
	<description>Temporal Starter</description>

	<properties>
		<java.version>11</java.version>
		<maven.compiler.source>11</maven.compiler.source>
		<maven.compiler.target>11</maven.compiler.target>
		<version.temporal>1.12.0</version.temporal>
		<version.ch.qos.logback>1.2.6</version.ch.qos.logback>
		<version.commons.configuration>1.10</version.commons.configuration>
		<version.powermock>2.0.9</version.powermock>
		<version.mockito>4.0.0</version.mockito>
		<version.junit>4.13.2</version.junit>
		<version.junit.jupiter>5.8.1</version.junit.jupiter>
		<version.org.slf4j>1.7.26</version.org.slf4j>
		<java.module.name>${project.name}</java.module.name>
		<version.jq>1.0.0-preview.20210928</version.jq>
		<version.sw.sdk>4.0.3.Final</version.sw.sdk>
	</properties>

	<dependencies>
		<dependency>
			<groupId>io.temporal</groupId>
			<artifactId>temporal-sdk</artifactId>
			<version>${version.temporal}</version>
		</dependency>

		<!-- serverless workflow java sdk -->
		<dependency>
			<groupId>io.serverlessworkflow</groupId>
			<artifactId>serverlessworkflow-api</artifactId>
			<version>${version.sw.sdk}</version>
		</dependency>
		<dependency>
			<groupId>io.serverlessworkflow</groupId>
			<artifactId>serverlessworkflow-validation</artifactId>
			<version>${version.sw.sdk}</version>
		</dependency>
		<dependency>
			<groupId>io.serverlessworkflow</groupId>
			<artifactId>serverlessworkflow-spi</artifactId>
			<version>${version.sw.sdk}</version>
		</dependency>
		<dependency>
			<groupId>io.serverlessworkflow</groupId>
			<artifactId>serverlessworkflow-util</artifactId>
			<version>${version.sw.sdk}</version>
		</dependency>

		<dependency>
			<groupId>ch.qos.logback</groupId>
			<artifactId>logback-classic</artifactId>
			<version>${version.ch.qos.logback}</version>
		</dependency>
		<dependency>
			<groupId>commons-configuration</groupId>
			<artifactId>commons-configuration</artifactId>
			<version>${version.commons.configuration}</version>
		</dependency>

		<!-- jq -->
		<dependency>
			<groupId>net.thisptr</groupId>
			<artifactId>jackson-jq</artifactId>
			<version>${version.jq}</version>
		</dependency>

		<!-- Testing depends -->
		<dependency>
			<groupId>io.temporal</groupId>
			<artifactId>temporal-testing</artifactId>
			<scope>test</scope>
			<version>${version.temporal}</version>
		</dependency>

		<dependency>
			<groupId>junit</groupId>
			<artifactId>junit</artifactId>
			<scope>test</scope>
			<version>${version.junit}</version>
		</dependency>
		<dependency>
			<groupId>org.junit.jupiter</groupId>
			<artifactId>junit-jupiter-api</artifactId>
			<scope>test</scope>
			<version>${version.junit.jupiter}</version>
		</dependency>
		<dependency>
			<groupId>org.junit.jupiter</groupId>
			<artifactId>junit-jupiter-engine</artifactId>
			<scope>test</scope>
			<version>${version.junit.jupiter}</version>
		</dependency>
		<dependency>
			<groupId>org.junit.vintage</groupId>
			<artifactId>junit-vintage-engine</artifactId>
			<scope>test</scope>
			<version>${version.junit.jupiter}</version>
		</dependency>
		<dependency>
			<groupId>org.powermock</groupId>
			<artifactId>powermock-api-mockito2</artifactId>
			<scope>test</scope>
			<version>${version.powermock}</version>
		</dependency>
		<dependency>
			<groupId>org.mockito</groupId>
			<artifactId>mockito-core</artifactId>
			<scope>test</scope>
			<version>${version.mockito}</version>
		</dependency>
	</dependencies>

	<build>
		<sourceDirectory>src/main/java</sourceDirectory>
		<plugins>
			<plugin>
				<artifactId>maven-compiler-plugin</artifactId>
				<version>3.8.1</version>
				<configuration>
					<source>${java.version}</source>
					<target>${java.version}</target>
				</configuration>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-surefire-plugin</artifactId>
				<version>3.0.0-M4</version>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-jar-plugin</artifactId>
				<version>3.2.0</version>
				<executions>
					<execution>
						<id>default-jar</id>
					</execution>
					<!-- No OSGi manifestEntries for <goal>jar</goal>: if it supported, then felix has already added them -->
					<execution>
						<id>test-jar</id>
						<goals>
							<goal>test-jar</goal>
						</goals>
						<configuration>
							<skipIfEmpty>true</skipIfEmpty>
							<excludes>
								<exclude>**/logback-test.xml</exclude>
								<exclude>**/jndi.properties</exclude>
							</excludes>
							<archive>
								<manifestEntries>
									<Bundle-SymbolicName>${java.module.name}.tests</Bundle-SymbolicName>
									<Bundle-Version>
										${parsedVersion.majorVersion}.${parsedVersion.minorVersion}.${parsedVersion.incrementalVersion}.${osgi.snapshot.qualifier}
									</Bundle-Version>
									<Bundle-Name>${project.name}</Bundle-Name>
									<Bundle-Vendor>${project.organization.name}</Bundle-Vendor>
								</manifestEntries>
							</archive>
						</configuration>
					</execution>
				</executions>
				<configuration>
					<archive>
						<manifest>
							<addDefaultSpecificationEntries>true</addDefaultSpecificationEntries>
							<addDefaultImplementationEntries>true</addDefaultImplementationEntries>
						</manifest>
					</archive>
				</configuration>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-dependency-plugin</artifactId>
				<version>3.2.0</version>
				<executions>
					<execution>
						<goals>
							<goal>sources</goal>
							<goal>resolve</goal>
						</goals>
					</execution>
				</executions>
			</plugin>
		</plugins>
	</build>
</project>

You could run
mvn dependency:tree > depends.txt
against the pom you provided and check if there are multiple versions of com.fasterxml.jackson.core:jackson-core being pulled in.
Hope this helps.

Thanks, @tihomir. I was able to find the issue in my system after running the dependency: tree