Details

    • Type: Story
    • Status: Closed (View Workflow)
    • Resolution: Done
    • Affects Version/s: None
    • Fix Version/s: 1.0.0.Alpha6
    • Component/s: None
    • Labels:
      None

      Description

      I created a simple JAX-RS + JPA app.

      https://github.com/emag/wildfly-swarm-quickstarts/tree/master/jaxrs-jpa

      I use @ PersistenceContext for injection EntityManager but not injected.
      It seems it is needed JPA Fraction. In WildFly Distro, a single persistence unit is automatically discovered.

      I've got the following log.

       sh
      $ git clone https://github.com/emag/wildfly-swarm-quickstarts && cd wildfly-swarm-quickstarts/jaxrs-jpa/
      $ mvn clean package && java -jar target/jaxrs-jpa-*-swarm.jar
      ...
      2015-05-14 02:14:51,421 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-5) MSC000001: Failed to start service jboss.deployment.unit."jaxrs-jpa-1.0.0.war".WeldStartService: org.jboss.msc.service.StartException in service jboss.deployment.unit."jaxrs-jpa-1.0.0.war".WeldStartService: Failed to start service
      	at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1904)
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
      	at java.lang.Thread.run(Thread.java:745)
      Caused by: java.lang.IllegalArgumentException: WFLYWELD0037: Error injecting persistence unit into CDI managed bean. Can't find a persistence unit named '' in deployment jaxrs-jpa-1.0.0.war for injection point private javax.persistence.EntityManager wildflyswarm.jaxrsjpa.domain.repository.EmployeeRepository.em
      	at org.jboss.as.weld.services.bootstrap.WeldJpaInjectionServices.getScopedPUName(WeldJpaInjectionServices.java:111)
      	at org.jboss.as.weld.services.bootstrap.WeldJpaInjectionServices.registerPersistenceContextInjectionPoint(WeldJpaInjectionServices.java:74)
      	at org.jboss.weld.injection.ResourceInjectionFactory$PersistenceContextResourceInjectionProcessor.getResourceReferenceFactory(ResourceInjectionFactory.java:313)
      	at org.jboss.weld.injection.ResourceInjectionFactory$PersistenceContextResourceInjectionProcessor.getResourceReferenceFactory(ResourceInjectionFactory.java:301)
      	at org.jboss.weld.injection.ResourceInjectionFactory$ResourceInjectionProcessor.createFieldResourceInjection(ResourceInjectionFactory.java:207)
      	at org.jboss.weld.injection.ResourceInjectionFactory$ResourceInjectionProcessor.createResourceInjections(ResourceInjectionFactory.java:182)
      	at org.jboss.weld.injection.ResourceInjectionFactory.discoverType(ResourceInjectionFactory.java:405)
      	at org.jboss.weld.injection.ResourceInjectionFactory.getResourceInjections(ResourceInjectionFactory.java:92)
      	at org.jboss.weld.injection.producer.ResourceInjector.<init>(ResourceInjector.java:59)
      	at org.jboss.weld.injection.producer.ResourceInjector.of(ResourceInjector.java:49)
      	at org.jboss.weld.injection.producer.BeanInjectionTarget.<init>(BeanInjectionTarget.java:62)
      	at org.jboss.weld.injection.producer.BeanInjectionTarget.createDefault(BeanInjectionTarget.java:46)
      	at org.jboss.weld.manager.InjectionTargetFactoryImpl.chooseInjectionTarget(InjectionTargetFactoryImpl.java:128)
      	at org.jboss.weld.manager.InjectionTargetFactoryImpl.createInjectionTarget(InjectionTargetFactoryImpl.java:87)
      	at org.jboss.weld.bean.ManagedBean.<init>(ManagedBean.java:100)
      	at org.jboss.weld.bean.ManagedBean.of(ManagedBean.java:80)
      	at org.jboss.weld.bootstrap.AbstractBeanDeployer.createManagedBean(AbstractBeanDeployer.java:264)
      	at org.jboss.weld.bootstrap.BeanDeployer.createClassBean(BeanDeployer.java:228)
      	at org.jboss.weld.bootstrap.ConcurrentBeanDeployer$2.doWork(ConcurrentBeanDeployer.java:78)
      	at org.jboss.weld.bootstrap.ConcurrentBeanDeployer$2.doWork(ConcurrentBeanDeployer.java:75)
      	at org.jboss.weld.executor.IterativeWorkerTaskFactory$1.call(IterativeWorkerTaskFactory.java:60)
      	at org.jboss.weld.executor.IterativeWorkerTaskFactory$1.call(IterativeWorkerTaskFactory.java:53)
      	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
      	... 3 more
      

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                emag Yoshimasa Tanabe
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: