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

static producer of @PersistenceContext producing null

    Details

    • Steps to Reproduce:
      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

      Description

      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.

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  jharting Jozef Hartinger
                  Reporter:
                  jjsnyder Joseph Snyder
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  3 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: