The easiest way to migrate your project to the latest OpenXava version is to ask your AI assistant:
Migrate my project to OpenXava 8.0.1 following these instructions:
https://openxava.org/OpenXavaDoc/docs/migration_en.html
Apply only the sections after the OpenXava version in my pom.xml.
If your AI assistant cannot access the web, copy and paste the content of this page instead of the URL. Afterwards, review the changes and test your application.
Edit the pom.xml file in your project and change the value of the openxava.version property to point to the latest OpenXava version, thus:
<properties>
<openxava.version>8.0.1</openxava.version>
...
</properties>
If your current version is prior to 8.0 you should follow the instructions in the section Migration from OpenXava 7.7.3 to OpenXava 8.0 first.
Finally, revise the instructions below to adapt your code.
No issues.
Now Java 17 is the minimum supported version. If your project still uses Java 8 or 11 you should update it to compile with Java 17, 21 or 25. To do this modify the pom.xml:
<properties>
<maven.compiler.source>17</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target>
...
</properties>
Make sure you have a JDK 17 (or higher) installed on your system and configured in your IDE.
You can consult the official Java documentation for migration to Java 17 and if you use Java 8 the migration documentation from Java 8.
If you were using the AI chat feature in version 7.7, you had to add the openxava-7.7-chat-jdk17 dependency to your pom.xml. In version 8.0 this dependency is no longer needed because the chat functionality is now included in the OpenXava core.
Remove the following dependency from your pom.xml:
<!-- Remove this dependency -->
<dependency>
<groupId>org.openxava</groupId>
<artifactId>openxava-7.7-chat-jdk17</artifactId>
<version>${openxava.version}</version>
</dependency>
If you don't remove it, your build will fail because this artifact does not exist in version 8.0.
Projects created from the OpenXava 7.7 archetypes include an AGENTS.md file with instructions for AI coding assistants, and a .xava folder with code examples for them. In OpenXava 8.0 the openxava-agents-examples artifact no longer exists, so you have to remove the unpack-agents-examples execution of the maven-dependency-plugin from your pom.xml:
<!-- Remove this execution -->
<execution>
<id>unpack-agents-examples</id>
<phase>initialize</phase>
<goals>
<goal>unpack</goal>
</goals>
<configuration>
<artifactItems>
<artifactItem>
<groupId>org.openxava</groupId>
<artifactId>openxava-agents-examples</artifactId>
<version>${openxava.version}</version>
<outputDirectory>.xava</outputDirectory>
<includes>agents/**</includes>
</artifactItem>
</artifactItems>
</configuration>
</execution>
If you don't remove it, your build will fail because this artifact does not exist in version 8.0. Keep the other execution that unpacks the DTDs (xava/dtds/*).
Then delete the .xava folder from your project and remove the /.xava/ entry from your .gitignore.
Finally, update your AGENTS.md. The new version instructs the AI assistant to always use jakarta.* imports (never javax.*) and points to the code examples directly on GitHub instead of the local .xava folder. The easiest way is to replace your AGENTS.md with the one included in the OpenXava 8.0 archetype. If you prefer to keep your current file, at least remove the references to ./.xava/agents/test and add a note to use jakarta.* imports.
In OpenXava 7.7 the application was started with a custom launcher class located in the run package, which called AppServer.run() to start an embedded Tomcat, and it was executed with mvn exec:java (configured through the exec-maven-plugin). In OpenXava 8.0 the application is a standard Spring Boot application started with mvn spring-boot:run.
Remove your old launcher class (the one in the run package) and create a Spring Boot application class that extends org.openxava.spring.OpenXavaApplication. Place it in the root package of your application:
// BEFORE: src/main/java/com/yourcompany/yourapp/run/yourapp.java
package com.yourcompany.yourapp.run;
import org.openxava.util.*;
public class yourapp {
public static void main(String[] args) throws Exception {
DBServer.start("yourapp-db");
AppServer.run("yourapp");
}
}
// AFTER: src/main/java/com/yourcompany/yourapp/YourappApplication.java
package com.yourcompany.yourapp;
import org.openxava.util.DBServer;
import org.openxava.spring.OpenXavaApplication;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
public class YourappApplication extends OpenXavaApplication {
public static void main(String[] args) throws Exception {
DBServer.start("yourapp-db"); // Only for the bundled HSQLDB, remove it if you use your own database
SpringApplication.run(YourappApplication.class, args);
}
}
Extending OpenXavaApplication (which extends SpringBootServletInitializer) makes the application work both when launched with Spring Boot and when deployed as a WAR in an external servlet container.
In your pom.xml, remove the exec-maven-plugin and add the spring-boot-maven-plugin pointing to your new application class:
<!-- REMOVE this plugin -->
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>3.1.0</version>
<configuration>
<mainClass>${project.groupId}.${project.artifactId}.run.${project.artifactId}</mainClass>
</configuration>
</plugin>
<!-- ADD this plugin -->
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>4.1.0</version>
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
</execution>
</executions>
<configuration>
<mainClass>com.yourcompany.yourapp.YourappApplication</mainClass>
</configuration>
</plugin>
Also, since the embedded server is now provided by Spring Boot, you must not exclude the Tomcat jars from your WAR. Remove the WEB-INF/lib/tomcat-*.jar line from the packagingExcludes of the maven-war-plugin if it is present.
In OpenXava 7.7 the datasource was declared via JNDI in src/main/webapp/META-INF/context.xml. With Spring Boot you remove the datasource declarations (the <Resource> entries) from that file and define the datasource in src/main/resources/application.properties instead. OpenXava binds this Spring datasource to the JNDI name used in persistence.xml, so you don't need to change persistence.xml.
server.servlet.context-path=/yourapp
server.tomcat.additional-tld-skip-patterns=htmlunit-*.jar,jetty-*.jar
spring.datasource.username=sa
spring.datasource.password=
spring.datasource.hikari.maximum-pool-size=20
spring.datasource.hikari.minimum-idle=5
spring.datasource.hikari.connection-timeout=10000
# HSQLDB
spring.datasource.url=jdbc:hsqldb:hsql://localhost:1666
spring.datasource.driver-class-name=org.hsqldb.jdbcDriver
If your application uses more than one datasource (for example because it has secondary persistence-units in persistence.xml), declare the additional ones in the same application.properties using the openxava.datasources.<name>.* prefix. The default datasource keeps using spring.datasource.*. OpenXava creates each additional datasource and binds it to the JNDI name declared in its jndi property, which must match the one used in persistence.xml. There is no need for any Java configuration class:
openxava.datasources.companya.jndi=jdbc/companyaDS
openxava.datasources.companya.url=jdbc:hsqldb:file:data/company-a-db
openxava.datasources.companya.username=sa
openxava.datasources.companya.password=
openxava.datasources.companya.driver-class-name=org.hsqldb.jdbcDriver
openxava.datasources.companya.maximum-pool-size=20
openxava.datasources.companya.minimum-idle=5
openxava.datasources.companya.connection-timeout=10000
openxava.datasources.companyb.jndi=jdbc/companybDS
openxava.datasources.companyb.url=jdbc:hsqldb:file:data/company-b-db
openxava.datasources.companyb.username=sa
openxava.datasources.companyb.password=
openxava.datasources.companyb.driver-class-name=org.hsqldb.jdbcDriver
This way the whole database configuration of your application stays in a single declarative file, equivalent to the old context.xml but in the standard Spring Boot style.
To start the application use:
mvn spring-boot:run
The old mvn exec:java command no longer applies.
When the application runs with Spring Boot's embedded Tomcat, the src/main/webapp/WEB-INF/web.xml file is not processed. This means that any servlets, filters, or listeners declared in web.xml will not be registered. You must declare your custom servlets using the @WebServlet annotation (and @WebFilter, @WebListener for filters and listeners) in the Java class itself:
<!-- BEFORE: src/main/webapp/WEB-INF/web.xml -->
<servlet>
<servlet-name>testServlet</servlet-name>
<servlet-class>com.yourcompany.yourapp.servlets.TestServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>testServlet</servlet-name>
<url-pattern>/test</url-pattern>
</servlet-mapping>
// AFTER: src/main/java/com/yourcompany/yourapp/servlets/TestServlet.java
import jakarta.servlet.annotation.WebServlet;
import jakarta.servlet.http.HttpServlet;
@WebServlet("/test")
public class TestServlet extends HttpServlet {
// ...
}
OpenXava's auto-configuration already scans the org.openxava and com.openxava packages for @WebServlet, @WebFilter, and @WebListener annotations, so if your servlets are in those packages they will be picked up automatically. If your servlets are in a different package, add @ServletComponentScan to your application class with the appropriate base packages.
Since web.xml is no longer needed, you should delete the src/main/webapp/WEB-INF/web.xml file. When the application is deployed as a WAR in an external servlet container, the annotations are processed by the container automatically, so web.xml is not required in either scenario.
With Spring Boot the logging system has changed, so the javaLoggingLevel and hibernateJavaLoggingLevel properties in xava.properties no longer have effect. Now you configure the log level in application.properties instead.
Before in xava.properties:
javaLoggingLevel=FINE
hibernateJavaLoggingLevel=FINE
After in application.properties:
logging.level.org.openxava=DEBUG
logging.level.org.hibernate=DEBUG
The equivalent levels are: SEVERE = ERROR, WARNING = WARN, INFO = INFO, FINE = DEBUG, FINER/FINEST = TRACE.
OpenXava 8.0 uses Jakarta Persistence 3.2 and Hibernate 7.4. This implies significant changes compared to previous versions. Below we detail the most common issues you may encounter when migrating your application.
You can consult the official Hibernate migration guide for more information.
The main change is replacing the javax namespace with jakarta in all JPA annotations. This affects your entities, key classes, and any code using persistence annotations.
// BEFORE
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.ManyToOne;
// AFTER
import jakarta.persistence.Entity;
import jakarta.persistence.Id;
import jakarta.persistence.ManyToOne;
Also, if you use import org.hibernate.annotations.*; in your files, this can cause ambiguity between org.openxava.annotations.View and org.hibernate.annotations.View. The solution is to use specific imports:
// BEFORE
import org.hibernate.annotations.*;
// AFTER
import org.hibernate.annotations.GenericGenerator;
import org.hibernate.annotations.Parameter;
import org.hibernate.annotations.Type;
The persistence.xml file requires updating the namespace to version 3.2 of Jakarta Persistence:
<persistence version="3.2"
xmlns="https://jakarta.ee/xml/ns/persistence"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="https://jakarta.ee/xml/ns/persistence
https://jakarta.ee/xml/ns/persistence/persistence_3_2.xsd">
The JNDI name format for the data source in persistence.xml has changed. In OpenXava 7.x the name used java:// as prefix, but in OpenXava 8.0 you must use java: (without the double slash). The old format with // does not work in 8.0:
<!-- BEFORE (7.x) -->
<non-jta-data-source>java://comp/env/jdbc/yourappDS</non-jta-data-source>
<!-- AFTER (8.0) -->
<non-jta-data-source>java:comp/env/jdbc/yourappDS</non-jta-data-source>
If you use properties for schema generation in your persistence.xml, you must update them from javax.persistence.* to jakarta.persistence.*:
<!-- OLD (javax) -->
<property name="javax.persistence.schema-generation.database.action" value="update"/>
<property name="javax.persistence.create-database-schemas" value="true"/>
<!-- NEW (jakarta) -->
<property name="jakarta.persistence.schema-generation.database.action" value="update"/>
<property name="jakarta.persistence.create-database-schemas" value="true"/>
The hibernate.jdbc.factory_class property with value org.hibernate.jdbc.NonBatchingBatcherFactory is no longer valid in Hibernate 7. Remove this property from your persistence.xml.
In Hibernate 7 the org.hibernate.dialect.MySQL5Dialect class has been removed. If your persistence.xml uses it, replace it with org.hibernate.dialect.MySQLDialect. Using the old class will make Hibernate fall back to a different dialect and fail during schema generation (for example with Unknown table 'sequences' in information_schema):
<!-- BEFORE (7.x) -->
<property name="hibernate.dialect" value="org.hibernate.dialect.MySQL5Dialect"/>
<!-- AFTER (8.0) -->
<property name="hibernate.dialect" value="org.hibernate.dialect.MySQLDialect"/>
Hibernate 7 requires MySQL 8.0 or higher. It generates datetime(6) for Timestamp fields and uses DELETE statements with an alias that older MySQL versions do not support properly.
The JDBC URL must also include the database name explicitly. A URL without a database, such as jdbc:mysql://localhost:3306, will produce No database selected errors. You must use a URL like jdbc:mysql://localhost:3306/myapplicationdb:
# BEFORE
spring.datasource.url=jdbc:mysql://localhost:3306
# AFTER
spring.datasource.url=jdbc:mysql://localhost:3306/myapplicationdb
Hibernate 7 no longer allows using @Column(scale=..., precision=...) or @Digits(integer=..., fraction=...) on float or double types:
// ERROR in Hibernate 7
@Column(scale=7, precision=7)
private double axisY;
Solution: Use @DecimalMax from Jakarta Validator instead:
// Valid solution
@DecimalMax("0.9999999")
private double axisY;
In Hibernate 6+ nested joins must use the full path from the root entity. You cannot use the alias of a previous join as a prefix for a nested join.
// INCORRECT (Fails in Hibernate 6+)
SELECT e FROM Product2 e
LEFT JOIN e.subfamily e_subfamily
LEFT JOIN e_subfamily.family e_subfamily_family -- Error!
// CORRECT (Full path from root entity)
SELECT e FROM Product2 e
LEFT JOIN e.subfamily e_subfamily
LEFT JOIN e.subfamily.family e_subfamily_family -- Correct!
If you sort or filter by a common field (like name, id, description, code, etc.) and the query has JOINs, Hibernate will throw the Ambiguous unqualified attribute reference exception. You must always qualify property references with the entity alias:
// INCORRECT (Fails in Hibernate 6+)
SELECT e FROM Traveler e
LEFT JOIN e.lastJourney e_lastJourney
ORDER BY name -- Error! 'name' exists in both Traveler and Journey
// CORRECT
SELECT e FROM Traveler e
LEFT JOIN e.lastJourney e_lastJourney
ORDER BY e.name -- Correct!
Hibernate 7 does not allow using the alias of an aggregate function (like sum()) in the GROUP BY clause. Moreover, all the non-aggregated properties of the SELECT must be included in the GROUP BY:
// INCORRECT (Fails in Hibernate 7)
select new org.openxava.invoicedemo.dashboards.InvoicedPerCustomer(i.customer.name, sum(i.total) as amount)
from Invoice i
group by i.customer.number, amount -- Error! 'amount' is an aggregate
order by amount desc
// CORRECT
select new org.openxava.invoicedemo.dashboards.InvoicedPerCustomer(i.customer.name, sum(i.total) as amount)
from Invoice i
group by i.customer.number, i.customer.name -- Correct!
order by amount desc
With Hibernate 6/7, @IdClass classes containing fields that are @ManyToOne relationships must be adapted:
// BEFORE (Not compatible with Hibernate 6/7)
public class CityKey implements Serializable {
@ManyToOne(fetch=FetchType.LAZY)
@JoinColumn(name="STATE", referencedColumnName="ID")
private State state;
private int code;
}
// AFTER (Compatible)
public class CityKey implements Serializable {
private String state; // Primary key type of State
private int code;
}
The main entity does not require changes to its @Id or @ManyToOne annotations.
In Hibernate 6+ boolean literals are compiled directly to SQL dialect boolean literals, which can break compatibility with databases that use CHAR types for booleans (like OpenXava with SiNoType).
// INCORRECT (Generates error in Hibernate 6+)
Query query = XPersistence.getManager()
.createQuery("from Invoice as o where o.paid = true");
// CORRECT (Use parameters)
Query query = XPersistence.getManager()
.createQuery("from Invoice as o where o.paid = :paid");
query.setParameter("paid", true);
Custom types require several changes in Hibernate 7:
Custom types (UserType and CompositeUserType) practically need to be rewritten for the new Hibernate 7 API. The changes are deep and include method removal, signature changes, and new use of @Embeddable. Consult the Hibernate documentation for complete details.
For CompositeUserType with multiple columns, change @Columns to @AttributeOverrides:
// BEFORE
@CompositeType(org.openxava.types.Date3Type.class)
@Columns(columns = {
@Column(name="YEARDELIVERY"),
@Column(name="MONTHDELIVERY"),
@Column(name="DAYDELIVERY")
})
// AFTER
@CompositeType(org.openxava.types.Date3Type.class)
@AttributeOverrides({
@AttributeOverride(name="year", column=@Column(name="YEARDELIVERY")),
@AttributeOverride(name="month", column=@Column(name="MONTHDELIVERY")),
@AttributeOverride(name="day", column=@Column(name="DAYDELIVERY"))
})
Native queries to CHAR columns now return Character instead of String. Use toString() to convert:
// Before (Hibernate 5.6)
String value = (String) query.getSingleResult();
// After (Hibernate 7.4)
String value = query.getSingleResult().toString();
In Hibernate 5 the default UUID was 32 characters (without dashes), but in Hibernate 7 it is 36 characters (with dashes). If you have existing tables with columns sized for 32 characters, you need to use @UUID32 annotation from OpenXava to keep the 32-character format:
// BEFORE (Hibernate 5)
@Id @GeneratedValue(generator="system-uuid") @Hidden
@GenericGenerator(name="system-uuid", strategy = "uuid")
@Column(length=32)
private String id;
// AFTER (Hibernate 7 with @UUID32)
@Id @Hidden
@UUID32
@Column(length=32)
private String id;
Import: import org.openxava.annotations.UUID32;
Hibernate 7.4 strictly enforces the JPA specification for the @OrderBy annotation. Using a nested path (such as association.property) in @OrderBy will throw a NullPointerException on startup during the SessionFactory building.
According to the JPA specification, @OrderBy must refer directly to basic attributes of the target entity. If you need to sort a collection based on an attribute of an associated entity, you must expose that column in the target entity as a read-only field and sort by it.
// INCORRECT (Fails with NullPointerException in Hibernate 7.4)
@OneToMany(mappedBy="role")
@OrderBy("module.name asc")
private Collection<ModuleRights> modulesRights;
// CORRECT
// 1. Map the join column as a read-only basic property in the target entity (ModuleRights):
@Column(name="modules_name", insertable=false, updatable=false)
private String moduleName;
// 2. Sort by the basic property in the parent entity:
@OneToMany(mappedBy="role")
@OrderBy("moduleName asc")
private Collection<ModuleRights> modulesRights;
Hibernate 7.4 generates invalid DDL when using @Column(columnDefinition=...) with a full column definition that includes a DEFAULT clause and the schema migration mode (jakarta.persistence.schema-generation.database.action=update) is enabled. This happens because Hibernate concatenates the entire columnDefinition as the column type in the ALTER COLUMN ... SET DATA TYPE statement, producing SQL that databases like HSQLDB reject with unexpected token: DEFAULT.
// INCORRECT (Generates invalid ALTER DDL in Hibernate 7.4)
@Column(columnDefinition="varchar(1) default 'Y' not null")
private boolean active;
// CORRECT (Use standard JPA attributes + @ColumnDefault)
@Column(length=1, nullable=false)
@org.hibernate.annotations.ColumnDefault("'Y'")
private boolean active;
This issue typically manifests at startup when Hibernate tries to migrate the schema for existing tables. The fix is to replace the raw columnDefinition with standard JPA attributes (length, nullable) for the column metadata and @org.hibernate.annotations.ColumnDefault for the default value, which Hibernate treats as separate metadata instead of concatenating it into the type clause.
In Hibernate 7.4, byte[] properties without @Lob are mapped to a varbinary(255) column by default. This is too small for most binary data (files, images, documents, etc.) and causes a string data, right truncation error at startup when Hibernate tries to migrate the schema of existing tables that contain data larger than 255 bytes:
// ERROR in Hibernate 7.4 (varbinary(255) is too small)
private byte[] data;
Add @Lob so that Hibernate maps the column to a large binary type (BLOB) instead of varbinary(255):
// CORRECT
@Lob
private byte[] data;
If you use MySQL and need to support files larger than 16 MB, also add @Column(length = Integer.MAX_VALUE) so that MySQL uses LONGBLOB instead of TINYBLOB or MEDIUMBLOB:
// For MySQL with files larger than 16 MB
@Lob
@Column(length = Integer.MAX_VALUE)
private byte[] data;
OpenXava 8.0 uses Jakarta Validator 3.1 and Hibernate Validator 9.1. This implies changes in validation annotations.
You can consult the official Hibernate Validator migration guide for more information.
Change the validation imports:
// BEFORE
import javax.validation.constraints.*;
import javax.validation.Payload;
// AFTER
import jakarta.validation.constraints.*;
import jakarta.validation.Payload;
OpenXava 8.0 has migrated its entire web layer to the modern Jakarta Servlet 6.1 specification running on Tomcat 11. This requires adjusting any custom servlet components, JSP views, and web configurations in your application.
The standard Java Servlet classes have changed their package namespace. If your application defines custom filters, servlets, listeners, or other servlet-related classes, you must rename the imports:
// BEFORE
import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.jsp.*;
// AFTER
import jakarta.servlet.*;
import jakarta.servlet.http.*;
import jakarta.servlet.jsp.*;
Since OpenXava 8.0 uses Spring Boot, the web.xml file is no longer processed when running with the embedded Tomcat. As explained in the Spring Boot migration section, you should delete src/main/webapp/WEB-INF/web.xml and declare your servlets, filters, and listeners using annotations (@WebServlet, @WebFilter, @WebListener) instead.
If for any reason you need to keep web.xml (for example for a WAR-only deployment in an external servlet container), it must be updated to reference the Servlet 6.1 namespace:
<web-app xmlns="https://jakarta.ee/xml/ns/jakartaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="https://jakarta.ee/xml/ns/jakartaee
https://jakarta.ee/xml/ns/jakartaee/web-app_6_1.xsd"
version="6.1">
Standard JavaServer Pages Standard Tag Library (JSTL) URIs have changed from their legacy sun.com locations to the new jakarta.tags namespace. If you have custom JSP files, you must update the taglib directives:
<%-- BEFORE --%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
<%-- AFTER --%>
<%@ taglib uri="jakarta.tags.core" prefix="c" %>
<%@ taglib uri="jakarta.tags.fmt" prefix="fmt" %>
<%@ taglib uri="jakarta.tags.functions" prefix="fn" %>
OpenXava 8.0 has upgraded the file upload library to Apache Commons FileUpload 2. This version includes important changes in its package names and API design, particularly around the FileItem interface which is exposed in several OpenXava public APIs (such as WithFileItem, IProcessLoadedFileAction, and the @FileItemUpload annotation).
All classes from the org.apache.commons.fileupload package have been moved. If your custom actions process uploaded files, you must update the package imports:
// BEFORE
import org.apache.commons.fileupload.FileItem;
// AFTER
import org.apache.commons.fileupload2.core.FileItem;
If your application instantiates factories or upload handlers manually, note that DiskFileItemFactory now uses a builder pattern, and ServletFileUpload has been replaced with the Jakarta-specific implementation:
// BEFORE
DiskFileItemFactory factory = new DiskFileItemFactory();
ServletFileUpload upload = new ServletFileUpload(factory);
// AFTER
DiskFileItemFactory factory = DiskFileItemFactory.builder().get();
JakartaServletFileUpload upload = new JakartaServletFileUpload(factory);
OpenXava 8.0 has migrated the REST client (JAX-RS, implemented by Jersey) and the JSON binding API to the Jakarta namespace. JAX-RS has been upgraded to 4.0 (Jersey 4.0) and Jakarta JSON Binding to 3.0. If your application uses the JAX-RS client or JSON-B annotations (for example in a service that consumes a REST web service), update the imports from the javax namespace to jakarta:
// BEFORE
import javax.ws.rs.client.*;
import javax.json.bind.annotation.*;
// AFTER
import jakarta.ws.rs.client.*;
import jakarta.json.bind.annotation.*;
The API of these classes (such as ClientBuilder, @JsonbProperty, etc.) remains the same, so no further changes are required in your code.
In addition, OpenXava 8.0 no longer includes Jersey or Jakarta JSON Binding as transitive dependencies of the openxava artifact, because the framework itself does not use them. If your application relies on these libraries, add the following dependencies to your pom.xml:
<dependency>
<groupId>jakarta.json.bind</groupId>
<artifactId>jakarta.json.bind-api</artifactId>
<version>3.0.2</version>
</dependency>
<dependency>
<groupId>org.glassfish.jersey.core</groupId>
<artifactId>jersey-client</artifactId>
<version>4.0.2</version>
</dependency>
<dependency>
<groupId>org.glassfish.jersey.inject</groupId>
<artifactId>jersey-hk2</artifactId>
<version>4.0.2</version>
</dependency>
<dependency>
<groupId>org.glassfish.jersey.media</groupId>
<artifactId>jersey-media-json-binding</artifactId>
<version>4.0.2</version>
</dependency>
If you do not use JAX-RS or JSON-B in your application, you can ignore this section.
OpenXava 8.0 no longer includes Groovy as a transitive dependency of the openxava artifact, because the framework itself does not use it. Groovy was previously provided so that application developers could write entities and other code in Groovy without adding an extra dependency.
If your application uses Groovy, add the following dependency to your pom.xml:
<dependency>
<groupId>org.apache.groovy</groupId>
<artifactId>groovy</artifactId>
<version>4.0.32</version>
</dependency>
If you do not use Groovy in your application, you can ignore this section. For more details about using Groovy with OpenXava, see the Groovy documentation.
OpenXava 8.0 has migrated from javax.inject:1 (JSR 330) to Jakarta Dependency Injection 2.0.1 (jakarta.inject:jakarta.inject-api:2.0.1). This is the Jakarta EE equivalent of the same JSR 330 specification, with the only change being the package namespace from javax.inject to jakarta.inject. The @Inject and @Named annotations work exactly the same way, so if your actions or controllers use dependency injection, you just need to update the imports:
// BEFORE
import javax.inject.*;
// AFTER
import jakarta.inject.*;
The semantics of @Inject and @Named remain unchanged. For example, the following action code requires no modification beyond the import:
public class AddColumnsAction extends ViewBaseAction {
@Inject @Named("xava_customizingTab")
private Tab tab;
// ...
}
OpenXava 8.0 has removed the last javax.ejb dependency. The old EJB exception classes are no longer available in the classpath, so any code that used them must be updated to the OpenXava equivalents.
The following exceptions now live in the org.openxava.model package and keep the same semantics and hierarchy:
Update the imports in your code and any catch or throws clauses that reference the old javax.ejb names:
// BEFORE
import javax.ejb.CreateException;
import javax.ejb.FinderException;
import javax.ejb.ObjectNotFoundException;
import javax.ejb.RemoveException;
import javax.ejb.DuplicateKeyException;
// AFTER
import org.openxava.model.CreateException;
import org.openxava.model.FinderException;
import org.openxava.model.ObjectNotFoundException;
import org.openxava.model.RemoveException;
import org.openxava.model.DuplicateKeyException;
Public APIs such as MapFacade, the persistence providers, and the action base classes now throw the new org.openxava.model exceptions. If you were catching javax.ejb.FinderException, ObjectNotFoundException, etc., catch the OpenXava versions instead.
OpenXava no longer uses java.rmi.RemoteException as a system-level error. It has been replaced by the runtime exception org.openxava.util.SystemException. This only affects you if your code referenced RemoteException explicitly; most applications need no changes.
Your own interfaces or classes that declared throws RemoteException by imitating the old OpenXava style are not required to change, but you may clean them up for consistency.
Direct Web Remoting (DWR) has been completely removed from OpenXava. DWR was a library unmaintained since 2016, which represented a significant security risk. Furthermore, DWR does not support the Jakarta namespace, meaning it cannot function on modern servlet containers like Tomcat 11. Therefore, DWR is neither included nor can it be added to OpenXava 8.0 projects since it will not work.
DWR was primarily used internally by OpenXava, so standard projects should not be affected. However, if you have developed your own custom editor by copying an OpenXava editor that relied on DWR, you must migrate it. A simple and robust option is to migrate from DWR to JavaScript fetch combined with a standard Java Servlet.
You can refer to the following example of this migration in OpenXava:
Using an AI assistant to migrate your DWR logic to modern fetch + servlet is highly recommended and usually yields excellent results.
The OpenXava user interface generator (the xava folder, which included core.jsp, detail.jsp, list.jsp, buttonBar.jsp, bottomButtons.jsp, sections.jsp, etc.) has been completely rewritten in plain Java (in the org.openxava.web.render package) and all those JSP files have been removed from OpenXava.
If your project (especially if it comes from OpenXava 6 or older, where JSPs were copied directly into the project) contains customized copies of these core JSP files in the src/main/webapp/xava (or web/xava) folder, these customizations will no longer take effect because OpenXava no longer invokes those JSPs. You can safely remove those obsolete JSP files from your project.
Note that this only affects core xava JSPs. The following elements continue to work with JSP as before:
OpenXava 8.0 introduces a redesigned user interface with a design token system (spacing, corner radius, elevations, typography scale and transitions defined as CSS variables in base.css). As part of this redesign the available themes have changed:
themes=auto.css, light.css, dark.cssThe accent color of the application (primary buttons, focus rings, hover states) can now be customized redefining a single variable in the custom.css of your project (src/main/webapp/xava/style/custom.css):
:root {
--accent-color: #0d9488; /* Your brand color */
--accent-color-hover: #0f766e; /* A darker variant for hover */
--accent-soft: #f0fdfa; /* A very light tint for hover backgrounds */
}
If you want to keep the look of the removed terra theme, you can recreate it in custom.css redefining the theme variables:
:root {
--terra: #CDB380;
--light-terra: #E8DDCB;
--dark-terra: #806632;
--acqua: #036564;
--acqua-profonda: #033649;
--accent-color: var(--acqua-profonda);
--accent-color-hover: var(--acqua);
/* Modules left menu */
--modules-list-color: var(--light-terra);
--modules-list-background: var(--acqua-profonda);
--modules-list-selected-color: white;
/* Module header */
--module-header-color: white;
--module-header-background: var(--acqua-profonda);
/* Button bar */
--button-bar-background: var(--terra);
/* Backgrounds & labels */
--background: var(--light-terra);
--color: var(--dark-terra);
/* Actions */
--action-color: var(--acqua);
--action-hover-color: var(--acqua-profonda);
--action-hover-background: white;
}
Applications with their own custom CSS themes that extend base.css keep working; the legacy --my-* variables are still honored by light.css. However, note that base.css now uses the Inter typeface (instead of Roboto), a 14px base font size (instead of 13px) and standardized corner radius and shadows, so your custom theme may need small visual adjustments.
The default label format has changed from NORMAL (label to the left of the field) to SMALL (label above the field). This affects all forms in your application. If you prefer the previous behavior, set the defaultLabelFormat property in xava.properties:
defaultLabelFormat=NORMAL
OpenXava 8.0 upgrades JasperReports from version 6 to version 7. JasperReports 7 introduced a breaking change in the JRXML format: the old Apache Commons Digester based parser was replaced by a Jackson XML based parser, which uses a different XML grammar. This means that JRXML files created with JasperReports 6 or earlier (including those generated by iReport or older versions of Jaspersoft Studio) are not directly compatible with JasperReports 7.
OpenXava 8.0 includes an automatic on-the-fly conversion mechanism: when a legacy JRXML file is detected at runtime, it is transparently converted to the JasperReports 7 format using an XSLT transformation. This means that in most cases your existing reports will continue to work without any action on your part.
If a report uses constructs that cannot be converted automatically, you will get a clear error message indicating what the unsupported construct is. In that case, open the report with Jaspersoft Studio 7 and save it to convert it manually.
If you prefer to convert all your JRXML files at once instead of relying on the on-the-fly conversion, you can use the JRXMLMigrator utility included in OpenXava. Run it from the command line:
java -cp "target/yourapp/WEB-INF/lib/*" org.openxava.reports.JRXMLMigrator src/main/resources/reports
Where yourapp in target/yourapp/ is the finalName of your project (usually the artifactId from pom.xml). Run this from inside your project directory after mvn package. The exploded WAR in target/yourapp/WEB-INF/lib/ contains all the dependency jars needed by the migrator, including the OpenXava jar where JRXMLMigrator lives.
This will scan the given directory for .jrxml files, convert the ones that are in the old format, and leave the already-converted ones untouched. Files that cannot be converted will be reported with the reason.
Since JDK 25, annotation processing is no longer enabled by default, so Lombok does not work unless you configure the maven-compiler-plugin. Projects created from OpenXava 7.6 onwards often declare Lombok under annotationProcessorPaths with a fixed version. That works, but forces you to keep that version in sync whenever OpenXava upgrades Lombok.
In OpenXava 8.0 the recommended approach is to enable full annotation processing from the classpath. Lombok then comes transitively from the openxava dependency, so you always use the same version as OpenXava without declaring it in your pom.xml.
In the build/plugins section of your pom.xml, replace the maven-compiler-plugin configuration, and add a profile activated for JDK 23 or higher:
<!-- BEFORE -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.12.0</version>
<configuration>
<source>${maven.compiler.source}</source>
<target>${maven.compiler.target}</target>
<encoding>${project.build.sourceEncoding}</encoding>
<annotationProcessorPaths>
<path>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.18.40</version>
</path>
</annotationProcessorPaths>
</configuration>
</plugin>
<!-- AFTER -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.12.0</version>
<configuration>
<source>${maven.compiler.source}</source>
<target>${maven.compiler.target}</target>
<encoding>${project.build.sourceEncoding}</encoding>
</configuration>
</plugin>
And after the build section, as a direct child of project:
<!-- Enable annotation processing from classpath (Lombok via openxava); required since JDK 25.
-proc:full only since JDK 23, so it lives in this profile to keep JDK 17 builds working. -->
<profiles>
<profile>
<id>jdk23-annotation-processing</id>
<activation>
<jdk>[23,)</jdk>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<proc>full</proc>
</configuration>
</plugin>
</plugins>
</build>
</profile>
</profiles>
If your pom.xml does not yet include the maven-compiler-plugin, add the AFTER plugin plus the profile. This is required when you compile with JDK 25, even if your maven.compiler.source/target is 17 or 21. With this setup, future OpenXava upgrades that change the Lombok version no longer require editing a hidden version number in your application pom.xml.
The <proc>full</proc> option goes in the profile, not directly in build, because the -proc:full flag does not exist before JDK 23. If you put it in build, compiling with JDK 17 or 21 fails with error: invalid flag: -proc:full. With the profile, the same pom.xml works with JDK 17, 21 and 25.
To migrate to OpenXava 7.7.3 from any previous version of OpenXava: