openejb

Why datasource is not found in JNDI after injection from jndi.properties?

青春壹個敷衍的年華 提交于 2019-12-01 16:30:10
This is my persistence.xml : <persistence> <persistence-unit name="MyUnit"> <provider>org.hibernate.ejb.HibernatePersistence</provider> <jta-data-source>jdbc/abcDS</jta-data-source> </persistence-unit> </persistence> This is jndi.properties file from src/test/resources which is supposed to create a datasource during testing, since a real application server with a real datasource is absent: java.naming.factory.initial=org.apache.openejb.client.LocalInitialContextFactory jdbc/abcDS=new://Resource?type=DataSource jdbc/abcDS.JdbcDriver=org.hsqldb.jdbcDriver jdbc/abcDS.JdbcUrl=jdbc:hsqldb:mem

Test @Webservice EJBs with WebServiceContext (using OpenEJB?)

╄→尐↘猪︶ㄣ 提交于 2019-12-01 00:24:40
I have some EJBs as JAX-WS Web Service: @WebService @Stateless @Remote(MobileFacade.class) public class MobileFacadeBean implements MobileFacade { ... @Resource WebServiceContext wsc; ... } Within this Web Service class, a WebServiceContext is injected via @Resource. I use this WebServiceContext to get the principal in the implementation. This works quite well, but now I wonder how to (Unit-)test this class! So far, I was using OpenEJB to test my EJBs. Since the Web Service class also is an Stateless Session Bean, I would really like to use the same approach here. However, it does not work

Test @Webservice EJBs with WebServiceContext (using OpenEJB?)

佐手、 提交于 2019-11-30 19:46:14
问题 I have some EJBs as JAX-WS Web Service: @WebService @Stateless @Remote(MobileFacade.class) public class MobileFacadeBean implements MobileFacade { ... @Resource WebServiceContext wsc; ... } Within this Web Service class, a WebServiceContext is injected via @Resource. I use this WebServiceContext to get the principal in the implementation. This works quite well, but now I wonder how to (Unit-)test this class! So far, I was using OpenEJB to test my EJBs. Since the Web Service class also is an

Jetty 8 + EJB 3.1 + JTA + CDI + JPA 2 stack?

我是研究僧i 提交于 2019-11-30 09:23:33
Can anyone tell me if it is currently possible to "glue together" a partial Java EE 6 Web Profile over Jetty? I've found a lot of articles about integrating standalone EJB 3 containers, JTA providers, etc with older Jetty versions, so I wounder if I could make it all work together. I would like to assemble a Servlet 3.0 + CDI + EJB 3.1 + JTA (if needed, all I really want is declarative transaction management) + JPA 2 environment over Jetty 8 (or Tomcat 7 if no Jetty alternatives are available). My questions are: Can it be done? Has anyone managed to do that? Any articles about getting OpenEJB,

In TDD, why OpenEJB and why Arquillian?

霸气de小男生 提交于 2019-11-30 07:25:46
I'm a web developer ended up in some Java EE development (Richfaces, Seam 2, EJB 3.1, JPA). To test JPA I use hypersonic and Mockito. But I lack deeper EJB knowledge. Some may argue that we should use OpenEJB and Arquillian, but for what? When do I need to do container dependent tests? What are the possible test scenarios where I need OpenEJB and Arquillian? Please enlighten me :) Piotr Nowicki There are two aspects in this case. Unit tests . These are intended to be very fast (execute the whole test suite in seconds). They test very small chunks of your code - i.e. one method. To achieve this

DDL generation and general persistence.xml settings (OpenJPA)

你离开我真会死。 提交于 2019-11-30 04:24:52
问题 Summary I'm trying to run a Java web application JPA 2.0 example. The example application was written to run in Glassfish , using EclipseLink as JPA provider. I would like to convert it to run in TomEE with OpenJPA as the JPA provider, but I can't any detailed tutorials for getting up and running with OpenJPA . Problem I'm having trouble converting persistence.xml to work with OpenJPA instead of EclipseLink . More specifically, the given persistence.xml doesn't specify: Entity classes. Are

What to put into jta-data-source of persistence.xml?

一曲冷凌霜 提交于 2019-11-30 04:17:16
What value should I place into <jta-data-source> of my persistence.xml ? In glassfish admin panel I created a datasource name "abcDS" . In my jndi.properties (inside src/test/resources ) I defined it like this: [...] abcDS=new://Resource?type=DataSource abcDS.JdbcDriver=org.hsqldb.jdbcDriver abcDS.JdbcUrl=jdbc:hsqldb:mem:testdb abcDS.JtaManaged=true [...] What shall I place into persistence.xml ? I've found a lot of variants in the Net, like: "jdbc/abcDS" , "java:/abcDS" , "abcDS" . Which one is right? And is there some rule for this? I understand that it's related to JNDI, but... I'm trying

Jetty 8 + EJB 3.1 + JTA + CDI + JPA 2 stack?

早过忘川 提交于 2019-11-29 14:34:15
问题 Can anyone tell me if it is currently possible to "glue together" a partial Java EE 6 Web Profile over Jetty? I've found a lot of articles about integrating standalone EJB 3 containers, JTA providers, etc with older Jetty versions, so I wounder if I could make it all work together. I would like to assemble a Servlet 3.0 + CDI + EJB 3.1 + JTA (if needed, all I really want is declarative transaction management) + JPA 2 environment over Jetty 8 (or Tomcat 7 if no Jetty alternatives are available

How to configure OpenEJB logging?

≡放荡痞女 提交于 2019-11-29 10:06:51
How can I configure OpenEJB logging format? This is what what I see now in logs: [...] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.011 sec Running com.XXX.FooTest Apache OpenEJB 3.1.3 build: 20101015-05:42 http://openejb.apache.org/ INFO - openejb.home = /code/XXX INFO - openejb.base = /code/XXX INFO - Configuring Service(id=Default Security Serv... [...] I would like to disable INFO messages, and change formatting of others. Changes in log4j.properties have no effect. Keep in mind that the overriding ability you get with the OpenEJB logger works with system properties as

In TDD, why OpenEJB and why Arquillian?

喜欢而已 提交于 2019-11-29 09:35:28
问题 I'm a web developer ended up in some Java EE development (Richfaces, Seam 2, EJB 3.1, JPA). To test JPA I use hypersonic and Mockito. But I lack deeper EJB knowledge. Some may argue that we should use OpenEJB and Arquillian, but for what? When do I need to do container dependent tests? What are the possible test scenarios where I need OpenEJB and Arquillian? Please enlighten me :) 回答1: There are two aspects in this case. Unit tests . These are intended to be very fast (execute the whole test