Spring-xd - Error when trying to stream data with "Twittersearch" - spring

I created a stream that writes tweets into a file by this spring xd code:
stream create --name javatweets --definition "twittersearch --query=java --consumerKey=<my_key>
--consumerSecret=<my_secret> | file" --deploy
Unfortunately, I gets the following error messages:
WARN DeploymentsPathChildrenCache-0 annotation.AnnotationConfigApplicationContext -
Exception encountered during context initialization - cancelling refresh attempt
org.springframework.beans.factory.BeanCreationException: Error creating bean with name
'org.springframework.integration.x.twitter.TwitterSearchChannelAdapter#0' defined in class path resource [config/twittersearch.xml]: Cannot resolve reference to bean 'twitterTemplate' while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'twitterTemplate' defined in class path resource [config/twittersearch.xml]: Bean instantiation via constructor failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.social.twitter.api.impl.TwitterTemplate]: Constructor threw exception; nested exception is org.springframework.web.client.HttpClientErrorException: 403 Forbidden

HttpClientErrorException: 403 Forbidden
Your credentials (consumerKey and/or consumerSecret) are incorrect.

Related

Why my spring boot app couldn't access service of the redis node provided by sentinel but that redis node is actually healthy

Platform: Windows 10
JDK: 11
Command to start redis and sentinel:
cd PATH_TO_REDIS\redis_s6379
redis-server.exe redis.windows.conf
redis-server.exe sentinel.conf --sentinel
Redis client: jedis
Detailed log
partial log
Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [io.micrometer.spring.web.servlet.WebMvcMetricsFilter]: Factory method 'webMetricsFilter' threw exception; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'endpointHandlerMapping' defined in class path resource [org/springframework/boot/actuate/autoconfigure/EndpointWebMvcManagementContextConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.boot.actuate.endpoint.mvc.EndpointHandlerMapping]: Factory method 'endpointHandlerMapping' threw exception; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'mvcEndpoints' defined in class path resource [org/springframework/boot/actuate/autoconfigure/EndpointWebMvcManagementContextConfiguration.class]: Invocation of init method failed; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'healthMvcEndpoint' defined in class path resource [org/springframework/boot/actuate/autoconfigure/EndpointWebMvcManagementContextConfiguration.class]: Unsatisfied dependency expressed through method 'healthMvcEndpoint' parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.boot.actuate.autoconfigure.EndpointAutoConfiguration': Bean instantiation via constructor failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.boot.actuate.autoconfigure.EndpointAutoConfiguration$$EnhancerBySpringCGLIB$$700f4ba6]: Constructor threw exception; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'org.springframework.boot.actuate.autoconfigure.HealthIndicatorAutoConfiguration$RedisHealthIndicatorConfiguration': Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'jedisConnectionFactory' defined in class path resource [com/corp_name/corp_config/RedisConfig.class]: Invocation of init method failed; nested exception is redis.clients.jedis.exceptions.JedisConnectionException: All sentinels down, cannot determine where is mymaster master is running...
The solution for this one is to make sure your sentinel.conf file have the right config.
Add 127.0.0.1 redis-server in your host file. Use "redis-server" as the host value of redis for both the configurations of file("redis.windows.conf") and file("sentinel.conf").
The above solution is inferred from reading the source code file("Connection.java").
redis/clients/jedis/Connection.java:184
Some prerequisite:
windows doesn't support ping the host itself using ipv4 address but mac does.

Install reportportal on kube get error : starting Tomcat context. Exception: org...message: Error creating bean with name 'servletEndpointRegistrar'

I've installed reportportal 5.7.0 to kubernetes cluster. I've implemented it from doc:https://github.com/reportportal/kubernetes/tree/develop/reportportal. From the doc,I have to install rabbitmq, postgres and minio for reportportal. I've successfully installed abbitmq, postgres and minio. All pods were running but when I've installed reportportal. Report-portal-api pods was error. I've get logs form the pods then the pods logs shown that
o.s.b.web.embedded.tomcat.TomcatStarter : Error starting Tomcat
context. Exception: org.springframework
.beans.factory.BeanCreationException. Message: Error creating bean
with name 'servletEndpointRegistrar' defined in class path resource
[org/springframework/bo
ot/actuate/autoconfigure/endpoint/web/ServletEndpointManagementContextConfiguration$WebMvcServletEndpointManagementContextConfiguration.class]:
Bean instantia tion via factory method failed; nested exception is
org.springframework.beans.BeanInstantiationException: Failed to
instantiate [org.springframework.boot.actu
ate.endpoint.web.ServletEndpointRegistrar]: Factory method
'servletEndpointRegistrar' threw exception; nested exception is
org.springframework.beans.factory.B eanCreationException: Error
creating bean with name 'infoEndpoint' defined in class path resource
[org/springframework/boot/actuate/autoconfigure/info/InfoEnd
pointAutoConfiguration.class]: Bean instantiation via factory method
failed; nested exception is
org.springframework.beans.BeanInstantiationException: Failed to
instantiate [org.springframework.boot.actuate.info.InfoEndpoint]:
Factory method 'infoEndpoint' threw exception; nested exception is
org.springframework.be ans.factory.UnsatisfiedDependencyException:
Error creating bean with name 'infoContributorComposite' defined in
URL [jar:file:/service-api-5.7.0-exec.jar!/BOO
T-INF/classes!/com/epam/ta/reportportal/info/InfoContributorComposite.class]:
Unsatisfied dependency expressed through constructor parameter 0;
nested excepti on is
org.springframework.beans.factory.UnsatisfiedDependencyException:
Error creating bean with name 'analyzerInfoContributor' defined in URL
[jar:file:/serv
ice-api-5.7.0-exec.jar!/BOOT-INF/classes!/com/epam/ta/reportportal/info/AnalyzerInfoContributor.class]:
Unsatisfied dependency expressed through constructor p arameter 0;
nested exception is
org.springframework.beans.factory.BeanCreationException: Error
creating bean with name 'managementTemplate' defined in class p ath
resource
[com/epam/ta/reportportal/core/configs/rabbit/AnalyzerRabbitMqConfiguration.class]:
Bean instantiation via factory method failed; nested exceptio n is
org.springframework.beans.BeanInstantiationException: Failed to
instantiate
[com.epam.ta.reportportal.core.analyzer.auto.client.RabbitMqManagementClient]
: Factory method 'managementTemplate' threw exception; nested
exception is com.epam.ta.reportportal.exception.ReportPortalException:
Unclassified Report Porta l Error
I suspected that reportportal connect to rabbitmq was error but I'm not sure. What should I do?
That's true. Double-check your rabbitmq configuration: connection URL, open ports, etc. We have a step-by-step guide on Kubernetes deployment: https://github.com/reportportal/kubernetes/tree/develop/reportportal

Cassandra-3.7 connection from Spring boot 2.1.2/2.1.6

We have an application developed in spring boot and we do use cassandra.
Our application was suing spring boot 1.4, cassandra 3.7 and JDK 1.8
Now we are tryign to upgrade spring boot to 2.1.2/2.1.6 and JDK 1.8 to Open JDK 11.0.2 and cassandra is as : 3.7
So when we are trying, we are recieving the
Caused by: com.datastax.driver.core.exceptions.NoHostAvailableException: All host(s) tried for query failed.
(com.datastax.driver.core.exceptions.TransportException: [HOSTS] Error writing)
Not sure what is going wrong.
Couple of pointers is:
1) Application is running fine on local on eclipse and this is issue when we are trying to start the application in server
Here is the stacktrace I see:
WARN 10473 --- [ main] org.eclipse.jetty.webapp.WebAppContext : Failed startup of context o.s.b.w.e.j.JettyEmbeddedWebAppContext#75a118e6{application,/console,[org.springframework.boot.web.embedded.jetty.JettyServletWebServerFactory$LoaderHidingResource#1d540566],UNAVAILABLE}
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'servletEndpointRegistrar' defined in class path resource [org/springframework/boot/actuate/autoconfigure/endpoint/web/ServletEndpointManagementContextConfiguration$WebMvcServletEndpointManagementContextConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.boot.actuate.endpoint.web.ServletEndpointRegistrar]: Factory method 'servletEndpointRegistrar' threw exception;
nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'healthEndpoint' defined in class path resource [org/springframework/boot/actuate/autoconfigure/health/HealthEndpointConfiguration.class]: Unsatisfied dependency expressed through method 'healthEndpoint' parameter 1;
nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'healthIndicatorRegistry' defined in class path resource [org/springframework/boot/actuate/autoconfigure/health/HealthIndicatorAutoConfiguration.class]: Bean instantiation via factory method failed;
nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.boot.actuate.health.HealthIndicatorRegistry]: Factory method 'healthIndicatorRegistry' threw exception;
nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'org.springframework.boot.actuate.autoconfigure.cassandra.CassandraHealthIndicatorAutoConfiguration': Unsatisfied dependency expressed through constructor parameter 0;
nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'cassandraTemplate' defined in class path resource [CassandraDatabaseConfig.class]: Bean instantiation via factory method failed;
nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.data.cassandra.core.CassandraAdminTemplate]: Factory method 'cassandraTemplate' threw exception;
nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in class path resource [CassandraDatabaseConfig.class]: Bean instantiation via factory method failed;
nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.data.cassandra.SessionFactory]: Factory method 'sessionFactory' threw exception;
nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'session' defined in class path resource [CassandraDatabaseConfig.class]: Invocation of init method failed;
nested exception is com.datastax.driver.core.exceptions.NoHostAvailableException: All host(s) tried for query failed (tried: host1:port1 (com.datastax.driver.core.exceptions.TransportException: [host1:port1] Error writing))
at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:627)
Please let me know if any more additional details needed.
Tried to changed version of Cassandra driver version, explicilty trying to logging to Cassandra
This is our CassandraConfig class where we create the cluster object.
CassandraClusterFactoryBean cluster = new CassandraClusterFactoryBean();
cluster.setContactPoints(contactPoints);
cluster.setPort(Integer.valueOf(port));
cluster.setUsername(userName);
cluster.setPassword(password);
return cluster;
Server should start by connecting to cassandra

Error creating bean with name 'BitronixTransactionManager' defined in URL

I created two tomcat instances in single OS(windows). when i ran second instance i got below error.
2018-07-04 13:11:22,859 ERROR [localhost-startStop-1] o.s.w.c.ContextLoader [ContextLoader.java:331] Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'BitronixTransactionManager' defined in URL [jar:file:/C:/Program%20Files/Apache%20Software%20Foundation/Tomcat%208/webapps/mfsmiddleware/WEB-INF/lib/a.b.c.d.e-0.1-SNAPSHOT.jar!/META-INF/spring/jbpm-a-b.xml]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [bitronix.tm.BitronixTransactionManager]: Factory method 'getTransactionManager' threw exception; nested exception is bitronix.tm.utils.InitializationException: cannot open disk journal
at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:599) ~[spring-beans-4.1.8.RELEASE.jar:4.1.8.RELEASE]
Caused by: bitronix.tm.utils.InitializationException: cannot open disk journal
Caused by: java.io.IOException: The process cannot access the file because another process has locked a portion of the file

HTTP ERROR 503 with Spring Framework

I am using appEngine with Spring Framework and maven. I run the application from maven and everything is fine in command line but in browser I found this error.
HTTP ERROR: 503
Problem accessing /. Reason:
SERVICE_UNAVAILABLE
I don't know where I have to fix. Below is the error code in terminal when I try to run with maven. I think Spring framework has big problem in my PC.
[INFO] WARNING: Nested in org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping#0': Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.web.servlet.handler.MappedInterceptor#0': Cannot create inner bean '(inner bean)' of type [org.springframework.web.servlet.handler.ConversionServiceExposingInterceptor] while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name '(inner bean)': Cannot resolve reference to bean 'org.springframework.format.support.FormattingConversionServiceFactoryBean#0' while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.format.support.FormattingConversionServiceFactoryBean#0': Invocation of init method failed; nested exception is java.lang.NoClassDefFoundError: java.time.format.FormatStyle is a restricted class. Please see the Google App Engine developer's guide for more details.:
[INFO] java.lang.NoClassDefFoundError: java.time.format.FormatStyle is a restricted class. Please see the Google App Engine developer's guide for more details.

Resources