Questions tagged [ejb-3.1]

This tag is used for question related to the session bean and message-driven bean component types of the EJB 3.1 programming model.

JSR 318: Enterprise JavaBeans, Version 3.1

Enterprise JavaBeans is an architecture for the development and deployment of component-based business applications. Applications written using the Enterprise JavaBeans architecture are scalable, transactional, and multi-user secure.

The Enterprise JavaBeans 3.0 specification focused on bringing ease-of-use to the EJB API. The purpose of the Enterprise JavaBeans 3.1 specification is to further simplify the EJB architecture by reducing its complexity from the developer's point of view, while also adding new functionality in response to the needs of the community.

The focus will be on the core session bean and message-driven bean component models and their client API. Although the Java Persistence API was developed within EJB 3.0, it will evolve under a separate JSR rather than within EJB 3.1.

1103 questions
8
votes
1 answer

EJB 3.1. Is @Local annotation needed?

So far, I almost always worked with no-interface EJBs and have a slight understanding about the need of @Local annotation. Consider this example: public interface MyBeanIntf { void doStuff(); } @Stateless public class MyBean implements MyBeanIntf…
jFrenetic
  • 5,384
  • 5
  • 42
  • 67
8
votes
3 answers

Passing state between EJB methods / @RequestScoped and @Stateless

I have a @RequestScoped CDI bean that I want to turn into an EJB to get declarative transactions. (I'm on EJB 3.1, Java EE 6) Currently, I am passing state between subroutines, under the assumption that the instance is only used in a single…
wrschneider
  • 17,913
  • 16
  • 96
  • 176
8
votes
2 answers

@MessageDriven transactions and redelivery semantics

What's the best way to accomplish the following? @MessageDriven bean does some work on database on failure, I want to roll back the DB transaction but I also want the JMS message NOT to be redelivered, i.e., don't re-try. I can think of a few ways…
wrschneider
  • 17,913
  • 16
  • 96
  • 176
8
votes
2 answers

Difference between MDB and JMS

Please let me know what is the difference between: Message Driven Beans (MDB) Java Message Service (JMS)
JavaUser
  • 25,542
  • 46
  • 113
  • 139
8
votes
3 answers

Fixing "Could not resolve a persistence unit..." errors when PU is specified, found

I'm running Glassfish 3.1-SNAPSHOT as of today (2010-11-12). I'm using the embedded EJBContainer. On the classpath, as reported by the EJBContainer, I have a META-INF/persistence.xml. This file defines two persistence units: one called "ngp" and…
Laird Nelson
  • 15,321
  • 19
  • 73
  • 127
8
votes
1 answer

Invoking remote ejb in a 2-node wildfly cluster

I am trying to invoke remote ejb on each node of a cluster with nodes node1 & node2, but i am always getting node1. Deployed EJB & client code as EAR file in both nodes. Application is running on Wildfly 9 ApplicationServer. Invoked client code from…
Sumanth
  • 595
  • 3
  • 14
  • 39
8
votes
2 answers

EJB 3.1 application deployed as WAR-only: What about ejb-jar.xml?

I have a JavaEE6 application, consisting of Web stuff and EJBs and which is deployed as WAR-only (using EJB3.1). The build is based on Maven. I just read about a new possibility to order the module initialization in Java EE 6 here which i also need…
Wolkenarchitekt
  • 20,170
  • 29
  • 111
  • 174
8
votes
1 answer

WildFly: How to test EJB using embedded container?

I'm doing my first Java EE project and I want to preform a test. I searched and found that since EJB 3.1, there's the possibility of using an embedded EJB container to test the business layer. I'm using WildFly but I haven't found how to configure…
codenoob
  • 257
  • 3
  • 15
8
votes
1 answer

EJB 3.1 Binding does not work on Websphere Application Server

I want to call a local Stateless-EJB from on ejb project from another singleton-EJB in another ejb-project. Both EJB-Projects are in the same ear file. The Application Server is a WebSphere Application Server 8.0.0.1. First EJB 3.1-Project…
veote
  • 1,400
  • 9
  • 33
  • 62
8
votes
3 answers

Maven 2 & Packaging ejb vs jar

If i'm working with ejb 3.1, what's the différence between jar and ejb ... org.apache.maven.plugins maven-ejb-plugin
tweetysat
  • 2,187
  • 14
  • 38
  • 75
8
votes
3 answers

what is the purpose of including empty beans.xml in CDI implemenations projects?

I am using weld,a RI of CDI as dependency injection component in my JSF-EJB-JPA web app. I see in my project we have empty beans.xml in META-INF/beans.xml in ejb.jar and WEB-INF/beans.xml in my WAR. I don't get it why we need to keep empty…
SRy
  • 2,901
  • 8
  • 36
  • 57
7
votes
1 answer

Java EE 6 - The Persistent Domain Objects pattern - any successes?

I have a moderately complex application using POJOs, and now come to migrated it to EJB3.1 so it can be deployed online, accessed through REST services and benefit from the container environment (persistence being the most major, but transactions…
user1180316
  • 448
  • 4
  • 12
7
votes
3 answers

Does CDI make sense if there is no Web layer and hence no HTTP session?

The new JSR 299 "Contexts and Dependency Injection for Java EE" seems to be based on the concept of "Scope". The beans are created and associated to one of the supported Scopes: Application, Session (mapped to a HTTP session), Conversation, and…
Mr.Eddart
  • 10,050
  • 13
  • 49
  • 77
7
votes
1 answer

@Asynchronous not resulting in async invocation of EJB method in JBossAS7

I'm struggling to figure out why an @Asynchronous method in my EJB isn't actually being invoked asynchronously. I'm running on JBoss AS 7 using CDI (with beans.xml) in a JSF2 project with simple .war packaging produced by Maven. The EJB is packaged…
Craig Ringer
  • 307,061
  • 76
  • 688
  • 778
7
votes
3 answers

Unit Testing EJB 3.1

I am doing a small research on Unit Testing of EJB 3.1. At the end my goal is to produce a easy to use solution for Unit Testing EJB 3.1. I do not have much knowledge with big EJB implementations and hence I would like to first get some…
Bala
  • 1,193
  • 2
  • 12
  • 34