Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
gnemethartemis
Contributor
Contributor

Custom Input component: java.lang.NoClassDefFoundError: routines/system/DynamicMetadata

Hello Everyone,

I created a simple input component which subscribes to an event bus, and produces Records based on the input.

The component works well in IntelliJ, passes the tests.

When deployed to TOS the "Guess Schema" action also works, and returns a valid schema.

However when I run the job and the first message arrives java.lang.NoClassDefFoundError: routines/system/DynamicMetadata is thrown. It happens when the runtime tries to cast the Record returned by the input component to the type created from the schema.

Does anyone have any idea, how to fix it?

I understand that the DynamicMetadata is an enterprise only feature, and I don't need it.

Thank you In Advance,

Gabor

Labels (4)
12 Replies
Anonymous
Not applicable

Hi Team,

 

I hope you are doing good.

Is the error: java.lang.NoClassDefFoundError: routines/system/DynamicMetadata observed when the job is run locally from the studio?

Please try to build the job and check the routines that get packaged to the .zip file.

The zip should have the Dynamic Metadata in the routines/system path.

Thanks in advance.

gnemethartemis
Contributor
Contributor
Author

Hi asaxena,

 

Thank you for your reply.

 

Unfortunately the error is thrown both in TOS and when running as a standalone job.

 

I went ahead and built a schema from the studio supplied information and provide that for the RecordBuilder, but it didn't help either.

 

Gabor

 

Here is how the record is built :

------------

private Record buildRecord(Map<String, Object> source){

if (source == null) return null;

System.out.println("Building record");

 

buildSchema();

if (this.schema == null) System.out.println("There is NO schema defined");

else System.out.println("Schema is defined");

Record.Builder rb = this.schema == null ? builderFactory.newRecordBuilder() : builderFactory.newRecordBuilder(schema);

for (String s : source.keySet()){

Object value = source.get(s);

if (value == null) continue;

if (value instanceof String) rb.withString(s, (String)value);

else if (value instanceof Boolean) rb.withBoolean(s, (boolean)value);

else if (value instanceof Date) rb.withDateTime(s, (Date)value);

else if (value instanceof Long) rb.withLong(s, (long) value);

else if (value instanceof Float) rb.withFloat(s, (long) value);

}

return rb.build();

}

--------------------

 

Here is the whole output for the job:

 .\connectorTest_run.ps1

outgoing schema is defined

SchemaInfo(label=__replayid__, key=true, talendType=id_Long, nullable=false, pattern=)

SchemaInfo(label=CreatedById, key=false, talendType=id_String, nullable=true, pattern=)

SchemaInfo(label=CreatedDate, key=false, talendType=id_String, nullable=true, pattern=)

SchemaInfo(label=Location__c, key=false, talendType=id_String, nullable=true, pattern=)

SchemaInfo(label=Urgent__c, key=false, talendType=id_Boolean, nullable=false, pattern=)

Handshake message

{ext={replay=true, payload.format=true}, minimumVersion=1.0, clientId=9ie1tc6txy2vktgullgebxs4j4zs, supportedConnectionTypes=[Ljava.lang.Object;@7cdb56b5, channel=/meta/handshake, id=1, version=1.0, successful=true}

Building record

Schema is defined

[statistics] disconnected

Exception in thread "main" java.lang.NoClassDefFoundError: routines/system/DynamicMetadata

    at java.base/java.lang.Class.getDeclaredMethods0(Native Method)

    at java.base/java.lang.Class.privateGetDeclaredMethods(Class.java:3402)

    at java.base/java.lang.Class.getDeclaredMethod(Class.java:2673)

    at org.talend.sdk.component.runtime.record.RecordConverters$MappingMeta.newInstance(RecordConverters.java:479)

    at org.talend.sdk.component.runtime.record.RecordConverters.toType(RecordConverters.java:268)

    at platformevent.connectortest_0_1.connectorTest.SfPlatformEventPlatformEventInput_1Process(connectorTest.java:838)

    at platformevent.connectortest_0_1.connectorTest.runJobInTOS(connectorTest.java:1496)

    at platformevent.connectortest_0_1.connectorTest.main(connectorTest.java:1327)

Caused by: java.lang.ClassNotFoundException: routines.system.DynamicMetadata

    at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:641)

    at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:188)

    at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:520)

    ... 8 more

Anonymous
Not applicable

Hi

Please provide the following information for us to be more better evaluate the issue:

 

- Product version (such as Talend Cloud Real-Time Big Data Platform (7.3.120200219_1130)

- Operating System (such as Windows 10, 64 bit)

- Java version (such as Oracle JDK build 11.0.8+10-LTS)

 

Regards

Shong

gnemethartemis
Contributor
Contributor
Author

Hi,

 

  • Product version: TOS_DI-20211109_1610-V8.0.1
  • Operating System: Windows 10 pro 64 bit,
  • Java version: openjdk 11.0.14.1 2022-02-08 LTS
    • OpenJDK Runtime Environment Zulu11.54+25-CA (build 11.0.14.1+1-LTS)
    • OpenJDK 64-Bit Server VM Zulu11.54+25-CA (build 11.0.14.1+1-LTS, mixed mode)

 

Best Regards,

Gabor

Ulrich_Wohlfeil
Contributor
Contributor

Hi,

 

I can reproduce this bug with the component kit version 1.38.6 and also the newest version 1.51.2.

 

  • Product version: TOS_DI-20211109_1610-V8.0.1
  • Operating System: Linux
  • Java version: openjdk 11.0.17 2022-10-18
  • Talend Component Kit 1.38.6 and 1.51.2

 

Currently Talend 8.x does not seem to have a compatible Talend Component Kit version.

 

Best regards

Uli

Ulrich_Wohlfeil
Contributor
Contributor

Update:

as expected, same problem under Windows 10.

Problem does not exists in TOS 7.3.1

 

Anonymous
Not applicable

Hello,

 

I don't have a final fixVersion but component-runtime soon will include a fix for this. So in theory once that is released you can use the latest runtime and it will be compatible with TOS as well. https://jira.talendforge.org/browse/TCOMP-2165

 

Sorry about the inconvenience caused!

 

Regards,

Balázs

Hieu_Trung
Contributor
Contributor

Hi, how can I update latest runtime to my TOS?

Anonymous
Not applicable

basically you have to build your component with the latest version of component kit runtime, as of now 1.60

https://talend.github.io/component-runtime/main/latest/index.html

 

That version should work with TOS 8.0 too, but some features might require Talend 8.0 with monthly release of R2023-09 as the framework itself constantly evolving.