Forum Stats

  • 3,760,438 Users
  • 2,251,706 Discussions
  • 7,871,122 Comments

Discussions

How to resolve SQL Developer error?

Hi,

Recently, I have installed Oracle Database 21c on my VirtualBox machine and after finishing the steps and installation, I want to try and explore the features, so I have installed Oracle SQLDeveloper in Oracle Linux but when I run the command SQL developer, I am getting the following error in the terminal and the other screenshot error in UI, can someone please suggest, how can I fix this issue in Oracle Linux, also if by mistake JDK path is set wrong for the Oracle user then how to fix it? Is there any command available? I tried to find a product.conf file but I am not able to find it.

java.lang.NullPointerException
	at org.netbeans.core.netigso.Netigso.findResources(Netigso.java:380)
	at org.netbeans.NetigsoModule.findResources(NetigsoModule.java:177)
	at org.netbeans.core.startup.NbInstaller.loadLayers(NbInstaller.java:626)
	at org.netbeans.core.startup.NbInstaller.loadImpl(NbInstaller.java:353)
	at org.netbeans.core.startup.NbInstaller.access$000(NbInstaller.java:102)
	at org.netbeans.core.startup.NbInstaller$1.run(NbInstaller.java:343)
	at org.openide.filesystems.FileUtil$2.run(FileUtil.java:436)
	at org.openide.filesystems.EventControl.runAtomicAction(EventControl.java:127)
	at org.openide.filesystems.FileSystem.runAtomicAction(FileSystem.java:519)
	at org.openide.filesystems.FileUtil.runAtomicAction(FileUtil.java:420)
	at org.openide.filesystems.FileUtil.runAtomicAction(FileUtil.java:440)
	at org.netbeans.core.startup.NbInstaller.load(NbInstaller.java:340)
	at org.netbeans.ModuleManager.enable(ModuleManager.java:1365)
	at org.netbeans.ModuleManager.enable(ModuleManager.java:1170)
	at org.netbeans.core.startup.ModuleList.installNew(ModuleList.java:340)
	at org.netbeans.core.startup.ModuleList.trigger(ModuleList.java:276)
	at org.netbeans.core.startup.ModuleSystem.restore(ModuleSystem.java:301)
	at org.netbeans.core.startup.Main.getModuleSystem(Main.java:181)
	at org.netbeans.core.startup.Main.getModuleSystem(Main.java:150)
	at org.netbeans.core.startup.Main.start(Main.java:307)
	at org.netbeans.core.startup.TopThreadGroup.run(TopThreadGroup.java:123)
	at java.lang.Thread.run(Thread.java:748)

The screenshot error in SQL Developer


«13

Answers

  • EdStevens
    EdStevens Member Posts: 28,491 Gold Crown

    I treat all of my VBox VMs as if they were phyisical machines in a server rack behind a locked door in a lights-out data center. In other words, beyond statrtup and shutdown, I don't even access the VM console at all. Install SQL dev (and any other client software) on the host OS, and access the VM just like you would any other remote server.

  • Kinjan Bhavsar
    Kinjan Bhavsar Member Posts: 78 Red Ribbon

    @EdStevens Thanks for your reply, just correct me if I am wrong, you are saying that if I have Windows OS and Linux in VirtualBox, install SQL Developer in Windows OS machine and connect the DB which is installed in VirtualBox?

    If yes, then before connecting in SQLDev, do I need to start anything in the VirtualBox terminal so that my database is accessible to connect in SQL Developer? Apologies for asking too many questions as I am doing this for the first time.

  • EdStevens
    EdStevens Member Posts: 28,491 Gold Crown
    edited Aug 23, 2021 9:08PM

    ou are saying that if I have Windows OS and Linux in VirtualBox, install SQL Developer in Windows OS machine and connect the DB which is installed in VirtualBox?

    That's exactly what I am saying. The only thing you need to do at the VM console is get the OS networking setup correctly. And to do this you need to first have the virtual NIC set up correctly on the VM.

    The VM needs to have a network adapter that is either HOSTONLY or BRIDGED. I generally prefer the HOSTONLY. This will create an internal network on the host machine, with its own subnet (range of IP addresses) so that you can communicate between the host and the VM, and between multiple VMs on the same host.

    With the hostonly adpter configured, you need to (at the OS level of the VM) bind that adapter to a fixed IP address. You then need to make an entry in both the VM's and the Windows (host) 'hosts' file, equating the given IP address to the server name.

    For more detail on the basic networking, see https://edstevensdba.wordpress.com/2012/12/15/configure-the-virtualbox-network-2/


    Once all that is done correctly, you can install SQL Dev on the host to connect to the database, and use an ssh client (I prefer PuTTY) to create a command session on the VM, for any admin work outside of the database itself.

    A couple of other helpful articles I wrote on the subject:


    I have created scores of personal VMs over the years, and can't imagine anyone calling themselves a DBA not having their own private system on their personal machines, at a minimum. At my last two employers (I've recently retired) I had created multiple VMs on my office workstation, thus creating an entire computer lab that (with the use of HOSTONLY adapters) was completely insulated from and invisible to the corporate network.

  • Kinjan Bhavsar
    Kinjan Bhavsar Member Posts: 78 Red Ribbon

    Hi @EdStevens ,

    I installed SQLDeveloper in my host machine and also added the following in tnsnames.ora

    TEST =
       (DESCRIPTION =
        (ADDRESS_LIST =
          (ADDRESS = (PROTOCOL = TCP)(HOST = rac1.localdomain)(PORT = 1521))
        )
        (CONNECT_DATA =
          (SERVER = DEDICATED)
          (SERVICE_NAME = cdb1)
    
    

    but neither I see this TNS in my host machine SQLDeveloper nor am I able to connect to my VirtualBox Db in my host machine, I am not a DBA so I am not aware in much detail and am doing it in my local system to explore few things.

  • EdStevens
    EdStevens Member Posts: 28,491 Gold Crown

    but neither I see this TNS in my host machine SQLDeveloper nor am I able to connect to my VirtualBox Db in my host machine, I am not a DBA so I am not aware in much detail and am doing it in my local system to explore few things.

    First things first. We need to make sure you have basic network connectivity between the host and the VM guest. Did you read the first link I gave you, to my blog article specifically addressing the network setup?

    First thing - you need to have a 'hostonly' adapter as part of your VM setup. Here's a shot of mine to show you where to see it. If you don't have a HOSTONLY adapter, you need to add one to your VM. With the VM shut down, click on the 'network' settings of your VM, then click on the tab for 'Adapter 2', and make it 'hostonly adapter'. When you've done that, post a screen shot of it as confirmation. Then we can go to the next step.


  • Kinjan Bhavsar
    Kinjan Bhavsar Member Posts: 78 Red Ribbon
    edited Aug 26, 2021 11:40AM

    Hi @EdStevens ,

    Here is the screenshot


    Let me know the further steps.

  • EdStevens
    EdStevens Member Posts: 28,491 Gold Crown

    OK, so we confirm you have a hostonly adapter. Next step is to confirm the manually assigned IP address associated with that adapter. For that we need to know two things:

    1) the exact version of Oracle Linux running on the VM

    2) The subnet the host adapter is running on. For this we need to see the output of 'ipconfig', as executed from a command line on the host Windows machine.

  • Kinjan Bhavsar
    Kinjan Bhavsar Member Posts: 78 Red Ribbon

    Hi @EdStevens ,

    Here are the answers with a screenshot

    1) Version of Oracle Linux as shown in command line and when it boots up - it shows Oracle Linux 7.9

    2) IP addresses of hostonly-adapter(enp0s8)


  • EdStevens
    EdStevens Member Posts: 28,491 Gold Crown

    very good.

    I see the host name is rac1.localdomain. Is this a RAC setup?

    Now show me the contents of /etc/sysconfig/network-scripts/ifcfg-enp0s8, and /etc/hosts (on the linux vm) and C:\Windows\System32\drivers\etc\hosts

    (BTW, copy, paste, and formatted text is usually easier to read than screen shots. )

  • Kinjan Bhavsar
    Kinjan Bhavsar Member Posts: 78 Red Ribbon

    Hi @EdStevens ,

    I am not 100% sure whether it's a rac setup, I just gave a name to rac1.localdomain while installing Oracle Linux the first time by taking the reference from the following url

    1) The contents of /etc/sysconfig/network-scripts/ifcfg-enp0s8 in the Linux VM

    TYPE=Ethernet
    PROXY_METHOD=none
    BROWSER_ONLY=no
    BOOTPROTO=dhcp
    DEFROUTE=yes
    IPV4_FAILURE_FATAL=no
    IPV6INIT=yes
    IPV6_AUTOCONF=yes
    IPV6_DEFROUTE=yes
    IPV6_FAILURE_FATAL=no
    IPV6_ADDR_GEN_MODE=stable-privacy
    NAME=enp0s8
    UUID=f33b2696-8665-46dc-8c3d-40d3cd368ff2
    DEVICE=enp0s8
    ONBOOT=yes
    IPV6_PRIVACY=no
    

    2) The contents of /etc/hosts in the Linux VM, the last entry I have added as I was trying to find the solution to why it is not getting connected by host machine

    127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
    ::1         localhost localhost.localdomain localhost6 localhost6.localdomain6
    192.168.56.102  rac1.localdomain
    

    3) The contents of C:\Windows\System32\drivers\etc\hosts in the Windows Host machine

    # Copyright (c) 1993-2009 Microsoft Corp.
    #
    # This is a sample HOSTS file used by Microsoft TCP/IP for Windows.
    #
    # This file contains the mappings of IP addresses to host names. Each
    # entry should be kept on an individual line. The IP address should
    # be placed in the first column followed by the corresponding host name.
    # The IP address and the host name should be separated by at least one
    # space.
    #
    # Additionally, comments (such as these) may be inserted on individual
    # lines or following the machine name denoted by a '#' symbol.
    #
    # For example:
    #
    #      102.54.94.97     rhino.acme.com          # source server
    #       38.25.63.10     x.acme.com              # x client host
    
    
    # localhost name resolution is handled within DNS itself.
    #	127.0.0.1       localhost
    #	::1             localhost
    # Added by Docker Desktop
    192.168.101.104 host.docker.internal
    192.168.101.104 gateway.docker.internal
    # To allow the same kube context to work on the host and the container:
    127.0.0.1 kubernetes.docker.internal
    # End of section