apache-tomee

How to define MySQL data source in TomEE?

早过忘川 提交于 2019-11-28 06:05:17
问题 Platform: TomEE Web profile 1.5.0. I am trying to do a very basic thing, setup a data source for MySQL. I have read the official guide (http://openejb.apache.org/configuring-datasources.html). It asks us to enter a Resource element in openejb.xml. I can not find that file anywhere in tomee-webprofile-1.5.0. I read in other places that I could use tomee.xml for the same purpose. So, I added this to my conf/tomee.xml. <Resource id="TestDS" type="DataSource"> JdbcDriver com.mysql.jdbc.Driver

How to use TomEE with Hibernate

和自甴很熟 提交于 2019-11-27 08:28:50
I have created very simple app with persistence context (hibernate as provider) to read some value from database. I use Eclipse with Maven. First, I get Caused by: org.apache.openejb.OpenEJBException: java.lang.ClassCastException: org.hibernate.ejb.HibernatePersistence cannot be cast to javax.persistence.spi.PersistenceProvider: and according to this topic http://openejb.979440.n4.nabble.com/problem-with-hibernate-persistence-provider-td980429.html I excluded hibernate-jpa-2.0-api. Now, my dependencies look <dependency> <groupId>postgresql</groupId> <artifactId>postgresql</artifactId> <version

How to use TomEE with Hibernate

拟墨画扇 提交于 2019-11-26 17:45:40
问题 I have created very simple app with persistence context (hibernate as provider) to read some value from database. I use Eclipse with Maven. First, I get Caused by: org.apache.openejb.OpenEJBException: java.lang.ClassCastException: org.hibernate.ejb.HibernatePersistence cannot be cast to javax.persistence.spi.PersistenceProvider: and according to this topic http://openejb.979440.n4.nabble.com/problem-with-hibernate-persistence-provider-td980429.html I excluded hibernate-jpa-2.0-api. Now, my

Where to use EJB 3.1 and CDI?

微笑、不失礼 提交于 2019-11-26 08:38:59
问题 I am making a Java EE based product in which I\'m using GlassFish 3 and EJB 3.1. My application has session beans, a scheduler and uses web services. I recently came to know about Apache TomEE, which supports Contexts and Dependency Injection (CDI). The GlassFish container also supports CDI. Can I replace session beans where I do not require any feature that CDI also doesn\'t already provides? And if then, what are the benefits I can get? 回答1: Yes, you can freely mix both CDI and EJB and