Questions tagged [java-ee-6]

Use this tag for questions relating specifically to Java Enterprise Edition 6.

Java Enterprise Edition 6 (JEE6) is a specification defining a collection of Java-based technologies and how they interoperate. JEE6 incorporates a set of technologies, including EJB3, JPA, JSF, CDI, etc.

Numerous implementations are available in the form of both commercial products and open source projects.

Information

This tag is specific for the Java EE 6 version. See the tag for general Java EE questions.

Useful links

2030 questions
147
votes
4 answers

What is javax.inject.Named annotation supposed to be used for?

I am trying to understand the javax.inject package and I am not clear what the javax.inject.Named annotation is supposed to be used for. The Javadoc does not explain the the idea behind it. Javadoc is at…
ams
  • 60,316
  • 68
  • 200
  • 288
111
votes
3 answers

How do CDI and EJB compare? interact?

I'm having a tough time understanding how the two interact and where the boundary between them lies. Do they overlap? Are there redundancies between them? I know there are annotations associated with both, but I haven't been able to find a complete…
Tim
  • 6,851
  • 11
  • 42
  • 46
109
votes
3 answers

Java EE 6 @javax.annotation.ManagedBean vs. @javax.inject.Named vs. @javax.faces.ManagedBean

I feel there is a little mess in the Java EE 6 spec. There are several sets of annotations. We have javax.ejb annotations like @Stateful and @Stateless for creating EJBs. There is also a @javax.annotation.ManagedBean to create a managed bean. There…
Piotr Gwiazda
  • 12,080
  • 13
  • 60
  • 91
91
votes
16 answers

Java EE 6 vs. Spring 3 stack

I'm starting a new project now. I have to choose technologies. I need something light, so no EJB or Seam. On the other hand I need JPA (Hibernate or alternative) and JSF with IceFaces. Do you think that such a stack on Spring 3 deployed on Tomcat is…
Piotr Gwiazda
  • 12,080
  • 13
  • 60
  • 91
73
votes
3 answers

Is CDI a good replacement of Spring?

We are planning to write a web application from the scratch, it has been decided to go with the latest edition of Glassfish which complies with Java EE 6 standard, therefore we are analyzing if CDI can be used instead of Spring. Can we say that CDI…
prassee
  • 3,651
  • 6
  • 30
  • 49
69
votes
5 answers

Use Enum type as a value parameter for @RolesAllowed-Annotation

I'm developing a Java enterprise application, currently doing Java EE security stuff to restrict access for particular functions to specific users. I configured the application server and everything, and now I'm using the RolesAllowed-annotation to…
Wolkenarchitekt
  • 20,170
  • 29
  • 111
  • 174
61
votes
1 answer

Where can I find a list of all the reference implementations for Java EE 6?

Do you know if there is a list with all the reference implementation for every component of Java EE 6? I.e. GlassFish is the reference container, Hibernate Validator for validation, etc.
Maxime ARNSTAMM
  • 5,274
  • 10
  • 53
  • 76
58
votes
8 answers

Glassfish DeploymentException: Error in linking security policy for

I have been trying to deploy my web application (war) from Glassfish AdminConsole but I keep getting the following error message - Exception while loading the app : Error in linking security policy for MyApp-war -- Inconsistent Module State. But it…
Bhesh Gurung
  • 50,430
  • 22
  • 93
  • 142
49
votes
3 answers

What's the difference between standalone and domain on JEE6?

I'm starting an JBoss to use on the development, and I'm using it as standalone. I read that on the production environment the JBoss should be as a domain. I searched for that to understand what's the difference between than. But I didn't found any…
endrigoantonini
  • 1,191
  • 2
  • 15
  • 28
49
votes
3 answers

Excluding fields in JAXB

I have 2 classes: @XmlRootElement public class A { private Long id; private B b; // setters and getters } and @XmlRootElement public class B { private Long id; private String field1; private String field2; // setters…
Piotr Nowicki
  • 17,914
  • 8
  • 63
  • 82
45
votes
4 answers

Testing an EJB with JUnit

How should I test an EJB 3.1 which gets an instance of EntityManager injected? A possible EJB: @Stateless @LocalBean public class CommentService { @PersistenceContext private EntityManager em; public List findAll() { …
Matthias
  • 7,432
  • 6
  • 55
  • 88
39
votes
3 answers

What is the difference between @Inject and @EJB

I'm currently learning the new Java EE 6 component models and am confused with the latest dependency injection mechanism. So here are my questions: 1) What is the difference between @Inject and @EJB 2) If I have a simple POJO that contains another…
xandross
  • 911
  • 2
  • 11
  • 17
37
votes
1 answer

EJB3 + JEE6: What is a persistent Timer?

I'm just about to use the new EJB3 TimerService (as part of Java EE 6), and as usual, I'm impressed by the brevity of JavaDoc :) Do you know what is the effect of the persistent property of the TimerConfig object? JavaDoc TimerConfig says: The…
Hank
  • 4,597
  • 5
  • 42
  • 84
35
votes
1 answer

Select MAX timestamp with JPA2 Criteria API

So my entity has: @Column(name="TS", nullable=false) private java.sql.Timestamp timestamp; My generated MetaModel has: public static volatile SingularAttribute timestamp; I want to select by the Max Timestamp…
planetjones
  • 12,469
  • 5
  • 50
  • 51
35
votes
1 answer

What is Weld, JSR-299?

I've found lots of tutorials showing Weld code samples, but not an introductory overview. Could you please suggest an introductory article, or answer the following: What does Weld do/give you? How does it relate to Java EE 6? How would one use it…
retrodev
  • 2,323
  • 6
  • 24
  • 48
1
2 3
99 100