Menu

Eclipse,hibernator-Not Create New Connection

Help
Sam
2003-08-06
2003-12-04
  • Sam

    Sam - 2003-08-06

    I am having problem in integrating Eclipse2.1.0 with hibernator-0.9.5.zip. I unzipped it in Eclipse plugin. I tried creating new Connection to Oracle 9i. I am trying to add a new connection by entering values in the GUI, but new connection does not get created. However, I can connect to Oracle using SQL Plus, and from Java program using the url and class name below.

    I am using:

    Connection Name= webdev
    driver_class=oracle.jdbc.driver.OracleDriver
    url=jdbc:oracle:thin:@dbtest.internal.myworld.com:1521:webdev
    username=xxx
    password=xxx
    dialect=net.sf.hibernate.dialect.OracleDialect
    Driver File Name = classes12.jar

    I am having the following error in Eclipse Log:
    !ENTRY org.eclipse.ui 4 4 Aug 06, 2003 14:40:40.25
    !MESSAGE Unhandled exception caught in event loop.
    !ENTRY org.eclipse.ui 4 0 Aug 06, 2003 14:40:40.25
    !MESSAGE java.lang.NullPointerException
    !STACK 0
    java.lang.NullPointerException
        at java.util.Hashtable.put(Hashtable.java:386)
        at java.util.Properties.setProperty(Properties.java:102)
        at net.sf.hibernator.views.ConnectionSet.save(ConnectionSet.java:71)
        at net.sf.hibernator.views.ConnectionSet.add(ConnectionSet.java:32)
        at net.sf.hibernator.views.ConnectionView.add(ConnectionView.java:204)
        at net.sf.hibernator.views.ConnectionView.access$1(ConnectionView.java:195)
        at net.sf.hibernator.views.ConnectionView$3.run(ConnectionView.java:131)
        at org.eclipse.jface.action.Action.runWithEvent(Action.java:842)
        at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:456)
        at org.eclipse.jface.action.ActionContributionItem.handleWidgetEvent(ActionContributionItem.java:403)
        at org.eclipse.jface.action.ActionContributionItem.access$0(ActionContributionItem.java:397)
        at org.eclipse.jface.action.ActionContributionItem$ActionListener.handleEvent(ActionContributionItem.java:72)
        at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:81)
        at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:840)
        at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:1838)
        at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:1545)
        at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1402)
        at org.eclipse.ui.internal.Workbench.run(Workbench.java:1385)
        at org.eclipse.core.internal.boot.InternalBootLoader.run(InternalBootLoader.java:845)
        at org.eclipse.core.boot.BootLoader.run(BootLoader.java:461)
        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:324)
        at org.eclipse.core.launcher.Main.basicRun(Main.java:291)
        at org.eclipse.core.launcher.Main.run(Main.java:747)
        at org.eclipse.core.launcher.Main.main(Main.java:583)

    Any thoughts?
    Regards,
    Sam
    sgho@aol.com

     
    • Daniel Bradby

      Daniel Bradby - 2003-09-11

      The code tells me that the dialect is null?! Very strange. I will tighten the validation around this area though.

      Any luck getting further?

       
      • Anonymous

        Anonymous - 2003-12-04

        It looks likes caused by following method.

        NewConnectionWizard.java:
          public void performFinish() {
            ...
            int index = dialect.getSelectionIndex();
            if(index != -1)
                initialData.setDialect(dialect.getItem(index));
          }

        If the dialect was inputed from keyboard not by combo select box,
        the index become -1.  So the dialect in initialData stay null.

        How about this fix?

        NewConnectionWizard.java:
          public void performFinish() {
            ...
            int index = dialect.getSelectionIndex();
            if(index != -1)
                initialData.setDialect(dialect.getItem(index));
        +   if (initialData.getDialect() == null) {
        +       initialData.setDialect(dialect.getText());
        +   }
          }

         

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.