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
35
votes
3 answers

Can't find javax.ws.rs package in jdk

I'm trying to get into JAX-RS. My project jdk is set to 1.7.03. Does there have to be definitions of annotations for JAX-RS(javax.ws.rs)? If not, where I can find them?
narek.gevorgyan
  • 4,165
  • 5
  • 32
  • 52
31
votes
4 answers

How to define and in servlet 3.0's web.xml-less?

I have existing web-app which I want to convert into web.xml-less of servlet's 3.0. I've managed to make it working, however there are 2 tags in web.xml which I still don't know the equivalent code in web.xml-less environment.
Wins
  • 3,420
  • 4
  • 36
  • 70
30
votes
3 answers

What are the best debugging tricks with Weld/CDI?

One of the beauties with Java EE 6 is the new dependency injection framework - CDI with the Weld reference implementation - which has prompted us to start migrating internally to JSR-330 in an implementation agnostic manner, with the explicit target…
Thorbjørn Ravn Andersen
  • 73,784
  • 33
  • 194
  • 347
29
votes
5 answers

Packaging EJB in JavaEE 6 WAR vs EAR

Starting a new project and would like to know the pros and cons of packaging EJB in a WAR vs EAR. Will JNDI still works when EJBs are in the WAR? efficiency? etc.? Thanks.
duvo
  • 1,634
  • 2
  • 18
  • 30
28
votes
10 answers

A message body writer for Java type, class myPackage.B, and MIME media type, application/octet-stream, was not found

I am new at RESTful webservices and was trying to update my @OneToMany relationship from a standalone client application, but I am not able to do that. I am using the Jersey implementation of JAX-RS that ships with Glassfish 3.1.1. I have a class A…
skip
  • 12,193
  • 32
  • 113
  • 153
28
votes
3 answers

How to run an aggregate function like SUM on two columns in JPA and display their results?

I am new to JPA. So my question should be so simple to some. Below is the Simple Query in SQL which i would like to convert to JPA. I already have an entity class called TimeEnt. SELECT SUM(TimeEntryActualHours) as UnBilledHrs, SUM…
BinCode
  • 633
  • 3
  • 12
  • 22
28
votes
2 answers

@ApplicationScoped CDI bean and @PersistenceContext - is this safe?

Is it safe to do something like this with CDI? @Named @ApplicationScoped public class DAO { @PersistenceContext private EntityManager entityManager; } I understand that EntityManager itself is not thread-safe, and therefore should not be…
wrschneider
  • 17,913
  • 16
  • 96
  • 176
27
votes
1 answer

Where should beans.xml be placed?

I've just upgraded to NetBeans 7.1 from 7.0. On opening a JSF managed bean it "helpfully" told me that it couldn't find my beans.xml file so would I like it created for me. I knew I had a beans.xml file under WEB-INF but I said yes anyway to see…
wobblycogs
  • 4,083
  • 7
  • 37
  • 48
27
votes
4 answers

what is the right path to refer a jar file in jpa persistence.xml in a web app?

persistence.xml looks like this: org.hibernate.ejb.HibernatePersistence jdbc/test
Bobo
  • 8,777
  • 18
  • 66
  • 85
27
votes
1 answer

Does a JCA 1.6 ResourceAdapter need a ManagedConnectionFactory?

I have written a JCA resource adapter before. However, now I find myself in a position of having to write one solely to get access to the BootstrapContext and its associated WorkManager, and effectively for no other reason. If I'm reading the…
Laird Nelson
  • 15,321
  • 19
  • 73
  • 127
27
votes
5 answers

java.lang.ClassFormatError: Absent Code attribute in method that is not native or abstract in class file javax/mail/MessagingException

I have a maven dependency for javaee Bibliothek. javax javaee-api 6.0 provided I get the error in Eclipse in some…
Kayser
  • 6,544
  • 19
  • 53
  • 86
25
votes
3 answers

JavaEE6 DAO: Should it be @Stateless or @ApplicationScoped?

I'm currently creating an EJB3 Data Access Class to handle all database operations in my Java EE 6-application. Now, since Java EE 6 provides the new ApplicationScoped annotation, I wonder what state my EJB should have, or if it should be stateless.…
Wolkenarchitekt
  • 20,170
  • 29
  • 111
  • 174
24
votes
2 answers

Avoid expunging timer on glassfish

I have a method annotated with @Schedule that is called by the container once in a while. @Schedule(second = "*/5", minute = "*", hour = "*", persistent = false) public void myTimerMethod() throws Exception { ... } Problem is on certain…
Aksel Willgert
  • 11,367
  • 5
  • 53
  • 74
23
votes
1 answer

jax-rs retrieve form parameters

I'm trying to retrieve some parameters that are passed to jax-rs from a posted form with the HttpServletRequest. However, my request object is always returning null values for my parameters. Am I not going about this the right way? I've posted the…
Brian DiCasa
  • 9,369
  • 18
  • 65
  • 97
23
votes
3 answers

Can the EJB 3.1 @Schedule be configured outside of the application code?

How can I configure a schedule intervals: @Schedule(persistent=true, minute="*", second="*/5", hour="*") outside of the application code? How can I configure it in ejb-jar.xml? Can I configure it outside the application (kind of properties file)?
Moran
  • 231
  • 1
  • 2
  • 3