Uploaded image for project: 'Weld'
  1. Weld
  2. WELD-1505

static producer of @PersistenceContext producing null

XMLWordPrintable

    • Hide

      Start GlassFish
      Start db (glassfish/bin/asadmin start-database)
      Build (mvn clean install) the attached project, deploy the war,
      execute http://localhost:8080/pu-typesafe-1.0-SNAPSHOT/TestServlet.

      When it doesn't work you get:
      --> Listing movies

      If it works you should see

      --> Listing movies
      The Matrix
      The Lord of The Rings
      Inception
      The Shining

      Show
      Start GlassFish Start db (glassfish/bin/asadmin start-database) Build (mvn clean install) the attached project, deploy the war, execute http://localhost:8080/pu-typesafe-1.0-SNAPSHOT/TestServlet . When it doesn't work you get: --> Listing movies If it works you should see --> Listing movies The Matrix The Lord of The Rings Inception The Shining

      The following producer produces null:
      static @Produces @PersistenceContext(unitName = "defaultPU") @DefaultDatabase EntityManager defaultEM;

      remove the "static" and the producer produces the correct object and the above movies are displayed corectly.

            rhn-engineering-jharting Jozef Hartinger
            jjsnyder Joseph Snyder (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: