Wildfly created using Wildfly-maven-plugin raises error "Transaction is required to perform this operation"

249 views
Skip to first unread message

dafi

unread,
Feb 22, 2023, 11:05:13 AM2/22/23
to WildFly
I created a custom WF installation based on Wildfly-
26.1.3.Final using the maven plugin https://github.com/wildfly/wildfly-maven-plugin/

It works fine but when I try to make SQL insert from my app I obtain this error

 javax.persistence.TransactionRequiredException: WFLYJPA0060: Transaction is required to perform this operation (either use a transaction or extended persistence context)
10:47:37,259 ERROR [stderr] (default task-2)     at org.jboss.as.jpa.container.AbstractEntityManager.transactionIsRequired(AbstractEntityManager.java:880)
10:47:37,261 ERROR [stderr] (default task-2)     at org.jboss.as.jpa.container.AbstractEntityManager.persist(AbstractEntityManager.java:582)

So I downloaded a full copy of Wildfly-26.1.3.Final and the app works fine, insert, update, delete are executed correctly

My layer configuration is shown below, I know transactions is redundant...

<layers>
<layer>jaxrs-server</layer>
<layer>jpa</layer>
<layer>transactions</layer>
</layers>

What am I missing?

Env

maven 3.8.7
wildfly-maven-plugin 4.0.0.Final
JDK OpenJDK Runtime Environment Temurin-17.0.6+10 (build 17.0.6+10)

Wei Nan Li

unread,
Feb 22, 2023, 11:28:04 AM2/22/23
to dafi, WildFly
It could either be a source code bug or a config problem. Could you
please provide an example project that contains your setup and your
core part of the code which uses the transaction?
> --
> You received this message because you are subscribed to the Google Groups "WildFly" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to wildfly+u...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/wildfly/9032b28f-e52c-4067-a6a7-5cbcd4441af7n%40googlegroups.com.



--
Cheers,
Wei Nan | JBoss

dafi

unread,
Feb 23, 2023, 1:31:33 AM2/23/23
to WildFly
The application works fine under any Widlfly version since 18.x to 26.1.3 so the problem is releated to some missing layer, indeed I finally found the missing piece, the "ejb-lite" layer.
After adding "ejb-lite" all transactions works fine.

Thanks for your time

Wei Nan Li

unread,
Feb 23, 2023, 10:00:44 AM2/23/23
to dafi, WildFly
On Thu, Feb 23, 2023 at 2:31 PM dafi <davide.fi...@gmail.com> wrote:
>
> The application works fine under any Widlfly version since 18.x to 26.1.3 so the problem is releated to some missing layer, indeed I finally found the missing piece, the "ejb-lite" layer.
> After adding "ejb-lite" all transactions works fine.
>
Okay! btw here is the document that contains the list of WildFly
Galleon Layers for reference:

- https://github.com/wildfly/wildfly/blob/main/docs/src/main/asciidoc/_galleon/Galleon_layers.adoc
> To view this discussion on the web visit https://groups.google.com/d/msgid/wildfly/f2447f16-371f-4f3c-8baa-4eed3c60b7a8n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages