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
0
votes
2 answers
NullPointerException when calling session bean from Thread
I have some problem with my simple exercise program. I want to call a session bean from thread but it become NullPointer exception! but if I call it from a main thread it can run normally
this is warning and exception
Warning: C:\Documents…

cherry
- 37
- 1
- 1
- 9
0
votes
0 answers
EJB reinjected all dependencies before each business method call
This question is not a doubt, in truth is a tip.
Did you know that a session EJB reinjected all dependencies before each business method call? Well, I didn't know until few minutes ago and it gave me a big headache.
I thought that the dependency…

Marlon Patrick
- 2,366
- 1
- 18
- 26
0
votes
2 answers
Encapsulating stateless beans inside a stateful session
I have a Java EE application using EJBs, and perform most of the functions through Stateless EJBs.
I have a requirement for all users to also have an active session, and I'm wondering what the best way of using the beans are.
Currently, I have a…

Antix
- 369
- 3
- 19
0
votes
1 answer
Parameter passing through remote session bean to DTO/DAO service backend
I'm relatively new to developing on JavaEE. I'm wondering what the best format is in terms of passing parameters into a session bean for object creation or deletion calls.
For my backend, I use a DTO with a DAO to run create, update, delete and read…

Antix
- 369
- 3
- 19
0
votes
1 answer
lookup EJB in member instantiate
i have an issue of saving a reference to an EJB as a member from a non EJB class (which is used as static member in an EJB)
say i have
@EJB(...)
@Stateless
public Class SessionBean implements MySession{
protected static MyHelper helper = new…

Yoni
- 375
- 3
- 19
0
votes
1 answer
injecting Session bean from another session bean in JBoss 7.1
I am not able to inject a SLSB in another SLSB. Actually created 3 projects
1) created a EJB project with an MDB
2) created a EJB project with a stateless session bean for posting the message
3) created a EJB project with a stateless session bean…

kalyani l
- 1
- 2
0
votes
1 answer
MongoDB JavaEE Singleton Extra Instances
So, i've been having this small issue while attempting to use MongoDB (And java driver), using Servlets EJBs and EJB Timers, running on Jboss 4.2.3.
I create a mongo singleton like so
private static Mongo mongoSingleton = null;
private…

user2351681
- 1
- 3
0
votes
1 answer
only one stateless bean created
I created one session bean and invoke it method in servlet like this:
@WebServlet(name = "NewServlet1", urlPatterns = {"/NewServlet1"})
public class NewServlet1 extends HttpServlet {
@EJB NewSessionBean bean;
protected void…

user2219773
- 3
- 1
0
votes
1 answer
Creating a new session Bean in javaee6
Please, I tried to add a simple session Bean to my javaee6 project and when I right clicked on the project->EJB->session Bean as shown on this link:
and clicked next, I got to the next link:
Everything was ok but i can't add the project's name.…

helpdesk
- 1,984
- 6
- 32
- 50
0
votes
2 answers
stateful bean behaving like a stateless bean
I'm new to EJB and try to write a implementation for EJB stateful bean but when I try to do the transaction its returning like a stateless bean
package beanpackage;
import javax.ejb.Stateful;
//import javax.ejb.Stateless;
/**
* Session Bean…

user1272855
- 82
- 1
- 8
0
votes
0 answers
Is it true that the session bean in Java EE can create a Shopping Cart like session in ASP
When I make a commercial website in ASP, I use the session to keep the items in shopping cart even the customer close the website (when they come back, all items still in their cart).
I am reading about Java EE, especially about stateless and…

MasterDark116
- 88
- 1
- 1
- 4
0
votes
1 answer
the method doesn't add daa in the database
i'm working on an ejb 3.0 tutorial and i want to add data to the database when i set run it doesn't indicate any error and it doesn't add the following data in the db either : this is the session bean code :
public String creerCompte(CompteBancaire…

marcAntoine
- 668
- 5
- 19
- 35
0
votes
1 answer
JNDI lookup - Is it a correct way in my app?
I am writing an application in Java and I have some REST web services there. My application has following structure: http://cl.ly/L7Pv/o
REST web service classes are Stateless session beans. It works like charm. But Classes in red on the picture…

Macejkou
- 636
- 3
- 14
- 24
0
votes
2 answers
inject specific EntityManager in stateless SessionBean on condition
I'm currently deal with web applications calling stateless Session Beans in order to interact with a database. My question is about how such application can call the same session bean in a way that the latter can choose which entity manager must use…
0
votes
2 answers
UserTransaction failed when call utx.begin() throws "java.lang.IllegalStateException: Operation not allowed"
i want to use ejb and jpa controller, in netbeans the controller is generated automatically... I try to call the jpa controller from class (UniversidadServiceEJB) that is a session bean stateless, I debugged the project and the UserTransaction and…

Will86
- 157
- 1
- 4
- 13