Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 352179

Summary: Import of a connection profile gives NPE
Product: [Tools] Data Tools Reporter: Carsten Nikiel <carsten>
Component: ConnectivityAssignee: Brian Fitzpatrick <bfitzpat>
Status: NEW --- QA Contact:
Severity: major    
Priority: P3 CC: bfitzpat, buckett, lchan
Version: 1.9   
Target Milestone: 1.9.1   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
connection specification that is failing to import.
none
stack trace from juno SR when import fails none

Description Carsten Nikiel CLA 2011-07-15 02:30:55 EDT
Build Identifier: 20110615-0604

I exported some connection profiles and the xml looks OK, but upon importing them I get an NPE:
java.lang.NullPointerException
	at org.eclipse.datatools.connectivity.internal.ConnectionProfileMgmt.readCPsFromXML1_0(ConnectionProfileMgmt.java:643)
	at org.eclipse.datatools.connectivity.internal.ConnectionProfileMgmt.loadCPs(ConnectionProfileMgmt.java:925)
	at org.eclipse.datatools.connectivity.internal.ConnectionProfileMgmt.importCPs(ConnectionProfileMgmt.java:766)
	at org.eclipse.datatools.connectivity.internal.ui.wizards.ImportProfilesDialog.okPressed(ImportProfilesDialog.java:287)
	at org.eclipse.jface.dialogs.Dialog.buttonPressed(Dialog.java:472)
	at org.eclipse.jface.dialogs.Dialog$2.widgetSelected(Dialog.java:624)
	at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:240)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1053)
	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4165)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3754)
	at org.eclipse.jface.window.Window.runEventLoop(Window.java:825)
	at org.eclipse.jface.window.Window.open(Window.java:801)
	at org.eclipse.datatools.connectivity.ui.actions.ImportProfileViewAction.execute(ImportProfileViewAction.java:116)
	at org.eclipse.ui.internal.handlers.HandlerProxy.execute(HandlerProxy.java:293)
	at org.eclipse.core.commands.Command.executeWithChecks(Command.java:476)
	at org.eclipse.core.commands.ParameterizedCommand.executeWithChecks(ParameterizedCommand.java:508)
	at org.eclipse.ui.internal.handlers.HandlerService.executeCommand(HandlerService.java:169)
	at org.eclipse.ui.internal.handlers.SlaveHandlerService.executeCommand(SlaveHandlerService.java:241)
	at org.eclipse.ui.internal.handlers.SlaveHandlerService.executeCommand(SlaveHandlerService.java:241)
	at org.eclipse.ui.menus.CommandContributionItem.handleWidgetSelection(CommandContributionItem.java:829)
	at org.eclipse.ui.menus.CommandContributionItem.access$19(CommandContributionItem.java:815)
	at org.eclipse.ui.menus.CommandContributionItem$5.handleEvent(CommandContributionItem.java:805)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)

I have the OEPE for Indigo installed, maybe that has something to do with it.
Since automatic loading of profiles seems also not to be working, I have to create the connections each time I restart eclipse.

Reproducible: Always

Steps to Reproduce:
1. export the connection profile for some Oracle database
2. import the very same profile

Happens with or without overwriting the profiles.
Even importing to an empty list does not work
Comment 1 Brian Fitzpatrick CLA 2011-07-15 09:37:02 EDT
Hey Linda, since nothing else has changed in the core connectivity except for the OSGi tweaks you made for Indigo, I'm guessing this might be yours. It may have something to do with Oracle needing to change the enablement plug-ins they host themselves vs. what's in DTP?
Comment 2 Linda Chan CLA 2011-07-15 17:47:06 EDT
I don't think the NPE has anything to do with my previous changes.
The stack trace points to the following code snippet, which is not related and could have more robust handling.  It looks like the driver template referenced by a driver instance no longer exists.  Perhaps the driver definitions are out of sync with the profiles in the user environment.  

  DriverInstance[] testDI = DriverManager.getInstance().getDriverInstancesByName(driverName);
  if (testDI != null) {
        // we found the driver, so we're ok to continue
	for (int index = 0; index < testDI.length; index++){
	     if (testDI[index].getTemplate().getId().equalsIgnoreCase(driverTypeID)) { // line 643
	       // the driver with the same name happens to have the same template ID, so we should be ok
	       xistingDriverHasName = true;
	      }
	}
   }
Comment 3 Brian Fitzpatrick CLA 2011-07-18 17:33:14 EDT
Carsten - are you using the Oracle plug-ins that come with DTP or the ones that come from Oracle?
Comment 4 Carsten Nikiel CLA 2011-07-28 03:19:32 EDT
I WAS using the DTP from Oracle, but since you mentioned it I uninstalled it.
NOW it works perfectly, but I miss some of the functionality from the OEPE.
Like the execution plan in graphical form (or even the textual form)

But at least without OEPE I do not have to type in the connection details each time I start eclipse.

(In reply to comment #3)
> Carsten - are you using the Oracle plug-ins that come with DTP or the ones that
> come from Oracle?
Comment 5 Brian Fitzpatrick CLA 2011-07-28 09:20:50 EDT
(In reply to comment #4)
> I WAS using the DTP from Oracle, but since you mentioned it I uninstalled it.
> NOW it works perfectly, but I miss some of the functionality from the OEPE.
> Like the execution plan in graphical form (or even the textual form)
> 
> But at least without OEPE I do not have to type in the connection details each
> time I start eclipse.

Thanks Carsten - that gives me somewhere to start. I'm unable to reproduce it locally and suspected I was missing something. I'll see if I can get this licked for the first maintenance release.
Comment 6 Matthew Buckett CLA 2013-03-05 06:25:18 EST
I'm seeing this on Juno SR2 importing connection profiles generated from Indigo.
Comment 7 Matthew Buckett CLA 2013-03-05 06:33:02 EST
Created attachment 227928 [details]
connection specification that is failing to import.

connections.dat is an edited attachement that is failing to import for me on Juno SR2.
Comment 8 Matthew Buckett CLA 2013-03-05 06:40:15 EST
Created attachment 227929 [details]
stack trace from juno SR when import fails

Stack trace from: Build id: 20130225-0426 with DTP version 1.10.2.v201209181447
Comment 9 Matthew Buckett CLA 2013-03-05 06:49:51 EST
My problem was that I had the Data Toole Platform Extender SDK installed but not the Data Tool Platform Enablement Extender SDK. Installing the Extender allowed the import of the connection profiles to work without a problem.

I still think it stands as a bug because you should get a better error message.
Comment 10 Nobody - feel free to take it CLA 2015-02-16 02:29:57 EST
SPAM comment removed