[NTM] HANA STUDIO NoClassDefFoundError: javax/xml/soap/SOAPException

Sometimes, when I am looking for the solution to a problem by googling, I find my own blog posts or forum replies. These found-again solutions are one of the nice returns from prolonged activity in forums and usually a reminder of how much my detail memory behaves like a colander sometimes…

Anyhow, this is one of those cases, that I found myself digging up multiple times over the course of the past year. So I figured, I’ll make a note to myself (NTM) and put it into a blog post for even easier retrieval in the future.

Update 25.11.2020

After I don’t know how many months, SAP has finally decided to provide an updated HANA Eclipse Plugin that works with Java 11.

Just go and get it at https://tools.hana.ondemand.com/#hanatools, respectively install it into your Eclipse 2020-09 (4.17).

This means: the whole mucking around with the java version on your machine is finally over.

Original post

https://answers.sap.com/questions/698488/eclipse-photon-connection-to-hana-express.html, 04.12.2018

Problem

The connection to the HANA express edition fails with an “java.lang.NoClassDefFoundError: javax/xml/soap/SOAPException” error.

Solution

Based on the information on StackOverflow (here) this problem is caused by

  • using a JDK newer than JDK 8

and

  • the fact that the package that contains code for XML/SOAP handling had been moved to a different Java module

The easy fix

I’m no JDK expert, but the easiest solution I found working for me was to make sure that my eclipse uses the JDK 8 on my mac.

First, I checked what JDKs are installed and where they are located:

> /usr/libexec/java_home -V
Matching Java Virtual Machines (3):
    11.0.1, x86_64:	"OpenJDK 11.0.1"	/Library/Java/JavaVirtualMachines/openjdk-11.0.1.jdk/Contents/Home
    1.8.0_191, x86_64:	"Java SE 8"	/Library/Java/JavaVirtualMachines/jdk1.8.0_191.jdk/Contents/Home
    1.8.0_181, x86_64:	"Java SE 8"	/Library/Java/JavaVirtualMachines/jdk1.8.0_181.jdk/Contents/Home

/Library/Java/JavaVirtualMachines/openjdk-11.0.1.jdk/Contents/Home

This means, there are 3 JDKs on my machine in total (two for JAVA SE 8 and for JAVA 11). The newest one (JDK 11) is the default JDK.

That’s the one (the latest) eclipse on macOS uses by default. To change that, you open the ECLIPSE package contents (right-click on the application icon and choose “Show Package Contents”) and edit the ./Contents/info.plist file. macOS uses this file to determine the runtime environment for the application.

This XML file has a section/key for “Eclipse” – including a comment on how to set a specific JDK VM.
I inserted the <string> section for the most recent JDK 8 (1.8.0_191) on my computer like so:

<key>Eclipse</key>
 <array>
 <!-- to use a specific Java version (instead of the platform's default) uncomment one of the following options,
 or add a VM found via $/usr/libexec/java_home -V
 <string>-vm</string><string>/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Commands/java</string>
 <string>-vm</string><string>/Library/Java/JavaVirtualMachines/1.8.0.jdk/Contents/Home/bin/java</string>
 -->
<string>-vm</string> 
<string>/Library/Java/JavaVirtualMachines/jdk1.8.0_191.jdk/Contents/Home/bin/java</string>
 <string>-keyring</string>
      <string>~/.eclipse_keyring</string>
 </array>

After saving this file, restart eclipse as usual and the problem should be solved.

Geek and Poke cartoon: developer saying "on my machine it works" to another developer
Geek and Poke: Advanced YIW = OMMIW

It works on my machine ;-)).

There you go, now you know!

2 thoughts on “[NTM] HANA STUDIO NoClassDefFoundError: javax/xml/soap/SOAPException”

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.