ejb-3.0

Persistence Unit Service starting multille times

a 夏天 提交于 2019-12-12 04:59:07
问题 I am having EAR project which contains 1 EJB 3.0 Project and 2 WAR Project. I have defined persistence.xml in my EJB project. However when the application starts it starts persistence unit service 3 times. As per log on startup I can see Starting Persistence Unit Service 'xyz-ear.ear/xyz-ejb-1_0_0-SNAPSHOT.jar#xyzUnit' Starting Persistence Unit Service 'xyz-ear.ear/xyz-war-1_0_0-SNAPSHOT.war#xyzUnit' Starting Persistence Unit Service 'xyz-ear.ear/xyz-service-war-1_0_0-SNAPSHOT.war#xyzUnit'

JSF2.0 State_Saving_Method client issues

允我心安 提交于 2019-12-12 03:56:31
问题 Im using Mojarra 2.1.3, Netbeans 7.0.1, primefaces 3.2. I am currently in a quandary whether to use STATE_SAVING_METHOD client or server. Currently Im setting the saving method to client. And this involves me doing adjustment to seriazibility of many objects. And putting transient keyword on the stateless facade session beans. @ManagedBean @ViewScoped public class SaProductController implements Serializable { @EJB transient SaProductFacade saProductFacade; @EJB transient SaKeywordFacade

NameNotFoundException in Container Managed EntityManager

江枫思渺然 提交于 2019-12-12 03:38:42
问题 I am trying to use Container Managed EntityManager, however I am getting NameNotFoundException. I have tried adding entries in web.xml but in vain. @Stateless @Path("/mypath") public class EmployeeService { @EJB private EmployeeDAO employeeDAO; @GET @Path("/myresults") @Produces(MediaType.APPLICATION_JSON) public Employee getValues() { Employee emp = new Employee(); try { emp = employeeDAO.getEmployees(); // exception here } catch (Exception ex) { ex.printStackTrace(); } return emp; }

Programming BMT - UserTransaction

ε祈祈猫儿з 提交于 2019-12-12 03:06:03
问题 Is the complete programming of BMT based on UserTransaction interface? In other words, if I want to use BMT, is there any scenario when I would require more services than those provided by the UserTransaction interface. Why this question? If I use a different implementation of the transaction manager (such as Bitronix TM or Atomikos) and not the default provided by the container, is it just enough to inject the new TM into UserTransaction object? -Thanks 回答1: This is really limited to what

Entity manager error on the server?

大兔子大兔子 提交于 2019-12-12 02:26:36
问题 Hi I have developed my java application on glassfish server with EJB 3.0 persistance. On my local machine the application was running fine and was persisting the data perfectly. However, When I deployed it on the linux server, whenever I persist any data it gives me this EJB exception error: Caused by: Java.lang.IllegalStateException: Attempting to execute an operation on a closed EntityManagerFactory. And here is my persistence.xml file: <?xml version="1.0" encoding="UTF-8" ?> <persistence

EJB3: Right way to insert initial data when application starts like Grails Bootstrap?

本秂侑毒 提交于 2019-12-12 01:59:43
问题 Similar to Bootstrap.groovy in Grails, how to add some initial data when an app starts? Since in @PostContstruct method, the EntityManager is not available in Stateless session beans (or am I doing something wrong?), so what should be the right way to insert some initial data? E.g. I want to add one Admin account in my system when the application starts. 回答1: Since in @PostContstruct method, the EntityManager is not available This is not true, @PostConstruct is usually the right place where

Load external properties files into EJB 3 app running on WebLogic 11

柔情痞子 提交于 2019-12-11 23:33:06
问题 Am researching the best way to load external properties files from and EJB 3 app whose EAR file is deployed to WebLogic. Was thinking about using an init servlet but I read somewhere that it would be too slow (e.g. my message handler might receive a message from my JMS queue before the init servlet runs). Suppose I have multiple property files or one file here: ~/opt/conf/ So far, I feel that the best possible solution is by using a Web Logic application lifecycle event where the code to read

Writing to database log in the middle of rollback

时光怂恿深爱的人放手 提交于 2019-12-11 20:39:18
问题 I am using jboss5.1.x, ejb3.0 I have a transaction which goes like this: MDB listen to JMS Queue. MDB takes msg from JMS writing to Database. in some of the catch clauses i throw "New EJBException(..)", in order to have rollbacks when specific exceptions occurs. beside of that I have configured a re-try mechanism, after 3 times the msg going to error queue. What i wanna achive is: when Iam having a rollback, i want to increase the current re-try number, so if some1 is observing the database,

Error while running client code in EJB

吃可爱长大的小学妹 提交于 2019-12-11 18:53:52
问题 Getting error while running client code in EJB: Exception in thread "Main Thread" java.lang.NoClassDefFoundError: weblogic/kernel/KernelStatus at weblogic.jndi.Environment.(Environment.java:78) at weblogic.jndi.WLInitialContextFactory.getInitialContext(WLInitialContextFactory.java:117) at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:667) at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:288) at javax.naming.InitialContext.init(InitialContext.java:223)

Find all EJBs implementing interface

元气小坏坏 提交于 2019-12-11 18:39:32
问题 I have a set of data that is provided by multiple providers. As they each have their own ways of accessing it, they each have separate EJBs although they all implement the same interface. Is there a way to have all of them injected? So that I end up with some sort of List<MyInterface> ? Standard injection seems to give either one, or error on ambiguity. 回答1: With the CDI integration, you have two options, based on how you have organized your projects. If the providers are defined within the