ejb-3.1

Fixing “Could not resolve a persistence unit…” errors when PU is specified, found

非 Y 不嫁゛ 提交于 2019-12-01 15:44:37
问题 I'm running Glassfish 3.1-SNAPSHOT as of today (2010-11-12). I'm using the embedded EJBContainer. On the classpath, as reported by the EJBContainer, I have a META-INF/persistence.xml. This file defines two persistence units: one called "ngp" and one called "cx". Debugging output shows that the Glassfish JPA deployer finds it, and recognizes both the cx PU and the ngp PU. The EJBContainer bombs out with the following all-too-common JPA error: java.lang.RuntimeException: Could not resolve a

CDI with ejb 3.1 , weld-logger on glassfish v3.0.1

こ雲淡風輕ζ 提交于 2019-12-01 13:55:18
Scenario: 1) create maven ear project, create war project inside 2) add beans.xml to war project`s WEB-INF/ 3) creat simple @Steateless bean project - http://drp.ly/1j5C3t ejb bean : @Stateless @LocalBean public class TestEjb { @Inject Logger log; public TestEjb() { } @Schedule(hour = "*", minute = "*", second = "*/15") public void print1Partner() { log.info("Yrjaaaa"); System.out.println("This is test"); } } maven pom-xml of war project : <?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi

CDI with ejb 3.1 , weld-logger on glassfish v3.0.1

两盒软妹~` 提交于 2019-12-01 12:04:44
问题 Scenario: 1) create maven ear project, create war project inside 2) add beans.xml to war project`s WEB-INF/ 3) creat simple @Steateless bean project - http://drp.ly/1j5C3t ejb bean : @Stateless @LocalBean public class TestEjb { @Inject Logger log; public TestEjb() { } @Schedule(hour = "*", minute = "*", second = "*/15") public void print1Partner() { log.info("Yrjaaaa"); System.out.println("This is test"); } } maven pom-xml of war project : <?xml version="1.0" encoding="UTF-8"?> <project xmlns

javax.persistence.PersistenceException: Invalid persistence.xml

半城伤御伤魂 提交于 2019-12-01 11:29:10
I'm working on project with Servlet,JPA,EJB and JBoss in eclipse. As you can see in the title of my topic I have an error on my persistence.xml file but I don't know which: <persistence version="2.1" xmlns="http://xmlns.jcp.org/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/persistence http://xmlns.jcp.org/xml/ns/persistence/persistence_2_1.xsd"> <persistence-unit name="TrainingAppEJB-PU"> <provider>org.hibernate.ejb.HibernatePersistence</provider> <jta-data-source>java:jboss/datasources/MysqlDS</jta-data-source> <class

Eclipse doesn't deploy Gradle project properly

耗尽温柔 提交于 2019-12-01 08:02:06
问题 So I have a gradle project that apparently has some problems fully integrating with eclipse. When I build the whole thing with "gradle build" command and deploy the EAR file on glassfish4 server, everything appears to work perfectly fine, but when I try to run "gradle eclipse" "gradle eclipseWtp" import the project to eclipse and press "run on server" only the part of the app actually gets deployed... I mean, when you go to admin panel, you can actually see the app there, but the application

EJB 3.1: Does it allow injection of beans into resources not managed by the container?

淺唱寂寞╮ 提交于 2019-12-01 06:27:44
I am using JBoss 6.1 and its not fully EJB 3.1 compliant. As of now, I can't inject an EJB into my Struts action classes (or in any non-Java EE Container-managed class) via @EJB , but will this be possible when the EJB 3.1 specification is fully implemented? If not, will it be too infeasible to have that due to performance reasons in the foreseeable future? No container will ever be able to inject anything into a non-managed object. To be able to to inject into an object, the container needs to manage the object's lifecycle, or at least to participate in the management of its lifecycle, so it

EJB 3.1: Does it allow injection of beans into resources not managed by the container?

﹥>﹥吖頭↗ 提交于 2019-12-01 04:20:15
问题 I am using JBoss 6.1 and its not fully EJB 3.1 compliant. As of now, I can't inject an EJB into my Struts action classes (or in any non-Java EE Container-managed class) via @EJB , but will this be possible when the EJB 3.1 specification is fully implemented? If not, will it be too infeasible to have that due to performance reasons in the foreseeable future? 回答1: No container will ever be able to inject anything into a non-managed object. To be able to to inject into an object, the container

Passing state between EJB methods / @RequestScoped and @Stateless

女生的网名这么多〃 提交于 2019-12-01 04:15:15
I have a @RequestScoped CDI bean that I want to turn into an EJB to get declarative transactions. (I'm on EJB 3.1, Java EE 6) Currently, I am passing state between subroutines, under the assumption that the instance is only used in a single request. If I add @Stateless now that assumption would change. For example, I want to do something like @Stateless @Named @RequestScoped public class Foo { private String var1; // can't use instance vars in @Stateless? private String var2; public void transactionForRequest() { var1 = value; var2 = value; .... subroutine(); } } I assume the above doesn't

How to get all EJB timers?

断了今生、忘了曾经 提交于 2019-12-01 03:26:07
In EJB 3.1 I can get all timers for a specific bean using TimerService#getTimers() on the TimerService instance obtained for that bean. What I actually need however is a system-wide version of this. I.e. I would like to have a list of all Timers in the EJB container. Is something like that possible? There simply is no official API for this in EJB 3.1. If you're only using annotations and/or interfaces to mark your timeout method, you could do a run-time walk over all classes on the class path and check if this annotation or interface is present. This will at least give you the beans which

Passing state between EJB methods / @RequestScoped and @Stateless

梦想的初衷 提交于 2019-12-01 00:35:10
问题 I have a @RequestScoped CDI bean that I want to turn into an EJB to get declarative transactions. (I'm on EJB 3.1, Java EE 6) Currently, I am passing state between subroutines, under the assumption that the instance is only used in a single request. If I add @Stateless now that assumption would change. For example, I want to do something like @Stateless @Named @RequestScoped public class Foo { private String var1; // can't use instance vars in @Stateless? private String var2; public void