How to manage tmp and data folder in WildFly

WildFly / JBoss EAP application storage is contained under each server installation. For standalone mode that means:

standalone/
├── configuration
├── data
├── deployments
├── lib
├── log
└── tmp

As you start deploying applications, you will see that the folders “data”, “log” and “tmp” start growing. In this tutorial we will learn how to manage the storage of the application server and which files or folders are safe to be deleted.

Managing the “data” folder.

The “data” folder is used to persist information for some of the services that are running on WildFly:

├── data
│   ├── activemq
│   │   ├── bindings
│   │   │   ├── activemq-bindings-1.bindings
│   │   │   ├── activemq-bindings-2.bindings
│   │   │   ├── activemq-jms-1.jms
│   │   │   └── activemq-jms-2.jms
│   │   ├── journal
│   │   │   ├── activemq-data-1.amq
│   │   │   ├── activemq-data-2.amq
│   │   │   ├── server.lock
│   │   │   ├── serverlock.1
│   │   │   └── serverlock.2
│   │   └── largemessages
│   ├── content
│   ├── kernel
│   │   └── process-uuid
│   ├── timer-service-data
│   └── tx-object-store
│       └── ShadowNoFileLockStore
│           └── defaultStore

Within this folder, you will find storage data for the embedded Artemis MQ server (if used) under the “activemq” folder. You will also find data used by ejb3 timer service (timer-service-data) to store the timer service data. It can also contain the transaction related data (tx-object-store), which might be needed for transaction recovery.
the tmp folder.

Additionally, if you are deploying applications through the Management tools (CLI, Web Console) you will find a “content” data where deployment unit are stored.

│   │   └── 2bbedd17970ea2728ea71661e944fedc16faba
│   │   └── content
│   └── 35
│   └── 863f1e5c8a8b03b4148d4f9f3c41b19acb3ba3
│   └── content

Also, the data folder is used to store WSDL generated for your SOAP Web service endpoints:

└── wsdl
└── jaxws-pojo-service.war
└── JSEBeanService.wsdl

You should never delete/modify the content of the “data” folder or you might end up breaking your WildFly / JBoss EAP installation.
In the unfortunate event that you already touched/removed the “data” folder, the best option to get a successful start of WildFly is to remove both the tmp/* and data/* content, then clean up all deployments from your “deployments” folder and from your XML configuration:

<deployments>
  <!-- remove or comment 
    <deployment name="jaxws-pojo-service.war" runtime-name="jaxws-pojo-service.war">
        <content sha1="35863f1e5c8a8b03b4148d4f9f3c41b19acb3ba3"/>
    </deployment>
  -->
</deployments>

Managing the “tmp folder”

The tmp folder of WildFly / JBoss EAP is used for several purposes. If you are deploying Web applications, it is used to store compiled JSP files into Servlets:

│   └── org
│   └── apache
│   └── jsp
│   ├── index_jsp.class
│   └── index_jsp.java

Also, the tmp folder is used to cache applications (under the vfs folder) in “exploded” format:

tmp
└── vfs
    └── temp
        └── temp4d9a4f0bf7360a9e
            ├── content-94599702390aef75
            │   ├── META-INF
            │   │   ├── INDEX.LIST
            │   │   ├── MANIFEST.MF
            │   │   └── maven
            │   │       └── org.wildfly.quickstarts
            │   │           └── jaxws-pojo-service
            │   │               ├── pom.properties
            │   │               └── pom.xml
            │   └── WEB-INF
            │       ├── classes
            │       │   ├── log4j.properties
            │       │   └── org
            │       │       └── jboss
            │       │           └── quickstarts
            │       │               └── ws
            │       │                   └── jaxws
            │       │                       └── samples
            │       │                           └── jsr181pojo
            │       │                               └── JSEBean.class
            │       └── jboss-web.xml

The VFS (Virtual File System) is used to abstract resources into a single resource type, VirtualFile.
Quite the opposite to the “data” folder, it is safe to remove the content of the “tmp” folder in WildFly. Provided that you are operating when the application server is not running.

Found the article helpful? if so please follow us on Socials