ejb-3.0

Why and when to use EJB-based web services?

To transfer data from one system to another, through data interface, by web services, we normally get a result set by SQL query, and format them as a web service endpoint, and allow it to be retrieved by another side. With EJB 3.0, it seems we can replace the result set by stateless session bean. So are there any advantages over the SQL...

JEE deployment patterns resourses

I'm looking book/online resourses about JEE application deployment pattens. Especially I want to know patterns when to use local interfaces when remote ones (how many nodes I need to?). The key question is to use single EAR (EJB and WAR) or separate nodes for EJB and WARs. Resources I've found are bitty outdated, they concentrate on EJB...

Sequence / Identity support in python webframeworks

Currently I'm evaluating web frameworks with an ORM layer and I've stumbled upon an interesting issue. I used tables with an ID column in a JEE (EJB3/JPA) application with different databases. In SAPDB I could define a sequence and use the jpa sequence generator annotation to deal with it, the same way I did on an oracle database previou...

Can I call a Stateful Session Bean through a Stateless Session Bean?

Can I call a Stateful Session Bean through a Stateless Session Bean? Is the client of the SFSB then automatically the client of the SLSB for state preservation purposes? The problem is that because of the design being set in stone, I am not easily allowed to call the SFSB directly. ...

EJB3 Getting at original JDBC Errors

Hi all, I am using EJB3 on Glassfish using the default TopLink persistance manager. Within a Session Bean, when the persistence manager catches a DB exception, it marks the transaction to be rolled back, and throws an EJBException, in turn wrapping a RollbackException. Now I was expecting to be able to get the original jdbc exception ou...

JNDI lookup of EJB3 inside an EAR file on Glassfish

I have an EAR file with a bunch of JARs in it, and one of these JARs contains Local Session Beans (EJB3). I need to perform a JNDI lookup of these Session Beans from within an unmanaged POJO, also contained in the EAR (and in this case in the same JAR as the EJBs as well). I tried following the Glassfish EJB FAQ, but I keep on receiving ...

Where exactly is the JTA Transaction demarcation for CMT respected?

I'm trying to fully understand the JTA demarcation with CMT. The behavior I am experiencing is that only the first @TransactionAttribute of the method is respected on the EJB and subsequent method invocations of the same bean with different @TransactionAttribute annotations are not. Example: @Stateless @TransactionAttribute(Transact...

Is it possible to use @EJB annotation to inject EJBs through different servers?

I have 2 session beans, OrderBean and InventoryBean which are deployed at different weblogic servers. The OrderBean needs to access the InventoryBean to check if the supply is sufficient. Currently, I use JNDI look up to locate the InventoryBean and it works fine. Now I'm wondering if it is possible to use @EJB to inject InventoryBe...

How to get notification about EJB deployment (to set up a timer)?

Hi community, I'm deploying an EJB which should set a timer and be triggered by it every 24 hours. But where should I set the timer? @PostConstruct does not help -- this is a session bean, so post-construct method will be invoked when the actual instance is created (this never happens as the sole purpose of this bean is to track timer)....

EJB Authentication and Authorization

Is there any way to extend the authentication operation which connects a client application to an EJB, using standard JAAS/container-based security? I'm looking for a way to use more than just a username to authenticate the user (in this case a domain name is also needed). Ideally I'd like to be able to use the SessionContext.getCallerPr...

EJB3/DB2 Transactions not rolling back.

Hello all, I have a situation where I have a tree of Entities, and a Session Bean. The Session Bean simply persists or merges the entities, and the method in question is marked as @TransactionAttribute(TransactionAttributeType.REQUIRES_NEW). Now in the case that a child entity fails to be persisted/merged due to (for example) a foreig...

Criteria queries in EJB 3

Can I use Criteria queries with EJB3 entities? If so, how can I combine them with EntityManager? ...

Lookup Local EJB from Glassfish LifeCycle module

I can look up the remote interface of an EJB3 from a Glassfish 2.1 using the global jndi name. However, as I understand, if this were not a LC module but an EJB (Servlet), I would have an ejb-local-ref entry in its ejb-jar.xml (web.xml). Is there a place to define Local references for an LC module? Thanks! ...

EJB into SEAM Component (Different projects and same JBoss)

Hey guys, I have the following setup: JBoss 4.2.3 under that i have: --> Project A (Wich is not SEAM 2.1.2GA based) EJBs: * beanA (JNDI = beanA/remote) * beanB (JNDI = beanB/remote) --> Project B (SEAM based) EJBs / Components: * ComponentX * ComponentY On component X i have the current pie...

@Cache annotation usage error

I added the following annotation to enable cache to one of my EJB3 entities, to test caching with ehCache, where I use Hibernate as the persistence provider: .... import org.hibernate.annotations.Cache; import org.hibernate.annotations.CacheConcurrencyStrategy; @Entity @Table(name = "F") @Cache(usage=CacheConcurrencyStrategy.READ_WRITE...

NameNotFoundException when calling a EJB in Weblogic 10.3

I have a EJB defined as this: package com.foo; @Stateless (mappedName="HelloWorld") public class HelloWorldBean implements HelloWorld, HelloWorldLocal .... When it's deployed to Weblogic (WL), it gets the name myBean. I'm not sure if this is important. I try to call the bean with this code: Hashtable ht = new Hashtable(); ht.put(Co...

JPA custom script at startup

What is the best way to fill tables create with jpa at application startup/shutdown of application ? like but with data manipulation language instead data definition language. i'm using HibernatePersistence as persistence provider. ...

EJB3 Web Services Error with JAXB

Update: I checked the JBoss log and found the following errors: 2009-10-28 10:21:34,472 ERROR [org.jboss.ws.metadata.wsdl.xmlschema.JBossXSErrorHandler] (main) JBossWS_ejb.uhandler.pds.hsc.xyzis.com_8603663089732759450.xsd[domain:http://www.w3.org/TR/xml-schema-1]::[key=src-resolve]::Message=src-resolve: Cannot resolve the name 'ns1:Mes...

Using Dependency Injection in POJO's to inject EJB's

Is it possible to inject ejb's into pojo's using the @EJB annotation? If it is, do I have to set up anything special on a JBoss server to make it work? Please let us not discuss the rationale behind doing this - I am just trying to hack some old code to make it work :-) ...

Jboss Message Bean (EJB3) - configuration name

Is there a way of specifying the configuration name of a message bean through annotations? In the jboss.xml descriptor you can have different configurations and bind the beans to a particular config: <message-driven> <ejb-name>PushUserAgentBean</ejb-name> <destination-jndi-name>queue/PushUserAgent</des...