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
23
votes
2 answers

Is it possible to define a jax-rs service interface separated from its implementation (with eclipse and jersey)?

I don't know if the title is confusing, but let's say I have this interface: @Produces(MediaType.APPLICATION_JSON) @Path("/user") public interface UserService { @GET @Path("/{userId}") public Response getUser(@PathParam("userId") Long…
dierre
  • 7,140
  • 12
  • 75
  • 120
22
votes
2 answers

How to inject a non-serializable class (like java.util.ResourceBundle) with Weld

I want to create a Producer that makes it possible to inject a java.util.ResourceBundle into any class in order to get localized Strings easily. My ResourceBundle-Producer looks like this: public class ResourceBundleProducer { @Inject …
Wolkenarchitekt
  • 20,170
  • 29
  • 111
  • 174
21
votes
10 answers

FilerException when building Java EE 6 Project

I have a Java EE 6 Project in Netbeans 7 which runs fine when I compile and start it in the IDE. However, when I clean and build the project, I am getting a java.lang.RuntimeException: javax.annotation.processing.FilerException: Attempt to…
Jan Algermissen
  • 4,930
  • 4
  • 26
  • 39
21
votes
2 answers

EAR vs separate EJB + WAR

What's the difference in deploying application as EAR (with 1 EJB and 1 WAR module) vs separate modules? I want to use GlassFish 3 web profile but it does not support EAR archive. Can I simply use EJB and WAR as separate modules? Any other options?
karolkpl
  • 2,189
  • 10
  • 39
  • 60
21
votes
3 answers

Java CDI @PersistenceContext and thread safety

Is an EntityManager @Inject[ed] as follows in muliple classes threadsafe? @PersistenceContext(unitName="blah") private EntityManager em; This question and this one seem to be Spring specific. I am using Jave EE CDI services
auser
  • 6,307
  • 13
  • 41
  • 63
20
votes
2 answers

Java EE 6 : @Inject and Instance

I have a question about the @Inject annotation in java ee 6 : What is the difference between : @Inject private TestBean test; @Inject private Instance test2; To have the reference : test2.get(); Some infos about Instance :…
jihedMaster
  • 331
  • 1
  • 3
  • 11
20
votes
1 answer

How to work with interfaces and JPA

I should start out by saying that I am fairly new to Java EE and that I do not have a strong theoretical background in Java yet. I'm having trouble grasping how to use JPA together with interfaces in Java. To illustrate what I find hard I created a…
Niklas Norin
  • 355
  • 1
  • 3
  • 9
20
votes
2 answers

How to set JSF2 with faces servlet mapping?

I have a simple JSF2 app using Facelets. My web.xml is set as follows:- Faces Servlet *.jsf I want to set the app to default to the welcome page which is…
oidsman
  • 385
  • 1
  • 5
  • 17
20
votes
4 answers

JPA Nested Transactions And Locking

Consider the scenario two methods exists in different stateless bean public class Bean_A { Bean_B beanB; // Injected or whatever public void methodA() { Entity e1 = // get from db e1.setName("Blah"); entityManager.persist(e1); …
anergy
  • 1,374
  • 2
  • 13
  • 29
19
votes
1 answer

Is it possible to @Inject a @RequestScoped bean into a @Stateless EJB?

Is it possible to inject a request-scoped CDI bean into a Stateless session bean? I had asked a related question and thought the specific CDI @RequestScoped into @Stateless question merited its own post. Passing state between EJB methods /…
wrschneider
  • 17,913
  • 16
  • 96
  • 176
19
votes
1 answer

@OneToOne(optional=false) and @JoinColumn(nullable=false) used together

I've bumped into this example in JPA 2.0 FR Specification, 11.1.37. OneToOne Annotation, page 403: @OneToOne(optional=false) @JoinColumn(name="CUSTREC_ID", unique=true, nullable=false, updatable=false) public CustomerRecord getCustomerRecord() {…
Piotr Nowicki
  • 17,914
  • 8
  • 63
  • 82
19
votes
5 answers

Unsatisfied dependencies for type [...] with qualifiers [@Default] at injection point (using @Stateful EJB with CDI)

I have the following code to manage two kinds of repositories. Both repository classes inherit an interface to allow reinitialization of their resources. public interface CachingRepository { public void invalidateCache(); } Global,…
Kawu
  • 13,647
  • 34
  • 123
  • 195
18
votes
5 answers

Why does maven not copy the properties files during the build process?

Nothing I've found has been able to help me solve this one specific case. I recently switched from a plain old java web app project (which was working) to a maven web project. I get the following runtime…
Nicholas22j
  • 183
  • 1
  • 1
  • 5
18
votes
2 answers

How can i config module and application name for JNDI Lookups

In EJB 3.1 JNDI Lookups can be made with different Lookup-Names: java:global[/]//! java:global[/]//
Michael W.
  • 531
  • 2
  • 7
  • 17
18
votes
2 answers

httpOnly Session Cookie + Servlet 3.0 (e.g. Glassfish v3)

By default, Glassfish v3 doesn't set the httpOnly flag on session cookies (when created as usual with request.getSession()). I know, there is a method javax.servlet.SessionCookieConfig.setHttpOnly(), but I'm not sure, if that's the best way to do…
Chris Lercher
  • 37,264
  • 20
  • 99
  • 131