compiles and starts. registration still fails

This commit is contained in:
Antonis Lempesis 2021-10-15 20:31:03 +00:00
parent f866810dfd
commit c09f7a534e
7 changed files with 273 additions and 38 deletions

View File

@ -1,9 +1,10 @@
FROM tomcat:7.0.90-jre8
#FROM tomcat:7.0.90-jre8
FROM tomcat:8.5.71-jre8-openjdk-bullseye
MAINTAINER "pkanakakis@di.uoa.gr"
RUN ["rm", "-fr", "/usr/local/tomcat/webapps/ROOT"]
COPY ./target/uoa-repository-manager-service.war /usr/local/tomcat/webapps/uoa-repository-manager-service.war
#COPY src/main/resources/dnet-override-new.properties /usr/local/tomcat/lib/dnet-override.properties
COPY src/main/resources/application.properties /usr/local/tomcat/lib/dnet-override.properties
COPY validator.env /usr/local/tomcat/lib/dnet-override.properties
#COPY src/main/resources/application.properties /usr/local/tomcat/lib/application.properties
#COPY src/main/resources/email-texts.properties /usr/local/tomcat/lib/email-texts.properties
VOLUME /var/log/uoa-repository-manager-service:/var/log/uoa-repository-manager-service/

160
pom.xml
View File

@ -20,25 +20,107 @@
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
<exclusions>
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-logging</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-log4j2</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<version>${spring.boot.version}</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jdbc</artifactId>
<version>${spring.boot.version}</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-actuator-autoconfigure</artifactId>
<version>${spring.boot.version}</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
<!--<scope>provided</scope>-->
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-redis</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-validation</artifactId>
</dependency>
<!-- https://mvnrepository.com/artifact/org.springframework.cloud/spring-cloud-starter-netflix-hystrix -->
<!--
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-netflix-hystrix</artifactId>
<version>2.2.9.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-bootstrap</artifactId>
<version>3.0.1</version>
</dependency>
-->
<!--
<dependency>
<groupId>javax.el</groupId>
<artifactId>javax.el-api</artifactId>
<version>3.0.0</version>
</dependency>
-->
<dependency>
<groupId>eu.dnetlib</groupId>
<artifactId>uoa-clients</artifactId>
<version>[2.0.0-SNAPSHOT, 3.0.0)</version>
<exclusions>
<exclusion>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
</exclusion>
<exclusion>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
</exclusion>
<exclusion>
<groupId>com.google.gwt</groupId>
<artifactId>gwt-user</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>eu.dnetlib</groupId>
<artifactId>dnet-runtime</artifactId>
<version>1.0.2-SNAPSHOT</version>
<exclusions>
<exclusion>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>eu.dnetlib</groupId>
<artifactId>uoa-hcm</artifactId>
<version>[2.0.0-SNAPSHOT, 3.0.0)</version>
<exclusions>
<exclusion>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
</exclusion>
</exclusions>
</dependency>
<!-- <dependency>-->
<!-- <groupId>org.springframework</groupId>-->
@ -64,6 +146,10 @@
<groupId>cglib</groupId>
<artifactId>cglib</artifactId>
</exclusion>
<exclusion>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
@ -99,11 +185,11 @@
<artifactId>oai4j</artifactId>
<version>[0.6b1,)</version>
</dependency>
<!-- <dependency>-->
<!-- <groupId>xalan</groupId>-->
<!-- <artifactId>xalan</artifactId>-->
<!-- <version>2.7.2</version>-->
<!-- </dependency>-->
<dependency>
<groupId>xalan</groupId>
<artifactId>xalan</artifactId>
<version>2.7.2</version>
</dependency>
<!-- <dependency>-->
<!-- <groupId>xerces</groupId>-->
@ -111,19 +197,20 @@
<!-- <version>2.11.0</version>-->
<!-- </dependency>-->
<!--
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
<version>2.5.1</version>
<version>2.9.4</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.5.1</version>
<version>2.9.4</version>
<scope>compile</scope>
</dependency>
-->
<!-- <dependency>-->
<!-- <groupId>org.springframework</groupId>-->
<!-- <artifactId>spring-context</artifactId>-->
@ -204,15 +291,27 @@
<dependency>
<groupId>org.springframework.session</groupId>
<artifactId>spring-session-data-redis</artifactId>
<version>1.3.1.RELEASE</version>
</dependency>
<!--
<dependency>
<groupId>org.springframework.session</groupId>
<artifactId>spring-session-data-redis</artifactId>
<version>2.5.1</version>
<type>pom</type>
</dependency>
</dependency>
-->
<!-- https://mvnrepository.com/artifact/redis.clients/jedis -->
<dependency>
<groupId>redis.clients</groupId>
<artifactId>jedis</artifactId>
<version>2.9.0</version>
</dependency>
<version>${jedis.version}</version>
<!--<version>3.7.0</version>-->
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-pool2</artifactId>
</dependency>
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
@ -224,18 +323,18 @@
<artifactId>cors-filter</artifactId>
<version>2.5</version>
</dependency>
<dependency>
<groupId>com.netflix.hystrix</groupId>
<artifactId>hystrix-core</artifactId>
<version>1.5.18</version>
</dependency>
</dependency>
<!--
<dependency>
<groupId>com.netflix.rxjava</groupId>
<artifactId>rxjava-core</artifactId>
<version>0.20.7</version>
</dependency>
-->
<!-- https://mvnrepository.com/artifact/javax.xml.ws/jaxws-api -->
<dependency>
<groupId>javax.xml.ws</groupId>
@ -315,9 +414,23 @@
</dependencies>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.session</groupId>
<artifactId>spring-session-bom</artifactId>
<version>2021.0.2</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<build>
<outputDirectory>${project.build.directory}/${project.build.finalName}/WEB-INF/classes</outputDirectory>
<plugins>
<!--
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
@ -328,7 +441,6 @@
<encoding>UTF-8</encoding>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
@ -336,7 +448,13 @@
<configuration>
<failOnMissingWebXml>false</failOnMissingWebXml>
</configuration>
</plugin>
</plugin>
-->
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>cz.habarta.typescript-generator</groupId>
<artifactId>typescript-generator-maven-plugin</artifactId>
@ -396,4 +514,4 @@
</snapshots>
</repository>
</repositories>
</project>
</project>

View File

@ -1,16 +1,79 @@
package eu.dnetlib.repo.manager.config;
import org.bouncycastle.util.Arrays;
import org.springframework.beans.factory.config.PropertyPlaceholderConfigurer;
import eu.dnetlib.api.enabling.ISLookUpService;
import eu.dnetlib.api.functionality.ValidatorService;
import eu.dnetlib.clients.enabling.islookup.ws.ISLookUpClient;
import eu.dnetlib.clients.functionality.validator.ws.ValidatorWebService;
import eu.dnetlib.clients.functionality.validator.ws.ValidatorWebServiceClient;
import eu.dnetlib.domain.enabling.Vocabulary;
import gr.uoa.di.driver.enabling.ISLookUp;
import gr.uoa.di.driver.enabling.islookup.ISLookUpImpl;
import gr.uoa.di.driver.util.ServiceLocator;
import gr.uoa.di.driver.util.StaticServiceLocator;
import gr.uoa.di.driver.xml.VocabularyXmlConverter;
import org.apache.cxf.frontend.ClientProxyFactoryBean;
import org.apache.cxf.jaxws.JaxWsProxyFactoryBean;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.*;
import org.springframework.context.support.PropertySourcesPlaceholderConfigurer;
import org.springframework.core.io.support.PathMatchingResourcePatternResolver;
import java.io.IOException;
@Configuration
@ImportResource("classpath*:/gr/uoa/di/driver/app/springContext-commons.xml")
//@ImportResource({"classpath*:/gr/**/springContext-*.xml","/eu/dnetlib/clients/ws/springContext-locatorFactory.xml","/eu/dnetlib/soap/cxf/applicationContext-eprbuilders.xml","/eu/dnetlib/enabling/hcm/springContext-hcmService.xml"})
@ImportResource("application-compat.xml")
@PropertySource("application-compat.properties")
public class Config {
@Value("${ISLookUpService.url}")
private String lookupURL;
@Value("${ValidatorService.url}")
private String validatorUrl;
private ServiceLocator<ISLookUpService> createIsLookupServiceLocator() throws Exception {
JaxWsProxyFactoryBean factory = new JaxWsProxyFactoryBean();
//factory.setServiceClass(eu.dnetlib.services.ISLookUpService.class);
factory.setServiceClass(eu.dnetlib.enabling.is.lookup.rmi.ISLookUpService.class);
factory.setAddress(lookupURL);
//eu.dnetlib.services.ISLookUpService client = (eu.dnetlib.services.ISLookUpService) factory.create();
eu.dnetlib.enabling.is.lookup.rmi.ISLookUpService client = (eu.dnetlib.enabling.is.lookup.rmi.ISLookUpService) factory.create();
ISLookUpClient service = new ISLookUpClient();
service.setWebService(client);
StaticServiceLocator<ISLookUpService> locator = new StaticServiceLocator<>();
locator.setService(service);
return locator;
}
@Bean(name="vocabularyLookUp")
public ISLookUp<Vocabulary> createVocabularyLookUp() throws Exception {
ISLookUpImpl<Vocabulary> lookUp = new ISLookUpImpl<>();
lookUp.setLookupLocator(createIsLookupServiceLocator());
lookUp.setConverter(new VocabularyXmlConverter());
return lookUp;
}
@Bean("validatorServiceLocator")
public ServiceLocator<ValidatorService> createValidatorServiceLocator() {
JaxWsProxyFactoryBean factory = new JaxWsProxyFactoryBean();
factory.setServiceClass(ValidatorWebService.class);
factory.setAddress(validatorUrl);
ValidatorWebService service = (ValidatorWebService) factory.create();
ValidatorWebServiceClient client = new ValidatorWebServiceClient();
client.setWebService(service);
StaticServiceLocator<ValidatorService> locator = new StaticServiceLocator<>();
locator.setService(client);
return locator;
}
}

View File

@ -258,6 +258,9 @@ public class RepositoryServiceImpl implements RepositoryService {
String rs = restTemplate.postForObject(uriComponents.toUri(), requestFilter, String.class);
JSONArray jsonArray = (JSONArray) new JSONObject(rs).get("datasourceInfo");
while (jsonArray.length() > 0) {
LOGGER.debug("json: " + jsonArray);
resultSet.addAll(mapper.readValue(String.valueOf(jsonArray),
mapper.getTypeFactory().constructCollectionType(List.class, RepositorySnippet.class)));
page += 1;

View File

@ -9,7 +9,8 @@ import org.springframework.security.core.context.SecurityContext;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.security.oauth2.common.exceptions.UnauthorizedClientException;
import org.springframework.security.web.context.HttpSessionSecurityContextRepository;
import org.springframework.session.ExpiringSession;
import org.springframework.session.Session;
//import org.springframework.session.ExpiringSession;
import org.springframework.session.FindByIndexNameSessionRepository;
import org.springframework.stereotype.Service;
@ -28,11 +29,11 @@ public class AuthoritiesUpdater extends HttpSessionSecurityContextRepository {
public void update(String email, Collection<? extends GrantedAuthority> authorities) {
if (sessions != null) {
Map<String, ExpiringSession> map = sessions.
Map<String, Session> map = sessions.
findByIndexNameAndIndexValue(FindByIndexNameSessionRepository.PRINCIPAL_NAME_INDEX_NAME, email);
if (map != null) {
logger.debug(map.values().toArray().length);
for (ExpiringSession session : map.values()) {
for (Session session : map.values()) {
logger.debug(session.getId());
if (!session.isExpired()) {
SecurityContext securityContext = session.getAttribute(SPRING_SECURITY_CONTEXT_KEY);

View File

@ -7,4 +7,43 @@ is.registry.creatorId = ${transport.soap.baseAddress}
openaire.db.driverClassName = org.postgresql.Driver
openaire.db.url = jdbc:postgresql://node1.d.openaire.research-infrastructures.eu:5432/dnet_openaire
openaire.db.username = dnet
openaire.db.password = dnetPwd
openaire.db.password = dnetPwd
transport.soap.baseAddress=http://${container.hostname}:${container.port}/${container.context}
container.context=/
infrastructure.name=dev
transport.soap.force.local.address=false
services.hcm.serviceName=hcmService
services.common.nkua.useCache = true
ISLookUpService.url= INVALID LINK!!! ISLookUpService
ISRegistryService.url= INVALID LINK!!! ISRegistryService
ResultSetService.url= INVALID LINK!!! ResultSetService
ISSNService.url= INVALID LINK!!! ISSNService
DBService.url= INVALID LINK!!! DBService
ActionManagerService.url = INALVID LINK!!! action Service
A2Service.url= INVALID LINK!!! A2Service
UserProfileService.url= INVALID LINK!!! UserProfileService
IndexService.url= INVALID LINK!!! IndexService
SearchService.url= INVALID LINK!!! SearchService
CommunityService.url= INVALID LINK!!! CommunityService
CollectionService.url= INVALID LINK!!! CollectionService
PublisherService.url= INVALID LINK!!! PublisherService
RecommendationService.url= INVALID LINK!!! RecommendationService
ValidatorService.url=http://88.197.53.69:8080/uoa-validator-service/services/validatorWebService
ForumService.url = INVALID LINK!!! ForumService
RatingService.url = INVALID LINK!!! RatingService
WebInterfaceService.url = INVALID LINK!!! WebInterfaceService
DatasourceManagerService.url = https://dev-openaire.d4science.org:443/is/services/datasourceManager
MDStoreService.url = INVALID LINK!!! MDStoreService
services.similarityService.ws.url = INVALID LINK!!! similarityService
services.alertService.ws.url = INVALID LINK!!! alertService
services.notificationService.ws.url = INVALID LINK!!! notificationService
services.conversionService.ws.url = INVALID LINK!!! conversionService
services.registration.delay = 3600
services.registration.default.hnmlocator = nullHNMLocator
services.registration.default.removeRegistration=true

View File

@ -73,7 +73,7 @@ services.repomanager.mail.replyTo = test.openaire@gmail.com
ISLookUpService.url = https://dev-openaire.d4science.org:443/is/services/isLookUp
ISRegistryService.url = https://dev-openaire.d4science.org:443/is/services/isRegistry
ISSNService.url = https://dev-openaire.d4science.org:443/is/services/isSN
ValidatorService.url=http://estella.athenarc.gr:8080/validator-service/services/validatorWebService
ValidatorService.url=http://88.197.53.69:8080/uoa-validator-service/services/validatorWebService
# LDAP
#services.validator.ldap.address = 88.197.53.113
@ -100,11 +100,11 @@ redis.host = localhost
redis.port = 6379
redis.password = 2106875370
oidc.dev.home = http://localhost:8480/uoa-repository-manager-service/openid_connect_login
webapp.dev.front = http://localhost:4200/dashboard
oidc.dev.home = http://88.197.53.69/api/openid_connect_login
webapp.dev.front = http://88.197.53.69/join
services.repomanager.db.driverClassName=org.postgresql.Driver
services.repomanager.db.url=jdbc:postgresql://194.177.192.119:5432/repomanager
services.repomanager.db.url=jdbc:postgresql://localhost:5432/repomanager
services.repomanager.db.username=dnet
services.repomanager.db.password=dnetPwd
#infrastructure.name=integration
@ -155,3 +155,13 @@ services.broker.url=http://broker1-dev-dnet.d4science.org
services.broker.port=8080
services.broker.api=api/
services.broker.openaire=openaireBroker
oidc.url.base=https://aai.openaire.eu
oidc.issuer=${oidc.url.base}/oidc/
aai.registry.url=${oidc.url.base}/registry/
aai.registry.coid=2
aai.registry.production=false
aai.registry.authentication.username=provide_openaire
aai.registry.authentication.password=u8WfYv2R^f#y7G98