--
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/d040fcb3-0398-4bc0-bec6-946d5c12ac3cn%40googlegroups.com.
Hi,Actually I managed to solve 1 and 2 now and since 3 only shows up during startup it is not a show stopper, only annoying.
ErrorMessage 1: Problem was that I injected a SessionScoped Object (a logged in User) in my RequestScoped SFSB. And that's why I got the errorMessage that "session" is null.
ErrorMessage 2: I removed @Stateful from my NavigationBean. I didn't need the features of it anyway since it's basically just a POJO. Although I don't understand why it can't be a SFSB. Maybe because I use it to put in my JSF ViewParameters?
It sounds like removing @Stateful helped avoid the error since extended persistence context are only supported in @Stateful bean. Meaning that the persistence context is now treated as a transaction scoped persistence context which avoids the previously thrown WFLYEJB0034 error. In terms of whether the throwing of the WFLYEJB0034 error is a bug or not, I think that would be an interesting question to explore.
Do you happen to know if the previously mentioned "persistence context already in transaction =ExtendedEntityManager" bean was in the current call stack? I will call that bean, the unknown bean for now. Or was the previous call to the unknown bean done within the same active (JTA) transaction and the call to a unknown bean method had completed before the call to the NavigationBean?
To summarize the possibilities:
A. An unknown bean method was first called and the unknown bean method then called the NavigationBean method which threw the error.
B. An unknown bean method was first called and the unknown bean method returned to the caller. The caller than then called the NavigationBean method which threw the error.
I hope that ^ makes sense.
ErrorMessage 3: Still there. Guess there are some more things to fix in my code. Any ideas, please tell me. It annoys me even though it just shows up during startup of the server and only in production with at least some load. I guess there are some old SFSB hanging around that it tries to passivate and then try to save the state of and then tries to insert things in my database? This is strange behaviour.
If you get this locally on your machine, you could turn on TRACE logging for org.hibernate category and org.jboss.as.jpa which should help identify the part of your application that influences the unexpected insert to happen. https://docs.wildfly.org/31/Developer_Guide.html#troubleshooting has more details about enabling TRACE logging.
Thanks,
Scott
To view this discussion on the web visit https://groups.google.com/d/msgid/wildfly/76aaa42b-3089-4ef8-8390-fdd9dd468220n%40googlegroups.com.
On 3/30/24 05:17, Susanne Jarl wrote:
Hi,Actually I managed to solve 1 and 2 now and since 3 only shows up during startup it is not a show stopper, only annoying.
ErrorMessage 1: Problem was that I injected a SessionScoped Object (a logged in User) in my RequestScoped SFSB. And that's why I got the errorMessage that "session" is null.
ErrorMessage 2: I removed @Stateful from my NavigationBean. I didn't need the features of it anyway since it's basically just a POJO. Although I don't understand why it can't be a SFSB. Maybe because I use it to put in my JSF ViewParameters?It sounds like removing @Stateful helped avoid the error since extended persistence context are only supported in @Stateful bean. Meaning that the persistence context is now treated as a transaction scoped persistence context which avoids the previously thrown WFLYEJB0034 error. In terms of whether the throwing of the WFLYEJB0034 error is a bug or not, I think that would be an interesting question to explore.
Do you happen to know if the previously mentioned "persistence context already in transaction =ExtendedEntityManager" bean was in the current call stack? I will call that bean, the unknown bean for now. Or was the previous call to the unknown bean done within the same active (JTA) transaction and the call to a unknown bean method had completed before the call to the NavigationBean?
To summarize the possibilities:
A. An unknown bean method was first called and the unknown bean method then called the NavigationBean method which threw the error.
B. An unknown bean method was first called and the unknown bean method returned to the caller. The caller than then called the NavigationBean method which threw the error.
I will make a few more assumptions now. Since the default WildFly configuration standalone.xml contains the following, I will assume that possibility (B) is what we experienced for the mentioned failure:
"
<subsystem xmlns="urn:jboss:domain:jpa:1.1">
<jpa default-extended-persistence-inheritance="DEEP"/>
</subsystem>
"
If you happen to be using <jpa default-extended-persistence-inheritance="SHALLOW"/, please let me know that as well.
I think that we should create a https://issues.redhat.com/browse/WFLY issue requesting an enhancement request to allow extended persistence contexts (XPC) to be able to share the XPC joined to the current active JTA transaction which I think would of avoided the error message 2 (WFLYJPA0030).
Let me know if you can create a
https://issues.redhat.com/browse/WFLY for ^.
Thanks,
Scott
<f:metadata>
<o:viewParam name="urlId" value="#{navigationBean.urlId}" />
<o:viewAction action=”#{myBean.find()}" onPostback="true" />
</f:metadata>
ErrorMessage 3: Still there. Guess there are some more things to fix in my code. Any ideas, please tell me. It annoys me even though it just shows up during startup of the server and only in production with at least some load. I guess there are some old SFSB hanging around that it tries to passivate and then try to save the state of and then tries to insert things in my database? This is strange behaviour.If you get this locally on your machine, you could turn on TRACE logging for org.hibernate category and org.jboss.as.jpa which should help identify the part of your application that influences the unexpected insert to happen. https://docs.wildfly.org/31/Developer_Guide.html#troubleshooting has more details about enabling TRACE logging.
The problem is that this error only appears in production with some load. I would be nice to solve this problem as well.