How do I solve the “unrecognized project; missing plug-in?” error in NetBeans?

October 24, 2012 in Glassfish, Mac Tips, NetBeans, PrimeFaces, Recipes, Windows Tips by Francesco Zuliani

A NetBeans project is basically a standard folder with a nbproject folder inside it. When opening a project using the Open Project dialog window, NetBeans should be able to automatically recognize it and display the project folder with a particular icon depending on the type of the project.

Different icons for different types of NetBeans projects.

Sometimes, when trying to open a project, NetBeans fails to correctly recognize the project folder. Instead of the project type icon, a regular icon is used. If you click on the folder, the error “unrecognized project; missing plug-in?” is displayed in the Project Name textbox.

An unrecognized NetBeans project showing the standard folder icon.

The error indicates that your NetBeans installation is missing some plugins needed for the project to run: these can ben installed by choosing Tools > Plugins from the NetBeans application menu. For example, to fix this error for Java Web Projects (e.g. that make use of technologies such as PrimeFaces. Tomcat and Glassfish) follow these steps:

  1. Choose Tools > Plugins from the NetBeans application menu.
  2. In the Available Plugins pane, choose Java EE Base and click on Install.
  3. Accept the license agreements and click on Install.

Installing plugins in NetBeans.

After following these steps, your Java Web Project should be correctly recognized.

Unfortunately, NetBeans does not tell exactly which plugins are missing for a certain kind of project. To find out which plugins you need to install, you can use a text editor to open the project.xml file located in the nbproject folder, which is inside the NetBeans project folder you are trying to open. The web-module-library section lists all the dependencies, for example:

            <web-module-libraries>
                <library dirs="200">
                    <file>${file.reference.gson-2.1.jar}</file>
                    <path-in-war>WEB-INF/lib</path-in-war>
                </library>
                <library dirs="200">
                    <file>${file.reference.glass-x-1.0.4.jar}</file>
                    <path-in-war>WEB-INF/lib</path-in-war>
                </library>
                <library dirs="200">
                    <file>${file.reference.commons-io-2.3.jar}</file>
                    <path-in-war>WEB-INF/lib</path-in-war>
                </library>
                <library dirs="200">
                    <file>${file.reference.commons-fileupload-1.2.2.jar}</file>
                    <path-in-war>WEB-INF/lib</path-in-war>
                </library>
                <library dirs="200">
                    <file>${file.reference.commons-codec-1.6.jar}</file>
                    <path-in-war>WEB-INF/lib</path-in-war>
                </library>
                    <file>${file.reference.primefaces-3.3.jar}</file>
                    <path-in-war>WEB-INF/lib</path-in-war>
                </library>
            </web-module-libraries>


Credits go to Mchl and Glen Smith for their helpful tips.