ejb

@Schedule can´t inject EJB

只愿长相守 提交于 2019-12-23 17:23:48
问题 I´m using JBoss AS 7.1.1. I need some jobs to run in a specific date and time, so instead of using Quartz, I´m trying to use the @Schedule annotation. When I was testing, it worked just fine, but when I started implementing my real business, my real problems started. so, that´s my scenario: I have 1 component, for loggin and utils porposes, I use it in a lot of projects and it works fine, that would be something like it: My log ejb (it works fine in a lot of other components, basically all of

Why can't I have a session bean as a JSF backing bean in Java EE 5

戏子无情 提交于 2019-12-23 15:53:29
问题 AFAIK, the whole purpose of JBoss Seam is to integrate EJB and JSF. The book Seam in Action says that: By design, EJB components cannot be bound directly to a JSF view. It’s great that EJB components are scalable, transactional, thread-safe, and secure, but it doesn’t do much good if they are completely isolated from the web tier, accessible only through a JSF backing bean acting as an intermediary. But I couldn't find the reason/motive of such impossibility, why are they isolated from the

what is difference between @EJB and @Resource? in dependency injection in EJB

天大地大妈咪最大 提交于 2019-12-23 14:54:31
问题 I like to know what is the main difference between EJB @EJB and @Resource annotation? In which case we have to go for @EJB and @resource 回答1: Specification states, regarding @EJB: The Bean Provider uses the EJB annotation to annotate a field or setter property method of the bean class as a target for the injection of an EJB reference. The reference may be to a session bean’s business interface or to the local home interface or remote home interface of a session bean or entity bean. regarding

what is difference between @EJB and @Resource? in dependency injection in EJB

余生长醉 提交于 2019-12-23 14:54:00
问题 I like to know what is the main difference between EJB @EJB and @Resource annotation? In which case we have to go for @EJB and @resource 回答1: Specification states, regarding @EJB: The Bean Provider uses the EJB annotation to annotate a field or setter property method of the bean class as a target for the injection of an EJB reference. The reference may be to a session bean’s business interface or to the local home interface or remote home interface of a session bean or entity bean. regarding

How to invoke method on one @Stateless bean from another @Stateless bean

霸气de小男生 提交于 2019-12-23 12:51:25
问题 I have created stateless session bean in Java. Now I want to invoke a method of another stateless session bean. Some things are missing in my code. Usual way of invoking method does not fit here. Being invoked method at another stateless session bean retrieves data from the Internet. Likewise, how to invoke a method from @Stateless bean of a simple Java class. I build a REST web service with Java and somehow I can't invoke methods being at simple Java class from @Stateless beans. Cheers 回答1:

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

我的梦境 提交于 2019-12-23 12:28:08
问题 I'm trying to get the percentage of the progress from a EJB Asynchronous process. Is this possible? Does anyone have an idea how I could do this? 回答1: To get to know the progress of asynchronous processes is always tricky, especially if you don't know if they have actually started yet. The best way I have found is to write another function that just gets the progress, so, if you have some unique id for each call, then update a hashmap with the current process. You may want to look at

How do I set up a mock queue using mockrunner to test an xml filter?

橙三吉。 提交于 2019-12-23 12:17:24
问题 I'm using the mockrunner package from http://mockrunner.sourceforge.net/ to set up a mock queue for JUnit testing an XML filter which operates like this: sets recognized properties for an ftp server to put and get xml input and a jms queue server that keeps track of jobs. Remotely there waits a server that actually parses the xml once a queue message is received. creates a remote directory using ftp and starts a queue connection using mqconnectionfactory to the given address of the queue

How to configure Java Message Driven Beans and Websphere Activation specification without hardcoded JNDI Names?

瘦欲@ 提交于 2019-12-23 11:13:11
问题 We have a MDB listening to a Queue reading data and sending data to another Queue @MessageDriven( activationConfig = { @ActivationConfigProperty( propertyName = "destinationType", propertyValue = "javax.jms.Queue" ) }, mappedName = "jms/dataQ") public class DataMDB implements MessageListener { @Resource(name="jms/dataQueueConnectionFactory") private ConnectionFactory connectionfactory; @Resource(name="jms/dataDestinationQ") private Destination destination; ... } and an XML (ibm-ejb-jar-bnd

Cache entry not in use

夙愿已清 提交于 2019-12-23 10:52:44
问题 We have a web application using the following technologies: JSF 2.0, EJB 3.1, JPA 2.0, JBoss AS 7.1 Final Sometimes we get the following exception out of nowhere: 09:46:29,664 ERROR [org.jboss.ejb3.invocation] (http-10.99.0.10-10.99.0.10-8080-14) JBAS014134: EJB Invocation failed on component VehicleServiceBean for method public abstract java.util.List com.hji.common.service.VehicleService.findVehiclesBySearchCriteriaAndImporterIds(com.hji.common.domain.repository.VehicleRepository

Why is PostConstruct not called?

余生颓废 提交于 2019-12-23 07:19:45
问题 I am working on a simple Java EE application. I have class like this: import javax.annotation.PostConstruct; import javax.ejb.Stateless; import javax.persistence.EntityManager; import javax.persistence.EntityManagerFactory; import javax.persistence.Persistence; @Stateless public class BlogEntryDao { EntityManager em; @PostConstruct public void initialize(){ EntityManagerFactory emf = Persistence.createEntityManagerFactory("Persistence"); em = emf.createEntityManager(); } public void