I have a simple maven bobcat project with YAML configuration. I am now truing to add additional property implementing WebDriverCreator interface. I have add necessary methods (create(), getId() and getOptions()) in the implemented class "CustomChromeCreator".
However when I have tried to execute it I am getting error "No WebDriverCreator registered for the provided type: customChrome".
Can anyone provide me a sample codebase how to do it.
NOTE: I am using bb-core version 2.2.0
Related
Is there a way to overwrite a configuration in a Quarkus extension with a hard-coded value?
What I'm trying to do: I am creating a custom Quarkus extension for JSON logging, based on quarkus-logging-json but with additional (non static) fields. I reuse some classes from the extension's runtime library, so it is a Maven dependency of the runtime module of the extension (and the deployment also needs to be declared as a dependency to my deployment module, because the quarkus extension plugin checks this).
It seems to work fine, except that I now have 2 formatters, and the following line is logged:
LogManager error of type GENERIC_FAILURE: Multiple console formatters were activated
I would like to disable the quarkus-logging-json extension completely by hard-coding these values:
quarkus.console.json.enable=false
quarkus.file.json.enable=false.
Is there a way to do this?
Thank you.
An extension cannot override runtime configuration values, it can however set a default value using io.quarkus.deployment.builditem.RunTimeConfigurationDefaultBuildItem
I am trying to build a custom Liquibase docker image (based on the official liquibase/liquibase:4.3.5 image) for running database migrations in Kubernetes.
I am using some custom types for the database which are implemented using #DataTypeInfo annotation and extending existing LiquibaseDataTypes like liquibase.datatype.core.VarcharType (class discovery is implemented using the META-INF/services/liquibase.datatype.LiquibaseDatatype mechanism introduced in Liquibase 4+).
These extensions are implemented inside their own maven module called "schema-impl", which is generating a schema-impl.jar. Everything was working fine when using migrations integrated inside the app startup process, but now we want this to be done by the dedicated docker image.
The only information in the Liquibase documentation regarding this topic is the "Drivers and extensions" section from this document. According to this, I added the schema-impl.jar into the /liquibase/classpath directory during the image building process and also modified the liquibase.docker.properties in order to add this jar file explicitly inside the classpath property:
classpath: /liquibase/changelog:/liquibase/classpath:/liquibase/classpath/schema-impl.jar
liquibase.headless: true
However, when I try to run my changesets with the docker image, I am always getting an error because it cannot find the custom type definition:
liquibase.exception.DatabaseException: ERROR: type "my-string" does not exist
Any help would be really appreciated. Thanks in advance.
Ok I found it. Basically the problem was that I needed to include the classpath in the entrypoint command, not in the liquibase.docker.properties file (which seems to be useless for this usecase), like this:
--classpath=/liquibase/changelog:/liquibase/classpath/schema-impl.jar
Hello I'm trying to upgrade my spring boot version but getting following error,
I have tried enabling circulating reference from configuration but had no success the error is
escription:
An attempt was made to call a method that does not exist. The attempt was made from the following location:
org.springframework.boot.sql.init.dependency.DatabaseInitializationDependencyConfigurer.registerBeanDefinitions(DatabaseInitializationDependencyConfigurer.java:76)
The following method did not exist:
'org.springframework.beans.factory.support.BeanDefinitionBuilder org.springframework.beans.factory.support.BeanDefinitionBuilder.rootBeanDefinition(java.lang.Class, java.util.function.Supplier)'
The method's class, org.springframework.beans.factory.support.BeanDefinitionBuilder, is available from the following locations:
jar:file:/Users/.m2/repository/org/springframework/spring-beans/5.3.5/spring-beans-5.3.5.jar!/org/springframework/beans/factory/support/BeanDefinitionBuilder.class
jar:file:/Users/.m2/repository/org/springframework/spring-beans/5.3.13/spring-beans-5.3.13.jar!/org/springframework/beans/factory/support/BeanDefinitionBuilder.class
The class hierarchy was loaded from the following locations:
org.springframework.beans.factory.support.BeanDefinitionBuilder: file:/Users/.m2/repository/org/springframework/spring-beans/5.3.5/spring-beans-5.3.5.jar
Action:
Correct the classpath of your application so that it contains a single, compatible version of org.springframework.beans.factory.support.BeanDefinitionBuilder
I just deleted my whole "m2" folder and built it from scratch, it seems maven looks at all possible versions from the repository and circulates through it. (In production mode I use Virtualization so there should be no problem)
I have a setup like this:
Main SpringBoot project with application-default.properties which on our deployment server are partially overwritten by a deployment specific properties.
Shared SpringBoot library project which has its own properties.
And when I run my main project with the library project attached (via gradle sourceControl gitRepository) I can see that the properties in the library project are empty.
How can I make the library project use the properties passed down from the main application ?
If you want to merge properties, please consider this official page.
Option 1 - default properties in library
As I found previously (probably, it is fixed), if you have jar1 and jar2 (sorted alphabetically) and both of them have application.properties file, only first will be used. They aren't merged. So please be carefully there.
However you can use #PropertySource in your library, e.g. put default properties there into the custom file name (for example - defaults-for-jar2.properties or something like this, to avoid automatic loading by Spring).
In this case:
Property load logic outside of your library will be the same with current.
Your library will load file from #PropertySource and next they will be overridden (if you have this) by your application.
Option 2 - configuration properties
If you use Kotlin and Spring, you can use ConfigurationProperties. And you can define the default values there. Moreover, IntelliJ Idea will highlight the default and possible values (according to the type, because you can use not only String, but any custom enum class, Duration class, etc.).
Just from that link:
#ConstructorBinding
#ConfigurationProperties("blog")
data class BlogProperties(var title: String, val banner: Banner) {
data class Banner(val title: String? = null, val content: String)
}
#SpringBootApplication
#EnableConfigurationProperties(BlogProperties::class)
class BlogApplication {
// ...
}
Please note:
You should mention your settings data class in the library configuration.
You should configure kapt properly to have Intelli Sence in IDEs.
I'm having trouble getting the android driver to work correctly in a jbehave based serenity-bdd project
I've created the project using the serenity-jbehave archtype and in the generated AcceptanceTestSuite class, I create a AndroidDriver with all of the relevent desired capabilities. (When the driver configuration is used in a Junit test, it works correctly so I am confident it is not a problem with any of the driver's configuration).
My problem is that once my stories start executing, the project appears to completely forget about this driver and instead use whatever driver has been set up as the default.
What am I missing? Should I be doing this configuration in the serenity.properties file? (I found that adding android as the webdriver.driver config option doesn't work).
Thanks for any responses.
I found the answer. The driver confguration used by the framework is held in the serenity.properties file associated with the project.