ejb-3.0

Problem with WebServices using EJB. The error is: "..does not contain operation meta data.."

Hi, I got an error as I mentioned above. My application has EJB WebServices, developing with MyEclipse and running on jboss4.2.2.GA. I use Eclipse's Web Services Explorer to invoke a WSDL operation. When I enter the parameters for the wsdl and click Go to invoke, I am getting this error in the SOAP Response Envelope; <faultstring>Endp...

EJB 3.0 transaction boundary calling one local EJB from another

Imagine the following two ejb3.0 stateless session beans, each implements a local interface and they are deployed to the same container: public class EjbA { @EJB private ejbB; public void methodA() { for (int i=0; i<100; i++) { ejbB.methodB(); } } } public class EjbB { public void m...

How can i deploy Session Bean on another computer with Client JSP/Servlet

Hello Everybody i'm new in EJB3, i know how to deploy Session Bean (Stateless or stateful) on Glassfish server in one computer. My question is: how can i deploy session bean on Computer A and Deploy Servlet or JSP on Computer B? It mean Computer A have Session Bean Source and Computer B have Servlet or JSP source. if use 1 computer i ca...

Error while accessing a ServicePOJO in JBOSS 5.0.1

I have a Webapplication with EJBs and ServicePOJOs. When i try to access one of those POJOS, i get the following error: java.lang.NullPointerException at com.sonydadc.MyAPP.pa.server.PA_Bean.getServername(PA_Bean.java:539) at org.apache.jsp.templates.start_jsp._jspService(start_jsp.java:104) at org.apache.jasper.runtime.HttpJspBase.s...

How do I access EJB bean when inside a custom Converter

This converter is called from my JSF. I already register it inside faces-config.xml public class ProjectConverter implements Converter{ @EJB DocumentSBean sBean; @ManagedProperty(value="#{logging}") private Logging log; public ProjectConverter(){ } public Object getAsObject(FacesContext context, UICom...

Can reference to javax.persistence.EntityManager be cached?

Can we cache reference to EntityManager. As for our requirement, instead of injecting EntityManger into other EJBs, we are having utility class which will return the reference to entitymanager. The issue is each time we need to get reference, we are doing JNDI lookup. in order to avoid JNDI lookup, we want to cache the reference to ent...

Ejb3 dependency in Maven

I saw recently that Sun/a third party had released a maven dependency containing only the interfaces for e.g. EJB3 and JPA. Does anyone know the groupId, artifactId, repository etc where they are? I would prefer to not use the OpenEJB, Glassfish counterparts etc. ...

Problem initializing backing bean property in constructor

Hello, I have managed bean/backing bean and I inject there (with @EJB) session bean. Now in constructor I want to use it to initialize property in backing bean with value from database. But injected session bean is null. What are the other ways to initialize? As far as I know I can't use @PostConstruct because fetching data from databas...

Enterprise application development-RMI and EJB

I am new to enterprise applications. Just started to learn EJB. I know RMI well. Can anyone map RMI with EJB to understand the basic strongly else give some links/books to clearly understand EJB basics. ...

EJB3 Caching Instance Variables

Hi, I've noticed some strange code on a project I am working on - its a SLSB EJB3, and it uses a private instance variable to maintain a cache of data (it even calls it dataCache or something), with a getter/setter. For EJB2 and bellow, this was a typical EJB antipattern - SLSBs are not meant to retain state in between invocations, ther...

What is the equivalent of an EJB 3.0 Session Bean in Spring?

Is it as simple as creating a POJO with @Transactional methods? ...

Static Object in Jboss using EJB3

hi all, is it possible to create something like static object using EJB3 in Jboss. in other words i need to create something like a static object using singleton pattern or something like that, that is because i need to preload a configuration from database and i want that every bean that jboss creates uses this class to read this config...

The mappedName is always the same across application servers?

I have a stateless bean with some properties: It's a EJB3 class AddressFacade implements AddressFacadeRemote it's inside a ejb-jar (MyJAR.jar) it's in a EAR (MyEAR). My application server (Weblogic) generated this name (jndiName/mappedName): MyEARMyJAR_jarAddressFacade_AddressFacadeRemote I can't use injection, so I'll make a look...

JSF + Stateless EJB performance

Hey there, I have a JSF 2.0 application running on GlassFish v3. It has EJBs that serve database data via JPA for the main applications sessions. Even on non-IDE app-server, the EJB calls are very slow. Between some pages, the user has to wait over 10 seconds to get to the next page. The EJB runs on the same application server, and onl...

Using stateless EJB beans in an Entity Bean

Obviously using stateless EJB beans in an entity bean smells, but please consider a scenario as follows and tell me if you know of a better solution: I have an InvoiceTemplate Entity Bean with field NextInvoiceDate Generating NextInvoiceDate is a complex procedure and should be performed outside of the InvoiceTemplate class NextInvoice...

Testing EJB2.1 to EJB3 migration

We would like to migrate an application written using EJB2.1 beans (both Entity and Sessions beans) to EJB3 to improve on maintanance and use new features in the EJB3 spec. How would we do the migration and give the users the guarantee (if any) that the migrated system still works just as the old one. The original app didn't have test c...

First connect to Glassfish v3 is slow

When trying to connect to glassfish v3 from swing application it is very slow for the first time. Takes 4-10 seconds. On the client side: public void myMethod(){ NewSessionBeanRemote facade; try { InitialContext ic = new InitialContext(); facade = (NewSessionBeanRemote) ic.lookup(NewSessionBeanRemote.class.getNa...

declare a transaction in ejb 3.0

Hi, how can I force the EJB to not flush everything after every single command, I want to do a transaction. I've read that this is done somehow declaratively. But how exactly? @Stateless public class SomeBean{ @PersistenceContext EntityManager em; public void doSomeStuffAndThenFlushToTheDb(){ em.persist(entity); // it's flushed ...

Manage persistent context before flushing

hi, consider hibernate-link and JTA as peristence provider. How can I force em not to flush anything, and to handle it by myself? @Stateless public class SomeBean{ @PersistenceContext EntityManager em; public void method(){ em.persist(entity); // will get managed em.clear(); // everything gets unmanaged } } I would ex...

JSF preload list for datatable in page

I'm using EJB and JSF. I made a jsp simple page with a button "get list". When it's clicked, a managed bean method is called that sets the list, which is then displayed in the jsp with the dataTable tag. The question is, how can I pre load this list/dataTable on page load without having to click the button? This is the method that's ca...