hammock-project / hammock-examples

4 stars 3 forks source link

Examples does not work with latest 1.0 release #2

Closed shamoh closed 7 years ago

shamoh commented 7 years ago

hammock-cqrs

v1.0, including v0.5.0:

org.jboss.weld.exceptions.DeploymentException: WELD-001409: Ambiguous dependencies for type EntityManager with qualifiers @Default
  at injection point [BackedAnnotatedField] @Inject private ws.ament.hammock.cqrs.service.UpdateBookService.entityManager
  at ws.ament.hammock.cqrs.service.UpdateBookService.entityManager(UpdateBookService.java:0)
  Possible dependencies:
  - Resource Producer Field [EntityManager] with qualifiers [@Any @Default] declared as [[BackedAnnotatedField] @Produces @Dependent @PersistenceContext private ws.ament.hammock.cqrs.repository.EntityManagerProvider.entityManager],
  - Producer Method [EntityManager] with qualifiers [@Any @Default] declared as [[BackedAnnotatedMethod] @Produces @Dependent public ws.ament.hammock.jpa.EntityManagerProducer.createEM()]

    at org.jboss.weld.bootstrap.Validator.validateInjectionPointForDeploymentProblems(Validator.java:363)
    at org.jboss.weld.bootstrap.Validator.validateInjectionPoint(Validator.java:277)
    at org.jboss.weld.bootstrap.Validator.validateGeneralBean(Validator.java:130)
    at org.jboss.weld.bootstrap.Validator.validateRIBean(Validator.java:151)
    at org.jboss.weld.bootstrap.Validator.validateBean(Validator.java:494)
    at org.jboss.weld.bootstrap.ConcurrentValidator$1.doWork(ConcurrentValidator.java:64)
    at org.jboss.weld.bootstrap.ConcurrentValidator$1.doWork(ConcurrentValidator.java:62)
    at org.jboss.weld.executor.IterativeWorkerTaskFactory$1.call(IterativeWorkerTaskFactory.java:62)
    at org.jboss.weld.executor.IterativeWorkerTaskFactory$1.call(IterativeWorkerTaskFactory.java:55)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    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)

hammock-diy

v1.0:

java.lang.IllegalStateException: Singleton not set for STATIC_INSTANCE => [98d09163-7280-40e1-b0ac-e9aec55ec38b]
    at org.jboss.weld.bootstrap.api.helpers.RegistrySingletonProvider$RegistrySingleton.get(RegistrySingletonProvider.java:28)
    at org.jboss.weld.Container.instance(Container.java:53)
    at org.jboss.weld.SimpleCDI.<init>(SimpleCDI.java:76)
    at org.jboss.weld.environment.WeldProvider$EnvironmentCDI.<init>(WeldProvider.java:45)
    at org.jboss.weld.environment.WeldProvider.getCDI(WeldProvider.java:61)
    at javax.enterprise.inject.spi.CDI.current(CDI.java:60)
    at org.jboss.weld.servlet.WeldInitialListener.contextInitialized(WeldInitialListener.java:94)
    at org.jboss.weld.servlet.api.helpers.ForwardingServletListener.contextInitialized(ForwardingServletListener.java:34)
    at org.jboss.weld.environment.servlet.Listener.contextInitialized(Listener.java:122)
    at io.undertow.servlet.core.ApplicationListeners.contextInitialized(ApplicationListeners.java:187)
    at io.undertow.servlet.core.DeploymentManagerImpl$1.call(DeploymentManagerImpl.java:203)
    at io.undertow.servlet.core.DeploymentManagerImpl$1.call(DeploymentManagerImpl.java:172)
    at io.undertow.servlet.core.ServletRequestContextThreadSetupAction$1.call(ServletRequestContextThreadSetupAction.java:42)
    at io.undertow.servlet.core.ContextClassLoaderSetupAction$1.call(ContextClassLoaderSetupAction.java:43)
    at io.undertow.servlet.core.DeploymentManagerImpl.deploy(DeploymentManagerImpl.java:237)

hammock-microprofile

v1.0:

java.lang.NoSuchMethodError: org.apache.cxf.jaxrs.utils.ResourceUtils.createApplication(Ljavax/ws/rs/core/Application;ZZLorg/apache/cxf/Bus;)Lorg/apache/cxf/jaxrs/JAXRSServerFactoryBean;
    at org.apache.cxf.cdi.JAXRSCdiResourceExtension.createFactoryInstance(JAXRSCdiResourceExtension.java:185)
    at org.apache.cxf.cdi.JAXRSCdiResourceExtension.load(JAXRSCdiResourceExtension.java:136)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.jboss.weld.injection.StaticMethodInjectionPoint.invoke(StaticMethodInjectionPoint.java:88)
    ... 19 more
    at org.jboss.weld.bootstrap.events.AbstractDeploymentContainerEvent.fire(AbstractDeploymentContainerEvent.java:37)
    at org.jboss.weld.bootstrap.events.AfterDeploymentValidationImpl.fire(AfterDeploymentValidationImpl.java:28)
    at org.jboss.weld.bootstrap.WeldStartup.validateBeans(WeldStartup.java:458)
    at org.jboss.weld.bootstrap.WeldBootstrap.validateBeans(WeldBootstrap.java:90)
    at org.jboss.weld.environment.se.Weld.initialize(Weld.java:615)
    at org.jboss.weld.environment.se.StartMain.go(StartMain.java:44)
    at org.jboss.weld.environment.se.StartMain.main(StartMain.java:53)
    at ws.ament.hammock.Bootstrap.main(Bootstrap.java:23)
    at ws.ament.hammock.example.canonical.RestApplication.main(RestApplication.java:31)
johnament commented 7 years ago

For DIY, you need to use a custom bootstrap. It's due to my hasty upgrade to Weld 2.4.1 which I'm now solidifying.

for hammock-microprofile, I have not seen that one before. It looks almost like the CXF versions are not in sync.

And yeah, CQRS needs some love. It was put together purely for JavaOne 2016, haven't touched it since.

johnament commented 7 years ago

I updated the examples for the 1.1 snapshot. They all run properly. I'm planning to release 1.1 in a day or two, just need to work out some of the last OWB integration stuff.