Feedback of Target Platform migration from Eclipse 4.3 to 4.4.1 - Follow-up with Datatools

aurelien.pupier's picture
aurelien.pupier
Blog Categories: 

I discovered a new issue since my last post about Target Platform migration from Eclipse 4.3 to 4.4.1. It concerns a behavior modification in Datatools API which broke our integration of the Datatools Graphical Designer.

datatools Graphical Designer Integration

The symptom

When trying to connect to a database, a NPE is thrown (which is the case when using the Graphical Designer):

!ENTRY org.eclipse.datatools.connectivity 4 10001 2015-03-18 13:31:13.354
!MESSAGE Internal Error - org.eclipse.datatools.connectivity
!STACK 0
java.lang.NullPointerException
        at org.eclipse.datatools.connectivity.drivers.DriverValidator.validateJarListFiles(DriverValidator.java:161)
        at org.eclipse.datatools.connectivity.drivers.DriverValidator.isValid(DriverValidator.java:92)
        at org.eclipse.datatools.connectivity.internal.ConnectionProfileMgmt.writeCPToXML1_0(ConnectionProfileMgmt.java:321)
        at org.eclipse.datatools.connectivity.internal.ConnectionProfileMgmt.saveCPs(ConnectionProfileMgmt.java:216)
        at org.eclipse.datatools.connectivity.internal.ConnectionProfileMgmt.saveCPs(ConnectionProfileMgmt.java:172)
        at org.eclipse.datatools.connectivity.internal.InternalProfileManager.saveChanges(InternalProfileManager.java:1018)
        at org.eclipse.datatools.connectivity.internal.InternalProfileManager.addProfile(InternalProfileManager.java:784)
        at org.eclipse.datatools.connectivity.internal.InternalProfileManager.addProfile(InternalProfileManager.java:737)
        at org.eclipse.datatools.connectivity.internal.InternalProfileManager.createProfile(InternalProfileManager.java:633)
        at org.eclipse.datatools.connectivity.internal.InternalProfileManager.createProfile(InternalProfileManager.java:483)
        at org.eclipse.datatools.connectivity.ProfileManager.createProfile(ProfileManager.java:179)
        at org.bonitasoft.studio.datatools.ConnectionProfileUtil.createConnectionProfile(ConnectionProfileUtil.java:102)

The fix

The fix "simply" consisted in specifying the IDriverMgmtConstants.PROP_DEFN_TYPE property value for the DriverInstance. The value required to be based on the Driver Template ID defined by extension points "org.eclipse.datatools.connectivity.driverExtension".

And that's all!...

I mean for all databases except Oracle's ones...

For Oracle , it also requires to duplicate the properties given to the DriverInstance to the Connection Profile creation method (org.eclipse.datatools.connectivity.ProfileManager.createProfile(String, String, String, Properties).

Acknowledgements

I want to thanks JBoss Tools Integration Stack developers for having provided information in their public bugtracker on how they solve the issue on their side and Mickaël Istria for his help guiding me to the specific git commit solving the issue. It saves me a lot of time.

Notifications