ejb-3.0

“JNDI name is already in use” in Weblogic 12c with EJB3

我是研究僧i 提交于 2020-01-03 10:56:45
问题 I have the following code that I'm trying to deploy as an EJB to WebLogic 12c, but I'm getting an error: "Error deploying the EJB GeopoliticalServiceBean(Application: campaigner-ejb, EJBComponent: campaigner-service.jar), the JNDI name java:global/campaigner-ejb/campaigner-service/GeopoliticalServiceBean!com.dr_dee_sw.campaigner.service.GeopoliticalServiceLocal is already in use. You must set a different JNDI name in the weblogic-ejb-jar.xml deployment descriptor or corresponding annotation

Weblogic 10.3.5 & EJB 3 JNDI names

会有一股神秘感。 提交于 2020-01-02 19:56:16
问题 Could someone tell me where I can find infos on the default JNDI naming for EJB 3 ? Does Weblogic use portable JNDI names like Glassfish? Can I find (like for Glassfish) a trace of EJB deployment with JNDI names used? For example : an interface (Service) with only @Remote a bean (ServiceImpl) with only @Stateless implementing the interface everything packaged in an .ear file (service-application-1.0) When deploying on Weblogic the only JNDI reference I see is: service-application-1.0service

How do i access EJB implementing remote interface in separate web application?

亡梦爱人 提交于 2020-01-02 12:04:09
问题 I am using Netbeans 6.8 and Glassfish v3.0. I created an ejb module and created entity classes from database and then created stateless session bean with remote interface. Say eg. @Remote public interface customerRemote{ public void add(String name, String address); public Customer find(Integer id); } @Stateless public class customerBean implements customerRemote{ //implementations of methods } Then i created a new web application. But now how do i access remote ejb's in my web application. I

JBoss 6: Injecting EJB into servlet

孤者浪人 提交于 2020-01-02 09:28:17
问题 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

EntityManager.flush() commits the transaction in a Java web service

只愿长相守 提交于 2020-01-02 02:48:11
问题 EDIT : Thanks everybody for your answers, but the problem was with my data source configuration, which was actually in auto-commit mode. See my answer below for details. Both the Javadoc of the EntityManager.flush() method and searching for it in Google seem to suggest that the flush method only sends the pending statements to the database and does not commit the transaction. But a simple test web service I created (in Java 7, Oracle 11gR2, JBoss 7.1 and the Web service is packaged as a jar

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

此生再无相见时 提交于 2020-01-02 02:43:17
问题 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 InventoryBean by providing the JNDI name and the URL in xml or somewhere else. 回答1: Finally I found a way to do this. i. Configure the foreign JNDI on the weblogic server and

How do I obtain a new stateful session bean in a servlet thread?

我的梦境 提交于 2020-01-01 05:35:07
问题 I'm experimenting with EJB3 I would like to inject a stateful session bean into a servlet, so that each user that hits the servlet would obtain a new bean. Obviously, I can't let the bean be an instance variable for the servlet, as that will be shared. And apparantly injecting local variables isn't allowed. I can use the new operator to create a bean, but that doesn't seem the right approach. Is there a right way to do this? It seems like what I'm trying to do is fairly straightforward, after

How singleton is javax.ejb.Singleton in a clustered environment?

↘锁芯ラ 提交于 2020-01-01 03:03:18
问题 I need to maintain a simple counter that is unique within the application, for all users and all nodes in a clustered environment. I thought about using the singleton session bean annotation javax.ejb.Singleton like so: package foo; import javax.ejb.Singleton; @Singleton public class Bean { private int counter; [...] } This looks simple, but I could not find an answer if this works as desired in a clustered environment. Would every node of the cluster have it's own instance or not? Of course

EJB3 - using 2 persistence units within a transaction (Exception: Local transaction already has 1 non-XA Resource)

烂漫一生 提交于 2020-01-01 02:45:28
问题 I am trying to use 2 persistence units within the same transaction in a Java EE application deployed on Glassfish. The 2 persistence units are defined in persistence.xml, as follows: <persistence-unit name="BeachWater"> <jta-data-source>jdbc/BeachWater</jta-data-source> ... <persistence-unit name="LIMS"> <jta-data-source>jdbc/BeachWaterLIMS</jta-data-source> ... These persistence units correspond to JDBC resources and connection pools which I had defined in Glassfish as follows (include one

EJB3 & How JAAS subject/principal is propagated to EJB Tier from servlet container?

前提是你 提交于 2019-12-30 05:24:04
问题 I'm trying to understand how the JAAS principal propagates to the Business/EJB tier from web tier. I've read that the if the roles/realm is configured in login-config & security-context of web.xml then the servlet container will also transparently pass the authenticated principal to the EJB Tier. Two questions 1.) First & more importantly is that true ? Without any intervention from the developer ! 2.) And secondly any idea how that works under the hood. 回答1: yes it's true. that's generally