This week's book giveaway is in the Reactive Progamming forum.
We're giving away four copies of Reactive Streams in Java: Concurrency with RxJava, Reactor, and Akka Streams and have Adam Davis on-line!
See this thread for details.
Win a copy of Reactive Streams in Java: Concurrency with RxJava, Reactor, and Akka Streams this week in the Reactive Progamming forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Junilu Lacar
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • Tim Cooke
  • Devaka Cooray
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Ganesh Patekar

Frontman, TomEE, OpenJPA

 
Ranch Hand
Posts: 67
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Simple servlet that works:



Simple Frontman command that EntityManagerFactory is null:



The code is almost identical. I read elsewhere that what's in brackets

{@PersistenceUnit(unitName = "JPAtestPU")
private EntityManagerFactory emf;}

only works in a client class whose lifecycle is managed by the container, i.e. an EJB, a JSF ManagedBean, a CDI bean or a servlet.

I'm rewriting an existing core JDBC Tomcat web-app. I had started out to just update it to try-with-resources and a connection pool. But, I've decided to try OpenJPA instead. How do I make this work in Frontman 2? Are commands not being recognized as servlets?

Thanks.
 
Marshal
Posts: 67289
170
Mac Mac OS X IntelliJ IDE jQuery Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Frontman commands are not servlets. The servlet is the front controller.

Annotations that requires a servlet will not work with commands.
 
Howard Watson
Ranch Hand
Posts: 67
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Guess I knew the first part of that. Does that mean I cannot use Frontman or that I need to use it differently? Thanks for the reply Bear.
 
Howard Watson
Ranch Hand
Posts: 67
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This got me past null and a new error:



Thank you.
 
Yes, my master! Here is the tiny ad you asked for:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!