playtika.testcontainers Error creating bean with name 'embeddedClickHouse' - java

I am trying to run tests using playtika.testcontainers embedded-clickhouse, which used to work, but now I am getting java.lang.IllegalStateException: Failed to load ApplicationContext, caused by Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'embeddedClickHouse' defined in class path resource [com/playtika/test/clickhouse/EmbeddedClickHouseBootstrapConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.testcontainers.containers.ClickHouseContainer]: Factory method 'clickHouseContainer' threw exception; nested exception is java.lang.NoClassDefFoundError: net/jpountz/lz4/LZ4Factory.
Does anybody know if something was changed in the API?

This issue might be fixed with https://github.com/PlaytikaOSS/testcontainers-spring-boot/pull/865.
In general, I would recommend using Testcontainers for Java directly on such cases.

Related

junit test cases creating errors for when spring boot application migrated from 2.6.6 to 2.7.7. junit5 is used

Few Error Examples :
Failed to introspect annotated methods on class
java.lang.IllegalStateException: Failed to load ApplicationContext
Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'welcomePageHandlerMapping' defined in class path resource [org/springframework/boot/autoconfigure/web/servlet/WebMvcAutoConfiguration$EnableWebMvcConfiguration.class]: Unsatisfied dependency expressed through method 'welcomePageHandlerMapping' parameter 2; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'mvcResourceUrlProvider' defined in class path resource [org/springframework/boot/autoconfigure/web/servlet/WebMvcAutoConfiguration$EnableWebMvcConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.web.servlet.resource.ResourceUrlProvider]: Factory method 'mvcResourceUrlProvider' threw exception; nested exception is java.lang.NullPointerException
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'mvcResourceUrlProvider' defined in class path resource [org/springframework/boot/autoconfigure/web/servlet/WebMvcAutoConfiguration$EnableWebMvcConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate
I only changed the version and nothing else in the code, inside parent tag.
<version>2.7.7</version>

Runtime error in creating beans. java.lang.AbstractMethodError:

I am getting an error in runtime of my spring 5 application. It is working fine in debug mode in eclipse but throwing the errors while creating bean from the application context. Below I have shared the error log. I have rebuild the jar many times and changed the dependencies in manifest file but still the same error while runtime. Please advice.
org.springframework.beans.factory.BeanCreationException: Error creating bean wit
h name 'LIQBeanFactory' defined in URL [jar:file:/D:/LoanIQ/Server/sdk-post/QNB_
GL_V92_PROD_Encr.jar!/beanRefFactory.xml]: Bean instantiation via constructor fa
iled; nested exception is org.springframework.beans.BeanInstantiationException:
Failed to instantiate [org.springframework.context.support.ClassPathXmlApplicati
onContext]: Constructor threw exception; nested exception is org.springframework
.beans.factory.BeanCreationException: Error creating bean with name 'LiqTransact
ionManager' defined in class path resource [applicationContext.xml]: Initializat
ion of bean failed; nested exception is java.lang.AbstractMethodError: Receiver
class org.springframework.aop.framework.autoproxy.InfrastructureAdvisorAutoProxy
Creator does not define or inherit an implementation of the resolved method abst
ract postProcessPropertyValues(Lorg/springframework/beans/PropertyValues;[Ljava/
beans/PropertyDescriptor;Ljava/lang/Object;Ljava/lang/String;)Lorg/springframewo
rk/beans/PropertyValues; of interface org.springframework.beans.factory.config.I
nstantiationAwareBeanPostProcessor.

Issue with creating bean

I've a java/spring application(service) which runs fine on my machine(windows). But when I deploy the same to a linux box, I keep getting following run-time error:
Error creating bean with name 'xxx' defined in class path resource
xxxx/applicationContext.xml]: Bean instantiation via factory method failed;
nested exception is
org.springframework.beans.BeanInstantiationException: Failed to
instantiate [com.tangosol.net.NamedCache]: Factory method 'abc' threw exception;
nested exception is (Wrapped)
java.security.PrivilegedActionException:
java.lang.reflect.InvocationTargetException
Am new to java I'm not sure how to go about fixing this error.
Thanks.

I am getting java.lang.ExceptionInInitializerError while running JUNIT tests in Struts application

Error in console for all test cases i am running in STRUTS maven project:
testOverride(com.cisco.mcm.testcase.TestOverrides) Time elapsed: 3.969 sec <<< ERROR!
java.lang.ExceptionInInitializerError
at com.cisco.servicesales.mcm.utils.MCMDataUtil.getDataSource(MCMDataUtil.java:55)
at com.cisco.servicesales.mcm.utils.MCMDataUtil.getServices(MCMDataUtil.java:45)
at com.cisco.mcm.dao.AccessManagementDAO.getUserData(AccessManagementDAO.java:83)
MCMDataUtil.java(line 55 ):
public static DataSource getDataSource(String ConnectionPoolName) {
System.out.println("Inside getDatasource...1");
logger.info("Inside getDataSource Method");
DataSource dataSource = null;
System.out.println(":Inside getDatasource...2");
line 55: ApplicationContext context = SpringSingleton.getContext();
System.out.println(":Inside getDatasource...3");
Due to this error bean is not getting instantiated:
at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:334)
at
org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:980)
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource' defined in class path resource [dataSource-beans.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.factory.BeanDefinitionStoreException: Factory method [public javax.sql.DataSource com.cisco.mcm.util.WASConnectionPoolManager.loadPool(java.lang.String)] threw exception; nested exception is java.lang.NoClassDefFoundError: oracle/security/pki/OracleWallet
at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:396)
at org.springframework.beans.factory.support.Ab
Can you please help to get rid of this error?
I am trying since long time and unable to find any solution.
If you read your way through the exception, sometimes it will tell you about nested exceptions. These can be hard to read if you aren't used to the stack traces. In this case, your root cause is:
nested exception is java.lang.NoClassDefFoundError: oracle/security/pki/OracleWallet
That tells us the JVM can't find oracle.security.pki.OracleWallet to load, in order to create a connection to the database. Do you have oracle.security.pki.OracleWallet on your classpath as part of another jar?

Unclosed Parenthesis exception on CREATE in spring-data-neo4j

I'm running Spring Data Neo4j version 2.3.3. When I try to execute a CREATE statement through my GraphRepository, I'm getting the following exception:
org.springframework.dao.InvalidDataAccessResourceUsageException: Error executing statement ... nested exception is Unclosed parenthesis
"CREATE (:line{id:1})-[:ROOT]->(:point{id:10})-[:NEXT]->(:point{id:11})-[:NEXT]->(:point{id:12})-[:NEXT]->(p:point{id:13})"
^
The ... merely hides the same thing printed below it, and the ^ appears in the correct place. As you can see if you look at my query, there is no unclosed parenthesis. What's going on here?
EDIT: For testing purposes, I tried reducing the statement to: CREATE (:line{id:1}), and I get the same result.
EDIT: I tried upgrading my pom to use version 3.0.0, and now am getting the following exception:
Error creating bean with name 'controller': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: org.example.model.LineRepo org.example.controller.Controller.lineRepo; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'lineRepo': Cannot resolve reference to bean 'neo4jTemplate' while setting bean property 'neo4jTemplate'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.data.neo4j.config.Neo4jConfiguration#0': Cannot resolve reference to bean 'graphDatabaseService' while setting bean property 'graphDatabaseService'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'graphDatabaseService' defined in ServletContext resource [/WEB-INF/dispatcher-servlet.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.neo4j.kernel.EmbeddedGraphDatabase]: Constructor threw exception; nested exception is java.lang.RuntimeException: org.neo4j.kernel.lifecycle.LifecycleException: Component 'org.neo4j.kernel.extension.KernelExtensions#61634a3b' failed to initialize. Please see attached cause exception.
The deepest root cause exception given is:
java.lang.NoSuchMethodError: org.neo4j.kernel.impl.nioneo.store.FileSystemAbstraction.getOrCreateThirdPartyFileSystem(Ljava/lang/Class;Lorg/neo4j/helpers/Function;)Lorg/neo4j/kernel/impl/nioneo/store/FileSystemAbstraction$ThirdPartyFileSystem;
Nothing was changed other than upgrading the dependency. The 'controller' bean it is referring to is the controller I have #Autowired with my GraphRepository
Spring Data Neo4j 2.3.3 is for Neo4j 1.9, which doesn't support labels (the syntax you're using in Cypher). You need to use 3.0.0 in order to get Neo4j 2.0 support.

Categories

Resources