It should work - but may not.
The situation I encountered is a war with all stacks of any ages within, mixed 
etc.
If you put such a war in TomEE, it won't work at all, because of the different 
serviceLoaders will be confused for loading implementations (Soap, Rest, etc)
On my side, developers did not full agree with the idea of an application 
server - because they said - they won't have hands-on the stack.
But when unsovable difficulties came - imagine conflicts in different versions 
of bouncycastle dependencies, that no version resolves all problems at the same 
time (true story), they agree that an application server is a better choice.

JEE is a SPECIFICATION - not a framework - released by a process with many 
actors..
The goal of a specification is gathering the needs and certify a behavior among 
different implementation.
The goal of a specification is freedom.

Spring is a framework - a commercial one - not a community one gathering 
different interest.
The goal for a commercial framework is capturing the customer for the interest 
of the unique owner of the framework.
The goal of a commercial framework is to be fancy in order to capture customers 
and making money.

That’s only facts.

Best Regards


-----Message d'origine-----
De : Zowalla, Richard <[email protected]> 
Envoyé : jeudi, 9 avril 2020 14:23
À : [email protected]
Objet : Re: Spring Boot Persistence Context [signed INVALID]

I agree with you 100%. I had the same "pain" in legacy Web
applications. We even had the (business) need for mixing the technology
stack (legacy).

I used the term "fancy" as Spring(Boot) is (over)hyped at the moment :)
A lot of people will find and use it. You can see the (bad) questions
on Stackoverflow with no deep understanding of the basic concepts. 

However, teaching the concepts & theory is really important. I know the
difference between JEE & "fancy" frameworks.

If my students decide to use "SpringBoot" (because they hear a lot
about it and think it is "fancy"), I will teach the related concepts /
theory. If they decide to use JEE, i will teach the related concepts /
theory. 

However, I think, that the original idea was:

"If a .war file works on Tomcat, it should also work with TomEE".

That might be useful for others who experience the same "pain" in
legacy applications.




Am Donnerstag, den 09.04.2020, 11:38 +0000 schrieb Stéphane Kay:
> Last conclusion was :
> 
> Stay or go to JEE if you have to refactor a monolythic app - or if
> you have to deliver on-premise systems that can't be on the couloud;
> If you create a new cloud-based system, you may go to Spring boot,
> but keep in mind that you have to understand the underlying required
> infrastructure needed.
> 
> Due to the standard nature of JEE :
> A JEE app may be ported on Spring with the right Spring libraries.
> From Spring to JEE is a complete and expensive refactoring.
> 
> -----Message d'origine-----
> De : Stéphane Kay 
> Envoyé : jeudi, 9 avril 2020 13:28
> À : [email protected]
> Objet : RE: Spring Boot Persistence Context
> 
> We are using an Application Server for our application - >15'000
> classes >2000 db tables, on-premised deployed - and not planed to be
> a cloud system (legal constraints).
> An application server is a better fit for this kind of application
> with a very long history / inception 1998.
> Today, this application server is TomEE.
> 
> When I dived into this app - any libs wered mixed, different versions
> (Axis, Axis2, Metro, etc) >370 libs over Tomcat, single app, home-
> made persistence and transactions framework .
> Some Spring were under the hood, adding complexity.
> Now, the better thing to do was ---> merging to some standard - any
> but one.
> 
> And the only standard today, IS JEE - and running for more than 20
> years - developed by all main industry actors, including Spring.
> Mixing SpringBoot with pure JEE is not good - my opinon- because both
> paradigms are close but don’t fit together, mixing up developers.
> 
> Most of time, Spring framework opens up the door for programing
> goodies, and JEE holds it (lately) but with the experience, and with
> smarter result (eg CDI).
> Same with Hibernate and JPA.
> 
> Most of time developers think that Spring is better (or Hibernate
> better than JPA), but when going to JEE they realize that it provides
> 80%-90% same functionality. But they don't know the counterparts.
> 
> I'm in the process of dividing the monolythic app I described, but I
> will never use the "microservice" term. Services is enough for me.
> 
> I had a *very* bad experience with a Spring-Boot architecture - just
> as an observer after the storm - not as an actor. The (juniors)
> developers who designed it didn't know the full life cycle of a
> software and didn't know what was the cost of misunderstanding the
> concept of "microservices". The result was in an application with as
> many Spring boot (Tomcat) as tables in the application - and no idea
> of how to create a secured transaction on rest implying multiple
> "microservices". Worse than that - it result in a ton of
> 'microservices' making just a reverse-proxy on a monolithic app - so
> never gain anything in term of resilience of performance. It was
> fancy- based on spring boot and Zuul (Netflix) - but wasting a ton of
> memory and a complexity under a ton of configuration files and logs.
> Now my job was to close that page - its closed - hopefully without
> too much harm.
> 
> Why is Spring fancy ? because it appears (still) to be a better way
> to develop cloud-based systems.
> Maybe the coming future of Jakarta-EE will change this.
> 
> If you don't need a cloud based system or refactoring a monolythic
> application - go or stay on JEE.
> 
> S
> 
> -----Message d'origine-----
> De : Jonathan Gallimore <[email protected]> Envoyé :
> mercredi, 8 avril 2020 14:31 À : [email protected] Objet : Re:
> Spring Boot Persistence Context
> 
> 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 < 
> [email protected]> 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.ht
> > ml#howto-weblogic
> > 
> > On 2020/04/06 11:29:14, Jonathan Gallimore 
> > <[email protected]>
> > 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-
> > 4834
> > 268279266350669tomee-xa-tx-0.0.1-SNAPSHOT.xml
> > > 06-Apr-2020 12:19:11.540 INFO [main] 
> > > org.apache.openejb.config.OutputGeneratedDescriptors.writeOpenejb
> > > Jar
> > > 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/tome
> > e-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/tome
> > e-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[/t
> > ome
> > e-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(ReportVali
> > dat
> > ionResults.java:88)
> > > at
> > 
> > org.apache.openejb.config.AppInfoBuilder.build(AppInfoBuilder.java:
> > 327
> > )
> > > at
> > > 
> > 
> > org.apache.openejb.config.ConfigurationFactory.configureApplication
> > (Co
> > nfigurationFactory.java:1036)
> > > at
> > > 
> > 
> > org.apache.tomee.catalina.TomcatWebAppBuilder.startInternal(TomcatW
> > ebA
> > ppBuilder.java:1286)
> > > at
> > > 
> > 
> > org.apache.tomee.catalina.TomcatWebAppBuilder.configureStart(Tomcat
> > Web
> > AppBuilder.java:1130)
> > > at
> > > 
> > 
> > org.apache.tomee.catalina.GlobalListenerSupport.lifecycleEvent(Glob
> > alL
> > istenerSupport.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-
> > 4834
> > 268279266350669tomee-xa-tx-0.0.1-SNAPSHOT.xml
> > > 06-Apr-2020 12:19:11.540 INFO [main] 
> > > org.apache.openejb.config.OutputGeneratedDescriptors.writeOpenejb
> > > Jar
> > > 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/tome
> > e-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/tome
> > e-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[/t
> > ome
> > e-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(ReportVali
> > dat
> > ionResults.java:88)
> > > at
> > 
> > org.apache.openejb.config.AppInfoBuilder.build(AppInfoBuilder.java:
> > 327
> > )
> > > at
> > > 
> > 
> > org.apache.openejb.config.ConfigurationFactory.configureApplication
> > (Co
> > nfigurationFactory.java:1036)
> > > at
> > > 
> > 
> > org.apache.tomee.catalina.TomcatWebAppBuilder.startInternal(TomcatW
> > ebA
> > ppBuilder.java:1286)
> > > at
> > > 
> > 
> > org.apache.tomee.catalina.TomcatWebAppBuilder.configureStart(Tomcat
> > Web
> > AppBuilder.java:1130)
> > > at
> > > 
> > 
> > org.apache.tomee.catalina.GlobalListenerSupport.lifecycleEvent(Glob
> > alL
> > istenerSupport.java:134)
> > > 
> > > Jon
> > > 

Attachment: smime.p7s
Description: S/MIME cryptographic signature

Reply via email to