[EJB 3.0] - Re: Extensions to EJB3: Message Driven POJOs
by jkurtz_wa
Thanks for fixing that link..
I have a remote client that needs to read a message from an MDB using a stateless session bean. Whereas I can easily write to the Bean and see the on-message method firing, I can not seem to be able to return that message to another remote client.
I can do this using an existing queue in JBoss. With an MDB, I need to be able to get an instance of the MDB or produce some type of callback, to let the stateless bean first know there is a message, then read the contents of the MDB.
With an entity bean, one uses the Entity Manger to get an instance of the object, so there maybe a similar way to get the "handle" of the MDB.
I am going to check out using the @Consumer tags to see if that will work. If you have any design suggestions and pointers to some tutorials, that would really help
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4099977#4099977
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4099977
18Â years, 6Â months
[JBoss Seam] - Re: Set non-shared Hibernate interceptor on JPA EntityManage
by mjschehl
I tried using the thread-unsafe interceptors in the persistance.xml by setting the property "hibernate.ejb.interceptor" and the code below.
I encountered two problems which I need help with:
1. The afterTransactionBegins never gets called
2. When the other methods get called, such as onSave, the identity and em don't get injected.
Could somebody please shed some light on this for me? I do not have to use JPA if that is a limitation.
Here is an explanation of what I am ultimately trying to achieve. If what I am trying to achieve can be done better in a different way, I would be okay with that.
anonymous wrote :
| Whenever a transaction starts, I need to create an Audit All entities annotated with @Historizable that are inserted or updated in that transaction must have their audit property set to that Audit updated on them. Additionally, for each insert, update, and delete, a HistoryEntry gets saved that stores each entity's class name, primary key, audit id, and toString(). The audit and history needs to be part of the main transaction so that it also rolls back if the transaction fails.
|
public class MyInterceptor extends EmptyInterceptor {
|
| @In Identity identity;
|
| @PersistenceContext
| private EntityManager em;
|
| ...
| }
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4099973#4099973
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4099973
18Â years, 6Â months
[JBoss Messaging] - How to setup context when accessing SLSB from MDB?
by alllle
I am consistently getting this exception with my deployed application.
I have a MDB that accesses other local EJB. I coded the MDB to lookup the other EJB using the InitialContext with its own username and password. The code looks like this:
| Hashtable<String, Object> env = new Hashtable<String, Object> ();
| env.put(Context.SECURITY_PRINCIPAL, username);
| env.put(Context.SECURITY_CREDENTIALS, password);
| env.put(Context.INITIAL_CONTEXT_FACTORY, "org.jboss.security.jndi.JndiLoginInitialContextFactory");
|
| InitialContext context = new InitialContext(env);
|
However, when the LoginModule.login() method is invoked by the JBoss AS on behalf of the MDB code during the process of invoking the EJB methods, the LoginModule does not see the username and password specified in the InitialContext. It gets null values and hence failed to proceed with the EJB invocation.
With the similar code, I can invoke the local EJB from Servlet code and I don't know what is the problem when used inside the MDB. Please help if you have any idea!
Thanks,
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4099969#4099969
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4099969
18Â years, 6Â months