I'm currently experimenting with EJB3 as a prestudy for a major project at work. One of the things I'm looking into is query caching.
I've made a very simple domain model with JPA annotations, a @Local business interface and a @Stateless implementation in an EJB-JAR, deployed in an EAR together with a very simple webapp to do some basi...
I've put the Hibernate libraries in both the Glassfish domain and in the library collection of my project in Netbeans. hibernate-entitymanager.jar contains both HibernatePersistence (the last class in the call stack) and Ejb3Configuration, so I'm rather stumped as to why I get the missing class error for Ejb3Configuration.
java.lang.NoC...
I want to define injection so that only if the injected interface has EJB it will be injected. This is used as a plug-in to the main EJB. How to do this? Is there some annotation for this?
I can use @PostConstruct to manually "inject" the variable. But then I have to handle the dependencies by myself. How can I handle dependencies knowi...
My boss has an idea for a web app he would like to build. Long story short it will need a lot of CMS features and a lot of social networking features, and some other unique things as well. We looked into just leveraging different CMS platforms like drupal and joomla etc, but they really don't meet our needs.
We have decided to build o...
(How) is it possible to persist a JPA Entity at the databases of multiple servers without copying everything to DTOs?
We have a distributed system. Some applications do have DBs for caching purposes. The JPA Provider throws an Exception in which it complains that it cannot persist a detached object.
But I would like to preserve the ID ...
I have an EJB in Weblogic 10.3 that has en EJB interceptor defined for it like such:
@Stateless(name="MyEJB")
@Interceptors ({AuditInterceptor.class})
public class MyEJBImpl extends BaseEJB implements MyEJB
It appears as if the interceptor advice is only being applied to certain methods in the EJB. I am using the @AroundInvoke annota...
Sometimes it would be useful to distribute the processing of some data to several threads in an EJB3 session bean.
Let's say that a stateless session bean fetches a lot of data from the database, splits it into several partitions and would like to spawn processing of those partitions in their own, parallel threads. What is the best way ...
The EJB3 spec indicates that EJB2 and EJB3 can co-exist in a single application.
I wish to migrate my EJB2 stateless session beans to EJB3 stateless session beans.
This question does not relate to JPA at all (that is a separate piece of work to be carried out in the future)
I'm running on websphere 6.1 with the EJB3 feature pack instal...
I am new to EJB3 and am missing something when it comes to accessing a @Remote @Stateless bean deployed as an ejb module inside an ear file. I want to access a remote bean in lima.ear from soup.ear.
Here is what I am doing now (somewhat abbreviated):
//deployed under lima.ear
@Remote
@Stateless
public interface LimaBean {
String s...
I'm upgrading an application from an old ejb2 setup to use ejb3's using the ejb3 feature pack on websphere 6.1
I've got a ServletContextListener which does some initialisation when the servlet context starts, part of this initialisation involves calling ejb's.
The server is set up to use FileRegistrySample for its custom user registry,...
By default it seems the jndi name of a bean is based on the ear in which it is contained. An EJB named MyBean my-app.ear will have the name "my-app/MyBean/local".
How can I change that behavior declaratively? I want the jndi name to be "something-else/MyBean/local". It has to be declarative rather than with an annotation b/c I can'...
Hi,
I am following the MasteringEJB4thEdition book, which I downloaded from The Server Site website.
There is a simple example of HelloBean, which works perfectly with GlassFish V3 app server. The same example when deployed on JBOSS fails because of JNDI name lookup.
Is there any rule how the JNDI lookup names in JBOSS are decided if ...
I wan to check if my stateful bean is passivated/activated and the corresponding callbacks are called properly.
For that I want to configure the containers GlassFish and/or JBOSS to limit the number of instances of the bean.
Is it possible ? If yes, how ?
...
I'm trying to deploy an EJB in JBoss that uses the @WebService annotation. However, the EJB has a dependency on an EJB in another ear. By adding the @Depends annotation, the EJB start is delayed until after the ear is loaded, but it appears the WebService generator is still trying to start up the generated WAR as soon as it sees the anno...
The JEE specification states that an EJB injection like this:
@EJB MyInterface myBean;
will create en entry in the Enterprise Naming Context, viz. java:comp/env/.MyInterface/myBean. It is up to the deployer to bind this context entry to a real value and to inject this value in the myBean field.
Now I have the feeling I am missing som...
I'd like to get into ejb3 to gain some practice in writing for it.
I searched for tutorials and how-to's but could find some scarce unhelpful information.
I'm looking for a tutorial or walkthrough that will guide me from the very basics (Which software do I need to install?) to write a "Hello World" for EJB3 with JBoss.
In short - Wher...
I have a JEE5 application that exposes services using (local) session beans.
When an internal fault occurs during service execution, a RuntimeException is thrown and encapsulated by JBoss(5.0.1) in a javax.ejb.EJBTransactionRolledbackException.
The problem is that client applications receiving this EJBTransactionRolledbackException can...
I have a simple hello-world EJB3 successfully deployed as web service. I can check it with url: http://localhost:8080/jbossws/services
Following is the client which works for Glassfish but doesn't work for JBOSS
package com.hardik.mejb;
import java.net.MalformedURLException;
import java.net.URL;
import javax.xml.namespace.QName;
impor...
How maxMessages property affects the MDB?
For example:
@ActivationConfigProperty(propertyName = "maxMessages", propertyValue="5").
How would this value affect if maxSessions is 10?
...
Using EJB3/JBoss, how can I use a composite element from a table, e.g.
@Entity
public class X {
@Id
private int id;
private Coordinate coordinate;
}
where Coordinate is a defined as (setters/getters left out for readability):
public class Coordinate {
int x;
int y;
}
And everything should be mapped to Table X which...