ejb-3.1

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 for my application. Also, i would like to have an option to define some EJB properties in...

EJB 3.1 - Handling exceptions in asychronous jobs

Hi all, I have several asynchronous jobs that I would like to transparently handle the exception for. I'd like to put the exception handling logic in another component / class. With Seam 2, I extended an exception handler class. For instance, I'd like to raise an event with the exception in it so that I can have several components ac...

Expose current progress of an @Asynchronous function to use in View

In my JEE6-App (running on Glassfish 3.0.1) I have an EmailEJB which has to send lots of mails. The mails are sent asynchronously, so its annotated with the new EJB3.1 @Asynchronous, letting it be run in a separate Thread. Now i want the user to be informed about the current status of the method: How many mails have already been sent? S...

Is there any way to know the progress of a EJB Asynchronous process??

I'm trying to get the percentage of the progress from a EJB Asynchronous process??, is this possible? or maybe any ideas ???? Thanks in advice ...

How to avoid ConcurrentModificationExceptions when using EJB3.1 @Asynchronous.

[My Setup: Java EE 6 application, with EJB3.1, CDI/Weld, JSF2 running on Glassfish 3.0.1] I read some articles about the new @Asynchronous methods in EJB3.1, but none of them mentioned the dangers of asynchronous methods and what you really have to care about. In my app i'm having an @Asynchronous E-Mail service, sending lots of mails...

Looking up an EJB dynamically

I'm developing an application on Glassfish 3. I have an EJB that looks like this: @LocalBean @Stateless public class MyBean { public void doSomething() {} } My client code (running inside the same application) looks like this: MyBean mb = (MyBean) InitialContext.doLookup(MyBean.class.getName()); According to a few sources, this s...

unit testing EJBs with Maven 2 and Glassfish 3

I've been trying to set my application up so that I can unit test it's EJBs all day but I can't seem to get past what seems like a really simple problem. I have a standard Maven web application set up in NetBeans 6.9. I've automatically generated a unit test for one of the EJBs but whenever I go to run it I get the error message: Testc...

JBoss 6 AS org.jboss.resource.adapter.mail.inflow.MailListener

Hi, currently i'am trying to migrate a jboss 4.0 project to jboss 6. On the first view i recognize that the MailListener package isn't available anymore. Is there any new Package or source which i need to use, to get the functionality of the MailListener? THX ...

JBoss6 AS EJB3StandaloneBootstrap & EJB3StandaloneDeployer

Hi, currently i'am migrating a JBoss 4 project to JBoss 6. I do miss substitutes for the EJB3StandaloneDeployer and EJB3StandaloneBootstrap. Are there any new sources which deliver the functionality of this two classes? THX ...

Accessing a EJB from a POJO

Is it possible to access an EJB from a POJO? I have tried the @EJB MyClass obj but that does not work. ...

DEADLOCK, EJB 3.1 with asynchronous Method and TimerService in Singleton

In my Singleton-EJB i start a TimerService every 2 minutes. When a client access the test method sometimes the application runs into a deadlock. The problem is, the test method calls a asynchronous method inside the EJB (see Method determineABC). The deadlock happens when the scheduleMethod tries to create a single action timer and there...

how can i test an EJB using netbeans?

I have been struggling trying to test a super simple EJB project in netbeans. i have tried several examples form my java book, and an even simpler example i found online (http://javadude.wordpress.com/2010/02/22/tutorial-most-simple-test-application-for-embedded-glassfish-netbeans-hudson/). this is a super basic EJB that only just adds...

Embedded Glassfish - EJB 3.1 - @Schedule

Hi all, I am new to Java EE 6 and working on getting a number of demo applications running finally. I have an application scoped bean that has a @Schedule annotation on it that should in theory trigger that method every minute. However, that method doesn't appear to ever be invoked. It simply writes to the logs that it was called. C...

How to inject one EJB 3.1 into another EJB

I'm developping simple app where one EJB should be injected into another. I'm developping in IDEA Jetbrains IDE. But after i make @EJB annotation in Ejb local statless class my IDE highlight it with error: EJB '' with component interface 'ApplicationController' not found. Can anyone tell Why? ...

EJB3 + JSF2; Stateless like a Statefull

I've a stateless session bean in an ejb container. If I invoke it from a jsf2 form it works fine, but if I recall the form again it shows me the same data I've inserted before. It happens even if I close and reopen the browser. I must wait several minutes until the form shows empty fields. The stateless session bean is not recreated for ...

How JEE6 makes the link between Observer and Observee (Observer Pattern)

Hello, I've read some blog articles about Observer pattern implementation on JEE6 and something bother me... I can't find any information atm so i ask there... I've found the following exemples: @Stateless [...] public class ParisJugService { @Inject Event event; public void helloParis(){ System.out.println("Hello P...

How can i use serializable transactions on JEE 6?

I am learning the new annotations for transaction management, like @TransactionAttribute(TransactionAttributeType.REQUIRES_NEW), but i could not find out how to create a transaction with SERIALIZABLE isolation. Is this possible on a per-method basis or i have to set it on the connection for the whole application? ...

EE 6 (GlassFish): how many containers? How many singletons?

Ok, still trying to understand the basic EE 6 concepts here. I'm hoping someone here can help me out. I'm running GlassFish v3 server Kukla with a single domain. I deploy MyEEApp.ear, which contain MyEEWebApp.war, MyEJBs.jar, and, MyUtilityLibrary.jar. My EJB jar contains a @Singleton bean called MySingleton. I then set up another serv...

Why session bean method throw EjbTransactionRolledbackException when RuntimeException was thrown

Hi All! I am trying to persist the entity with constraint validation, when invoke persist - there is constraint that thrown and the caller get EjbTransactionRolledbackException... so I try to call the validation explicit and throw ConstraintViolationException/RuntimeException and still the caller get EjbTransactionRolledbackException......

How to send mail via ejb 3.1 annotations based

Hi All! I am trying to inject javax.mail.session in ejb 3.1 via @Resource without any success, I believe that I miss understood the proper configurations (I want annotations based solution and not XML descriptor) I read in the new spec of JEE 6 and understand that I can used in the new JEE 6 Connector API to send mails via Message Driv...