Error creating bean with name 'BitronixTransactionManager' defined in URL - spring

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

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

Maven Dependency for Oracle RDS on AWS

I'm having trouble connecting to my AWS Oracle RDS instance, I have a connection in SQL developer all cool and fine.
Upon loading my application context (spring boot | java 8)>
*org.springframework.context.ApplicationContextException: Unable to start web server; nested exception is org.springframework.boot.web.server.WebServerException:
........................................................................................................................................................
Caused by: java.lang.IllegalStateException: Could not load JDBC driver class [jdbc:oracle:thin:#########:1521/DBNAME]*
would be greatly appreciated if someone could point me in the correct direction as to what artifactid groupid and version I should use. Current is below and wrong:
<dependency>
<groupId>com.oracle</groupId>
<artifactId>ojdbc6</artifactId>
<version>11.2.0.4</version>
</dependency>
Full Stack Trace:
2018-07-06 07:03:15.670 ERROR 88631 --- [ost-startStop-1] 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/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.BeanCreationException: Error creating bean with name 'healthEndpoint' defined in class path resource [org/springframework/boot/actuate/autoconfigure/health/HealthEndpointConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.boot.actuate.health.HealthEndpoint]: Factory method 'healthEndpoint' threw exception; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.boot.actuate.autoconfigure.jdbc.DataSourceHealthIndicatorAutoConfiguration': Bean instantiation via constructor failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.boot.actuate.autoconfigure.jdbc.DataSourceHealthIndicatorAutoConfiguration$$EnhancerBySpringCGLIB$$d6e2375e]: Constructor threw exception; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'jpaDBDataSource' defined in class path resource [com/config/DataSourceConfig.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [javax.sql.DataSource]: Factory method 'jpaDBDataSource' threw exception; nested exception is java.lang.IllegalStateException: Could not load JDBC driver class [jdbc:oracle:thin:#****************************************]

Weird ClassNotFoundException in WebLogic 10.3.6

We have an .ear file that is running normal in a WebLogic 10.3.6 application server.
The .ear uses Spring 3.0.5 and Hibernate 3.5.2.
If we deploy the same .ear file in another WebLogic 10.3.6 server, we get the next error.
org.springframework.web.context.ContextLoader initWebApplicationContext
SEVERE: Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'filterService': Autowiring of fields failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private nl.surf.adapter.generic.dao.MessageFilterDAO nl.surf.adapter.generic.service.FilterService.messageFilterDAO; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in ServletContext resource [/WEB-INF/domain-config.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean]: Constructor threw exception; nested exception is java.lang.NoClassDefFoundError
Caused by: org.springframework.beans.factory.BeanCreationException: Could not autowire field: private nl.surf.adapter.generic.dao.MessageFilterDAO nl.surf.adapter.generic.service.FilterService.messageFilterDAO; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in ServletContext resource [/WEB-INF/domain-config.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean]: Constructor threw exception; nested exception is java.lang.NoClassDefFoundError
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in ServletContext resource [/WEB-INF/domain-config.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean]: Constructor threw exception; nested exception is java.lang.NoClassDefFoundError
Caused by: org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean]: Constructor threw exception; nested exception is java.lang.NoClassDefFoundError
Caused by: java.lang.NoClassDefFoundError
Caused by: java.lang.ClassNotFoundException: org.hibernate.cfg.Configuration
I've tried several solutions:
Place hibernate3.jar in .war/WEB-INF/lib (all jars are now in .ear/lib)
Use <prefer-web-inf-classes>true</prefer-web-inf-classes> in .war/WEB-INF/weblogic.xml
Nothing seems to work.
I'm kind of lost here...
After some extensive searching on the web and trial and error changes on the .ear, i've found the solution for my problem.
I've changed file META-INF/weblogic-application.xml and added the tags beneath inside tag <weblogic-application>
<prefer-application-packages>
<package-name>org.apache.*</package-name>
<package-name>antlr.*</package-name>
</prefer-application-packages>

Resources