Questions tagged [ejb]

Enterprise JavaBeans (EJB) is a managed, server-side component architecture for modular construction of enterprise applications. The EJB specification is one of several [Java] APIs in the [Java EE] specification.

Enterprise JavaBeans (EJB) is a managed, component architecture for modular construction of enterprise applications which runs on an . The EJB specification is one of several APIs in the specification.

See also and

Tutorials

JBoss 4 EJB 3 Tutorial

JBoss 5 EJB 3 Tutorial

Video Tutorials

EJB Video Training

Reference :

Wikipedia

Oracle

6693 questions
17
votes
3 answers

javax.ejb.EJBException: Illegal non-business method access on no-interface view

I'm using EclipseLink on GlassFish 3.1.1 and I'm trying to understand this exception: javax.ejb.EJBException: Illegal non-business method access on no-interface view at…
Ryan
  • 7,499
  • 9
  • 52
  • 61
17
votes
3 answers

What is the point of a Facade in Java EE?

I'm not really understanding the point of a facade. public abstract class AbstractFacade { private Class entityClass; public AbstractFacade(Class entityClass) { this.entityClass = entityClass; } protected abstract…
Drew H
  • 4,699
  • 9
  • 57
  • 90
17
votes
3 answers

difference between jsf beans and ejb beans

I need some clarification. I know how to work with JSF and its corresponding session beans, but i am getting confused with EJB. What is the difference between the beans introduced with EJB and the session beans used with JSF (for ejb i know about…
Alexis
  • 171
  • 1
  • 1
  • 3
17
votes
2 answers

JBoss EAP 6.x understand the deployment phase - ResourceAdapters, EJB, jar, war

In JBoss, how is the sequence of the deployment phase? What is the order of object being instantiated and available to use? Considering an enterprise application (*.ear), inspecting all deployment log (server.log) the deployment phase looks…
StarsSky
  • 6,721
  • 6
  • 38
  • 63
17
votes
2 answers

Injection of HttpServletRequest

I am using ejb 3 and trying to @Inject HttpServletRequest, but while deploying I occur exception. Code: @Inject private HttpServletRequest httpRequest; Exception: org.jboss.weld.exceptions.DeploymentException: WELD-001408 Unsatisfied dependencies…
user1679671
16
votes
2 answers

Using a Stateful Session Bean to track an user's session

it's my first question here and I hope that I'm doing it right. I need to work on a Java EE project, so, before starting, I'm trying to do something simple and see if I can do that. I'm stuck with Stateful Session Beans. Here's the question : How…
StepTNT
  • 3,867
  • 7
  • 41
  • 82
16
votes
5 answers

How to mock services with Arquillian?

Is it possible to use some kind of mocking framework with Arquillian, or precisely how to mock injected EJBs? I know that, with using the CDI (Contexts and Dependency Injection), it is possible to inject alternatives in test. But without CDI as…
Teliatko
  • 1,521
  • 1
  • 14
  • 15
16
votes
3 answers

How does UserTransaction propagate?

I have a stateless bean with bean-managed transactions, and a method like this: @Stateless @TransactionManagement(TransactionManagementType.BEAN) public class ... { @Resource private UserTransaction ut; @EJB private…
Truong Ha
  • 10,468
  • 11
  • 40
  • 45
16
votes
3 answers

Wildfly DuplicateServiceException

I have created simple EAR application using Maven archetype: wildfly-javaee7-webapp-ear-blank-archetype/8.2.0.Final http://s17.postimg.org/cy8zbpiu7/Zrzut_ekranu_z_2015_02_13_23_15_10.png My log from starting wildFly: Java HotSpot(TM) 64-Bit Server…
KamilJ
  • 249
  • 3
  • 5
  • 14
16
votes
1 answer

Startup ejb bean does not work

I am trying to do something at startup using a startup ejb. But my bean is never called. This is my bean: import javax.annotation.PostConstruct; import javax.ejb.Startup; import javax.inject.Singleton; @Singleton @Startup public class StartupBean…
cremersstijn
  • 2,375
  • 4
  • 28
  • 41
15
votes
2 answers

EJB - Home/Remote and LocalHome/Local interfaces

Revising some past exam papers for an exam mainly focus on component-oriented design and J2EE, I have come across the following question: A preliminary investigation of scenario 3: “Exchange Request” suggests that two EJBs will provide a suitable…
Peter Perháč
  • 20,434
  • 21
  • 120
  • 152
15
votes
3 answers

How to handle internal calls on Spring/EJB/Mockito... proxies?

As you many know when you proxy an object, like when you create a bean with transactional attributes for Spring/EJB or even when you create a partial mock with some frameworks, the proxies object doesn't know that, and internal calls are not…
Sebastien Lorber
  • 89,644
  • 67
  • 288
  • 419
15
votes
2 answers

Inject @EJB bean based on conditions

A newbie question: is there anyway that I can inject different beans based on a condition that I set in a properties file. Here's what I want to achieve: I set some value in properties file. If it's true, then I want to public class MyClass{ …
neo
  • 2,461
  • 9
  • 42
  • 67
15
votes
3 answers

Transaction rollback and web services

Given an example of calling two web services methods from a session bean, what if an exception is thrown between the calls to two methods? In the case of not calling the web services the transaction will rollback and no harm done. However, the web…
Andreas Tasoulas
  • 453
  • 2
  • 8
  • 22
15
votes
2 answers

Building a standalone executeable JAR with OpenEJB

I am building a CLI tool, which integrates with several EJB modules. For this reason, I need to build a fat jar, which is then executed as a standalone application. However, executing this fat jar with java -jar (Note: conf/openejb.xml is in the…
rzo1
  • 5,561
  • 3
  • 25
  • 64