java-ee-6

How to specify the EJB bean name in the JNDI tree in JEE7

送分小仙女□ 提交于 2021-02-19 05:20:28
问题 I'm not sure if this is a generic JEE6 question or if it is a Wildfly 10/JBoss7 EAP implementation specific question. I'm trying to specify/override the default beanName used in my EJB JNDI mapping to something more meaningful to me. For example: LoginManagerBean: @Stateless public class LoginManagerBean extends BaseManagerBean implements LoginManager { .... } LoginManager: @Local public interface LoginManager{ .... } In this context, WF10 will automatically create a JNDI mapping for this EJB

How to specify the EJB bean name in the JNDI tree in JEE7

社会主义新天地 提交于 2021-02-19 05:18:45
问题 I'm not sure if this is a generic JEE6 question or if it is a Wildfly 10/JBoss7 EAP implementation specific question. I'm trying to specify/override the default beanName used in my EJB JNDI mapping to something more meaningful to me. For example: LoginManagerBean: @Stateless public class LoginManagerBean extends BaseManagerBean implements LoginManager { .... } LoginManager: @Local public interface LoginManager{ .... } In this context, WF10 will automatically create a JNDI mapping for this EJB

How to make @Schedule method to be called only once at a time

假如想象 提交于 2021-02-10 04:34:05
问题 We are using the @Schedule EJB annotation to start a scheduled job do a delta SOLR import every x seconds. Of course we want to have as less timeshift in indexing as possible. Currently I try to do the delta every 5 seconds. So my question is: Can I make sure the job is only called once? So let's say the indexing is lasting longer than 5 seconds, will the next schedules call wait until the previous is coming back? 回答1: Yes. You can make the bean a @Singleton and use @Lock(LockType.Write) to

How to make @Schedule method to be called only once at a time

情到浓时终转凉″ 提交于 2021-02-10 04:33:25
问题 We are using the @Schedule EJB annotation to start a scheduled job do a delta SOLR import every x seconds. Of course we want to have as less timeshift in indexing as possible. Currently I try to do the delta every 5 seconds. So my question is: Can I make sure the job is only called once? So let's say the indexing is lasting longer than 5 seconds, will the next schedules call wait until the previous is coming back? 回答1: Yes. You can make the bean a @Singleton and use @Lock(LockType.Write) to

Java EE @TransactionManagement.BEAN - how does it combine with container managed beans?

落花浮王杯 提交于 2021-02-08 04:01:27
问题 How will the transaction started in callSessionBean2() behave in the following scenario? Is it suspended? What happens if an exception is thrown in SessionBean2? SessionBean2 was setup with BEAN transaction management type because it does not communicate with any database, only with AD server via LDAP. I'm asking because I've been having issues in a production server some week after deployment that calls to SessionBean2 starts to hang, with transaction timeouts as the only error. I figured

Java EE @TransactionManagement.BEAN - how does it combine with container managed beans?

半城伤御伤魂 提交于 2021-02-08 04:01:02
问题 How will the transaction started in callSessionBean2() behave in the following scenario? Is it suspended? What happens if an exception is thrown in SessionBean2? SessionBean2 was setup with BEAN transaction management type because it does not communicate with any database, only with AD server via LDAP. I'm asking because I've been having issues in a production server some week after deployment that calls to SessionBean2 starts to hang, with transaction timeouts as the only error. I figured

Question about xa and transaction on ejbs

白昼怎懂夜的黑 提交于 2021-01-29 10:29:54
问题 I have two question/doubt: If two ejbs are deployed in different ear or different applicationserver, and one call the other, they still required XA indipendent that each one use one or more db as ? if two ejbs are deployed in different server, both are annotated with trans type = required,and when teh first ejb call the second, a new transaction start or use the propagation of first ejb? **My ejbs are deployed on Webpshere, Jboss, WebLogic and can be written with JEE 5/6/7 technology(EJB 2/3)

What is the difference between put and add method in statehelper in JSF 2

假如想象 提交于 2021-01-28 22:04:27
问题 What is the difference between: Object put(Serializable key, Object value) void add(Serializable key, Object value) methods in StateHelper in JSF? 回答1: I found the api documentation not that helpful myself and investigated it. Each time add is called it appends another value to a list which is saved under the given key. If you call a get on that key you get back a list. The add method saves you creating that list and watches for corner cases, ex. creating the list when the key is empty. The

@PreDestroy method not called in @Singleton on JBoss EAP 6.3.0

此生再无相见时 提交于 2021-01-27 21:10:45
问题 In my JavaEE application, I have a @Singleton class containing some @Scheduled methods. Furthermore there are methods with @PostConstruct and @PreDestroy to set up and clean up the database. (For the sake of simplicity, I just have logging in the example, since that reproduces the problem.) The application has to run on a JBoss EAP 6.3.0.GA server. While the @PostConstruct method works fine, @PreDestroy is not called when I shutdown the server (neither when pressing the stop the server button

How to get the client IP address in a JAX-RS resource class without injecting the HttpServletRequest?

岁酱吖の 提交于 2021-01-24 12:09:40
问题 We are using JAX-RS 1.0 and I want to get the client IP address in my resource class. Currently I inject the HttpServletRequest as a method parameter and then get the IP address. I want to make my code cleaner. I am thinking if I can use a MessageBodyReader class and set the IP address. But if I use a MessageBodyReader I have to unmarshall the XML to a Java object which is additional logic as far as I believe. Can anyone please let me know how to get the client IP address without having to