ejb-3.0

Consuming local EJB, in the same Container but different ears

自古美人都是妖i 提交于 2019-12-05 23:31:19
问题 I'm triying to consume a Local EJB in the same Glassfish, but different ears. But Glassfish can't found the local EJB or can't consume I read this: According to the JavaEE tutorial, the client of a @Local bean "must run in the same JVM as the enterprise bean it accesses." In the first ear , I have the local Interface inside a jar @Local public interface MyLocalBean { int getNumber(int num3); } In another jar, I have the implementation @Stateless @LocalBean public class MyLocalBeanImpl

JBoss 6: Injecting EJB into servlet

北城余情 提交于 2019-12-05 22:44:52
Folks, I am very annoyed by having to re-learn and waste time with this stuff every time a new version of JBoss rolls around. I have a stateless EJB that is discovered and declared in the JNDI space: 10:01:53,044 INFO [org.jboss.ejb3.proxy.impl.jndiregistrar.JndiSessionRegistrarBase] Binding the following Entries in Global JNDI: DTalk/UserManager/local - EJB3.x Default Local Business Interface DTalk/UserManager/local-com.doctalk.ejb.UserManagerLocal - EJB3.x Local Business Interface I need to use this EJB in a servlet which is part of a war which is part of the EAR that contains the EJB. I'd

why pool stateless bean?

十年热恋 提交于 2019-12-05 21:29:30
Normally we use singleton instance for business / dao layer. What is the reason behind pooling stateless session beans in case of EJBs? The "stateless" in the name refers to session conversation state, i.e. state that persists between invocations of the bean, retained for the duration of the session. However, stateless session beans are still permitted to have instance variables. Those instance variables should not relate to the conversation state, but are "shared" between clients. In other words, stateless session beans are not guaranteed thread safe. As a result, the container should ensure

EJB3 DataSource DataSource.getConnection

被刻印的时光 ゝ 提交于 2019-12-05 21:13:37
In a CMT J2EE environement (Container Managed Transaction) what transaction / connection is used when I JDNI-lookup for a DataSource object and invoke DataSource.getConnection ? Is this connection part of the (potentially distributed) transaction? Does getConnection() return the same Connection every time I call it for the same DataSource object? I only know using Connections by the same EntityManager using native SQL statements. It is something that keeps me puzzling. As I understood the SessionContext defines a transactional system that is used throught every time I use a datasource. I have

Configurable values to MDB annotations

我的未来我决定 提交于 2019-12-05 20:46:22
问题 I'm trying to use this method for receiving mail in our EJB3 app. In short, that means creating an MDB with the following annotations: @MessageDriven(activationConfig = { @ActivationConfigProperty(propertyName = "mailServer", propertyValue = "imap.company.com"), @ActivationConfigProperty(propertyName = "mailFolder", propertyValue = "INBOX"), @ActivationConfigProperty(propertyName = "storeProtocol", propertyValue = "imap"), @ActivationConfigProperty(propertyName = "debug", propertyValue =

What is the best prctice for using security in JAX-WS

大憨熊 提交于 2019-12-05 18:59:53
Here is scenario : I have some web services (JAX-WS) that need to be secured. Currently for authentication needs I providing addition SecurityWService that give authorized user some userid & sessionid that is need to be described in request to other services. It would be more better to use some java security. We have many of them but could not defined what is better to use. Q1 : It is understand that I should use SSL in transport layer, but what should I use for user authorization. Is there is better way to establishing session, validating user etc. ? Here is some key description : Most web

How to use Container Managed Transaction (CMT) with JBoss AS 6, Hibernate 3.6, JPA, JTA and EJB3

折月煮酒 提交于 2019-12-05 17:59:25
I'm attempting to setup a web app using CMT. I've got it running standalone within Eclipse ok, and now I'm trying to get it working within Jboss AS 6, using Struts 1.0. I've chosen CMT because the doco I've read hints that it's the best and "least verbose to use". So seems like contempory/good-practice use of Hibernate 3.6. I can load objects from a MySQL database with the following code extracts, but persisted objects are not being flushed/synchronised/saved to the database: From within Struts 1.0 Action class: InitialContext ctx = new InitialContext(); EntityManagerFactory emf =

EJB 3.1 Singleton + JPA + JSF design advice needed

倖福魔咒の 提交于 2019-12-05 13:08:31
Given: simple JSF webapp (no Seam), having JSF beans calling few EJB's which in turn load and persist JPA entities. What I want to is to use @Singleton annotation for ejb's and inject EntityManager instead of EntityManagerFactory : @Singleton public class MyEJB { @PersistenceContext(unitName = PERSISTENCE_UNIT_NAME) protected EntityManager em; // not EntityManagerFactory } Spec says that @Singleton is thread-safe, supports concurrency and transaction attributes which (from my pov) makes it safe for calling from JSF beans. I expect also performance benefits because of EntityManager not being

WebLogic ERROR: No credential mapper entry found for password indirection user=db_user?

喜夏-厌秋 提交于 2019-12-05 12:36:33
Every time I try to deploy my EJB service app to Weblogic 10.3 server, I get following error: java.security.PrivilegedActionException: weblogic.common.ResourceException: java.security.PrivilegedActionException: weblogic.common.ResourceException: No credential mapper entry found for password indirection user=db_user for data source my_ds How to solve this?? The Oracle forums have posted a solution for this, if you are deploying to another Weblogic server other than the Integrated one with JDeveloper. While generating ear file for an application from JDev, it will generate a *-jdbc.xml file for

How do I call a remote EJB in an EAR from another?

 ̄綄美尐妖づ 提交于 2019-12-05 07:24:00
In Weblogic 10.3, how do I inject a remote EJB from one EAR into a Stateless bean of another, both EARs being deployed in the same container? Ideally I'd like to do as much as possible with annotations. So suppose I have the following interface: public interface HelloService { public String hello(); } implemented by the following EJB: @Stateless @Remote public class HelloServiceBean implements HelloService { public String hello() { return "hello"; } } Suppose they're packaged and deployed in server.ear . Now in client.ear , I have the following: @Stateless public class HelloClientBean { @EJB