ejb-3.0

EJB3 - handling RollBackExceptions

Hi all, I have an EJB3 application which consists of some EJB's for accessing a DB, and exposed via a Session Bean as a web service. Now there are two things I need to find out: 1) Is there any way I can stop SQL exceptions from causing the web service from throwing a SOAP Fault? The transactions are handled by the container, and curr...

How to configure startup sequence of JBoss services (JmsActivation)

When I deploy my application on JBoss 5 the EJBs are created before the QueueService is started. Creation of Message Driven beans now fails miserably because the queues are not yet available: 17:11:29,151 INFO [EJBContainer] STARTED EJB: ..... 17:11:29,266 INFO [JndiSessionRegistrarBase] Binding the following Entries in Global JNDI: ....

When to use POJO and When to use SLSB

we are using EJB3 in our application. Our design aim is to separate persistence layer from Business Layer. So we have developed XXXbean classes to be used as SLSB and XXXRepository classes to be used as persistence classes. We also have POJO that implement reusable NON business logic(get list of countries etc) and we call then service/he...

How do I authenticate an application client to EJB 3.0 server

I am very new to the whole J2EE architecture. Could somebody help me out? I have a Swing client with Login, Password fields on machine A. Properties p = new Properties(); p.put(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory"); p.put(Context.URL_PKG_PREFIXES, "org.jboss.naming:org.jnp.interfaces"); p.put(Conte...

Can remote stateless session bean references be cached in EJB3?

I am calling a remote stateless session bean from a J2SE application and would like to cache the reference to the session bean in order to reduce the cost of the lookup. Is this ok? In EJB2 the ServiceLocator pattern was commonly used to cache lookups to remote resources, but EJB3 doesn't have separate EJB Home (which were usually cach...

EJB and FLEX

I'm working on a new application using EJB3 -> BlazeDS -> Flex. I can't find good example to see how to integrate EJB with BLAZEDS. Can someone give me some pointers on how to link them together. ...

How to implement a generic queue monitoring component in Java EE?

I'd like to create a queue monitoring container-managed component in a Java EE 5 app. The queue is a database table and every 5 mins or so the monitor would look for records that match certain criteria in that table. If there are any matching records, the monitor starts some kind of processing in a new thread. This sleep-check-do work...

Issue while getting the Hibernate EntityManagerFactory in Weblogic (EJB3 Application)

I am facing an issue when am getting the EntityManagerFactory from JPA from the following code in weblogic StartUp Class EntityManagerFactory emf = Persistence.createEntityManagerFactory("testEJBPU"); logger.info("Created EntityManagerFactory"); Context ctx = new InitialContext(); ctx.rebind("testEJBPU", emf...

EJB Transaction Type

i have looked for and compreensive article on this and have yet to find one good enough. Can some one explain to me the workings of the transaction types? (Required, RequiresNew, Mandatory, Never...) and mainly how these affect service calls between services with diferent types? ...

Container-managed EntityManager in Servlet

How to obtain? ...

Can't call EJB from FLEX (BlazeDS)

Right now I'm playing with Flex and Java integration and trying to access EJB3 methods by clicking Flex button but it's giving me null pointer error. Here is what I have in my code: [Controller:] public class homePageController { @EJB CategoryFacadeRemote categoryFacade; public String populateDBWithXMLData(){ Ar...

EJB3 Native Query Problem

I have the following inner class: @Entity @Table(name = "SATTET0") public class SATTET0Key { @Column(name="IESTATUT") public String estatut; @Column(name="IINICIO") public Date dataInicio; } In the same class i have the following code: Query q = exp.createNativeQuery("SELECT IESTAT...

EJB3 - handling non-standard link tables.

Hi all, I have a situation where I am working with EJB3 and a legacy database. I have a situation where there is a many-to-many relationship between two tables A and B, defined through a third (link) table L. The complication is that the link table has other fields in it other than the PK's of tables A and B. The columns are standard t...

Extending JPA entity mapping

I'm looking for an easy way to extend existing JPA mapping. The idea is as follows: I have an EAR project with EJB3+JPA module which has ClassA annotated and mapped to table class_a. But I want some other module (another EJB module) to have ClassB which adds more properties to ClassA (extend?). One way that I though about, is just to a...

EJB3 Query + in clause

I need to use an IN clause like the following SQL SELECT * FROM tableA WHERE colA in (1, 2,3) How can i do this in EJBQL? i've tryed the following, which obviously failed: SELECT tab FROM tableA tab WHERE tab.colA in (:colValues) then in java i did query.setParameter("colValues","1,2,3") that gives me the following exception ...

Spring 2.5 in EJB container

Hi, I would like to use the spring framework within an EJB3 project. In detail I would like to use the JDBC template class which should be instantinated from a given data source. When I put the spring.jar to my Jboss lib directoy everything is working fine. But when I put the JAR inside my EAR only there seems to be external dependencie...

How to get stateless EJBs JNDI path?

Hi, is there a way to get my stateless EJBs JNDI path? Supposing that I have written an EJB like this: @Stateless public class BookBean implements IBookBeanLocal { @Resource SessionContext sctx; .... @PostConstruct public void afterInit(){ // sctx?? } } Is there a way do discover the BookBeans JNDI path during initialization...

Controlling the column order when EclipseLink creates tables

I'm using EclipseLink with the "eclipselink.ddl-generation" property set to "create-tables". The order of the columns in the created tables seems random. I want the columns in a particular order - the order in which the fields appear in the Entity class definition. Is there a way to tell EclipseLink to create the columns in the order ...

EJB 3: Accessing a stateful session bean from an application client

I am having some trouble accessing a stateful session bean (SFSB) from an application client. I am using JBoss 5.0.1.GA. The application client and the EJBs are both packaged in an EAR which deploys and I have other application clients which work without problems. So far, I have only used stateless session beans (SLSBs), but as far as I ...

EJB3 constructor throwing an exception?

What happens, if an EJB3 stateless/stateful bean no args constructor throws an exception? For example, class A has a DI: @EJB B b; and B throws an exception in the constructor? I didn't find any mention for this case in EJB3 specs. I'd guess that the isntance of class A gets discarded, because it really has no means for succeeding in ...