ejb-3.0

MDB set ActivationConfig dynamically

本小妞迷上赌 提交于 2019-12-01 14:15:19
I have the following MDB configuration @MessageDriven(activationConfig = { @ActivationConfigProperty(propertyName = "destinationType", propertyValue = "javax.jms.Topic"), @ActivationConfigProperty(propertyName = "destinationJndiName", propertyValue = "jms/test/log"), @ActivationConfigProperty(propertyName= "destination", propertyValue="jms_test_log"), @ActivationConfigProperty(propertyName="acknowledgeMode", propertyValue="Auto-acknowledge"), @ActivationConfigProperty(propertyName="addressList", propertyValue="mq://test.server.co.uk:7676"), @ActivationConfigProperty(propertyName = "maxSession"

Is it possible to use hibernate as Glassfish's persistence provider?

会有一股神秘感。 提交于 2019-12-01 12:27:35
Is it possible to use hibernate as Glassfish's persistence provider and if so HOW? Guss While I'm not an expert on either Glassfish or Hibernate, I think you'd probably find this interesting: Instructions on using Hibernate in Glassfish The link provided by Guss to hibernate.org has expired. Here's a google cache dated Feb 20, 2010. As noted in a previous version of the linked wiki page, it is preferable to keep the hibernate libraries within your .ear / .war rather than the Glassfish install dir so that different applications can use their own version of Hibernate. Modern How-To To use

Is it possible to use hibernate as Glassfish's persistence provider?

馋奶兔 提交于 2019-12-01 11:37:09
问题 Is it possible to use hibernate as Glassfish's persistence provider and if so HOW? 回答1: While I'm not an expert on either Glassfish or Hibernate, I think you'd probably find this interesting: Instructions on using Hibernate in Glassfish 回答2: The link provided by Guss to hibernate.org has expired. Here's a google cache dated Feb 20, 2010. As noted in a previous version of the linked wiki page, it is preferable to keep the hibernate libraries within your .ear / .war rather than the Glassfish

MDB set ActivationConfig dynamically

风流意气都作罢 提交于 2019-12-01 10:39:16
问题 I have the following MDB configuration @MessageDriven(activationConfig = { @ActivationConfigProperty(propertyName = "destinationType", propertyValue = "javax.jms.Topic"), @ActivationConfigProperty(propertyName = "destinationJndiName", propertyValue = "jms/test/log"), @ActivationConfigProperty(propertyName= "destination", propertyValue="jms_test_log"), @ActivationConfigProperty(propertyName="acknowledgeMode", propertyValue="Auto-acknowledge"), @ActivationConfigProperty(propertyName=

Cant retrieve an images from the WEB-INF folder ussing classLoader.getResourceAsStream()

混江龙づ霸主 提交于 2019-12-01 08:53:32
The hold noon i was trying to make my app send both html+images via javamail, i only managed to send html, but with the image i am having a bit of problems. I decided to create a multipart message, and all was going ok, but then i use the class loader to retrieve the .png file from the WEB-INF/resources/images i get a NullPointerExcetion, i dont know why is that? Here is how my EJB(3.0) looks like. Ill appreciate a hand on this one i dont have much experience with the ClassLoader class(Dont know much about it). @Stateless(name = "ejbs/EmailServiceEJB") public class EmailServiceEJB implements

Long Polling with Java and JBoss

孤者浪人 提交于 2019-12-01 08:53:04
I'm looking for an example, how to implement a longpoling mechanism in java. I would love to use a stateless EJB. I know that something like that would work: @WebService(serviceName="mywebservice") @Stateless public class MyWebService { @WebMethod public String longPoll() { short ct = 0; while(someCondition == false && ct < 60) { sleep(1000); // 1 sec ct++; } if (someCondition) return "got value"; else return ""; } } Unfortunately i know that this does'nt scale. Can i return in the webmethod without finishing the response and finish it somewhere else? iirekm The thing you're trying to

Handling a timeout in EJB3 without using threads

£可爱£侵袭症+ 提交于 2019-12-01 07:44:14
I have the following situation. I have a job that: May time out after a given amount of time, and if so occurs needs to throw an exception If it does not time out, will return a result If this job returns a result, it must be returned as quickly as possible, because performance is very much an issue. Asynchronous solutions are hence off the table, and naturally tying up the system by hammering isn't an option either. Lastly, the system has to conform to the EJB standard, so AFAIK using ordinary threads is not an option, as this is strictly forbidden. Our current solution uses a thread that

EJB 3.1: Does it allow injection of beans into resources not managed by the container?

淺唱寂寞╮ 提交于 2019-12-01 06:27:44
I am using JBoss 6.1 and its not fully EJB 3.1 compliant. As of now, I can't inject an EJB into my Struts action classes (or in any non-Java EE Container-managed class) via @EJB , but will this be possible when the EJB 3.1 specification is fully implemented? If not, will it be too infeasible to have that due to performance reasons in the foreseeable future? No container will ever be able to inject anything into a non-managed object. To be able to to inject into an object, the container needs to manage the object's lifecycle, or at least to participate in the management of its lifecycle, so it

Handling a timeout in EJB3 without using threads

僤鯓⒐⒋嵵緔 提交于 2019-12-01 06:02:19
问题 I have the following situation. I have a job that: May time out after a given amount of time, and if so occurs needs to throw an exception If it does not time out, will return a result If this job returns a result, it must be returned as quickly as possible, because performance is very much an issue. Asynchronous solutions are hence off the table, and naturally tying up the system by hammering isn't an option either. Lastly, the system has to conform to the EJB standard, so AFAIK using

Cant retrieve an images from the WEB-INF folder ussing classLoader.getResourceAsStream()

淺唱寂寞╮ 提交于 2019-12-01 05:47:25
问题 The hold noon i was trying to make my app send both html+images via javamail, i only managed to send html, but with the image i am having a bit of problems. I decided to create a multipart message, and all was going ok, but then i use the class loader to retrieve the .png file from the WEB-INF/resources/images i get a NullPointerExcetion, i dont know why is that? Here is how my EJB(3.0) looks like. Ill appreciate a hand on this one i dont have much experience with the ClassLoader class(Dont