Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
esteveavi opened this issue Jan 12, 2014 · 17 comments
Open

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

esteveavi opened this issue Jan 12, 2014 · 17 comments
Assignees

Comments

@esteveavi
Copy link

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"}}

@ghost ghost assigned ALRubinger Jan 13, 2014
@ALRubinger
Copy link
Member

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

@ALRubinger
Copy link
Member

Thank you for this report, @esteveavi!

@aslakknutsen
Copy link
Member

@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
Copy link
Member

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
Copy link
Member

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

@ALRubinger
Copy link
Member

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
Copy link
Member

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
Copy link
Member

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

@aslakknutsen
Copy link
Member

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
Copy link
Member

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

@esteveavi
Copy link
Author

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

Regards.

@cbevin
Copy link

cbevin commented Apr 15, 2014

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
Copy link

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
Copy link

icast7 commented Sep 15, 2014

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
Copy link
Member

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
#110 (comment)
.

@yuxh
Copy link

yuxh commented Oct 28, 2015

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

@alameen
Copy link

alameen commented Dec 17, 2015

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants