Thanks for the follow up! I did get this working. I'm thinking a little Spring Boot example for TomEE might be useful. Any thoughts? Is anyone here using Spring Boot in their applications?
Jon On Tue, Apr 7, 2020 at 2:27 PM Gilberto Caetano de Andrade < gilbert...@gmail.com> wrote: > Maybe you need to adjust the config like this one [1] for weblogic. > > Regards, > > Gilberto > [1] > https://docs.spring.io/spring-boot/docs/current/rference/html/howto.html#howto-weblogic > > On 2020/04/06 11:29:14, Jonathan Gallimore <jonathan.gallim...@gmail.com> > wrote: > > Hi All, > > > > I'm looking at running a Spring Boot app in TomEE. Spring injects a > > persistence context into a bean managed by Spring: > > > > @EnableJpaRepositories(basePackages = "org.superbiz.movies.dao") > > > > @Repository > > public class MovieDao { > > > > @PersistenceContext(unitName = "movie-unit") > > private EntityManager entityManager; > > > > ..... > > > > } > > > > The .war created doesn't have a persistence.xml file, and so this fails > > validation. I've tried turning off CDI with a beans.xml file with > > bean-discovery-mode="none" - that doesn't make any difference. > > > > The exception is below. Does anyone have this working? I'm of the view > that > > if the .war file works on Tomcat, it should also work with TomEE, without > > changes. > > > > I'll debug through to see if the @Repository class is a managed > component, > > and if so, what sort of managed component it is and some options to try > and > > get this usecase to work. > > > > 06-Apr-2020 12:19:11.435 INFO [main] > org.hsqldb.persist.Logger.logInfoEvent > > Checkpoint end - txts: 1 > > 06-Apr-2020 12:19:11.453 INFO [main] > > org.apache.openejb.config.AutoConfig.processResourceRef Auto-linking > > resource-ref 'jdbc/DefaultDB' in bean > > tomee-xa-tx-0.0.1-SNAPSHOT.Comp1802029863 to Resource(id=Default JDBC > > Database) > > 06-Apr-2020 12:19:11.496 INFO [main] > > org.apache.openejb.config.OutputGeneratedDescriptors.writeEjbJar Dumping > > Generated ejb-jar.xml to: > > > /home/jgallimore/dev/tomee-xa-tx/target/apache-tomee/temp/ejb-jar-4834268279266350669tomee-xa-tx-0.0.1-SNAPSHOT.xml > > 06-Apr-2020 12:19:11.540 INFO [main] > > org.apache.openejb.config.OutputGeneratedDescriptors.writeOpenejbJar > > Dumping Generated openejb-jar.xml to: > > > /home/jgallimore/dev/tomee-xa-tx/target/apache-tomee/temp/openejb-jar-1838234661417596634tomee-xa-tx-0.0.1-SNAPSHOT.xml > > 06-Apr-2020 12:19:11.565 SEVERE [main] > > org.apache.openejb.config.ReportValidationResults.logResults FAIL ... > > tomee-xa-tx-0.0.1-SNAPSHOT: Missing required persistence.xml for > > @PersistenceContext ref "entityManager" to unit "movie-unit" > > 06-Apr-2020 12:19:11.565 SEVERE [main] > > org.apache.openejb.config.ReportValidationResults.logResults Invalid > > EjbModule(name=tomee-xa-tx-0.0.1-SNAPSHOT, > > > path=/home/jgallimore/dev/tomee-xa-tx/target/apache-tomee/webapps/tomee-xa-tx-0.0.1-SNAPSHOT) > > 06-Apr-2020 12:19:11.565 SEVERE [main] > > org.apache.openejb.config.ReportValidationResults.logResults FAIL ... > > tomee-xa-tx-0.0.1-SNAPSHOT: Missing required persistence.xml for > > @PersistenceContext ref "entityManager" to unit "movie-unit" > > 06-Apr-2020 12:19:11.566 SEVERE [main] > > org.apache.openejb.config.ReportValidationResults.logResults Invalid > > WebModule(name=tomee-xa-tx-0.0.1-SNAPSHOT, > > > path=/home/jgallimore/dev/tomee-xa-tx/target/apache-tomee/webapps/tomee-xa-tx-0.0.1-SNAPSHOT) > > 06-Apr-2020 12:19:11.566 INFO [main] > > org.apache.openejb.config.ReportValidationResults.deploy Set the > > 'openejb.validation.output.level' system property to VERBOSE for > increased > > validation details. > > 06-Apr-2020 12:19:11.566 SEVERE [main] > > org.apache.tomee.catalina.TomcatWebAppBuilder.startInternal Unable to > > deploy collapsed ear in war > > > StandardEngine[Catalina].StandardHost[localhost].StandardContext[/tomee-xa-tx-0.0.1-SNAPSHOT] > > org.apache.openejb.config.ValidationFailedException: Module failed > > validation. AppModule(name=tomee-xa-tx-0.0.1-SNAPSHOT) > > at > > > org.apache.openejb.config.ReportValidationResults.deploy(ReportValidationResults.java:88) > > at > org.apache.openejb.config.AppInfoBuilder.build(AppInfoBuilder.java:327) > > at > > > org.apache.openejb.config.ConfigurationFactory.configureApplication(ConfigurationFactory.java:1036) > > at > > > org.apache.tomee.catalina.TomcatWebAppBuilder.startInternal(TomcatWebAppBuilder.java:1286) > > at > > > org.apache.tomee.catalina.TomcatWebAppBuilder.configureStart(TomcatWebAppBuilder.java:1130) > > at > > > org.apache.tomee.catalina.GlobalListenerSupport.lifecycleEvent(GlobalListenerSupport.java:134) > > > > > > 06-Apr-2020 12:19:11.435 INFO [main] > org.hsqldb.persist.Logger.logInfoEvent > > Checkpoint end - txts: 1 > > 06-Apr-2020 12:19:11.453 INFO [main] > > org.apache.openejb.config.AutoConfig.processResourceRef Auto-linking > > resource-ref 'jdbc/DefaultDB' in bean > > tomee-xa-tx-0.0.1-SNAPSHOT.Comp1802029863 to Resource(id=Default JDBC > > Database) > > 06-Apr-2020 12:19:11.496 INFO [main] > > org.apache.openejb.config.OutputGeneratedDescriptors.writeEjbJar Dumping > > Generated ejb-jar.xml to: > > > /home/jgallimore/dev/tomee-xa-tx/target/apache-tomee/temp/ejb-jar-4834268279266350669tomee-xa-tx-0.0.1-SNAPSHOT.xml > > 06-Apr-2020 12:19:11.540 INFO [main] > > org.apache.openejb.config.OutputGeneratedDescriptors.writeOpenejbJar > > Dumping Generated openejb-jar.xml to: > > > /home/jgallimore/dev/tomee-xa-tx/target/apache-tomee/temp/openejb-jar-1838234661417596634tomee-xa-tx-0.0.1-SNAPSHOT.xml > > 06-Apr-2020 12:19:11.565 SEVERE [main] > > org.apache.openejb.config.ReportValidationResults.logResults FAIL ... > > tomee-xa-tx-0.0.1-SNAPSHOT: Missing required persistence.xml for > > @PersistenceContext ref "entityManager" to unit "movie-unit" > > 06-Apr-2020 12:19:11.565 SEVERE [main] > > org.apache.openejb.config.ReportValidationResults.logResults Invalid > > EjbModule(name=tomee-xa-tx-0.0.1-SNAPSHOT, > > > path=/home/jgallimore/dev/tomee-xa-tx/target/apache-tomee/webapps/tomee-xa-tx-0.0.1-SNAPSHOT) > > 06-Apr-2020 12:19:11.565 SEVERE [main] > > org.apache.openejb.config.ReportValidationResults.logResults FAIL ... > > tomee-xa-tx-0.0.1-SNAPSHOT: Missing required persistence.xml for > > @PersistenceContext ref "entityManager" to unit "movie-unit" > > 06-Apr-2020 12:19:11.566 SEVERE [main] > > org.apache.openejb.config.ReportValidationResults.logResults Invalid > > WebModule(name=tomee-xa-tx-0.0.1-SNAPSHOT, > > > path=/home/jgallimore/dev/tomee-xa-tx/target/apache-tomee/webapps/tomee-xa-tx-0.0.1-SNAPSHOT) > > 06-Apr-2020 12:19:11.566 INFO [main] > > org.apache.openejb.config.ReportValidationResults.deploy Set the > > 'openejb.validation.output.level' system property to VERBOSE for > increased > > validation details. > > 06-Apr-2020 12:19:11.566 SEVERE [main] > > org.apache.tomee.catalina.TomcatWebAppBuilder.startInternal Unable to > > deploy collapsed ear in war > > > StandardEngine[Catalina].StandardHost[localhost].StandardContext[/tomee-xa-tx-0.0.1-SNAPSHOT] > > org.apache.openejb.config.ValidationFailedException: Module failed > > validation. AppModule(name=tomee-xa-tx-0.0.1-SNAPSHOT) > > at > > > org.apache.openejb.config.ReportValidationResults.deploy(ReportValidationResults.java:88) > > at > org.apache.openejb.config.AppInfoBuilder.build(AppInfoBuilder.java:327) > > at > > > org.apache.openejb.config.ConfigurationFactory.configureApplication(ConfigurationFactory.java:1036) > > at > > > org.apache.tomee.catalina.TomcatWebAppBuilder.startInternal(TomcatWebAppBuilder.java:1286) > > at > > > org.apache.tomee.catalina.TomcatWebAppBuilder.configureStart(TomcatWebAppBuilder.java:1130) > > at > > > org.apache.tomee.catalina.GlobalListenerSupport.lifecycleEvent(GlobalListenerSupport.java:134) > > > > Jon > > >