arquillian / continuous-enterprise-development

Testable Solutions for Modern Applications
http://continuousdev.org/
116 stars 150 forks source link

Ch4. Wildfly start command should include TWITTER API env variables #110

Open esteveavi opened 10 years ago

esteveavi commented 10 years ago

Hi,

If app is deployed as Ch4 stands the application won't start due to Twitter API env variables are not set:

17:38:58,006 ERROR [org.jboss.msc.service.fail](ServerService Thread Pool -- 55) MSC000001: Failed to start service jboss.deployment.unit."geekseek-1.0.0-alpha-1-SNAPSHOT.war".component.SettingsProducer.START: org.jboss.msc.service.StartException in service jboss.deployment.unit."geekseek-1.0.0-alpha-1-SNAPSHOT.war".component.SettingsProducer.START: java.lang.IllegalStateException: JBAS011048: Failed to construct component instance at org.jboss.as.ee.component.ComponentStartService$1.run(ComponentStartService.java:57) [wildfly-ee-8.0.0.CR1.jar:8.0.0.CR1] at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) [rt.jar:1.7.0_21] at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334) [rt.jar:1.7.0_21] at java.util.concurrent.FutureTask.run(FutureTask.java:166) [rt.jar:1.7.0_21] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_21] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_21] at java.lang.Thread.run(Thread.java:722) [rt.jar:1.7.0_21] at org.jboss.threads.JBossThread.run(JBossThread.java:122) Caused by: java.lang.IllegalStateException: JBAS011048: Failed to construct component instance at org.jboss.as.ee.component.BasicComponent.constructComponentInstance(BasicComponent.java:162) [wildfly-ee-8.0.0.CR1.jar:8.0.0.CR1] at org.jboss.as.ee.component.BasicComponent.constructComponentInstance(BasicComponent.java:133) [wildfly-ee-8.0.0.CR1.jar:8.0.0.CR1] at org.jboss.as.ee.component.BasicComponent.createInstance(BasicComponent.java:89) [wildfly-ee-8.0.0.CR1.jar:8.0.0.CR1] at org.jboss.as.ejb3.component.singleton.SingletonComponent.getComponentInstance(SingletonComponent.java:123) at org.jboss.as.ejb3.component.singleton.SingletonComponent.start(SingletonComponent.java:138) at org.jboss.as.ee.component.ComponentStartService$1.run(ComponentStartService.java:54) [wildfly-ee-8.0.0.CR1.jar:8.0.0.CR1] ... 7 more Caused by: javax.ejb.EJBException: java.lang.IllegalStateException: AUTH_API_KEY env variable must be set at org.jboss.as.ejb3.tx.CMTTxInterceptor.handleExceptionInOurTx(CMTTxInterceptor.java:190) at org.jboss.as.ejb3.tx.CMTTxInterceptor.invokeInOurTx(CMTTxInterceptor.java:275) at org.jboss.as.ejb3.tx.CMTTxInterceptor.requiresNew(CMTTxInterceptor.java:369) at org.jboss.as.ejb3.tx.LifecycleCMTTxInterceptor.processInvocation(LifecycleCMTTxInterceptor.java:66) at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309) [jboss-invocation-1.2.0.Beta4.jar:1.2.0.Beta4] at org.jboss.as.weld.injection.WeldInjectionContextInterceptor.processInvocation(WeldInjectionContextInterceptor.java:43) at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309) [jboss-invocation-1.2.0.Beta4.jar:1.2.0.Beta4] at org.jboss.as.ejb3.component.interceptors.CurrentInvocationContextInterceptor.processInvocation(CurrentInvocationContextInterceptor.java:41) at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309) [jboss-invocation-1.2.0.Beta4.jar:1.2.0.Beta4] at org.jboss.as.ee.concurrent.ConcurrentContextInterceptor.processInvocation(ConcurrentContextInterceptor.java:45) [wildfly-ee-8.0.0.CR1.jar:8.0.0.CR1] at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309) [jboss-invocation-1.2.0.Beta4.jar:1.2.0.Beta4] at org.jboss.invocation.ContextClassLoaderInterceptor.processInvocation(ContextClassLoaderInterceptor.java:64) [jboss-invocation-1.2.0.Beta4.jar:1.2.0.Beta4] at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309) [jboss-invocation-1.2.0.Beta4.jar:1.2.0.Beta4] at org.jboss.invocation.InterceptorContext.run(InterceptorContext.java:325) [jboss-invocation-1.2.0.Beta4.jar:1.2.0.Beta4] at org.jboss.invocation.PrivilegedWithCombinerInterceptor.processInvocation(PrivilegedWithCombinerInterceptor.java:80) [jboss-invocation-1.2.0.Beta4.jar:1.2.0.Beta4] at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309) [jboss-invocation-1.2.0.Beta4.jar:1.2.0.Beta4] at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61) [jboss-invocation-1.2.0.Beta4.jar:1.2.0.Beta4] at org.jboss.as.ee.component.BasicComponent.constructComponentInstance(BasicComponent.java:160) [wildfly-ee-8.0.0.CR1.jar:8.0.0.CR1] ... 12 more Caused by: java.lang.IllegalStateException: AUTH_API_KEY env variable must be set at org.cedj.geekseek.service.security.oauth.SettingsProducer.validateEnvironment(SettingsProducer.java:44) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.7.0_21] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) [rt.jar:1.7.0_21] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [rt.jar:1.7.0_21] at java.lang.reflect.Method.invoke(Method.java:601) [rt.jar:1.7.0_21] at org.jboss.as.ee.component.ManagedReferenceLifecycleMethodInterceptor.processInvocation(ManagedReferenceLifecycleMethodInterceptor.java:96) [wildfly-ee-8.0.0.CR1.jar:8.0.0.CR1] at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309) [jboss-invocation-1.2.0.Beta4.jar:1.2.0.Beta4] at org.jboss.invocation.WeavedInterceptor.processInvocation(WeavedInterceptor.java:53) [jboss-invocation-1.2.0.Beta4.jar:1.2.0.Beta4] at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309) [jboss-invocation-1.2.0.Beta4.jar:1.2.0.Beta4] at org.jboss.as.weld.ejb.Jsr299BindingsInterceptor.doLifecycleInterception(Jsr299BindingsInterceptor.java:114) at org.jboss.as.weld.ejb.Jsr299BindingsInterceptor.processInvocation(Jsr299BindingsInterceptor.java:103) at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309) [jboss-invocation-1.2.0.Beta4.jar:1.2.0.Beta4] at org.jboss.invocation.InterceptorContext$Invocation.proceed(InterceptorContext.java:406) [jboss-invocation-1.2.0.Beta4.jar:1.2.0.Beta4] at org.jboss.weld.ejb.AbstractEJBRequestScopeActivationInterceptor.aroundInvoke(AbstractEJBRequestScopeActivationInterceptor.java:55) at org.jboss.as.weld.ejb.EjbRequestScopeActivationInterceptor.processInvocation(EjbRequestScopeActivationInterceptor.java:84) at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309) [jboss-invocation-1.2.0.Beta4.jar:1.2.0.Beta4] at org.jboss.as.weld.injection.WeldInjectionInterceptor.processInvocation(WeldInjectionInterceptor.java:53) at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309) [jboss-invocation-1.2.0.Beta4.jar:1.2.0.Beta4] at org.jboss.as.ee.component.AroundConstructInterceptorFactory$1.processInvocation(AroundConstructInterceptorFactory.java:28) [wildfly-ee-8.0.0.CR1.jar:8.0.0.CR1] at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309) [jboss-invocation-1.2.0.Beta4.jar:1.2.0.Beta4] at org.jboss.as.weld.injection.WeldInterceptorInjectionInterceptor.processInvocation(WeldInterceptorInjectionInterceptor.java:56) at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309) [jboss-invocation-1.2.0.Beta4.jar:1.2.0.Beta4] at org.jboss.as.weld.ejb.Jsr299BindingsCreateInterceptor.processInvocation(Jsr299BindingsCreateInterceptor.java:94) at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309) [jboss-invocation-1.2.0.Beta4.jar:1.2.0.Beta4] at org.jboss.as.ee.component.NamespaceContextInterceptor.processInvocation(NamespaceContextInterceptor.java:50) [wildfly-ee-8.0.0.CR1.jar:8.0.0.CR1] at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309) [jboss-invocation-1.2.0.Beta4.jar:1.2.0.Beta4] at org.jboss.as.ejb3.tx.CMTTxInterceptor.invokeInOurTx(CMTTxInterceptor.java:273) ... 28 more

17:38:58,024 ERROR [org.jboss.as.controller.management-operation](Controller Boot Thread) JBAS014613: Operation ("deploy") failed - address: ([("deployment" => "geekseek-1.0.0-alpha-1-SNAPSHOT.war")]) - failure description: {"JBAS014671: Failed services" => {"jboss.deployment.unit.\"geekseek-1.0.0-alpha-1-SNAPSHOT.war\".component.SettingsProducer.START" => "org.jboss.msc.service.StartException in service jboss.deployment.unit.\"geekseek-1.0.0-alpha-1-SNAPSHOT.war\".component.SettingsProducer.START: java.lang.IllegalStateException: JBAS011048: Failed to construct component instance Caused by: java.lang.IllegalStateException: JBAS011048: Failed to construct component instance Caused by: javax.ejb.EJBException: java.lang.IllegalStateException: AUTH_API_KEY env variable must be set Caused by: java.lang.IllegalStateException: AUTH_API_KEY env variable must be set"}}

ALRubinger commented 10 years ago

@aslakknutsen Could you update the build environment to skip this test unless manually specified (which we'll do in the CI)?

ALRubinger commented 10 years ago

Thank you for this report, @esteveavi!

aslakknutsen commented 10 years ago

@ALRubinger on a test level this is fixed, but not written about yet. #86

I believe this issue is about when you deploy the final build to a container, right @esteveavi ?

The App require some twitter keys etc to run. I guess we could setup an Twitter Application for testing purposes and hardcode it in the source as a default..

ALRubinger commented 10 years ago

So long as the user would only get the API gets and no way to mutate passwords or otherwise access the shared account, a default seems reasonable to me.

aslakknutsen commented 10 years ago

well that's the problem.. With the API keys I'm sure they could do whatever they want :)

ALRubinger commented 10 years ago

Yeah, then we need some other intelligent handling in the app to ignore / disable the service with a WARN log if the keys aren't in place. Hot ideas?

aslakknutsen commented 10 years ago

If we only WARN, the Login will simply not work. I guess we could detect that as well and present the user with 'not configured' message on login.. or setup a local login as default with Picketlink..

ALRubinger commented 10 years ago

Yeah, I'd throw up a red "Login not enabled unless..." thingy if not too much effort.

aslakknutsen commented 10 years ago

sure, except with login disabled, the app is just the front page with no data and no way to add any.. and we don't describe the process of setting up a twitter app

ALRubinger commented 10 years ago

Looks like we need a section to describe this Ch04 then?

esteveavi commented 10 years ago

@aslakknutsen Yes. I deploy it to Wildfly 8.CR1 . You can just add the step to export env variables: export API_.....

Regards.

cbevin commented 10 years ago

Any advice here on what we're supposed to do? I've built your source and deployed to Wildfly as the book states in Ch4, but get the error stacktrace above ...

lindstae commented 10 years ago

Hi,

I just deployed the built war file on Wildfly 8.1 and have the same problem "AUTH_API_KEY env variable must be set" any progress made on this?

icast7 commented 10 years ago

Been reading about this in all the threads I found, what is the recommendation? what can I set the AUTH_API_KEY to get it to work? Thanks

ALRubinger commented 10 years ago

Aslak:

Recommending we alter the book to disable these tests for WildFly profile in Maven, then add a section to instruct users how to obtain their own API key from Twitter.

Thoughts?

S, ALR

On Mon, Sep 15, 2014 at 2:07 AM, ikaz notifications@github.com wrote:

Been reading about this in all the threads I found, what is the recommendation? what can I set the AUTH_API_KEY to get it to work? Thanks

— Reply to this email directly or view it on GitHub https://github.com/arquillian/continuous-enterprise-development/issues/110#issuecomment-55555360 .

yuxh commented 8 years ago

so,is there any progress have been made?I meet this problem unfortunately.

alameen commented 8 years ago

Hi @ALRubinger & @aslakknutsen , any progress on this, I just ran into it. :(