Question
· Dec 19, 2017

SOLVED - Problem to execute Java Gateway Wizard in Atelier - Error message: ERROR #5023: Remote Gateway Error: java.lang.NoClassDefFoundError:

Hi ,

I have problem to run the Java Gateway Wizard in Eclipse with Atelier.

Eclipse version is the latest:

Atelier IDE is the latest stable version: version 1.0.284

Running on Windows 7 Enterprise

Ensemble server is version: Cache for Windows (x86-64) 2017.2 (Build 744U) Fri Sep 29 2017 10:58:27 EDT 

 

 

The JAR-file I am trying to import is a small example, it will just create two Apache Avro JSON-messages and write the result to a LOG-file.

Main JAR-file: DataLakeMessage.jar

Third-party JAR-files in a sub folder with the name lib:

  • avro-1.8.2.jar
  • avro-tools-1.8.2.jar
  • commons-logging.jar
  • jackson-core-asl-1.9.13.jar
  • jackson-mapper-asl-1.9.13.jar
  • log4j-1.2.15.jar

All JAR-files has a complete filepath and they are seperated with ;

C:\InterSystems\DataLakeMessage\lib\avro-1.8.2.jar;C:\InterSystems\DataLakeMessage\lib\avro-tools-1.8.2.jar;C:\InterSystems\DataLakeMessage\lib\commons-logging.jar;C:\InterSystems\DataLakeMessage\lib\jackson-core-asl-1.9.13.jar;C:\InterSystems\DataLakeMessage\lib\jackson-mapper-asl-1.9.13.jar;C:\InterSystems\DataLakeMessage\lib\log4j-1.2.15.jar;

 

 

Screen dump of Java GateWay Wizard:

Error messages

The same error messages in text:

ERROR #5023: Remote Gateway Error: java.lang.NoClassDefFoundError: Could not initialize class com.tieto.dataLake.content.data.Content_Data_Record
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at com.intersys.gateway.JavaGateway.loadClass(JavaGateway.java:1375)
at com.intersys.gateway.Generator.generate(Generator.java:168)
at com.intersys.gateway.Generator.generate(Generator.java:243)
at com.intersys.gateway.JavaGateway.generateClasses(JavaGateway.java:794)
at com.intersys.gateway.JavaGateway.processMessage(JavaGateway.java:565)
at com.intersys.gateway.JavaGateway.run(JavaGateway.java:548)
at com.intersys.gateway.JavaGateway.run(JavaGateway.java:519)
1

   org.apache.avro.data.RecordBuilder imported.

   org.apache.avro.data.RecordBuilderBase imported.

   org.apache.avro.specific.SpecificRecordBuilderBase imported.

 

 

Does anyone have any idea what is the problem?

Discussion (4)1
Log in or sign up to continue

Hello, Jan. It seems you are having a problem with the Java class loader. The team responsible for the Java Gateway forwarded the following suggestion. Could you please give it a try? If it doesn't help, please contact the WRC for further support.

java.lang.NoClassDefFoundError: Could not initialize class com.tieto.dataLake.content.data.Content_Data_Record is a Java class loader error typically means that the class loader ran into an exception when trying to load (read) the class. To make sure this is not a user error, I would suggest they try to write a small Java program that simply loads the above class (use Class.forName()), they might get the same error. If not, then it’s probably something to do with the static initializer, I imagine there must be one. They should try to catch an exception in it and that should provide more info on the actual error. A good example of what can go wrong is that they might try to access the file system, right there in the static initializer, and that the path or permissions are different in their dev environment, and on the machine where they try to import the class using the Java Gateway.

 

To avoid these kinds of errors, we have been advocating the use of a so called ‘façade approach’, where the user makes sure to build most of the app on the Java side, hiding all sorts of things like massive dependencies, big jar files, file system dependencies etc. etc. and exposing only that small app to Cache/Ensemble via the JG