In this walkthrough, we describe the steps to setup the NetBeans IDE so that you can develop INTGeoServer plugins.
The first step is to install the NetBeans IDE. We use NetBeans 8.0.1 for this demonstration. Make sure to download the Java EE version as described in the prerequirements.
The second step is to install INTGeoServer. By default, INTGeoServer will installs in C:\Program Files\INT\INTGeo
The third step is to install a web browser. We recommend Google Chrome (Microsoft Edge makes it difficult to read JSON content).
In NetBeans, select File->New Project. Select Web Application.
Choose a name and location for your project.
Select the server you wish to use. We recommend using GlassFish.
INTGeoServer does not require any additional frameworks to run, don't select anything here and click Finish.
Right click your project, and select New -> Other... In the Web category, select Standard Deployment Descriptor (web.xml).
Click Finish.
After creating this deployment file, copy the contents of C:\Program Files\INT\INTGeo\WEB-INF\web.xml into your web.xml.
Next, you will need to add the required INTGeoServer libraries. In your file explorer, navigate to where you installed INTGeoServer. Create a lib directory under the WEB-INF directory. Drag and drop all files in C:\Program Files\INT\INTGeo\WEB-INF\lib to the WEB-INF\lib folder of your web application. Your project should look like this:
Run the application, and in your web browser navigate to localhost:8080/MyFirstWebApp/json/serverinfo
You will see the following error has occurred:
Copy your license.dat file into the Web Pages directory.
Run the application again, and in your web browser navigate to localhost:8080/MyFirstWebApp/json/serverinfo and you should see a web page similar to the following:
Important Note: While NetBeans has features that allow immediate code changes (without restarting the server), we found that in many cases, we had to restart the server after a change:
In some instances, we had to restart NetBeans itself.
By default, when errors occur, the error handler just sends an error status code to the client, without logging any stack trace to the console unless this is an unexpected error (ex: NullPointerException). To force a more verbose error handling, add to your project the debugerrorhandler.jar file attached at the bottom this page . This file doesn't contain any code, just the following layer.xml entry in the META-INF/services folder:
<?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="com.interactive.intgeo.server.errorhandlers.AbstractIntGeoServerErrorHandler">
<file name="com.interactive.intgeo.server.errorhandlers.DefaultIntGeoServerErrorHandler.instance_hidden"/>
<file name="com.interactive.intgeo.server.errorhandlers.DebugIntGeoServerErrorHandler.instance"/>
</folder>
</filesystem>
These few lines effectively substitute the default error handler with a more verbose one that is also built-in.
You also have the option to include the XML lines above to your own layer.xml entry.
See the AbstractIntGeoServerErrorHandler class for how to plug your own error handler.
Once you have setup NetBeans, you can proceed to Adding your first web service.