This week's giveaway is in the JDBC forum.
We're giving away four copies of Java Database Connections & Transactions (e-book only) and have Marco Behler on-line!
See this thread for details.
Win a copy of Java Database Connections & Transactions (e-book only) this week in the JDBC 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
  • Devaka Cooray
  • Knute Snortum
  • Paul Clapham
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Ron McLeod
  • Piet Souris
  • Frits Walraven
Bartenders:
  • Ganesh Patekar
  • Tim Holloway
  • salvin francis

Frontman, TomEE, OpenJPA  RSS feed

 
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.
 
Sheriff
Posts: 67261
170
IntelliJ IDE Java jQuery Mac Mac OS X
  • 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.
 
Why fit in when you were born to stand out? - Seuss. Tiny ad:
how do I do my own kindle-like thing - without amazon
https://coderanch.com/t/711421/engineering/kindle-amazon
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!