facebook

Exception while opening the connection

  1. MyEclipse Archived
  2.  > 
  3. Database Tools (DB Explorer, Hibernate, etc.)
Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #258732 Reply

    mehtabkhan
    Member

    Just downloaded the Myeclipse ver 5.0.1 GA and Eclipse ver 3.2. I have JDK ver 1.5.0_08. I am facing the problem while opening the database connection.

    Through Windows -> Preferences -> MyEclipse -> Database Explorer -> Drivers, I configured the database driver as

    Driver Name : Oracle (OCI Driver)
    Connection URL : jdbc:oracle:oci:@<database name>
    Driver classname : oracle.jdbc.driver.OracleDriver

    Added the jars as well from Oracle’s lib dir D:\oracle\ora92\jdbc\lib\classes12.jar and D:\oracle\ora92\jdbc\lib\classes111.jar.

    Then when I go to the MyEclipse Database Explorer perspective and try creating a new database connection profile it gives throws the following exception (as seen in the D:\MyWorkspace\.metadata\.log file):

    !ENTRY com.genuitec.eclipse.sqlexplorer 4 4 2006-09-19 12:14:04.385
    !MESSAGE Error while trying to login to database
    !STACK 0
    java.lang.NullPointerException
    at com.genuitec.eclipse.sqlexplorer.actions.OpenPasswordConnectDialogAction.perfomLoginAndRetrieval(OpenPasswordConnectDialogAction.java:114)
    at com.genuitec.eclipse.sqlexplorer.actions.OpenPasswordConnectDialogAction.run(OpenPasswordConnectDialogAction.java:75)
    at com.genuitec.eclipse.sqlexplorer.actions.NewConnection.run(NewConnection.java:70)
    at org.eclipse.jface.action.Action.runWithEvent(Action.java:499)
    at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:539)
    at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:488)
    at org.eclipse.jface.action.ActionContributionItem$5.handleEvent(ActionContributionItem.java:400)
    at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66)
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:928)
    at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3348)
    at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2968)
    at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1914)
    at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1878)
    at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:419)
    at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
    at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplication.java:95)
    at org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:78)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:92)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:68)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:400)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:177)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:585)
    at org.eclipse.core.launcher.Main.invokeFramework(Main.java:336)
    at org.eclipse.core.launcher.Main.basicRun(Main.java:280)
    at org.eclipse.core.launcher.Main.run(Main.java:977)
    at org.eclipse.core.launcher.Main.main(Main.java:952)

    Could anyone please let me know what is that I am doing wrong here?

    Regards
    Khan

    #258735 Reply

    Haris Peco
    Member

    Khan,

    What is reason that you use oci driver – for ci driver you have to set oracle native libraries correct and you can have issues when set driver (JVM can load native libraries form classloaders and you have to remove driver, restart eclipse and add it again)
    thin driver work much better – it is pure java and you needn’t oracle client libraries
    Only different for you is url – it is like this

    jdbc:oracle:thin:@<server>:1521:SID

    If you have own reasons for oci driver you have to set ORACLE_HOME and ORACLE_SID before start eclipse

    Best
    Peco

    #259612 Reply

    jaindeepu1
    Member

    I get the same exception when I try to use LucidDb data base (open source data base for Business Intelligence http://eigenbase.wikispaces.com/LucidDbWiki)

    fyi, I have been using MyEclipse for last 2-3 years have used DB browser in past with different DB’s oracle and mysqlserver. I am
    sure that I was specifying the corrent jdbc url, user name , password and driver.

    Exception Stack Trace:
    java.lang.NullPointerException
    at com.genuitec.eclipse.sqlexplorer.actions.OpenPasswordConnectDialogAction.perfomLoginAndRetrieval(OpenPasswordConnectDialogAction.java:114)
    at com.genuitec.eclipse.sqlexplorer.actions.OpenPasswordConnectDialogAction.run(OpenPasswordConnectDialogAction.java:75)
    at com.genuitec.eclipse.sqlexplorer.actions.NewConnection.run(NewConnection.java:70)
    at com.genuitec.eclipse.sqlexplorer.actions.NewConnection.run(NewConnection.java:84)
    at org.eclipse.ui.internal.PluginAction.runWithEvent(PluginAction.java:254)
    at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:539)
    at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:488)
    at org.eclipse.jface.action.ActionContributionItem$6.handleEvent(ActionContributionItem.java:441)
    at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66)
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1085)
    at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3164)
    at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2840)
    at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1914)
    at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1878)
    at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:419)
    at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
    at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplication.java:95)
    at org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:78)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:92)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:68)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:400)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:177)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:585)
    at org.eclipse.core.launcher.Main.invokeFramework(Main.java:336)
    at org.eclipse.core.launcher.Main.basicRun(Main.java:280)
    at org.eclipse.core.launcher.Main.run(Main.java:977)
    at org.eclipse.core.launcher.Main.main(Main.java:952)

    Session Data:
    eclipse.buildId=M20060629-1905
    java.version=1.5.0_06
    java.vendor=Sun Microsystems Inc.
    BootLoader constants: OS=linux, ARCH=x86, WS=gtk, NL=en_US
    Framework arguments: -Dconfigs=*,*,* -Dbaseos=gtk -Dbasews=linux -Dbasearch=x86 -DbaseLocation=/home/djain/depot/platform/team/lifecycle/main/dev/eclipseWB
    Command-line arguments: -Dconfigs=*,*,* -Dbaseos=gtk -Dbasews=linux -Dbasearch=x86 -DbaseLocation=/home/djain/depot/platform/team/lifecycle/main/dev/eclipseWB -data /home/djain/sandbox/platform/lc.main/workspace

    regards,
    Deepak

    #259615 Reply

    Haris Peco
    Member

    Deepak,

    We haven’t tested LucidDb database, but some database with correct jdbc driver will work in MyEclipse
    Your log (NullPointerExecption in login) usually mean that you have problem with driver

    Try next test (it will list your table or throw exception) :

    
    import java.sql.Connection;
    import java.sql.DatabaseMetaData;
    import java.sql.DriverManager;
    import java.sql.ResultSet;
    
    
    public class TestTables {
        private static String driverName = "YOUR_CLASSNAME";
    
        private static String url = "YOUR URL";
    
        private static String username = "YOUR_USERNAME";
    
        private static String password = "YOUR_PASSWORD";
    
        public static void main(String[] args) {
    
            try {
                Class.forName(driverName);
                Connection connection = DriverManager.getConnection(url, username,
                        password);
                DatabaseMetaData md = connection.getMetaData();
                // you can change first argument with your catalog (if database support catalog)
                // and second with schema
                ResultSet tables = md.getTables(null, null, "%", new String[] { "TABLE","VIEW" });
                while (tables.next()) {
                    String table = tables.getString("TABLE_NAME");
                    System.out.println("table=" + table);
                }        
            } catch (Exception e) {
                e.printStackTrace();
            }
    
        }
    }
    

    Best
    Peco

    #259736 Reply

    Riyad Kalla
    Member

    Deepak,
    Was this issue resolved?

Viewing 5 posts - 1 through 5 (of 5 total)
Reply To: Exception while opening the connection

You must be logged in to post in the forum log in