on 2018 Dec 04 12:35 AM
The connection to the HANA express edition fails with a "java.lang.NoClassDefFoundError: javax/xml/soap/SOAPException" error.
The VM is up and running and I can connect from the VM console using SYSTEM.
I have verified that java home is set correctly both in terminal and eclipse.
This is what I get with java -version on terminal
p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; color: #000000} span.s1 {font-variant-ligatures: no-common-ligatures}
'java version "11.0.1" 2018-10-16 LTS
Java(TM) SE Runtime Environment 18.9 (build 11.0.1+13-LTS)
Java HotSpot(TM) 64-Bit Server VM 18.9 (build 11.0.1+13-LTS, mixed mode)
The current version of the jdk in Eclipse is "/Library/Java/JavaVirtualMachines/jdk-11.0.1.jdk/Contents/Home".
I have uninstalled and reinstalled eclipse several times but with no success.
Everything is fine with the HANA express install on the VM. It's just that I cant figure out as to why eclipse fails to connect when I try to add the system. I have also confirmed that it is not a firewall issue.
Any pointers would be appreocated
Based on the information on stackoverflow ( here) this problem is caused by
and
I'm not a 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 on the machine 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 (in the Applications folder) and edit the ./Contents/info.plist file. This file is used by macOS to determine the runtime environment for the application.
In this XML file there is a section for "Eclipse" with a comment that instructs you how to set a specific JDK VM.
I simply inserted the <string> section for my most recent JDK 8 (1.8.0_191) 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 (it is on my machine ;-)).
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you Lars. I appreciate the response. The problem turned out to be the port number.
It was selecting 39015 as the port number by default. I forced it to go to 39013 through the tenant option by inputting SYTEMDB:39013 and that seems to have worked.
There was one trick that I discovered by accident. The VM was up and running and it would still give me the same exception even after I changed the port. I shutdown the VM, changed the port in eclipse and saved the connection. I then turned on the VM and then double clicked on the connection and it worked. Now I cant say for sure whether this is required for anyone else encountering the same issue but just wanted to mention in case it helps someone.
Again, thanks for the response.
Yeah, na, this is not the solution amlan.bardhan!
What you've done is simply avoid that HANA Studio uses the XML library code (for now). The next time you try and set up a connection to a different system you will run into the same issue again.
The reason for why the error occurs in the first place is that HANA studio tries to read some meta-data information about the HANA system when it sets up the connection (e.g. what other hosts would be there if this was a scale-out system).
Anyhow, if you're happy with using your "trick", that's fine with me, too.
Hi Lars, your solution worked perfectly, thanks so much! amlan.bardhan you should accept the answer 🙂
Extending the solution by Lars for Windows users, you need to do similar changes in eclipse.ini file in Eclipse package content in case you have multiple java versions.
1) Goto the directory where your Eclipse.exe file is located. You will find eclipse.ini file here. Usually it would be
C:\Users\<userName>\eclipse\java-<version>\eclipse folder
2) Open eclipse.ini with notepad and try to locate string -vm-vm
C:\Program Files (x86)\java\jdk-11.0.7\bin
I changed the path to point it to JDK 8 so it looks like this
-vm
C:\Program Files\Java\jdk1.8.0_251\bin
4) Once done, save and close the file. Restart eclipse and you would be able to login now.
User | Count |
---|---|
71 | |
10 | |
8 | |
7 | |
6 | |
6 | |
6 | |
6 | |
6 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.