Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Error when using JPA with the batch DataSource Generator

    I'm using the evaluation enterprise version of smartgwt (3.0) along with gwt 2.4. I have some JPA annotated beans and was trying to use the batch datasource generator.

    When I fill in the form with the persistence unit name, I get an error "ERROR: [PersistenceUnit: DCServerObjects] Unable to configure EntityManagerFactory" on the page. The only thing I see in the console log file is:

    === 2012-07-16 16:46:55,365 [l0-5] DEBUG JPADSGenerator - Generating data sources for entities mapped in persistence unit 'DCServerObjects'

    I'm not sure if there is another log somewhere, but just not a log there. I figure something must be missing in my configuration but didn't see anything in the docs about using the EntityManagerFactory

    #2
    Remember, you can easily search the docs using the interface at docs.smartclient.com. Here's the first hit for EntityManagerFactory.

    If you need more help, be sure to post the complete server log for the request (always required).

    Comment


      #3
      Thanks for the pointer. When I read about this in the documentation, it would seem that the EntityManagerFactory and its requisite settings in server.properties is only used in the case where the app is using BMT or CMT. The project I'm using is configured to be LMT and the server.properties has the jpa.emfProvider set to com.isomorphic.jpa.EMFProviderLMT.

      So is the datasource generator for JPA only work for CMT/BMT apps?

      Of course, this is now academic. I've started down the path to create the datasource descriptions by hand (I already have all of the JPAs). So far so good, but I'm now looking for ways to deal with how to work with a bunch of polymorphic objects using datasources. Do I create one per object type? One for the shared abstract base but understands all the subclasses? Something else? The idea was to have a list of these things, grouped by type ... If you have any suggestions, I'm all ears. In the interim, I'll continue to stumble my way through the massive collection of javadocs and startup pdfs.

      Comment


        #4
        It's not clear why you would get an error with LMT or if it's even caused by LMT, but there's no need to create DataSources by hand in any case - see the very beginning of the Server Framework chapter in the QuickStart Guide (autoDeriveSchema / schemaBean and related discussion).

        As far as polymorphism, deliver to the client only what the client needs to understand for UI purposes - this may be a simplified version of the server-side structure if there is, for example, no need for the UI to understand an inheritance hierarchy (as there usually is not, since it's not exposed to end users).

        Comment

        Working...
        X