Over the years I have tried to port my Nb 6.5 based Platform application to an updated NetBeans version. It usually stopped with some major showstopper which was too hard to figure out on my own or which nobody in the great NetBeans community had heard of or could reproduce.This was the case trying Nb 6.7, 6.8, 6.9, 7.0 or 7.2. Over the years I took notes of problems other porters have had and kept those in a list as I knew I would use them one day.
NB 8.2 was released on Oct 3rd, 2016 and I did already work on the 8.2RC which was released about two weeks before. Below I will simply list the issues I run into and which solutions made them go away.
In short: NB 8.2. was the one release causing minimum of porting needed and I succeeded with the port (42 modules) under a week of work. Some of this time was due to issues with 3rd party products like Derby. (10.12.1.1 had issues with numerous triggers on the same table, which I fixed together with Bryan see
https://issues.apache.org/jira/browse/DERBY-6726)
Update (Nov 2016): This fix is now part of the latest Derby 10.13.1.1 release.
1) Upgrade local build to Ant 1.9.7
No big deal really. Nb 8.2 has Ant 1.9.7 build into the distro but I also did have build scripts who could build the system outside NetBeans in batch. Upgrade was done just to have the same version as NetBeans.
2) Upgrade all modules Implementation versions
Use Project --> properties. This was done to make sure no old update Center could trigger an update suggestion on the newly upgraded system.
3) Find which dependencies from NetBeans were needed
This was the first bigger puzzle game. Major split of API's were done in 8.0, like the Lookup was now it its own library. Also splits between Swing and non-swing code were done, like Progress API and Progress API - Swing. The idea was to take out as much as possible and with try and error see what dependencies need each other.
The main one to remove was under "platform" : Swing Layout Extension integration as it is deprecated.Which had implications on numerous TopComponents. From the suite's project properties I only needed 3. "ide", "nb" and "platform".
To reduce carrying too much not-to-be-used jar files around, below I list the modules in each of those 3 nodes which I
excluded and which did not trigger dependency warnings when removing.
"
ide": Bugzilla, CSS Preprocessors, CVS Installer, Database, Database Drivers, Docker*, Git*, Hudson*, ini4j, Issue Tracking*, Java DB Database Support, Lexer to NetBeans Bridge, Local*, Mercurial, Mylyn Support Utilities, Navigate to Test, org.eclipse*, Resource Bundle Syntax Coloring, Schema-to-Beans Library, Selenium*, Smack API, Subversion*, Team Commons, Versioning*, XML WSDL API
Note: The Database, Database Drivers and Java DB Database Support were removed as I have my own Derby setup.
"
netbeans": Bugzilla-Exception Reporter Bridge, Exception Detector, IDE Branding, Update Centers, Upgrade, Welcome Screen.
Note: My app is using the update center code but the Update Centers module is not needed.
"
platform": Compatibility APIs, Old Enumeration API, Swing Layout Extension integration, UI Gestures Collector Infradtructure, UI Handler Library,
Note: The first 3 are deprecated modules and having written code in Nb 6.5 did have some swing layout using the Swing Layout Extension integration. (more below about that)
4) Add dependencies to your modules were compile errors happen due to missing classes
a)
JUnit 4: Add JUnit 4 to your Unit Test Packages if not there, possibly also Hamcrest
b)
org.openide.util.ImageUtilities: Moved to module org-openide-util-ui, i.e. add Utilities API to your module
c) Lookup API: The lookup code has its own module, hence all your code using this need to depend on this
d) org.netbeans.api.progress.ProgressHandleFactory : You will need to include Progress API and often as well Progress API - Swing dependencies.
e)
org.openide.util.Utilities, util.HelpCtx, util.actions.CallableSystemAction: Add Utilities API
f) Module using <...>.lookup(XyzProject.class) : Triggers a class file for
org.netbeans.api.project.Project error. Also here - add the Project API as dependency
5) "The type of DialogDescriptor is erroneous” - kind of error
This one did confuse me for a while. Compilation in Java ok, but NetBeans rejected to compile this. It turned out that adding a dependency on the Utilities API did solve this problem. Nasty part here is that you have no way of knowing this. No info why this is happening. See
http://forums.netbeans.org/viewtopic.php?t=66899 for more details.
6) javax.crypto not found
Proguard 5.2.1 trouble shoot page explains that you shall add jce.jar
-libraryjars 'C:\Program
Files\Java\jre6\lib\jce.jar'
7) Non-Singleton TopComponents NPE's when exiting the application
A few of my TopComponents are non-singleton and I had to remove the files xyzSettings.xml and xyzWstcref.xml and all references in the layer.xml as well as any action possible left in there. Though removing the layer.xml entirely was a bad idea. For now I left a nearly empty layer.xml like:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE filesystem PUBLIC "-//NetBeans//DTD Filesystem 1.2//EN" "http://www.netbeans.org/dtds/filesystem-1_2.dtd">
<filesystem>
<folder name="Windows2">
</folder>
</filesystem>