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.
Questions tagged [stateless-session-bean]
188 questions
2
votes
0 answers
How i force my custom ConstraintValidator to stop execution of method when validator return force?
i made a custom ConstraintValidator , and it work when i assign its annotation to any method , but i noticed that it only make the method to return 500 internal server error and prevent method from print or return any output , but i noticed that any…

Jason4Ever
- 1,439
- 4
- 23
- 43
2
votes
0 answers
@EJB dependency injection query regarding Local Stateless Session bean (EJB 3.x)
I have 2 EJB projects.
Ejb1
Ejb2
Ejb1 has Stateless Local Session bean.
package p1;
@Stateless
public class CallerNew implements CallerLocal {
Ejb2 has Stateless Remote Session bean.
package p2;
@Stateless
public class MobilePhone…

Abhi
- 41
- 1
- 2
2
votes
2 answers
Can different threads access different methods of a specific instance of a stateless EJB?
@Stateless
public class MyBean1 {
pulic void method1() {
//method implementation
}
pulic void method2() {
//method implementation
}
}
Consider a specific instance of MyBean1. Then we know that method1() or…

siva636
- 16,109
- 23
- 97
- 135
2
votes
2 answers
Can we access/call Stateless Session Bean from Static method?
I am injecting a Stateless session bean in a class that has many static methods.
I would like to access this bean from these Static method. There is no documentation on this one.
So I wondering if its allowed. If yes, any downsides? Recommended /…

Kevin Rave
- 13,876
- 35
- 109
- 173
2
votes
1 answer
Stateless bean: private field reinitialization
I'm new in EJB. I heard that in some cases it is acceptable to store some information (such as configurations) in stateless beans. As I understand the stateless bean lifecycle begin on bean's method invocation and end on method conclusion. After…

VB_
- 45,112
- 42
- 145
- 293
2
votes
0 answers
Hibernate EntityManager - Closed Connection
I'm using EntityManagers to perform operations on the DB. However, and this happens like 20% of the time, the connection obtained by the EntityManager is closed and I can't perform any action. The EntityManager is open since i do check for that, but…

Brams
- 309
- 1
- 5
- 20
2
votes
1 answer
EJB3 with Spring Java Configuration
I need to inject a spring bean into an EJB 3 stateless session bean. The spring bean is declared in a jar file and initialized via a spring @Configuration class. All the examples I have run into thus far only suggest using beanRefContext.xml file…

user2224554
- 41
- 5
2
votes
2 answers
Scalability implications of converting stateless session beans to POJOs
Imagine a heavily-used service object that's implemented as an EJB 2.1 SLSB, and that also happens to be thread-safe in itself by virtue of having no state whatsoever. All its public methods are transactional (via CMT), most simply requiring a…

Andrew Swan
- 13,427
- 22
- 69
- 98
2
votes
1 answer
How to retrieve sql table with all its data using java
I am trying to make a Java EE project with SQL as my database and glassfish as my server.
I want to retrieve all the data in my table in to a html page but I have to use servlet and session beans. My output will be shown in a html page.

Predator Ajmera
- 25
- 1
- 3
2
votes
1 answer
Stateless session bean called out of context missing EntityManager
I am new to Java EE so my question may be very basic. I have built following REST web service with Stateless session bean (simplyfied):
@Path("/list/")
@Produces({MediaType.APPLICATION_XML,…

Macejkou
- 636
- 3
- 14
- 24
2
votes
1 answer
Caching objects in EJB 3.0
Which programming pattern (and product) I should use to create a generic in-memory object cache in EJB 3.0 stateless session bean?
Does use of static member variables or singleton pattern cause any side-effects in clustered environment, if cache is…

Sami Korhonen
- 1,254
- 8
- 17
2
votes
0 answers
Weblogic + Stateless Local Bean + DataSource Injection mistake
I Have a Stateless Local Bean like that:
@Stateless(name="GerencialFacadeBean", mappedName="GerencialFacade")
public class GerencialFacadeBean implements GerencialFacadeBeanLocal {
@Resource(name="jdbc/adq_sistint", mappedName =…

user1595509
- 61
- 5
2
votes
1 answer
EJB. When I call a Session Bean with var List throws: this javax.ejb.EJBException: java.rmi.MarshalException
I created a java web project in netbeans, I created my entities beans and later deployed my project to generate my Database, this work was successful.
Then I generated my session beans to access the database created. I created a main class to test…

Will86
- 157
- 1
- 4
- 13
1
vote
1 answer
perform sequential transaction using ejb2 stateless session bean
I want to perform client request in order they called session bean. But sometimes second request executed successfully before first one.
Is sequential client request execution is possible using ejb2 stateless session Bean ?
public generate(){
…

chetan
- 3,175
- 20
- 72
- 113
1
vote
2 answers
Execute some logic before every stateless bean method
I need to execute a logic before every call in a stateless bean method.
Example:
class MyStatelessBean
{
void myPreExecutionLogic()
{
System.out.println("pre method execution logic");
}
void method1()
{
…

Wagner Paz
- 11
- 1