Problems while restore nifi version 1.12.1 with old configs - apache-nifi

In general, the update was successful. But after transferring the configs from the old version (authorizers.xml, nifi.properties, keystore.jks, flow.xml.gz) to the new version, it starts to swear that they are not valid, and the keystore password is incorrect, but open it with the old password successfully. Below presented errors in the log:
WARN [main] org.eclipse.jetty.webapp.WebAppContext Failed startup of context o.e.j.w.WebAppContext#6bb4dd34{nifi-api,/nifi-api,file:///opt/nginx/nifi-ift/nifi/work/jetty/nifi-web-api-1.12.1.war/webapp/,UNAVAILABLE}{./work/nar/framework/nifi-framework-nar-1.12.1.nar-unpacked/NAR-INF/bundled-dependencies/nifi-web-api-1.12.1.war}
org.apache.nifi.web.NiFiCoreException: Unable to start Flow Controller.
Caused by: org.springframework.beans.factory.BeanCreationException:
Error creating bean with name 'flowService': FactoryBean threw
exception on object creation; nested exception is
org.springframework.beans.factory.BeanCreationException: Error
creating bean with name 'flowController': FactoryBean threw exception
on object creation; nested exception is
java.lang.IllegalStateException: Flow controller TLS configuration is
invalid
Caused by: org.springframework.beans.factory.BeanCreationException:
Error creating bean with name 'flowController': FactoryBean threw
exception on object creation; nested exception is
java.lang.IllegalStateException: Flow controller TLS configuration is
invalid
Caused by: java.lang.IllegalStateException: Flow controller TLS
configuration is invalid
Caused by: org.apache.nifi.security.util.TlsException: The truststore
properties are not valid
WARN [main] org.apache.nifi.web.server.JettyServer Failed to start web server... shutting down.
java.io.IOException: Keystore was tampered with, or password was incorrect
Caused by: java.security.UnrecoverableKeyException: Password verification failed

Related

SpringBoot 2.6.7 Upgrade Throws Startup Error - Provider for javax.xml.stream.XMLOutputFactory cannot be found

I am unable to get past this error after upgrading SpringBoot from 2.5.10 - 2.6.7
I did find a version diff in jackson-dataformat-xml and raised an issue but they are confident there is no diff in jackson-dataformat-xml versions https://github.com/FasterXML/jackson-dataformat-xml/issues/521
Anyone faced this issue? Would appreciate if anyone could help
org.springframework.context.ApplicationContextException: Unable to start web server; nested exception is org.springframework.boot.web.server.WebServerException: Unable to start embedded Tomcat
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.onRefresh(ServletWebServerApplicationContext.java:163) ~[spring-boot-2.6.7.jar!/:2.6.7]
Caused by: org.springframework.boot.web.server.WebServerException: Unable to start embedded Tomcat
at org.springframework.boot.web.embedded.tomcat.TomcatWebServer.initialize(TomcatWebServer.java:142) ~[spring-boot-2.6.7.jar!/:2.6.7]
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'formContentFilter' defined in class path resource [org/springframework/boot/autoconfigure/web/servlet/WebMvcAutoConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.boot.web.servlet.filter.OrderedFormContentFilter]: Factory method 'formContentFilter' threw exception; nested exception is javax.xml.stream.FactoryConfigurationError: Provider for javax.xml.stream.XMLOutputFactory cannot be found
at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:658) ~[spring-beans-5.3.19.jar!/:5.3.19]
Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.boot.web.servlet.filter.OrderedFormContentFilter]: Factory method 'formContentFilter' threw exception; nested exception is javax.xml.stream.FactoryConfigurationError: Provider for javax.xml.stream.XMLOutputFactory cannot be found
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:185) ~[spring-beans-5.3.19.jar!/:5.3.19]
Caused by: javax.xml.stream.FactoryConfigurationError: Provider for javax.xml.stream.XMLOutputFactory cannot be found
at javax.xml.stream.FactoryFinder.find(Unknown Source) ~[?:?]
at javax.xml.stream.XMLOutputFactory.newFactory(Unknown Source) ~[?:?]
at com.fasterxml.jackson.dataformat.xml.XmlFactory.<init>(XmlFactory.java:124) ~[jackson-dataformat-xml-2.13.2.jar!/:2.13.2]

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

mongodb on tomcat with spring

I have written an RestAPI server that uses mongodb with spring, and successfully tested it locally. But, when I am deploying the war file on my server (tomcat) it causes an error.
After searching, I added "compile 'org.mongodb:mongo-java-driver:2.13.3'" to my build.gradle/pom.xml file based on a tutorial. But, I don't know what to do next to solve the error. I assume it has something to do with initializing a mongodb. Here is my error on Jenkins when it tries do deploys it:
BUILD SUCCESSFUL in 6s
4 actionable tasks: 4 executed
Build step 'Invoke Gradle script' changed build result to SUCCESS
Deploying /var/jenkins_home/workspace/AddressBook/build/libs/AddressBook.war to container Tomcat 8.x Remote with context
Redeploying [/var/jenkins_home/workspace/AddressBook/build/libs/AddressBook.war]
Undeploying [/var/jenkins_home/workspace/AddressBook/build/libs/AddressBook.war]
Deploying [/var/jenkins_home/workspace/AddressBook/build/libs/AddressBook.war]
ERROR: Build step failed with exception
org.codehaus.cargo.container.ContainerException: Failed to deploy [/var/jenkins_home/workspace//AddressBook/build/libs/AddressBook.war]
at org.codehaus.cargo.container.tomcat.internal.AbstractTomcatManagerDeployer.deploy(AbstractTomcatManagerDeployer.java:106)
at org.codehaus.cargo.container.tomcat.internal.AbstractTomcatManagerDeployer.redeploy(AbstractTomcatManagerDeployer.java:184)
at hudson.plugins.deploy.CargoContainerAdapter.deploy(CargoContainerAdapter.java:77)
at hudson.plugins.deploy.CargoContainerAdapter$DeployCallable.invoke(CargoContainerAdapter.java:147)
at hudson.plugins.deploy.CargoContainerAdapter$DeployCallable.invoke(CargoContainerAdapter.java:117)
at hudson.FilePath.act(FilePath.java:997)
at hudson.FilePath.act(FilePath.java:975)
at hudson.plugins.deploy.CargoContainerAdapter.redeploy(CargoContainerAdapter.java:114)
at hudson.plugins.deploy.PasswordProtectedAdapterCargo.redeploy(PasswordProtectedAdapterCargo.java:93)
at hudson.plugins.deploy.DeployPublisher.perform(DeployPublisher.java:64)
at hudson.tasks.BuildStepMonitor$3.perform(BuildStepMonitor.java:45)
at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:744)
at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:690)
at hudson.model.Build$BuildExecution.post2(Build.java:186)
at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:635)
at hudson.model.Run.execute(Run.java:1749)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
at hudson.model.ResourceController.execute(ResourceController.java:97)
at hudson.model.Executor.run(Executor.java:429)
Caused by: org.codehaus.cargo.container.tomcat.internal.TomcatManagerException: The Tomcat Manager responded "FAIL - Deployed application at context path [/AddressBook] but context failed to start
" instead of the expected "OK" message
at org.codehaus.cargo.container.tomcat.internal.TomcatManager.invoke(TomcatManager.java:715)
at org.codehaus.cargo.container.tomcat.internal.TomcatManager.deployImpl(TomcatManager.java:761)
at org.codehaus.cargo.container.tomcat.internal.TomcatManager.deploy(TomcatManager.java:312)
at org.codehaus.cargo.container.tomcat.internal.AbstractTomcatManagerDeployer.deploy(AbstractTomcatManagerDeployer.java:101)
... 18 more
org.codehaus.cargo.container.tomcat.internal.TomcatManagerException: The Tomcat Manager responded "FAIL - Deployed application at context path [/AddressBook] but context failed to start
" instead of the expected "OK" message
at org.codehaus.cargo.container.tomcat.internal.TomcatManager.invoke(TomcatManager.java:715)
at org.codehaus.cargo.container.tomcat.internal.TomcatManager.deployImpl(TomcatManager.java:761)
at org.codehaus.cargo.container.tomcat.internal.TomcatManager.deploy(TomcatManager.java:312)
at org.codehaus.cargo.container.tomcat.internal.AbstractTomcatManagerDeployer.deploy(AbstractTomcatManagerDeployer.java:101)
at org.codehaus.cargo.container.tomcat.internal.AbstractTomcatManagerDeployer.redeploy(AbstractTomcatManagerDeployer.java:184)
at hudson.plugins.deploy.CargoContainerAdapter.deploy(CargoContainerAdapter.java:77)
at hudson.plugins.deploy.CargoContainerAdapter$DeployCallable.invoke(CargoContainerAdapter.java:147)
at hudson.plugins.deploy.CargoContainerAdapter$DeployCallable.invoke(CargoContainerAdapter.java:117)
at hudson.FilePath.act(FilePath.java:997)
at hudson.FilePath.act(FilePath.java:975)
at hudson.plugins.deploy.CargoContainerAdapter.redeploy(CargoContainerAdapter.java:114)
at hudson.plugins.deploy.PasswordProtectedAdapterCargo.redeploy(PasswordProtectedAdapterCargo.java:93)
at hudson.plugins.deploy.DeployPublisher.perform(DeployPublisher.java:64)
at hudson.tasks.BuildStepMonitor$3.perform(BuildStepMonitor.java:45)
at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:744)
at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:690)
at hudson.model.Build$BuildExecution.post2(Build.java:186)
at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:635)
at hudson.model.Run.execute(Run.java:1749)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
at hudson.model.ResourceController.execute(ResourceController.java:97)
at hudson.model.Executor.run(Executor.java:429)
Build step 'Deploy war/ear to a container' marked build as failure
Finished: FAILURE
My application is something like https://spring.io/guides/gs/accessing-data-mongodb/, with some RestAPI mappings.
And here is the tomcat log:
org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'per
sonController': Unsatisfied dependency expressed through field 'PersonRepo'; nested exception is org
.springframework.beans.factory.BeanCreationException: Error creating bean with name 'personRepositor
y': Cannot resolve reference to bean 'mongoTemplate' while setting bean property 'mongoOperations';
nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating
bean with name 'mongoTemplate' defined in class path resource [org/springframework/boot/autoconfigu
re/data/mongo/MongoDataAutoConfiguration.class]: Unsatisfied dependency expressed through method 'mo
ngoTemplate' parameter 0; nested exception is org.springframework.beans.factory.UnsatisfiedDependenc
yException: Error creating bean with name 'mongoDbFactory' defined in class path resource [org/sprin
gframework/boot/autoconfigure/data/mongo/MongoDataAutoConfiguration.class]: Unsatisfied dependency e
xpressed through method 'mongoDbFactory' parameter 0; nested exception is org.springframework.beans.
factory.BeanCreationException: Error creating bean with name 'mongo' defined in class path resource
[org/springframework/boot/autoconfigure/mongo/MongoAutoConfiguration.class]: Bean instantiation via
factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Fai
led to instantiate [com.mongodb.MongoClient]: Factory method 'mongo' threw exception; nested excepti
on is java.lang.IllegalAccessError: tried to access method org.bson.types.ObjectId.<init>(III)V from
class com.mongodb.Bytes
UPDATE (fix of above error):
So, I had this as dependency in my build.gradle:
compile 'org.mongodb:mongo-java-driver:2.13.3'
I changed it to (not enforcing version):
compile group: 'org.mongodb', name: 'mongo-java-driver'
But, now when I request a GET from my server, I see:
Sun Mar 04 21:05:23 UTC 2018
There was an unexpected error (type=Internal Server Error, status=500).
Timed out after 30000 ms while waiting for a server that matches ReadPreferenceServerSelector{readPreference=primary}. Client view of cluster state is {type=UNKNOWN, servers=[{address=localhost:27017, type=UNKNOWN, state=CONNECTING, exception={com.mongodb.MongoSocketOpenException: Exception opening socket}, caused by {java.net.ConnectException: Connection refused (Connection refused)}}]; nested exception is com.mongodb.MongoTimeoutException: Timed out after 30000 ms while waiting for a server that matches ReadPreferenceServerSelector{readPreference=primary}. Client view of cluster state is {type=UNKNOWN, servers=[{address=localhost:27017, type=UNKNOWN, state=CONNECTING, exception={com.mongodb.MongoSocketOpenException: Exception opening socket}, caused by {java.net.ConnectException: Connection refused (Connection refused)}}]
Here is my application.properties:
spring.data.mongodb.host=<server_address>
spring.data.mongodb.port=27017
spring.data.mongodb.user=<username>
MongoDB server on localhost:27017 (user , pwd: same as /var/jenkins_home).
Should I somehow tell my application about the path of mongoDB?
Or should I tell my application about the database name? (I think it will use some default one)

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

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.

No suitable driver exception while grail tomcat deployment

I have deployed a grails application into tomcat container but am getting No suitable driver exception: can any one help in solving this.
SEVERE: Exception sending context initialized event to listener instance of class org.codehaus.groovy.grails.web.context.GrailsContextLoader Listener org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory': Cannot resolve reference to bean 'h ibernateProperties' while setting bean property 'hibernateProperties'; nested exception is org.springframework.beans.factory.BeanCreationExc eption: Error creating bean with name 'hibernateProperties': Cannot resolve reference to bean 'dialectDetector' while setting bean property 'properties' with key [hibernate.dialect]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dialectDetector': Invocation of init method failed; nested exception is org.springframework.jdbc.support.MetaDataAccessException: Error while extracting DatabaseMetaData; nested exception is org.apache.commons.dbcp.SQLNestedException: Cannot create JDBC driver of class 'oracle.jdbc.OracleDriver' for connect URL 'jdbc:xxxx:oracle://xxxxx:1521;ServiceName=xxxx'>
at org.grails.datastore.gorm.plugin.support.PersistenceContextInterceptorAggregator.postProcessBeanFactory(PersistenceContextInterce ptorAggregator.groovy:104) Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'hibernateProperties': Cannot resolve refe rence to bean 'dialectDetector' while setting bean property 'properties' with key [hibernate.dialect]; nested exception is org.springframewo rk.beans.factory.BeanCreationException: Error creating bean with name 'dialectDetector': Invocation of init method failed; nested exception is org.springframework.jdbc.support.MetaDataAccessException: Error while extracting DatabaseMetaData; nested exception is org.apache.commons .dbcp.SQLNestedException: Cannot create JDBC driver of class 'oracle.jdbc.OracleDriver' for connect URL 'jdbc:xxxx:oracle://xxxx :1521;xxxx=xxxx'
... 1 more
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dialectDetector': Invocation of init meth od failed; nested exception is org.springframework.jdbc.support.MetaDataAccessException: Error while extracting DatabaseMetaData; nested exc eption is org.apache.commons.dbcp.SQLNestedException: Cannot create JDBC driver of class 'oracle.jdbc.OracleDriver' for connect URL 'jdbc:in formatica:oracle://xxxx:1521;xxx=xxx'
... 1 more
Caused by: org.springframework.jdbc.support.MetaDataAccessException: Error while extracting DatabaseMetaData; nested exception is org.apache .commons.dbcp.SQLNestedException: Cannot create JDBC driver of class 'oracle.jdbc.OracleDriver' for connect URL 'jdbc:xxx:oracle://xxxx:1521;xxxx=xxxx'
... 1 more
Caused by: org.apache.commons.dbcp.SQLNestedException: Cannot create JDBC driver of class 'oracle.jdbc.OracleDriver' for connect URL 'jdbc: xxxx:oracle://xxxx:1521;xxxx=xxxx'
at org.apache.commons.dbcp.BasicDataSource.createConnectionFactory(BasicDataSource.java:1452)
at org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1371)
at org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:1044)
... 1 more Caused by: java.sql.SQLException: No suitable driver
at java.sql.DriverManager.getDriver(DriverManager.java:264)
at org.apache.commons.dbcp.BasicDataSource.createConnectionFactory(BasicDataSource.java:1437)
... 3 more
May 30, 2013 7:31:25 PM org.apache.catalina.core.StandardContext start
SEVERE: Error listenerStart
May 30, 2013 7:31:25 PM org.apache.catalina.core.StandardContext start
SEVERE: Context [/Jarvis] startup failed due to previous errors
May 30, 2013 7:31:25 PM org.apache.catalina.core.ApplicationContext log
INFO: Closing Spring root WebApplicationContext
UPDATED for a dependency definition example
Add the following repository definition to your BuildConfig.groovy
mavenRepo "https://code.lds.org/nexus/content/groups/main-repo"
In your dependencies section the following should appear:
runtime 'com.oracle:ojdbc6:11.2.0.3'
A better way is to install manually the Oracle driver to your corporate Repository(Artifactory, Nexus, Archiva, file server, etc.)

Resources