ejb-3.0

Java EE 6: controlling startup of managed beans with dependencies: CDI, EJB

守給你的承諾、 提交于 2020-01-11 09:29:11
问题 I just read the very nice explanation of the various managed beans and their relations on Java EE 6 @javax.annotation.ManagedBean vs. @javax.inject.Named vs. @javax.faces.ManagedBean and as i face a annoying problem in my application i want to know if it is possible to control or influence the way how and when beans are started. In my Java EE application I use EJB, CDI and JSF2 as view technology. Via SPI a service from a third party is booted and it configures a job executor which starts

EJB 3 Session Bean Design for Simple CRUD

可紊 提交于 2020-01-10 08:38:36
问题 I am writing an application that's sole purpose in life is to do CRUD operations for maintaining records in database. There are relationships between some of the tables/entities. Most examples I've seen for creating session beans deals with complex business logic/operations that interact with many entities which I don't have. Since my application is so very basic, what would be the best design for the session bean(s)? I was thinking of having one session bean per entity which had CRUD the

Why is an injected value sometimes null inside my custom ConstraintValidator?

痞子三分冷 提交于 2020-01-06 13:27:17
问题 i created a custom ConstraintValidator Annotation which called APIAuth , and i tried to fetch the remote user IP Address Using @Context HttpServletRequest , but the problem is when calling the APIAuth inside my Stateless , the APIAuth custom validator work , and it fetch the remote user ip address , but when i try to refresh the request again quickly , it throw an exception , because of @Context HttpServletRequest be null at this case , it need from me to wait some seconds before trying to

EJB 3.0 Timer Cluster Info

我的梦境 提交于 2020-01-05 07:25:11
问题 I was able to get some hands on EJB3.0 Timer Service.I was able to get the timeout working and I was able to invoke the timer using servlet Context listener.I have deployed a simple app which sends alerts at a specific interval.I am using WL 10.3.1(does not support EJB3.1,to use Scheduler). I get alerts twice at the same time.(I have a cluster with 2 managed Servers).I looked at few examples of using a timer in WL cluster,for eg: http://shaoxiongyang.blogspot.com/2010/10/how-to-use-ejb-3

Possible to inject same stateful session bean instance into multiple other session beans?

对着背影说爱祢 提交于 2020-01-05 04:57:09
问题 Is it possible to make the container inject the same stateful session bean instance into multiple other stateful session beans? Given the following classes: @Stateful public class StatefulTwoBean implements StatefulTwo { @EJB private StatefulOne statefulOne; } @Stateful public class StatefulThreeBean implements StatefulThree { @EJB private StatefulOne statefulOne; } In the above example, StatefulTwoBean and StatefulThreeBean each get injected their own instance of StatefulOneBean . Is it

When should I use `REQUIRED` vs `NOT_SUPPORTED` as a the value of @TransactionAttribute for an MDB?

故事扮演 提交于 2020-01-04 08:03:14
问题 I know about container managed transactions(CMT). I also know about the different possible values of the enumerated type TransactionAttributeType . Since the client never calls a MDB directly, the attribute types other than the REQUIRED and NOT_SUPPORTED do not make sense for MDB's as there is no client initiated transaction to join to. So when should I annotate the onMessage() method of an MDB with REQUIRED vs NOT_SUPPORTED ? What will be the default behavior in none of the two options is

How to access EntityManager inside Entity class in EJB3

牧云@^-^@ 提交于 2020-01-04 05:27:17
问题 I need to execute a db query inorder to set the extra column "The order by column" in a many to many association table. so I need to access the db sequence from inside the Entity class and and select the nextval of the sequence and assign it to the order_by column in @prepersist lifecycle callback method. @Entity public class ProductWishlist implements Serializable { .... @Column(name="ORDER_BIT") private long orderBit; // getter setter // ....... @Prepersist public void setOrderBit

How can I set isolation levels per method in EJB 3

余生颓废 提交于 2020-01-04 03:52:48
问题 Is it possible to set the database isolation level (ie Serializable, repeatable-read etc) for a given EJB 3 method call? I understand that this is not covered by the EJB Spec, so details of how to do it on either a JBoss or Glassfish specific manner would be great. I'm starting to get the impression it's not possible and that you can only set it per Connection Pool which is clearly by no means an ideal solution. 回答1: This is indeed not covered by the spec and but can be configured through

Is JavaEE really portable?

跟風遠走 提交于 2020-01-04 03:01:20
问题 I'm just implementing a JavaEE assignment I was given on an interview. I have some prior experience with EJB, but nothing related to JMS and MDBs. So here's what I find through the numerous examples: application servers bind their topics and queues to different JNDI names - for example topic / queue , jms the activationConfig property is required on JBoss, while in the Sun tutorial it is not. after starting my application, jboss warns me that my topic isn't bound (it isn't actually - I haven

Are there any EJB migration tools available for migrating EJB 2.1 toEJB 3.x

我怕爱的太早我们不能终老 提交于 2020-01-03 13:36:41
问题 May be the best way is doing it manually. But in a large project you need some tool to assist you. It was the idea that led me to search a tool. Are there any EJB migration tools available for migrating EJB 2.0 to 3.x. 回答1: It was only under development for a short time, but for a period we did have an eclipse plugin that would read in ejb-jar.xml files and then update the source and insert the annotations. It's been used a handful of times by the person who wrote it (Jonathan Gallimore) and