ejb-3.0

How to test EJB method call with Arquillian Weld EE Embedded

爷,独闯天下 提交于 2019-12-06 08:49:19
问题 I would like to test an EJB, and I want to test it with Weld EE Embedded as I don't want to deploy an applicatoin server for that. Here is my class : @RunWith(Arquillian.class) public class EJBTest { @Deployment public static JavaArchive createTestArchive() { return ShrinkWrap .create(JavaArchive.class, "test.jar") .addAsManifestResource(EmptyAsset.INSTANCE, ArchivePaths.create("beans.xml")); } @Stateless public static class SomeService { public String someMethod() { return "test"; } }

Transaction TransactionImple ActionStatus.ABORTED was already rolled back

旧街凉风 提交于 2019-12-06 08:44:59
问题 I realize a migration of a DTO Business from TomEE to JBoss . I have this entity : @NamedQueries({ @NamedQuery(name = "common.plagebusiness.plage.getAllPlages", query = "SELECT p FROM Plage p ORDER BY p.plageRgMax, p.plageCReseau") }) @Entity @Table(name = "PLAGE") public class Plage { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) @Column(name = "idPlage") private Integer idPlage; @Column(name = "rgMin") private String plageRgMin; With this Interface : @Local public interface

How to get the field annotated with @Id in EJB3 (JPA) and Hibernate?

左心房为你撑大大i 提交于 2019-12-06 08:33:14
问题 The title is self explanatory. I would be glad to hear solutions, thanks. 回答1: There's a shorter approach than listed so far: Reflections r = new Reflections(this.getClass().getPackage().getName()); Set<Field> fields = r.getFieldsAnnotatedWith(Id.class); 回答2: JPA2 has a metamodel. Just use that, and you then stay standards compliant. The docs of any JPA implementation ought to give you enough information on how to access the metamodel 回答3: I'm not a java programmer, nor a user of Hibernate

mulitple queues in EJB messagedriven annotation

僤鯓⒐⒋嵵緔 提交于 2019-12-06 07:33:13
I have 3 queues and these three queues need to be listened by MDBbean and accordingly based on reading input, i will split out the task for each category of input. As of now, the code is working fine for only one queue and i don't know how to implement it for more than one queue. Could you please guide me @MessageDriven(mappedName="receiver1") public class MDBMessages implements MessageListener How i can make my MDBMessage to listen for receiver2 and receiver 3 queue. Thanks Prabhakar From Documentation : A message-driven bean is defined for a single messaging type, in accordance with the

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

牧云@^-^@ 提交于 2019-12-06 06:22:41
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 could lookup a bean with jndi name but what i want to know is, what type of object it will return? How

Generate constants for class attributes with maven?

旧街凉风 提交于 2019-12-06 05:19:34
i have a small code generation question. I have a EJB3 backend that serves DTO objects to a frontend. The frontend uses a configurable binding procedure to map the attributes of the DTO to their forms. At the moment they are doing it by specifing the attributes as strings in ther configuration. The binding implementation uses reflection to acces the attributes. Sounds nice but the problem is, each time we change an attribute name in a DTO, this will not lead to a compile error in the frontend because they have just strings. I'm now looking for a way to create a string constant for each

EJB Glassfish v3.1.2 client passed data to session bean is always null

对着背影说爱祢 提交于 2019-12-06 02:48:54
I am having a problem when calling session bean method passing method parameters from client application, the data reaches the method call is always null or set to default value. while the process of the method works well with the object for example: -we have method to persist an object entity addStudent(Student student); - from the client we create the student object setting student fields like student name and so on, calling the method addStudent(ourStudent); this ourStudent reaches method with fields of null or default value. the student is added with these empty fields. Thanks in advance.

Cant access EJB from a Java SE client - Lookup Failed Error

∥☆過路亽.° 提交于 2019-12-06 01:00:29
I am using Netbeans and am experimenting with EJBs. I have two projects (2 separate applications) 1- A Java ME Project called EnterpriseApp 2- A standard Java SE Project called Test Now here is what I did - in EnterpriseApp I generated a stateless EJB called TestEJB with both local and remote interfaces. For the remote project selection I selected the Test App. In short the bean code looks like this @Stateless public class TestEjb implements TestEjbRemote, TestEjbLocal { @Override public String Try() { return "Hello World"; } } And in the Java SE client Project here is my main class through

JMS queue message receive order

瘦欲@ 提交于 2019-12-06 00:52:57
I am adding two JMS messages in the same destination sequentially. Will both of these messages be received in the same order in which I have added them or is there a chance for reverse ordering, that is, which ever the message is received first in the destination will be retrieved first. I am adding into a destination as: producer.send(Msg1); producer.send(Msg2); Msg1 and Msg2 will be added sequentially in all the cases (like network failures and latency. etc.)? Aravind R. Yarram Message ordering is not guaranteed (and not mandated by the specification) and Total JMS Message ordering explains

Weblogic wrap application exception in javax.ejb.EJBException

▼魔方 西西 提交于 2019-12-05 23:52:37
My ear application was working fine. But suddenly it started to throw javax.ejb.EJBException in some method calls, instead of returning the original Application Exception (annotated with @ApplicationException(rollback=true). Now the original application exception is wrapped in the EJBException. the Currently the other developer who was working in the project is on leave. Therefore I have no idea what he has done to the code for happening this. This application exception and ejb remote interfaces are in a separate jar file which is deployed as a shared library in the weblogic. I would like to