Questions tagged [session-bean]

A session bean encapsulates business logic that can be invoked programmatically by a client over local, remote, or web service client views.

To access an application that is deployed on the server, the client invokes the session bean’s methods. The session bean performs work for its client, shielding it from complexity by executing business tasks inside the server.

96 questions
2
votes
2 answers

EJB : Singleton session bean or more like applicaton bean

I'm running through again the Javaee7 oracle documentation and here's what's stated. "A singleton session bean is instantiated once per application and exists for the lifecycle of the application. Singleton session beans are designed for…
yapkm01
  • 3,590
  • 7
  • 37
  • 62
2
votes
2 answers

Why session beans are called so?

As I see in examples, every java class can be defined as a session bean in ejb, even if there is no http session defined and used inside them. So, why are they called session beans?
Alex Hero
  • 57
  • 1
  • 4
2
votes
2 answers

Java EE @TransactionManagement.BEAN - how does it combine with container managed beans?

How will the transaction started in callSessionBean2() behave in the following scenario? Is it suspended? What happens if an exception is thrown in SessionBean2? SessionBean2 was setup with BEAN transaction management type because it does not…
Rasmus Franke
  • 4,434
  • 8
  • 45
  • 62
2
votes
2 answers

Can't get session scoped bean on session timeout

I need to get a proxied session-scoped bean on the HttpSessionListener.sessionDestroyed(). The objective is doing a session cleanup when it gets destroyed (either by invalidate() or timeout). I added the ContextLoaderListener to expose the context…
Caio Cunha
  • 23,326
  • 6
  • 78
  • 74
2
votes
2 answers

How to achieve clustering, load balancing and fail-over for Session Beans in OGS

JBoss seems to have a pretty easy set of annotations/configurations for clustering and load balancing session beans, but I'm not seeing the same features in the GlassFish 3.x docs. Let's say I have both MyStatefulBean and MyStatelessBean beans. For…
IAmYourFaja
  • 55,468
  • 181
  • 466
  • 756
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

How to update the JSF sessionscoped managed bean if i access it?

As title. The problem is the attribute in the bean is fixed after init(). I want to update the count attribute when ever i access #{managedBean.xyz} method in JSF I want to stick with the sessionscoped instead of view/request because it saves some…
Tommy
  • 1,960
  • 1
  • 19
  • 32
1
vote
2 answers

Is it enough to convert a POJO to an EJB session bean ...?

Is it enough to convert a POJO like Util class to an EJB session bean by putting an annotation (@Stateless or @Stateful) and using injected EntityManager in it?
chala
  • 11
  • 1
1
vote
0 answers

unable to invoke server2 EJB via server1

I want to invoke server2's EJB via server1, but still received by server 1. Look at my cliet code & screenshot test1 & test2 is ok test3 is fail Does anyone know how to do? thanks Server:wildfly-10.1.0.Final EJB:3.2 Screenshot Test Code Session…
1
vote
0 answers

How to call an entity class inside servlet in JEE. Beginner JEE programer

Im trying to use an entity class on my code but im getting "exception java.lang.NoClassDefFoundError:" exception. My student entity class: package entity; import java.io.Serializable; import javax.persistence.Entity; import…
1
vote
2 answers

How can I gracefully handle JSF application failures?

If my JSF applications, I'll sometimes come across a bug that, for example, corrupts a user session bean somewhere and the user is stuck looking @ a bunch of java exception gobbly-gook on their screen. The only way they can fix this is to restart…
wsaxton
  • 1,030
  • 15
  • 34
1
vote
1 answer

JAX-RS on EJB 3.1 Session Bean which only has Remote Interface

Can I use JAX-RS annotations like @Path on an EJB 3.1 session bean which only has a remote interface? This works: @Path("/service") @Stateless public class ServiceOne { @POST @Path("/foo") public Response foo() { return…
1
vote
0 answers

Spring Session cannot serialize session-scoped bean which created by AOP

I got very similar issue to below case: https://github.com/spring-projects/spring-session/issues/52 but not work when change to use RequestContextFilter instead of RequestContextListener :( Below is some of my application config: I use spring 4.23 +…
Paul Yiu
  • 56
  • 9
1
vote
1 answer

Cannot select project name when creating new session bean in eclipse

While creating a new session bean in eclipse for an ejb project, I can't seem to select the project name and hence cannot create a session bean. I'm using JBoss 7.1 ,ejb module 3.1 and jdk 1.8.
Deven
  • 55
  • 8
1
vote
1 answer

JSF + HashMap and its key

I have a database with 2 tables CD and Song. Session bean access then entity classes of those two tables. In my backing bean, I just have a String cd and HashMap cds that will hold the list of CD return back from my sessionbean, so…
Thang Pham
  • 38,125
  • 75
  • 201
  • 285