Only persistence units with transaction type JTA can be used as a container managed entity manager

NetBeans can use multiple deployment servers. When your web application uses the Entity Framework and you select the Glassfish server as the deployment server, you can get the error message when you try to run your application in the IDEÉ

Severe: Exception while preparing the app : The persistence-context-ref-name […] in module […] resolves to a persistence unit called […] which is of type RESOURCE_LOCAL. Only persistence units with transaction type JTA can be used as a container managed entity manager. Please verify your application.

When you first run the application NetBeans asks you to select the deployment server you want to use.

If only the Glassfish server is available, and Tomcat is installed on your workstation, add Tomcat to the available deployment servers.

Install Tomcat

For the Tomcat installation see Tomcat web server installation

Add Tomcat to the NetBeans server list

  1. In the Tools menu select Servers
  2. Click the Add Server button
  3. In the list select the Apache Tomcat or TomEEE server
  4. Click the Browse… button
  5. Select the Tomcat directory on your workstation
  6. Enter a Tomcat username and password for NetBeans, and click the Finish button.
  7. The user will be created in the tomcat-users.xml file in the Tomcat conf directory
  8. Click the Close button.

Select the Deployment Server

  1. Right-click the NetBeans project and select Run
  2. In the Select deployment server window select Apache Tomcat or TomEE

If the Select deployment server window does not pop up

  1. Right-click the NetBeans project and select Set Configuration -> Customize
  2. On the Run tab select the Apache server.

Starting of Tomcat failed, the server port 8080 is already in use

  1. If the Glassfish server already started, Tomcat cannot use the same ports and an error message will appear in the NetBeans RunOutput tab
  2. To stop the Glassfish server, restart your workstation.

Tomcat web server installation

Tomcat is one of the most popular free web servers. Tomcat runs on the Linux, Macintosh, and Windows operating systems.

To install Tomcat

Install the Java Runtime Environment (JRE)

  1. Download the Java JRE from
  2. Install the Java JRE

On Windows

  1. Execute the downloaded .exe file
  2. Create an environment variable to point to the installed Java
    1. If you installed the Java JDK (Java Development Kit)
      1. JAVA_HOME=c:\Program Files\Java\jdk-…
    2. If you installed the JRE (Java Runtime Environment)
      1. JRE_HOME=C:\Program Files\Java\jre-…


Install Tomcat

  1. Download the Tomcat installer from
  2. To select the right file to download read the explanation on the page linked to “Please see the README file for packaging information”.

On Windows

Select the installer based on the operating system and the Java environment you want to run:

  • 32 bit Java Virtual Machine on32 bit or 64 bit Windows: apache-tomcat-[version]
  • 64 bit Java Virtual Machine on 64 bit Windows: apache-tomcat-[version]
  1. Unzip the downloaded archive and move the apache-tomcat-x.x.x directory to C:\Program File
  2. Create the Tomcat environment variable
    CATALINA_HOME=C:\Program Files\apache-tomcat-x.x.x

Start Tomcat

  1. Open a terminal or console in the Tomcat bin directory
  2. Execute
  3. Enable the access to the Tomcat server through the firewall
    1. On Windows

Test Tomcat

  1. Open a web browser on the server and navigate to http://localhost:8080/
  2. You should see the Tomcat default page

Auto start Tomcat

If you want to use Tomcat as a web server, it should start automatically when the computer starts.

On Windows

  1. Open a command prompt in the tomcat bin directory
  2. Execute
    service.bat install
  3. On the User Account Control popup click the Yes button
  4. The last message in the command prompt should say

    The service ‘Tomcat..’ has been installed.

  5. Open  Services and select the Apache Tomcat service
  6. Set the Startup type to Automatic, click the Start button to start the service, and click OK.


Cannot restart the Atlassian Confluence service on Windows

When the Atlassian Confluence wiki is installed on a Windows server, it frequently becomes unavailable. Sometimes it is possible to restart the Atlassian Confluence Windows service, but most of the time the Stop phase times out with:

Windows could not stop the Atlassian Confluence service on Local Computer.
Error 1053: The service did not respond to the start or control request in a timely fashion.

To make Atlassian Confluence work again

  1. Open Task Manager,
  2. End the tomcat…exe process,
  3. Start the Atlassian Confluence Windows service.

Enable File Level Authentication or set SSL requirements in IIS 7 and 7.5

In Windows Server 2008 and 2008 R2 the Internet Information Services (IIS) Manager looks different from the  IIS 6 version.

To set file level attributes, like authentication, SSL requirement, follow the steps below:

  • Start Internet Information Services (IIS) Manager
  • On the left side select the application you want to administer.
  • At the bottom of the middle pane select the Content View tab to view the files of the application.
  • In the middle pane right click the file you want to administer and select Switch to Features View in the drop down menu.
  • In the middle pane double click the Authentication, SSL Settings, or any other icon you want to make changes to.