ejb-3.1

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

一世执手 提交于 2019-12-20 21:05:03
问题 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 XML. Since the example is deployed as an EAR-project the order is defined in the application.xml. But in a WAR-deployed project, there is no application.xml.

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

时光总嘲笑我的痴心妄想 提交于 2019-12-20 21:03:52
问题 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 XML. Since the example is deployed as an EAR-project the order is defined in the application.xml. But in a WAR-deployed project, there is no application.xml.

Possible to change ejb parameter at runtime for @Schedule annotation?

瘦欲@ 提交于 2019-12-20 12:27:44
问题 Probably a silly question for someone with ejb experience... I want to read and change the minute parameter dynamically for one of my EJB beans that uses the Java EE scheduler via the @Schedule annotation. Anyone know how to do this at runtime as opposed to hardcoding it in the class like below? If i were to do it programatically could i still use the @Schedule annotation? @Schedule(dayOfWeek = "0-5", hour = "0/2", minute = "0/20", timezone = "America/Los_Angeles") private void checkInventory

Possible to change ejb parameter at runtime for @Schedule annotation?

百般思念 提交于 2019-12-20 12:26:00
问题 Probably a silly question for someone with ejb experience... I want to read and change the minute parameter dynamically for one of my EJB beans that uses the Java EE scheduler via the @Schedule annotation. Anyone know how to do this at runtime as opposed to hardcoding it in the class like below? If i were to do it programatically could i still use the @Schedule annotation? @Schedule(dayOfWeek = "0-5", hour = "0/2", minute = "0/20", timezone = "America/Los_Angeles") private void checkInventory

Default EJB transaction mode for asynchronous methods?

故事扮演 提交于 2019-12-20 09:30:45
问题 When I have an @Asynchronous method in an EJB, and I don't specify the @TransactionAttribute , then how exactly does the container handle the transaction boundaries? Obviously, it can't use the calling thread's transaction, so what does it do? Same question, but regarding methods that are triggered by the TimerService. EDIT: I think I phrased that poorly. I already know that the default mode is 'REQUIRED'. So it should be safe to assume that those methods will always be called within a

Automatic EJB Timer on Glassfish Server not triggering

落爺英雄遲暮 提交于 2019-12-20 01:59:13
问题 So I'm running a Java EAR application on a Glassfish 3.1. I created a stateless session bean with a single annotated timer function in my EJB Module. I don't have the exact code but it looks something like this: @Stateless public class SessionTimerBean { public SessionTimerBean(){ System.out.println("Constructor Called"); } @Schedule(second="*/10", minute="*", hour="*") public void scheduleTimer(final Timer t) { System.out.println("Timer Called"); } } When I launch Glassfish the debug info

How to inject a Session Bean into a Message Driven Bean?

谁都会走 提交于 2019-12-19 19:55:55
问题 I'm reasonably new to Java EE, so this might be stupid.. bear with me pls :D I would like to inject a stateless session bean into a message-driven bean. Basically, the MDB gets a JMS message, then uses a session bean to perform the work. The session bean holds the business logic. Here's my Session Bean: @Stateless public class TestBean implements TestBeanRemote { public void doSomething() { // business logic goes here } } The matching interface: @Remote public interface TestBeanRemote {

JBoss 6 - Deploy ejb in war packaging

拥有回忆 提交于 2019-12-19 04:09:41
问题 I am trying to use the new EJB3.1 feature where one can deploy an EJB packaged within a .war file. I am using Maven 2.2.1 to package the EJB module and then dropping the ejb jar in a war module (as a dependency). The final war contains a simple web.xml with no content, and the ejb jar library in the lib directory. However, though the application is deployed correctly, the annotated ejb (@Stateless) is not recognized by the container. I have no ejb-jar.xml descriptor (which I believe is

Need clarification on JMS vs ActiveMQ bean/resource configuration

泄露秘密 提交于 2019-12-18 06:23:09
问题 There appears to be some inconsistency on how to use JMS resources, and setting up activationConfig with proper @ActivationConfigProperty on a @MessageDriven annotation. First, here is my resource config ( glassfish-resources.xml , but translatable to other deployment descriptors). This is applied to Glassfish ( asadmin add-resources glassfish-resources.xml ) along with the ActiveMQ Resource Adapter: <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE resources PUBLIC "-//GlassFish.org//DTD

Can I (and how) lookup CDI managed beans using javax.naming.Context#lookup in EJB module?

醉酒当歌 提交于 2019-12-17 22:20:18
问题 Can I (and if so, how?) lookup CDI managed beans using javax.naming.Context#lookup in EJB module? I'm using GlassFish v3. I suppose that I can use @Named , but what is JNDI name of CDI managed bean? I want to lookup them from unmanaged POJOs so I can't use @Inject . 回答1: You can lookup the BeanManager via JNDI ( java:comp/BeanManager ) then use the JSR-299 API hung off of the BeanManager to get a contextual reference to a managed bean. JSR-299 managed beans are not available for direct JNDI