Questions tagged [stateless-session-bean]

A session bean encapsulates business logic that can be invoked programmatically by a client over local, remote, or web service client views. More specifically, a stateless session bean does not maintain a conversational state with the client, so it is mostly used as a service(e.g. rest api, persistence-retrieval) and does specific job without the need of keeping a state.

188 questions
1
vote
1 answer

EJB 3 : Can't inject bean in client code, both of which are managed by the same container

@Local public interface EJBA{ // declares a method 'validate' } @Stateless public class EJBABean implements EJBA{ // implements the method 'validate' } class Model{ @EJB private EJBA ejbA; public void doSomething(){ ejbA.validate(); } } Now,…
Daud
  • 7,429
  • 18
  • 68
  • 115
1
vote
1 answer

Is the ArroundInvoke method gets invoked if it were invoked from another ejb method?

I've the following case: @Interceptors(MyInterceptClass.class) public void ejbMethod1() { } @Interceptors(MyInterceptClass.class) public void ejbMethod2() { ejbMethod1(); } Is calling ejbMethod2 causes TWO interceptor calls to be…
Muhammad Hewedy
  • 29,102
  • 44
  • 127
  • 219
1
vote
1 answer

EJB - Serialization error while doing a JNDI lookup for a Stateful Session Bean

In my EJB project I have this Session Bean (Stateful): @Stateful public class StatefulShopCart implements StatefulShopCartLocal, Serializable { private static final long serialVersionUID = 1L; private transient HashMap
Emanuel
  • 6,622
  • 20
  • 58
  • 78
1
vote
1 answer

Hibernate 3.6.6.Final (JBoss 6.1) merge() transient object tree

I try to save an object tree with Hibernate's merge() method. Entity Auftrag (means "order" in English) contains a collection of Auftragsposition objects, mapped with cascade="all-delete-orphan. The persisting occurs in a stateless session bean,…
chabicht
  • 107
  • 6
1
vote
0 answers

Wildfly 13 ejb stateless session bean not removed from pool

When load increases then stateless session beans count increases but later stateless beans are not removed from slsb-strict-max-pool when all are idle. Is there any setting to remove idle stateless bean ? Same issue in wildly 21 also. See below,…
kunal
  • 323
  • 2
  • 9
1
vote
1 answer

Error while Creating JMS Message Producer in jboss EAP 7

I have configured JMS topic in JBOSS_EAP_7.0 and write a simple java code to create a message producer. I have the following stateless bean @Stateless public class ExchangeSenderFacadeWrapperBean { private static final OMSLogHandlerI logger =…
IsharaD
  • 322
  • 2
  • 4
  • 17
1
vote
1 answer

Debugging Hibernate "Session is closed!" - abuse of SSBs?

(First of all, this is not my code. Secondly, to protect the guilty, I have changed the class names to hide anything specific to my employer, so if things don't correspond with each other that's why!). Can someone help me clear up a doubt please? I…
Rich
  • 15,602
  • 15
  • 79
  • 126
1
vote
0 answers

NullPointerException when I try to inject the SessionContextImpl in wildfly 9.0.2

I'm migrating a jboss 5.1.0 GA application to Wildfly 9.0.2, in which I manage EJB, in a stateless bean the EJBContext was injected in this way in jboss 5 and it works: import javax.ejb.EJBContext; @Stateless @SecurityDomain…
emiaj
  • 11
  • 1
1
vote
2 answers

Starting a CDI conversation and injecting @ConversationScoped bean into stateless session bean

Similar questions have been asked, but don't quite address what I'm trying to do. We have an older Seam 2.x-based application with a batch job framework that we are converting to CDI. The job framework uses the Seam Contexts object to initiate a…
1
vote
3 answers

Change password for user in database

my question is to change password for user that is logged in the system. It prints out new password changed successfully but when i check it, the password remains the same and has not been changed. Is it because i use set.Password? Is there other…
user8779054
1
vote
2 answers

EJB stateful vs stateless session beans when using a DB

I am a little confused as to the usage of stateful session beans (SFSB) versus stateless session beans (SLSB). I understand that SFSB's maintain state with a client. This helped: When to use Stateful session bean over Stateless session bean? The…
ovg
  • 1,486
  • 1
  • 18
  • 30
1
vote
1 answer

@PostConstruct called on Stateful EJB invocation but not Stateless Why?

This question is an offshoot of another that I posted a couple of weeks ago: log4j2 logging of code in EJB jar on JBoss EAP 7. In that post I posed a problem and eventually a solution for logging initialization on EJBs deployed as EJB jars (not…
1
vote
1 answer

Using Timer in a stateless EJB method to time out long-running operation

I have a Stateless EJB containing various methods and I would like to use a timer in a function so that if the method takes longer than say 30 seconds, a timeout will occur and the caller will be notified. I have looked at the @Schedule annotation…
user1107888
  • 1,481
  • 5
  • 34
  • 55
1
vote
1 answer

Can you run EJB 2.1 beans in OSGi?

I have a J2EE 1.3 app that uses EJB 2.1 session and entity beans. Currently this app runs as an EAR file on JBoss. I'd like to switch to the SpringSource dm Application Server because of all the benefits that OSGi provides. Does anyone know if…
Andrew Swan
  • 13,427
  • 22
  • 69
  • 98
1
vote
2 answers

Can i make my own Singleton Stateless Bean with EJB 3.0?

Now, with EJB 3.1, we can find the javax.ejb.Singleton annocation that can ensure that this bean is going to be singleton. Is there a way that i can ensure singleton using stateless beans in EJB 3.0 with some modifications in my code (use of the…
mohamida
  • 804
  • 2
  • 11
  • 25