Run webapp generated with JHipster : Mapper could not be found - eclipse

When I run my webapp with Eclipse IDE (Right click + run as Java application)
I have the following error :
2018-08-14 15:58:17.381 WARN 7324 --- [ restartedMain] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'actionServiceImpl' defined in file [D:\dfsdfdsfdsfsfsfsf\target\classes\com\showyou\service\impl\ActionServiceImpl.class]: Unsatisfied dependency expressed through constructor parameter 1; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'com.showyou.service.mapper.ActionMapper' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {}
Does anybody has an idea ? I followed all the required steps : https://www.jhipster.tech/configuring-ide-eclipse/

Related

Getting WELD-001408 errors while doing jboss migration from 6.4EAP to 7.4EAP

Getting below errors after jboss migration from 6.4eap to 7.4eap
same EAR/WAR is working on 6.4eap but giving errors on 7.4eap.
As part of migration do we need to take care anything else to fix below issue?
Caused by: org.jboss.weld.exceptions.DeploymentException: Exception List with 2 exceptions:
Exception 0 :
org.jboss.weld.exceptions.DeploymentException: WELD-001408: Unsatisfied dependencies for type Config with qualifiers #Named
at injection point [BackedAnnotatedParameter] Parameter 1 of [BackedAnnotatedConstructor] #Inject public org.openscoring.service.NetworkSecurityContextFilter(#Named Config)
at org.openscoring.service.NetworkSecurityContextFilter.(NetworkSecurityContextFilter.java:0)
Exception 1 :
org.jboss.weld.exceptions.DeploymentException: WELD-001408: Unsatisfied dependencies for type MetricRegistry with qualifiers #Default
at injection point [UnbackedAnnotatedParameter] Parameter 2 of [UnbackedAnnotatedConstructor] #Inject private org.openscoring.service.MetricResource(ModelRegistry, MetricRegistry)
at org.openscoring.service.MetricResource.(MetricResource.java:0)
Suppressed: org.jboss.weld.exceptions.DeploymentException: WELD-001408: Unsatisfied dependencies for type Config with qualifiers #Named
at injection point [BackedAnnotatedParameter] Parameter 1 of [BackedAnnotatedConstructor] #Inject public org.openscoring.service.NetworkSecurityContextFilter(#Named Config)

Gateway not appearing in the jhipster registry

I have created a docker image for the gateway application, but when i run the command:
docker-compose up
only the microservice and the registry are UP but the gateway is not even appeared in the intances
22-08-25 10:57:23.661 ERROR 1 --- [ restartedMain] o.s.boot.SpringApplication : Application run failed
mygateway_1 |
mygateway_1 | org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'securityConfiguration' defined in file [/app/classes/ma/s2m/nxp/config/SecurityConfiguration.class]: Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'userDetailsService' defined in file [/app/classes/ma/s2m/nxp/security/DomainUserDetailsService.class]: Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userRepository' defined in ma.s2m.nxp.repository.UserRepository defined in #EnableR2dbcRepositories declared on DatabaseConfiguration: Cannot create inner bean '(inner bean)#139c4f36' of type [org.springframework.data.repository.core.support.RepositoryFragmentsFactoryBean] while setting bean property 'repositoryFragments'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name '(inner bean)#139c4f36': Invocation of init method failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userRepositoryInternalImplFragment': Cannot resolve reference to bean 'userRepositoryInternalImpl' while setting constructor argument; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'userRepositoryInternalImpl' defined in file [/app/classes/ma/s2m/nxp/repository/UserRepositoryInternalImpl.class]: Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'r2dbcDatabaseClient' defined in class path resource [org/springframework/boot/autoconfigure/r2dbc/ConnectionFactoryDependentConfiguration.class]: Unsatisfied dependency expressed through method 'r2dbcDatabaseClient' parameter 0; nested exception is
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'connectionFactory' defined in class path resource [org/springframework/boot/autoconfigure/r2dbc/ConnectionFactoryConfigurations$PoolConfiguration$PooledConnectionFactoryConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [io.r2dbc.pool.ConnectionPool]: Factory method 'connectionFactory' threw exception; nested exception is java.lang.IllegalStateException: Unable to create a ConnectionFactory for 'ConnectionFactoryOptions{options={driver=postgresql, database=myGateway, host=mygateway-postgresql, port=5432, user=myGateway}}'. Available drivers: [ h2, pool ]

Having "APPLICATION FAILED TO START" error on Spring Boot startup

I'm developing an API on Spring Boot using Vault and Mongo, but it refuses to start.
2022-09-07 13:58:56.510 WARN 23885 --- [ main] s.c.a.AnnotationConfigApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'org.springframework.cloud.vault.config.VaultReactiveBootstrapConfiguration': Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.boot.context.properties.ConfigurationPropertiesBindException: Error creating bean with name 'spring.cloud.vault-org.springframework.cloud.vault.config.VaultProperties': Could not bind properties to 'VaultProperties' : prefix=spring.cloud.vault, ignoreInvalidFields=false, ignoreUnknownFields=true; nested exception is javax.validation.NoProviderFoundException: Unable to create a Configuration, because no Jakarta Bean Validation provider could be found. Add a provider like Hibernate Validator (RI) to your classpath.
2022-09-07 13:58:56.513 INFO 23885 --- [ main] ConditionEvaluationReportLoggingListener :
Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2022-09-07 13:58:56.521 ERROR 23885 --- [ main] o.s.b.d.LoggingFailureAnalysisReporter :
***************************
APPLICATION FAILED TO START
***************************
Description:
The Bean Validation API is on the classpath but no implementation could be found
Action:
Add an implementation, such as Hibernate Validator, to the classpath
EDIT: I think the problem is that Spring Boot tries to use javax and jakarta at the same time according to this part of the error:
nested exception is javax.validation.NoProviderFoundException: Unable to create a Configuration, because no Jakarta Bean Validation provider could be found.. Is this a normal behavior?
Consider to bypass the problem: try to add compile 'de.flapdoodle.embed:de.flapdoodle.embed.mongo' to your build.gradle, and #Bean public MongoClient embeddedMongoClient() to return a dummy Mongo client during the Init phase.
The real mongo Url could be fetched (and used) from the Vault later, during run time, once required, via a customized extends of spring-data-mongodb's MongoDbFactory.
Adding hibernate-validator 6 and spring-boot-starter-validation solved the problem.
Thing to know: hibernate-validator < 7 uses Javax, hibernate-validator => 7 uses Jakarta.
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-validation</artifactId>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-validator</artifactId>
<version>6.2.4.Final</version>
</dependency>

Grails, Spring Security and Mongo

I try to configure Grails 3.1.4 rest-api aplication. I'd like to use Mongo and Spring Security for authentication, but when I erase from application.yml h2 datasource and hibernate and try to run application I get a lot of exceptions like:
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'persistenceInterceptor':
Cannot create inner bean '(inner bean)#1b3bb287' of type [org.grails.orm.hibernate4.support.AggregatePersistenceContextInterceptor]
while setting constructor argument with key [0]; nested exception is
org.springframework.beans.factory.BeanCreationException: Error creating bean with name '(inner bean)#1b3bb287':
Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire method:
public void org.grails.orm.hibernate4.support.AggregatePersistenceContextInterceptor.setHibernateDatastores(org.grails.orm.hibernate.AbstractHibernateDatastore[]); nested exception is
org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [org.grails.orm.hibernate.AbstractHibernateDatastore]
found for dependency [array of org.grails.orm.hibernate.AbstractHibernateDatastore]:
expected at least 1 bean which qualifies as autowire candidate for this dependency.
I can confirm this behavior with Grails 3.1.7 if you just comment out the default H2 and cache part in application.yml. However, it disappears for me, if I comment out the following:
// compile "org.grails.plugins:hibernate4"
For reference, I'm using the following plugin versions for mongoDB and spring-security-core:
compile 'org.grails.plugins:mongodb:5.0.6'
compile "org.mongodb:mongodb-driver:3.0.2"
runtime 'org.springframework.data:spring-data-mongodb:1.8.1.RELEASE'
compile 'org.grails.plugins:spring-security-core:3.1.1'
Cheers!

Deployment issues on Tomcat

I am unable to deploy grails war in tomcat .
Copied all 55 jars to $CATALINA_HOME/shared/lib/grails-jars/
Added shared.loader= ${catalina.home}/shared/lib/grails-jars/*.jar
And started tomcat successfully. Now deployed grails war in deploy folder (war is ~572.4KB).
The console shows these errors :
log4j:ERROR Could not instantiate appender named "CONSOLE".
28 Jan, 2010 11:35:57 AM org.apache.catalina.core.ApplicationContext log
INFO: Initializing Spring root WebApplicationContext
2010-01-28 11:36:06,294 [ContainerBackgroundProcessor[StandardEngine[Catalina]]] ERROR context.ContextLoader - Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'messageSource': Initialization of bean failed;
nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'transactionManager': Cannot resolve reference to bean 'sessionFactory' while setting bean property 'sessionFactory';
nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory': Invocation of init method failed;
nested exception is org.hibernate.MappingException: Could not get constructor for org.codehaus.groovy.grails.orm.hibernate.persister.entity.GroovyAwareSingleTableEntityPersister
at java.security.AccessController.doPrivileged(Native Method)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3843)
My application contains 4 plugins :
hibernate-1.1.2
liferay-exploded-0.8
portlets-0.7
portlets-liferay-0.1
Could any one please help me .
thanks in advance .
Sounds like this might be a Hibernate version problem, as described here.