I need to deploy a web with jboss and it appears an ERROR :
[/WEB-INF/spring/persistence-beans.xml]: Cannot resolve reference to bean 'dataSource' while setting bean property 'dataSource';
16:44:33,079 WARN [org.springframework.web.context.support.XmlWebApplicationContext] (ServerService Thread Pool -- 122) Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in ServletContext resource [/WEB-INF/spring/persistence-beans.xml]: Cannot resolve reference to bean 'dataSource' while setting bean property 'dataSource'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource' defined in ServletContext resource [/WEB-INF/spring/persistence-beans.xml]: Invocation of init method failed; nested exception is javax.naming.NameNotFoundException: datasources/nhwebDSPostGreSQL [Root exception is java.lang.IllegalStateException]
I tried to reinstall the jboss but the message continues. Help pls 😢
Related
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 ]
I have test Alfresco Community 7.1 with Keycloak.
My Keycloak use https (self signed certificate)
My alfresco-global.properties (Alfresco Repository)
authentication.chain=identity-service1:identity-service,alfrescoNtlm1:alfrescoNtlm
identity-service.enable-basic-auth=true
identity-service.authentication.validation.failure.silent=false
identity-service.auth-server-url=https://192.168.10.25/auth
identity-service.realm=guru
identity-service.resource=alfresco-client
identity-service.public-client=true
identity-service.ssl-required=none
csrf.filter.referer=https://192.168.11.22:443
csrf.filter.origin=https://192.168.11.22:443/*
aims.enabled=true
aims.realm=guru
aims.resource=alfresco-client
aims.authServerUrl=https://192.168.10.25/auth
aims.publicClient=true
My share-config-custom.xml (Alfresco Share)
<alfresco-config>
<config evaluator="string-compare" condition="Users" replace="true">
<users>
<username-min-length>2</username-min-length>
<password-min-length>3</password-min-length>
<show-authorization-status>false</show-authorization-status>
</users>
<enable-external-users-panel>false</enable-external-users-panel>
</config>
<config evaluator="string-compare" condition="AIMS">
<enabled>true</enabled>
<realm>guru</realm>
<resource>alfresco-client</resource>
<authServerUrl>https://192.168.10.25/auth</authServerUrl>
<sslRequired>none</sslRequired>
<publicClient>true</publicClient>
</config>
</alfresco-config>
When I start alfresco with docker compose command. It show error like this
alfresco_1 | 2022-03-01 06:41:33,478 WARN [context.support.XmlWebApplicationContext] [main] Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'patch.updateAdminUserWhenDefault' defined in URL [jar:file:/usr/local/tomcat/webapps/alfresco/WEB-INF/lib/alfresco-repository-12.23.jar!/alfresco/patch/patch-services-context.xml]: Invocation of init method failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'authenticationComponent' defined in URL [jar:file:/usr/local/tomcat/webapps/alfresco/WEB-INF/lib/alfresco-repository-12.23.jar!/alfresco/subsystems/Authentication/identity-service/identity-service-authentication-context.xml]: Cannot resolve reference to bean 'authenticatorAuthzClient' while setting bean property 'authenticatorAuthzClient'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'authenticatorAuthzClient': FactoryBean threw exception on object creation; nested exception is java.lang.RuntimeException: Could not obtain configuration from server [https://192.168.10.25/auth/realms/guru/.well-known/uma2-configuration].
alfresco_1 | 2022-03-01 06:41:33,854 INFO [management.subsystems.ChildApplicationContextFactory] [main] Stopping 'Authentication' subsystem, ID: [Authentication, managed, alfrescoNtlm1]
alfresco_1 | 2022-03-01 06:41:33,856 INFO [management.subsystems.ChildApplicationContextFactory] [main] Stopped 'Authentication' subsystem, ID: [Authentication, managed, alfrescoNtlm1]
alfresco_1 | 2022-03-01 06:41:33,866 ERROR [web.context.ContextLoader] [main] Context initialization failed
alfresco_1 | org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'patch.updateAdminUserWhenDefault' defined in URL [jar:file:/usr/local/tomcat/webapps/alfresco/WEB-INF/lib/alfresco-repository-12.23.jar!/alfresco/patch/patch-services-context.xml]: Invocation of init method failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'authenticationComponent' defined in URL [jar:file:/usr/local/tomcat/webapps/alfresco/WEB-INF/lib/alfresco-repository-12.23.jar!/alfresco/subsystems/Authentication/identity-service/identity-service-authentication-context.xml]: Cannot resolve reference to bean 'authenticatorAuthzClient' while setting bean property 'authenticatorAuthzClient'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'authenticatorAuthzClient': FactoryBean threw exception on object creation; nested exception is java.lang.RuntimeException: Could not obtain configuration from server [https://192.168.10.25/auth/realms/guru/.well-known/uma2-configuration].
[Alfresco Repository Error]
: https://i.stack.imgur.com/4yHl4.jpg
[Alfreso Share Error][1]
: https://i.stack.imgur.com/FePSJ.jpg
But if I use another Keycloak Server on Public Cloud with Valid Certificate (Lets Encrypt) It can work without problem.
My Question is, How to configure alfresco to use with Keycloak Internal Server which use Self Sign Certificate.
Thank you
I ran my integration test locally, this works fine. But when try running jenkins, it fails.
This integration test contain embedded mongodb. The integration test is below:
#RunWith(SpringRunner.class)
#SpringBootTest
#EnableAutoConfiguration
public class MongoDbSpringUnitTest {
#Autowired
PriceRepository priceRepository;
#Test
public void testSavePriceMongoRepo() {
priceRepository.deleteAll();
Price price = priceRepository.save(new Price("1234productId", 24.5f));
// System.out.println("id : "+price);
assertEquals(0,24.5f, price.getCost());
assertNotNull("id is autogenerate", price.getId());
}
getting below error:
java.lang.IllegalStateException: Failed to load ApplicationContext
Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'priceController': Unsatisfied dependency expressed through field 'priceRepository'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'priceRepository': 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/autoconfigure/data/mongo/MongoDataAutoConfiguration.class]: Unsatisfied dependency expressed through method 'mongoTemplate' parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'mongoDbFactory' defined in class path resource [org/springframework/boot/autoconfigure/data/mongo/MongoDataAutoConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.data.mongodb.core.MongoDbFactorySupport]: Factory method 'mongoDbFactory' threw exception; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'embeddedMongoServer' defined in class path resource
[org/springframework/boot/autoconfigure/mongo/embedded/EmbeddedMongoAutoConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [de.flapdoodle.embed.mongo.MongodExecutable]: Factory method 'embeddedMongoServer' threw exception; nested exception is java.lang.IllegalArgumentException: this version does not support 32Bit: Version{3.5.5}:Windows:B32
above error show that embebbed db server cannot installed on 32 bit machine. I am not sure jenkins only support 32-bits. I am using jenkins 2.164.2.
The full code is present in below github:
https://github.com/ranjit5311/MicroServiceCode
Please let me know to resolve this issue.
Thanks,
Ranjit Kumar
After installing new version of Jenkins 2.164.3, resolved this issue.
I am trying to run local grails app in terminal (well, in Pycharm) and it fails with this:
[WARN] 2017-11-28 13:16:26,836 (springframework.jdbc.datasource.LazyConnectionDataSourceProxy:warn:189) | Could not retrieve default auto-commit and transaction isolation settings
org.postgresql.util.PSQLException: This ResultSet is closed.
at org.postgresql.jdbc2.AbstractJdbc2ResultSet.checkClosed(AbstractJdbc2ResultSet.java:2852)
at org.postgresql.jdbc2.AbstractJdbc2ResultSet.setFetchSize(AbstractJdbc2ResultSet.java:1875)
at org.postgresql.jdbc4.Jdbc4Statement.createResultSet(Jdbc4Statement.java:37)
at org.postgresql.jdbc2.AbstractJdbc2Statement$StatementResultHandler.handleResultRows(AbstractJdbc2Statement.java:219)
at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1816)
at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:255)
at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:559)
at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:403)
at org.postgresql.jdbc2.AbstractJdbc2Connection.execSQLUpdate(AbstractJdbc2Connection.java:376)
at org.postgresql.jdbc2.AbstractJdbc2Connection.getTransactionIsolation(AbstractJdbc2Connection.java:898)
at org.eclipse.jetty.server.handler.ContextHandler.startContext(ContextHandler.java:733)
at org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:233)
at org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1214)
at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:676)
at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:455)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:59)
at org.eclipse.jetty.server.handler.HandlerWrapper.doStart(HandlerWrapper.java:90)
at org.eclipse.jetty.server.Server.doStart(Server.java:261)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:59)
at org.grails.jetty.JettyServer.startServer(JettyServer.groovy:134)
at org.grails.jetty.JettyServer.start(JettyServer.groovy:99)
at _GrailsRun$_run_closure1.doCall(_GrailsRun.groovy:60)
at RunApp$_run_closure1.doCall(RunApp.groovy:33)
[WARN] 2017-11-28 13:16:27,152 (engine.jdbc.internal.JdbcServicesImpl:configure:195) | HHH000341: Could not obtain connection metadata : This ResultSet is closed.
[WARN] 2017-11-28 13:16:27,165 (grails.commons.spring.GrailsWebApplicationContext:warn:189) | Exception encountered during context initialization - cancelling refresh attempt
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'transactionManagerPostProcessor': 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 java.lang.NullPointerException
at org.eclipse.jetty.server.handler.ContextHandler.startContext(ContextHandler.java:733)
at org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:233)
at org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1214)
at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:676)
at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:455)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:59)
at org.eclipse.jetty.server.handler.HandlerWrapper.doStart(HandlerWrapper.java:90)
at org.eclipse.jetty.server.Server.doStart(Server.java:261)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:59)
at org.grails.jetty.JettyServer.startServer(JettyServer.groovy:134)
at org.grails.jetty.JettyServer.start(JettyServer.groovy:99)
at _GrailsRun$_run_closure1.doCall(_GrailsRun.groovy:60)
at RunApp$_run_closure1.doCall(RunApp.groovy:33)
Caused by: 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 java.lang.NullPointerException
... 13 more
I have postgres instance running in docker.
Version of grails is 2.4.5.
I have Mac OS. I am behind proxy.
The grails was compiled successfully before and also some tests passed.
Unfortunately I have no idea what could be wrong and what should I try. I have no clue what to look for.
I will be very glad for any suggestion which direction to look for!
Thanks! :)
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.