I cannot run jhipster application using the latest jhipster version 3.0 - jhipster

I'm using the new version of jhipster 3.0 , I created a jhipster application and when I run my application I had no error but no thing was displayed on my browser I cannot understand the problem.
I import my application to intellij and I run it from intellij.
Here is what I get in the intellij run console:
2016-03-25 01:39:33.675 DEBUG 3220 --- [nio-8080-exec-1]c.lyance.test.aop.logging.LoggingAspect : Enter: org.springframework.boot.actuate.audit.AuditEventRepository.add() with argument[s] = [AuditEvent [timestamp=Fri Mar 25 01:39:33 GMT-08:00 2016, principal=anonymousUser, type=AUTHORIZATION_FAILURE, data={type=org.springframework.security.access.AccessDeniedException, message=Access is denied}]] 2016-03-25 01:39:33.736 DEBUG 3220 --- [nio-8080-exec-1] c.lyance.test.aop.logging.LoggingAspect : Exit: org.springframework.boot.actuate.audit.AuditEventRepository.add() with result = null 2016-03-25 01:39:34.094 DEBUG 3220 --- [nio-8080-exec-1] c.l.t.s.Http401UnauthorizedEntryPoint : Pre-authenticated entry point called. Rejecting access 2016-03-25 01:39:39.922 DEBUG 3220 --- [nio-8080-exec-5] c.lyance.test.aop.logging.LoggingAspect : Enter: org.springframework.boot.actuate.audit.AuditEventRepository.add() with argument[s] = [AuditEvent [timestamp=Fri Mar 25 01:39:39 GMT-08:00 2016, principal=anonymousUser, type=AUTHORIZATION_FAILURE, data={type=org.springframework.security.access.AccessDeniedException, message=Access is denied}]]2016-03-25 01:39:39.923 DEBUG 3220 --- [nio-8080-exec-5] c.lyance.test.aop.logging.LoggingAspect : Exit:org.springframework.boot.actuate.audit.AuditEventRepository.add() with result = null 2016-03-25 01:39:39.923 DEBUG 3220 --- [nio-8080-exec-5] c.l.t.s.Http401UnauthorizedEntryPoint : Pre-authenticated entry point called. Rejecting access 2016-03-25 02:03:14.549 DEBUG 3220 --- [nio-8080-exec-6] c.lyance.test.aop.logging.LoggingAspect : Enter: org.springframework.boot.actuate.audit.AuditEventRepository.add() with argument[s] = [AuditEvent [timestamp=Fri Mar 25 02:03:11 GMT-08:00 2016, principal=anonymousUser, type=AUTHORIZATION_FAILURE, data={type=org.springframework.security.access.AccessDeniedException, message=Access is denied}]]2016-03-25 02:03:15.076 DEBUG 3220 --- [nio-8080-exec-6] c.lyance.test.aop.logging.LoggingAspect : Exit: org.springframework.boot.actuate.audit.AuditEventRepository.add() with result = null
2016-03-25 02:03:15.620 DEBUG 3220 --- [nio-8080-exec-6] c.l.t.s.Http401UnauthorizedEntryPoint : Pre-authenticated entry point called. Rejecting access
2016-03-25 02:03:21.547 DEBUG 3220 --- [nio-8080-exec-9] c.lyance.test.aop.logging.LoggingAspect : Enter: org.springframework.boot.actuate.audit.AuditEventRepository.add() with argument[s] = [AuditEvent [timestamp=Fri Mar 25 02:03:21 GMT-08:00 2016, principal=anonymousUser, type=AUTHORIZATION_FAILURE, data={type=org.springframework.security.access.AccessDeniedException, message=Access is denied}]]
2016-03-25 02:03:21.548 DEBUG 3220 --- [nio-8080-exec-9] c.lyance.test.aop.logging.LoggingAspect : Exit: org.springframework.boot.actuate.audit.AuditEventRepository.add() with result = null
2016-03-25 02:03:21.549 DEBUG 3220 --- [nio-8080-exec-9] c.l.t.s.Http401UnauthorizedEntryPoint : Pre-authenticated entry point called. Rejecting access
2016-03-25 02:03:31.991 DEBUG 3220 --- [nio-8080-exec-6] c.lyance.test.aop.logging.LoggingAspect : Enter: org.springframework.boot.actuate.audit.AuditEventRepository.add() with argument[s] = [AuditEvent [timestamp=Fri Mar 25 02:03:31 GMT-08:00 2016, principal=anonymousUser, type=AUTHORIZATION_FAILURE, data={type=org.springframework.security.access.AccessDeniedException, message=Access is denied}]]
2016-03-25 02:03:31.992 DEBUG 3220 --- [nio-8080-exec-6] c.lyance.test.aop.logging.LoggingAspect : Exit: org.springframework.boot.actuate.audit.AuditEventRepository.add() with result = null
2016-03-25 02:03:31.992 DEBUG 3220 --- [nio-8080-exec-6] c.l.t.s.Http401UnauthorizedEntryPoint : Pre-authenticated entry point called. Rejecting access
2016-03-25 02:03:39.009 DEBUG 3220 --- [nio-8080-exec-2] c.lyance.test.aop.logging.LoggingAspect : Enter: org.springframework.boot.actuate.audit.AuditEventRepository.add() with argument[s] = [AuditEvent [timestamp=Fri Mar 25 02:03:39 GMT-08:00 2016, principal=anonymousUser, type=AUTHORIZATION_FAILURE, data={type=org.springframework.security.access.AccessDeniedException, message=Access is denied}]]
2016-03-25 02:03:39.009 DEBUG 3220 --- [nio-8080-exec-2] c.lyance.test.aop.logging.LoggingAspect : Exit: org.springframework.boot.actuate.audit.AuditEventRepository.add() with result = null
2016-03-25 02:03:39.010 DEBUG 3220 --- [nio-8080-exec-2] c.l.t.s.Http401UnauthorizedEntryPoint : Pre-authenticated entry point called. Rejecting access
2016-03-25 02:03:43.700 DEBUG 3220 --- [nio-8080-exec-1] c.lyance.test.aop.logging.LoggingAspect : Enter: org.springframework.boot.actuate.audit.AuditEventRepository.add() with argument[s] = [AuditEvent [timestamp=Fri Mar 25 02:03:43 GMT-08:00 2016, principal=anonymousUser, type=AUTHORIZATION_FAILURE, data={type=org.springframework.security.access.AccessDeniedException, message=Access is denied}]]
2016-03-25 02:03:43.701 DEBUG 3220 --- [nio-8080-exec-1] c.lyance.test.aop.logging.LoggingAspect : Exit: org.springframework.boot.actuate.audit.AuditEventRepository.add() with result = null
2016-03-25 02:03:43.701 DEBUG 3220 --- [nio-8080-exec-1] c.l.t.s.Http401UnauthorizedEntryPoint : Pre-authenticated entry point called. Rejecting access
2016-03-25 02:03:48.072 DEBUG 3220 --- [nio-8080-exec-9] c.lyance.test.aop.logging.LoggingAspect : Enter: org.springframework.boot.actuate.audit.AuditEventRepository.add() with argument[s] = [AuditEvent [timestamp=Fri Mar 25 02:03:48 GMT-08:00 2016, principal=anonymousUser, type=AUTHORIZATION_FAILURE, data={type=org.springframework.security.access.AccessDeniedException, message=Access is denied}]]
2016-03-25 02:03:48.072 DEBUG 3220 --- [nio-8080-exec-9] c.lyance.test.aop.logging.LoggingAspect : Exit: org.springframework.boot.actuate.audit.AuditEventRepository.add() with result = null
2016-03-25 02:03:48.073 DEBUG 3220 --- [nio-8080-exec-9] c.l.t.s.Http401UnauthorizedEntryPoint : Pre-authenticated entry point called. Rejecting access
2016-03-25 02:03:51.393 DEBUG 3220 --- [nio-8080-exec-5] c.lyance.test.aop.logging.LoggingAspect : Enter: org.springframework.boot.actuate.audit.AuditEventRepository.add() with argument[s] = [AuditEvent [timestamp=Fri Mar 25 02:03:51 GMT-08:00 2016, principal=anonymousUser, type=AUTHORIZATION_FAILURE, data={type=org.springframework.security.access.AccessDeniedException, message=Access is denied}]]
2016-03-25 02:03:51.393 DEBUG 3220 --- [nio-8080-exec-5] c.lyance.test.aop.logging.LoggingAspect : Exit: org.springframework.boot.actuate.audit.AuditEventRepository.add() with result = null
2016-03-25 02:03:51.421 DEBUG 3220 --- [nio-8080-exec-5] c.l.t.s.Http401UnauthorizedEntryPoint : Pre-authenticated entry point called. Rejecting access
2016-03-25 02:05:13.542 DEBUG 3220 --- [nio-8080-exec-7] c.lyance.test.aop.logging.LoggingAspect : Enter: org.springframework.boot.actuate.audit.AuditEventRepository.add() with argument[s] = [AuditEvent [timestamp=Fri Mar 25 02:05:13 GMT-08:00 2016, principal=anonymousUser, type=AUTHORIZATION_FAILURE, data={type=org.springframework.security.access.AccessDeniedException, message=Access is denied}]]
2016-03-25 02:05:13.543 DEBUG 3220 --- [nio-8080-exec-7] c.lyance.test.aop.logging.LoggingAspect : Exit: org.springframework.boot.actuate.audit.AuditEventRepository.add() with result = null
2016-03-25 02:05:13.544 DEBUG 3220 --- [nio-8080-exec-7] c.l.t.s.Http401UnauthorizedEntryPoint : Pre-authenticated entry point called. Rejecting access
2016-03-25 02:05:19.580 DEBUG 3220 --- [nio-8080-exec-1] c.lyance.test.aop.logging.LoggingAspect : Enter: org.springframework.boot.actuate.audit.AuditEventRepository.add() with argument[s] = [AuditEvent [timestamp=Fri Mar 25 02:05:19 GMT-08:00 2016, principal=anonymousUser, type=AUTHORIZATION_FAILURE, data={type=org.springframework.security.access.AccessDeniedException, message=Access is denied}]]
2016-03-25 02:05:19.581 DEBUG 3220 --- [nio-8080-exec-1] c.lyance.test.aop.logging.LoggingAspect : Exit: org.springframework.boot.actuate.audit.AuditEventRepository.add() with result = null
2016-03-25 02:05:19.582 DEBUG 3220 --- [nio-8080-exec-1] c.l.t.s.Http401UnauthorizedEntryPoint : Pre-authenticated entry point called. Rejecting access
here is the code of .yo-rc.json file :
{
"generator-jhipster": {
"jhipsterVersion": "3.0.0",
"baseName": "test2",
"packageName": "com.lyance.test",
"packageFolder": "com/lyance/test",
"serverPort": "8080",
"authenticationType": "oauth2",
"hibernateCache": "ehcache",
"clusteredHttpSession": "no",
"websocket": "spring-websocket",
"databaseType": "sql",
"devDatabaseType": "postgresql",
"prodDatabaseType": "postgresql",
"searchEngine": "no",
"buildTool": "maven",
"useSass": true,
"applicationType": "monolith",
"testFrameworks": [
"gatling"
],
"enableTranslation": true,
"nativeLanguage": "fr",
"languages": [
"fr"
]
}
}
npm install & bower install :
npm WARN optional Skipping failed optional dependency / chokidar/fsevents:
npm WARN notsup Not compatible with your operating system or architecture : fsevents#1.0.9

From your .yo-rc.json file, I can see that you use SASS, it's probable that CSS were not generated, try running gulp sass.
Also for your dev workflow, you should consider running both maven and gulp as explained in the doc (Using the Java server and Gulp together): https://jhipster.github.io/development/

Hello #chouchato and #gaël-marziou
Recently, I've had to face the chouchato's error too. And I took considerable time to find a way to fix it. How the error did no sense for me, I did those (many) steps like trial and error and then the problem doesn't appeared again:
npm = 3.8.9
node = 5.9.0
1) Update NPM
2) Update all npm packages to LTS versions
3) Update yoeman package too (now 1.8.1)
4) Follow #gaël-marziou's advise: delete directory node_modules/ and bower_components/
5) I had to run npm rebuild to recompile packages C++ for Sass
6) Ran npm install & bower install
That is it. Everything is working like a charm now.

Related

Multitenancy is not working in my JHIpster application

I have followed some links to create multi-tenancy in my JHipster application,but its not working.
https://docs.jboss.org/hibernate/orm/current/userguide/html_single/Hibernate_User_Guide.html#multitenacy
https://www.baeldung.com/hibernate-5-multitenancy
https://github.com/jgasmi/jhipster-mt/
I did following:
Added following in my application-dev.yml:
datasource:
type: com.zaxxer.hikari.HikariDataSource
url: jdbc:mysql://localhost:3306/myApp?useUnicode=true&characterEncoding=utf8&useSSL=false&useLegacyDatetimeCode=false&serverTimezone=UTC&createDatabaseIfNotExist=true
username: root
password: root
serverName: localhost
hikari:
poolName: Hikari
auto-commit: false
data-source-properties:
cachePrepStmts: true
prepStmtCacheSize: 250
prepStmtCacheSqlLimit: 2048
useServerPrepStmts: true
jpa:
database-platform: org.hibernate.dialect.MySQL5InnoDBDialect
database: MYSQL
show-sql: true
properties:
hibernate.id.new_generator_mappings: true
hibernate.cache.use_query_cache: false
hibernate.generate_statistics: true
hibernate.cache.use_minimal_puts: true
hibernate.cache.hazelcast.use_lite_member: true
hibernate.tenant_identifier_resolver : com.mycompany.myapp.multitenancy.TenantIdentifierResolver
hibernate.multi_tenant_connection_provider : com.mycompany.myapp.multitenancy.SchemaMultiTenantConnectionProviderImpl
hibernate.multiTenancy : SCHEMA
My TenantIdentifierResolver class:
public class TenantIdentifierResolver implements CurrentTenantIdentifierResolver {
#Override
public String resolveCurrentTenantIdentifier() {
return "myapp2";
}
#Override
public boolean validateExistingCurrentSessions() {
return true;
}
}
And my class SchemaMultiTenantConnectionProviderImpl looks as follows:
public class SchemaMultiTenantConnectionProviderImpl implements MultiTenantConnectionProvider, ServiceRegistryAwareService
{
private final Logger log = LoggerFactory.getLogger(SchemaMultiTenantConnectionProviderImpl.class);
DataSource dataSource;
#Override
public Connection getAnyConnection() throws SQLException {
return this.dataSource.getConnection();
}
#Override
public void releaseAnyConnection(Connection connection) throws SQLException {
try {
connection.createStatement().execute("USE myapp2;");
}
catch (SQLException e) {
throw new HibernateException("Could not alter JDBC connection to specified schema [public]", e);
}
connection.close();
}
#Override
public Connection getConnection(String tenantIdentifier) throws SQLException {
log.warn("Get Connection for Tenatd is:"+tenantIdentifier);
final Connection connection = getAnyConnection();
/*
* try { connection.setCatalog(tenantIdentifier); //
* connection.createStatement().execute("USE " + tenantIdentifier + ";"); //
* connection.setCatalog(tenantIdentifier); //
* connection.setSchema(tenantIdentifier); } catch (SQLException e) { throw new
* HibernateException("Could not alter JDBC connection to specified schema [" +
* tenantIdentifier + "]", e); }
*/
return connection;
}
#Override
public void releaseConnection(String tenantIdentifier, Connection connection) throws SQLException {
// try {
// connection.createStatement().execute("USE "+tenantIdentifier+";");
// }
// catch (SQLException e) {
// throw new HibernateException("Could not alter JDBC connection to specified schema [public]", e);
// }
connection.close();
}
#Override
public boolean supportsAggressiveRelease() {
return false;
}
#Override
public boolean isUnwrappableAs(Class unwrapType) {
return false;
}
#Override
public <T> T unwrap(Class<T> unwrapType) {
return null;
}
#Override
public void injectServices(ServiceRegistryImplementor serviceRegistry) {
Map lSettings = serviceRegistry.getService(ConfigurationService.class).getSettings();
DataSource localDs = (DataSource) lSettings.get("hibernate.connection.datasource");
dataSource = localDs;
}
}
I am just trying to see first that it should work, and then I can change it to be based on tenant logic, schema tenancy logic or database tenancy logic.
When I run the application following is the logs:
D:\java-project\jhipsterptest-eclipse-workspace\sample\multitennnacy>mvnw -e
[INFO] Error stacktraces are turned on.
[INFO] Scanning for projects...
[INFO]
[INFO] --------------------------< com.myapp:my-app >--------------------------
[INFO] Building My App 0.0.1-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] >>> spring-boot-maven-plugin:2.4.7:run (default-cli) > test-compile # my-app >>>
[INFO]
[INFO] --- maven-resources-plugin:3.2.0:copy-resources (default-resources) # my-app ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Using 'UTF-8' encoding to copy filtered properties files.
[INFO] Copying 4 resources
[INFO] Copying 19 resources
[INFO]
[INFO] --- maven-resources-plugin:3.2.0:resources (default-resources) # my-app ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Using 'UTF-8' encoding to copy filtered properties files.
[INFO] Copying 4 resources
[INFO] Copying 19 resources
[INFO]
[INFO] --- maven-enforcer-plugin:3.0.0-M3:enforce (enforce-versions) # my-app ---
[INFO]
[INFO] --- maven-enforcer-plugin:3.0.0-M3:enforce (enforce-dependencyConvergence) # my-app ---
[WARNING]
Dependency convergence error for net.java.dev.jna:jna:5.2.0 paths to dependency are:
+-com.myapp:my-app:0.0.1-SNAPSHOT
+-org.testcontainers:mysql:1.15.3
+-org.testcontainers:jdbc:1.15.3
+-org.testcontainers:database-commons:1.15.3
+-org.testcontainers:testcontainers:1.15.3
+-org.rnorth.visible-assertions:visible-assertions:2.1.2
+-net.java.dev.jna:jna:5.2.0
and
+-com.myapp:my-app:0.0.1-SNAPSHOT
+-org.testcontainers:mysql:1.15.3
+-org.testcontainers:jdbc:1.15.3
+-org.testcontainers:database-commons:1.15.3
+-org.testcontainers:testcontainers:1.15.3
+-com.github.docker-java:docker-java-transport-zerodep:3.2.8
+-net.java.dev.jna:jna:5.8.0
[WARNING]
Dependency convergence error for org.wildfly.common:wildfly-common:1.5.2.Final paths to dependency are:
+-com.myapp:my-app:0.0.1-SNAPSHOT
+-org.springframework.boot:spring-boot-starter-undertow:2.4.7
+-io.undertow:undertow-core:2.2.8.Final
+-org.jboss.xnio:xnio-api:3.8.0.Final
+-org.wildfly.common:wildfly-common:1.5.2.Final
and
+-com.myapp:my-app:0.0.1-SNAPSHOT
+-org.springframework.boot:spring-boot-starter-undertow:2.4.7
+-io.undertow:undertow-core:2.2.8.Final
+-org.jboss.xnio:xnio-api:3.8.0.Final
+-org.wildfly.client:wildfly-client-config:1.0.1.Final
+-org.wildfly.common:wildfly-common:1.2.0.Final
[WARNING]
Dependency convergence error for org.apiguardian:apiguardian-api:1.1.0 paths to dependency are:
+-com.myapp:my-app:0.0.1-SNAPSHOT
+-org.springframework.boot:spring-boot-starter-test:2.4.7
+-org.junit.jupiter:junit-jupiter:5.7.2
+-org.junit.jupiter:junit-jupiter-api:5.7.2
+-org.apiguardian:apiguardian-api:1.1.0
and
+-com.myapp:my-app:0.0.1-SNAPSHOT
+-org.springframework.boot:spring-boot-starter-test:2.4.7
+-org.junit.jupiter:junit-jupiter:5.7.2
+-org.junit.jupiter:junit-jupiter-api:5.7.2
+-org.junit.platform:junit-platform-commons:1.7.2
+-org.apiguardian:apiguardian-api:1.1.0
and
+-com.myapp:my-app:0.0.1-SNAPSHOT
+-org.springframework.boot:spring-boot-starter-test:2.4.7
+-org.junit.jupiter:junit-jupiter:5.7.2
+-org.junit.jupiter:junit-jupiter-params:5.7.2
+-org.apiguardian:apiguardian-api:1.1.0
and
+-com.myapp:my-app:0.0.1-SNAPSHOT
+-org.springframework.boot:spring-boot-starter-test:2.4.7
+-org.junit.jupiter:junit-jupiter:5.7.2
+-org.junit.jupiter:junit-jupiter-engine:5.7.2
+-org.apiguardian:apiguardian-api:1.1.0
and
+-com.myapp:my-app:0.0.1-SNAPSHOT
+-com.tngtech.archunit:archunit-junit5-engine:0.19.0
+-com.tngtech.archunit:archunit-junit5-engine-api:0.19.0
+-org.junit.platform:junit-platform-engine:1.7.2
+-org.apiguardian:apiguardian-api:1.1.0
and
+-com.myapp:my-app:0.0.1-SNAPSHOT
+-org.zalando:problem-spring-web:0.26.2
+-org.zalando:problem-violations:0.26.2
+-org.apiguardian:apiguardian-api:1.1.0
and
+-com.myapp:my-app:0.0.1-SNAPSHOT
+-org.zalando:problem-spring-web:0.26.2
+-org.zalando:problem-spring-common:0.26.2
+-org.apiguardian:apiguardian-api:1.1.0
and
+-com.myapp:my-app:0.0.1-SNAPSHOT
+-org.zalando:problem-spring-web:0.26.2
+-org.apiguardian:apiguardian-api:1.1.0
and
+-com.myapp:my-app:0.0.1-SNAPSHOT
+-org.zalando:problem-spring-web:0.26.2
+-org.zalando:faux-pas:0.8.0
+-org.apiguardian:apiguardian-api:1.0.0
[WARNING] Rule 0: org.apache.maven.plugins.enforcer.DependencyConvergence failed with message:
Failed while enforcing releasability. See above detailed error message.
[INFO]
[INFO] --- jacoco-maven-plugin:0.8.7:prepare-agent (pre-unit-tests) # my-app ---
[INFO] argLine set to -javaagent:C:\\Users\\sachin\\.m2\\repository\\org\\jacoco\\org.jacoco.agent\\0.8.7\\org.jacoco.agent-0.8.7-runtime.jar=destfile=D:\\java-project\\jhipsterptest-eclipse-workspace\\sample\\multitennnacy\\target\\jacoco.exec -Djava.security.egd=file:/dev/./urandom -Xmx256m
[INFO]
[INFO] --- properties-maven-plugin:1.0.0:read-project-properties (default) # my-app ---
[INFO]
[INFO] --- checksum-maven-plugin:1.10:files (default) # my-app ---
[INFO]
[INFO] --- maven-antrun-plugin:3.0.0:run (eval-frontend-checksum) # my-app ---
[INFO] Executing tasks
[INFO] [copy] Copying 1 file to D:\java-project\jhipsterptest-eclipse-workspace\sample\multitennnacy\target
[INFO] Executed tasks
[INFO]
[INFO] --- frontend-maven-plugin:1.12.0:install-node-and-npm (install-node-and-npm) # my-app ---
[INFO] Node v14.17.1 is already installed.
[INFO] NPM 7.18.1 is already installed.
[INFO]
[INFO] --- frontend-maven-plugin:1.12.0:npm (npm install) # my-app ---
[INFO] Skipping execution.
[INFO]
[INFO] --- frontend-maven-plugin:1.12.0:npm (webapp build dev) # my-app ---
[INFO] Skipping execution.
[INFO]
[INFO] --- maven-compiler-plugin:3.8.1:compile (default-compile) # my-app ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 81 source files to D:\java-project\jhipsterptest-eclipse-workspace\sample\multitennnacy\target\classes
[INFO] /D:/java-project/jhipsterptest-eclipse-workspace/sample/multitennnacy/src/main/java/com/mycompany/myapp/multitenancy/ConnectionProviderFactory.java: D:\java-project\jhipsterptest-eclipse-workspace\sample\multitennnacy\src\main\java\com\mycompany\myapp\multitenancy\ConnectionProviderFactory.java uses unchecked or unsafe operations.
[INFO] /D:/java-project/jhipsterptest-eclipse-workspace/sample/multitennnacy/src/main/java/com/mycompany/myapp/multitenancy/ConnectionProviderFactory.java: Recompile with -Xlint:unchecked for details.
[INFO]
[INFO] --- maven-resources-plugin:3.2.0:testResources (default-testResources) # my-app ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Using 'UTF-8' encoding to copy filtered properties files.
[INFO] Copying 5 resources
[INFO]
[INFO] --- maven-compiler-plugin:3.8.1:testCompile (default-testCompile) # my-app ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 29 source files to D:\java-project\jhipsterptest-eclipse-workspace\sample\multitennnacy\target\test-classes
[INFO] /D:/java-project/jhipsterptest-eclipse-workspace/sample/multitennnacy/src/test/java/com/myapp/service/MailServiceIT.java: D:\java-project\jhipsterptest-eclipse-workspace\sample\multitennnacy\src\test\java\com\myapp\service\MailServiceIT.java uses or overrides a deprecated API.
[INFO] /D:/java-project/jhipsterptest-eclipse-workspace/sample/multitennnacy/src/test/java/com/myapp/service/MailServiceIT.java: Recompile with -Xlint:deprecation for details.
[INFO]
[INFO] <<< spring-boot-maven-plugin:2.4.7:run (default-cli) < test-compile # my-app <<<
[INFO]
[INFO]
[INFO] --- spring-boot-maven-plugin:2.4.7:run (default-cli) # my-app ---
[INFO] Attaching agents: []
??? ??? ??? ????????? ???????? ??????? ????????? ????????? ????????
??? ??? ??? ????????? ????????? ???????? ????????? ????????? ?????????
??? ????????? ??? ????????? ??????? ??? ??????? ?????????
??? ??? ????????? ??? ???????? ??????? ??? ??????? ????????
????????? ??? ??? ????????? ??? ???????? ??? ????????? ??? ????
??????? ??? ??? ????????? ??? ??????? ??? ????????? ??? ???
:: JHipster ? :: Running Spring Boot 2.4.7 ::
:: https://www.jhipster.tech ::
2021-07-14 10:46:05.956 DEBUG 24976 --- [kground-preinit] org.jboss.logging : Logging Provider: org.jboss.logging.Log4j2LoggerProvider
2021-07-14 10:46:05.988 INFO 24976 --- [ restartedMain] com.myapp.MyApp : Starting MyApp using Java 11.0.11 on SACHIN-MSI with PID 24976 (D:\java-project\jhipsterptest-eclipse-workspace\sample\multitennnacy\target\classes started by sachin in D:\java-project\jhipsterptest-eclipse-workspace\sample\multitennnacy)
2021-07-14 10:46:05.989 DEBUG 24976 --- [ restartedMain] com.myapp.MyApp : Running with Spring Boot v2.4.7, Spring v5.3.8
2021-07-14 10:46:05.989 INFO 24976 --- [ restartedMain] com.myapp.MyApp : The following profiles are active: dev,api-docs
2021-07-14 10:46:09.018 DEBUG 24976 --- [ restartedMain] i.m.c.u.i.logging.InternalLoggerFactory : Using SLF4J as the default logging framework
2021-07-14 10:46:09.217 DEBUG 24976 --- [ restartedMain] com.myapp.config.WebConfigurer : Registering CORS filter
2021-07-14 10:46:09.283 INFO 24976 --- [ restartedMain] com.myapp.config.WebConfigurer : Web application configuration, using profiles: dev
2021-07-14 10:46:09.283 INFO 24976 --- [ restartedMain] com.myapp.config.WebConfigurer : Web application fully configured
2021-07-14 10:46:09.570 DEBUG 24976 --- [ restartedMain] c.ehcache.core.Ehcache-usersByLogin : Initialize successful.
2021-07-14 10:46:09.592 DEBUG 24976 --- [ restartedMain] c.ehcache.core.Ehcache-usersByEmail : Initialize successful.
2021-07-14 10:46:09.595 DEBUG 24976 --- [ restartedMain] c.e.core.Ehcache-com.myapp.domain.User : Initialize successful.
2021-07-14 10:46:09.599 DEBUG 24976 --- [ restartedMain] c.e.c.E.myapp.domain.Authority : Initialize successful.
2021-07-14 10:46:09.602 DEBUG 24976 --- [ restartedMain] c.e.c.E.myapp.domain.User.authorities : Initialize successful.
2021-07-14 10:46:09.605 DEBUG 24976 --- [ restartedMain] c.e.c.Ehcache-com.myapp.domain.Tenant : Initialize successful.
2021-07-14 10:46:09.608 DEBUG 24976 --- [ restartedMain] c.e.c.Ehcache-com.myapp.domain.DbType : Initialize successful.
2021-07-14 10:46:09.622 DEBUG 24976 --- [ restartedMain] com.myapp.config.AsyncConfiguration : Creating Async Task Executor
2021-07-14 10:46:09.692 DEBUG 24976 --- [ restartedMain] com.myapp.config.LiquibaseConfiguration : Configuring Liquibase
2021-07-14 10:46:09.829 WARN 24976 --- [ my-app-task-1] t.j.c.liquibase.AsyncSpringLiquibase : Starting Liquibase asynchronously, your database might not be ready at startup!
2021-07-14 10:46:11.299 DEBUG 24976 --- [ restartedMain] com.myapp.security.jwt.TokenProvider : Using a Base64-encoded JWT secret key
2021-07-14 10:46:12.920 DEBUG 24976 --- [ restartedMain] t.j.c.apidoc.SpringfoxAutoConfiguration : Starting OpenAPI docs
2021-07-14 10:46:12.927 DEBUG 24976 --- [ restartedMain] t.j.c.apidoc.SpringfoxAutoConfiguration : Started OpenAPI docs in 5 ms
2021-07-14 10:46:13.623 INFO 24976 --- [ restartedMain] org.jboss.threads : JBoss Threads version 3.1.0.Final
2021-07-14 10:46:14.116 INFO 24976 --- [ restartedMain] com.myapp.MyApp : Started MyApp in 8.783 seconds (JVM running for 9.535)
2021-07-14 10:46:14.124 INFO 24976 --- [ restartedMain] com.myapp.MyApp :
----------------------------------------------------------
Application 'myApp' is running! Access URLs:
Local: http://localhost:8080/
External: http://192.168.43.1:8080/
Profile(s): [dev, api-docs]
----------------------------------------------------------
There are no error logs, but browser shows this.
Seems like I am missing something small, but not ablw to find it out.

Http status 500 with error message "Error when processing resource" when creating Sales Order with SDK

The OData Service I used is API_SALES_ORDER_SRV in SAP API Business Hub.
The payload to create sales order is as below. It works very good in SAP Gateway Client.
{
"DistributionChannel": "01",
"OrganizationDivision": "01",
"SalesOrderType": "***",
"SalesOrganization": "***",
"SoldToParty": "***",
"to_Item": [
{
"SalesOrderItem" : "10",
"RequestedQuantity": "10",
"Material": "***"
}
]
}
But when I create sales order with Cloud SDK, I got the following error message.
2019-11-12 19:51:02.870 ERROR 10392 --- [nio-8080-exec-8] c.b.h.service.MySalesOrderService : The endpoint responded with HTTP error code 500.
Full error message:
Error when processing resource
com.sap.cloud.sdk.datamodel.odata.helper.ODataVdmErrorResultHandler$ErpODataException: The endpoint responded with HTTP error code 500.
Full error message:
Error when processing resource
at com.sap.cloud.sdk.datamodel.odata.helper.ODataVdmErrorResultHandler.createException(ODataVdmErrorResultHandler.java:114)
at com.sap.cloud.sdk.datamodel.odata.helper.ODataVdmErrorResultHandler.createError(ODataVdmErrorResultHandler.java:94)
at com.sap.cloud.sdk.datamodel.odata.helper.ODataVdmErrorResultHandler.createError(ODataVdmErrorResultHandler.java:31)
at com.sap.cloud.sdk.odatav2.connectivity.internal.ODataConnectivityUtil.checkHttpStatus(ODataConnectivityUtil.java:217)
at com.sap.cloud.sdk.odatav2.connectivity.impl.ODataCreateRequestImpl.create(ODataCreateRequestImpl.java:275)
at com.sap.cloud.sdk.odatav2.connectivity.impl.ODataCreateRequestImpl.handleExecute(ODataCreateRequestImpl.java:391)
at com.sap.cloud.sdk.odatav2.connectivity.impl.ODataCreateRequestImpl.execute(ODataCreateRequestImpl.java:367)
at com.sap.cloud.sdk.datamodel.odata.helper.FluentHelperCreate.execute(FluentHelperCreate.java:155)
at com.bosch.hackathon.service.MySalesOrderService.createSalesOrder(MySalesOrderService.java:451)
at com.bosch.hackathon.controllers.MySalesOrderController.createSalesOrderSDK(MySalesOrderController.java:63)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:215)
at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:142)
at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:102)
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:895)
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:800)
at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87)
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1038)
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:942)
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:998)
at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:901)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:660)
at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:875)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:741)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at com.sap.cloud.sdk.cloudplatform.servlet.RequestAccessorFilter.lambda$doFilter$1(RequestAccessorFilter.java:71)
at com.sap.cloud.sdk.cloudplatform.thread.AbstractThreadContextExecutor.lambda$execute$0(AbstractThreadContextExecutor.java:317)
at com.sap.cloud.sdk.cloudplatform.thread.ThreadContextCallable.call(ThreadContextCallable.java:247)
at com.sap.cloud.sdk.cloudplatform.thread.AbstractThreadContextExecutor.execute(AbstractThreadContextExecutor.java:319)
at com.sap.cloud.sdk.cloudplatform.servlet.RequestAccessorFilter.doFilter(RequestAccessorFilter.java:71)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:99)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.springframework.web.filter.FormContentFilter.doFilterInternal(FormContentFilter.java:92)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.springframework.web.filter.HiddenHttpMethodFilter.doFilterInternal(HiddenHttpMethodFilter.java:93)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:200)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:199)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:490)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:139)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:74)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343)
at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:408)
at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:791)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1417)
at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Thread.java:748)
2019-11-12 19:51:02.888 WARN 10392 --- [nio-8080-exec-8] .m.m.a.ExceptionHandlerExceptionResolver : Resolved [com.bosch.hackathon.exception.BusinessException: The endpoint responded with HTTP error code 500.
Full error message:
Error when processing resource]
The code I used to create Sales order is as below. First I build an Sales Order Object and then use it as the parameter of method createSalesOrder.
private SalesOrder buildSalesOrderObject() {
SalesOrderItem item = SalesOrderItem.builder()
.salesOrderItem("myplant")
.material("mymaterial")
.requestedQuantity(new BigDecimal(10))
.build();
SalesOrder salesOrder = SalesOrder.builder()
.salesOrderType("YTA")
.salesOrganization("myso")
.distributionChannel("01")
.organizationDivision("01")
.soldToParty("party")
.item(item)
.build();
return salesOrder;
}
public SalesOrder createSalesOrder() throws BusinessException {
SalesOrder salesOrderCreated = buildSalesOrderObject();
try {
salesOrderCreated = salesOrderService.createSalesOrder(salesOrder)
.execute(DestinationUtil.getHttpDestinationT4X());
} catch (ODataException e) {
log.error(e.getMessage(), e);
throw BusinessException.convert(e);
}
return salesOrderCreated;
}
Could you take a look at this issue?
SAP Cloud SDK Version: 3.3.1
S/4HANA On-premise Version: 1909
Provide wire log.
2019-11-15 08:59:14.717 DEBUG 15276 --- [nio-8080-exec-5] h.i.c.PoolingHttpClientConnectionManager : Connection request: [route: {}->http://host:8091][total kept alive: 0; route allocated: 0 of 100; total allocated: 0 of 200]
2019-11-15 08:59:14.731 DEBUG 15276 --- [nio-8080-exec-5] h.i.c.PoolingHttpClientConnectionManager : Connection leased: [id: 0][route: {}->http://host:8091][total kept alive: 0; route allocated: 1 of 100; total allocated: 1 of 200]
2019-11-15 08:59:14.733 DEBUG 15276 --- [nio-8080-exec-5] o.a.http.impl.execchain.MainClientExec : Opening connection {}->http://host:8091
2019-11-15 08:59:14.944 DEBUG 15276 --- [nio-8080-exec-5] .i.c.DefaultHttpClientConnectionOperator : Connecting to host/ip1:8091
2019-11-15 08:59:15.161 DEBUG 15276 --- [nio-8080-exec-5] .i.c.DefaultHttpClientConnectionOperator : Connection established ip2:58702<->ip1:8091
2019-11-15 08:59:15.162 DEBUG 15276 --- [nio-8080-exec-5] o.a.http.impl.execchain.MainClientExec : Executing request GET /sap/opu/odata/sap/API_SALES_ORDER_SRV/$metadata HTTP/1.1
2019-11-15 08:59:15.162 DEBUG 15276 --- [nio-8080-exec-5] o.a.http.impl.execchain.MainClientExec : Proxy auth state: UNCHALLENGED
2019-11-15 08:59:15.163 DEBUG 15276 --- [nio-8080-exec-5] org.apache.http.headers : http-outgoing-0 >> GET /sap/opu/odata/sap/API_SALES_ORDER_SRV/$metadata HTTP/1.1
2019-11-15 08:59:15.163 DEBUG 15276 --- [nio-8080-exec-5] org.apache.http.headers : http-outgoing-0 >> com.sap.cloud.sdk.cloudplatform.connectivity.HttpClientWrapper$ApacheHttpHeader#65d86a53
2019-11-15 08:59:15.163 DEBUG 15276 --- [nio-8080-exec-5] org.apache.http.headers : http-outgoing-0 >> Host: host:8091
2019-11-15 08:59:15.163 DEBUG 15276 --- [nio-8080-exec-5] org.apache.http.headers : http-outgoing-0 >> Connection: Keep-Alive
2019-11-15 08:59:15.163 DEBUG 15276 --- [nio-8080-exec-5] org.apache.http.headers : http-outgoing-0 >> User-Agent: Apache-HttpClient/4.5.10 (Java/1.8.0_191)
2019-11-15 08:59:15.164 DEBUG 15276 --- [nio-8080-exec-5] org.apache.http.headers : http-outgoing-0 >> Accept-Encoding: gzip,deflate
2019-11-15 08:59:16.485 DEBUG 15276 --- [nio-8080-exec-5] org.apache.http.headers : http-outgoing-0 << HTTP/1.1 200 OK
2019-11-15 08:59:16.486 DEBUG 15276 --- [nio-8080-exec-5] org.apache.http.headers : http-outgoing-0 << set-cookie: sap-usercontext=sap-client=011; path=/
2019-11-15 08:59:16.486 DEBUG 15276 --- [nio-8080-exec-5] org.apache.http.headers : http-outgoing-0 << set-cookie: MYSAPSSO2=***; path=/; domain=***
2019-11-15 08:59:16.486 DEBUG 15276 --- [nio-8080-exec-5] org.apache.http.headers : http-outgoing-0 << set-cookie: SAP_SESSIONID_***_011=***; path=/
2019-11-15 08:59:16.486 DEBUG 15276 --- [nio-8080-exec-5] org.apache.http.headers : http-outgoing-0 << content-type: application/xml
2019-11-15 08:59:16.486 DEBUG 15276 --- [nio-8080-exec-5] org.apache.http.headers : http-outgoing-0 << content-length: 8058
2019-11-15 08:59:16.486 DEBUG 15276 --- [nio-8080-exec-5] org.apache.http.headers : http-outgoing-0 << last-modified: Mon, 21 Oct 2019 07:48:47 GMT
2019-11-15 08:59:16.486 DEBUG 15276 --- [nio-8080-exec-5] org.apache.http.headers : http-outgoing-0 << cache-control: max-age=0
2019-11-15 08:59:16.486 DEBUG 15276 --- [nio-8080-exec-5] org.apache.http.headers : http-outgoing-0 << dataserviceversion: 2.0
2019-11-15 08:59:16.486 DEBUG 15276 --- [nio-8080-exec-5] org.apache.http.headers : http-outgoing-0 << sap-processing-info: ODataBEP=,crp=,RAL=,st=,MedCacheHub=Table,codeployed=X,softstate=
2019-11-15 08:59:16.486 DEBUG 15276 --- [nio-8080-exec-5] org.apache.http.headers : http-outgoing-0 << sap-server: true
2019-11-15 08:59:16.486 DEBUG 15276 --- [nio-8080-exec-5] org.apache.http.headers : http-outgoing-0 << sap-perf-fesrec: 893169.000000
2019-11-15 08:59:16.487 DEBUG 15276 --- [nio-8080-exec-5] org.apache.http.headers : http-outgoing-0 << content-encoding: gzip
2019-11-15 08:59:16.492 DEBUG 15276 --- [nio-8080-exec-5] o.a.http.impl.execchain.MainClientExec : Connection can be kept alive indefinitely
2019-11-15 08:59:16.496 DEBUG 15276 --- [nio-8080-exec-5] o.a.h.c.protocol.ResponseProcessCookies : Cookie accepted [sap-usercontext="sap-client=011", version:0, domain:host, path:/, expiry:null]
2019-11-15 08:59:16.497 DEBUG 15276 --- [nio-8080-exec-5] o.a.h.c.protocol.ResponseProcessCookies : Cookie accepted [MYSAPSSO2="***", version:0, domain:***, path:/, expiry:null]
2019-11-15 08:59:16.497 DEBUG 15276 --- [nio-8080-exec-5] o.a.h.c.protocol.ResponseProcessCookies : Cookie accepted [SAP_SESSIONID_***_011="***", version:0, domain:host, path:/, expiry:null]
2019-11-15 08:59:16.621 DEBUG 15276 --- [nio-8080-exec-5] h.i.c.PoolingHttpClientConnectionManager : Connection [id: 0][route: {}->http://host:8091] can be kept alive indefinitely
2019-11-15 08:59:16.622 DEBUG 15276 --- [nio-8080-exec-5] h.i.c.DefaultManagedHttpClientConnection : http-outgoing-0: set socket timeout to 0
2019-11-15 08:59:16.622 DEBUG 15276 --- [nio-8080-exec-5] h.i.c.PoolingHttpClientConnectionManager : Connection released: [id: 0][route: {}->http://host:8091][total kept alive: 1; route allocated: 1 of 100; total allocated: 1 of 200]
2019-11-15 08:59:16.624 DEBUG 15276 --- [nio-8080-exec-5] o.a.h.client.protocol.RequestAddCookies : CookieSpec selected: default
2019-11-15 08:59:16.641 DEBUG 15276 --- [nio-8080-exec-5] o.a.h.client.protocol.RequestAddCookies : Cookie [version: 0][name: MYSAPSSO2][value: ***][domain: ***][path: /][expiry: null] match [host:8091/sap/opu/odata/sap/API_SALES_ORDER_SRV]
2019-11-15 08:59:16.642 DEBUG 15276 --- [nio-8080-exec-5] o.a.h.client.protocol.RequestAddCookies : Cookie [version: 0][name: SAP_SESSIONID_***_011][value: ***][domain: host][path: /][expiry: null] match [host:8091/sap/opu/odata/sap/API_SALES_ORDER_SRV]
2019-11-15 08:59:16.642 DEBUG 15276 --- [nio-8080-exec-5] o.a.h.client.protocol.RequestAddCookies : Cookie [version: 0][name: sap-usercontext][value: sap-client=011][domain: host][path: /][expiry: null] match [host:8091/sap/opu/odata/sap/API_SALES_ORDER_SRV]
2019-11-15 08:59:16.642 DEBUG 15276 --- [nio-8080-exec-5] o.a.h.client.protocol.RequestAuthCache : Auth cache not set in the context
2019-11-15 08:59:16.642 DEBUG 15276 --- [nio-8080-exec-5] h.i.c.PoolingHttpClientConnectionManager : Connection request: [route: {}->http://host:8091][total kept alive: 1; route allocated: 1 of 100; total allocated: 1 of 200]
2019-11-15 08:59:16.642 DEBUG 15276 --- [nio-8080-exec-5] h.i.c.PoolingHttpClientConnectionManager : Connection leased: [id: 0][route: {}->http://host:8091][total kept alive: 0; route allocated: 1 of 100; total allocated: 1 of 200]
2019-11-15 08:59:16.643 DEBUG 15276 --- [nio-8080-exec-5] h.i.c.DefaultManagedHttpClientConnection : http-outgoing-0: set socket timeout to 0
2019-11-15 08:59:16.643 DEBUG 15276 --- [nio-8080-exec-5] o.a.http.impl.execchain.MainClientExec : Executing request HEAD /sap/opu/odata/sap/API_SALES_ORDER_SRV HTTP/1.1
2019-11-15 08:59:16.643 DEBUG 15276 --- [nio-8080-exec-5] o.a.http.impl.execchain.MainClientExec : Proxy auth state: UNCHALLENGED
2019-11-15 08:59:16.643 DEBUG 15276 --- [nio-8080-exec-5] org.apache.http.headers : http-outgoing-0 >> HEAD /sap/opu/odata/sap/API_SALES_ORDER_SRV HTTP/1.1
2019-11-15 08:59:16.643 DEBUG 15276 --- [nio-8080-exec-5] org.apache.http.headers : http-outgoing-0 >> x-csrf-token: Fetch
2019-11-15 08:59:16.643 DEBUG 15276 --- [nio-8080-exec-5] org.apache.http.headers : http-outgoing-0 >> com.sap.cloud.sdk.cloudplatform.connectivity.HttpClientWrapper$ApacheHttpHeader#54937cbe
2019-11-15 08:59:16.643 DEBUG 15276 --- [nio-8080-exec-5] org.apache.http.headers : http-outgoing-0 >> Host: host:8091
2019-11-15 08:59:16.643 DEBUG 15276 --- [nio-8080-exec-5] org.apache.http.headers : http-outgoing-0 >> Connection: Keep-Alive
2019-11-15 08:59:16.643 DEBUG 15276 --- [nio-8080-exec-5] org.apache.http.headers : http-outgoing-0 >> User-Agent: Apache-HttpClient/4.5.10 (Java/1.8.0_191)
2019-11-15 08:59:16.643 DEBUG 15276 --- [nio-8080-exec-5] org.apache.http.headers : http-outgoing-0 >> Cookie: MYSAPSSO2=***; SAP_SESSIONID_***_011=***; sap-usercontext=sap-client=011
2019-11-15 08:59:16.643 DEBUG 15276 --- [nio-8080-exec-5] org.apache.http.headers : http-outgoing-0 >> Accept-Encoding: gzip,deflate
2019-11-15 08:59:16.902 DEBUG 15276 --- [nio-8080-exec-5] org.apache.http.headers : http-outgoing-0 << HTTP/1.1 200 OK
2019-11-15 08:59:16.903 DEBUG 15276 --- [nio-8080-exec-5] org.apache.http.headers : http-outgoing-0 << content-type: text/html
2019-11-15 08:59:16.903 DEBUG 15276 --- [nio-8080-exec-5] org.apache.http.headers : http-outgoing-0 << content-length: 0
2019-11-15 08:59:16.903 DEBUG 15276 --- [nio-8080-exec-5] org.apache.http.headers : http-outgoing-0 << x-csrf-token: jgGDK5ILPjPZmMUDQJmvLg==
2019-11-15 08:59:16.903 DEBUG 15276 --- [nio-8080-exec-5] org.apache.http.headers : http-outgoing-0 << dataserviceversion: 2.0
2019-11-15 08:59:16.903 DEBUG 15276 --- [nio-8080-exec-5] org.apache.http.headers : http-outgoing-0 << cache-control: no-store, no-cache, must-revalidate, max-age=0, post-check=0, pre-check=0
2019-11-15 08:59:16.903 DEBUG 15276 --- [nio-8080-exec-5] org.apache.http.headers : http-outgoing-0 << pragma: no-cache
2019-11-15 08:59:16.903 DEBUG 15276 --- [nio-8080-exec-5] org.apache.http.headers : http-outgoing-0 << expires: Tue, 03 Jul 2001 06:00:00 GMT
2019-11-15 08:59:16.903 DEBUG 15276 --- [nio-8080-exec-5] org.apache.http.headers : http-outgoing-0 << sap-processing-info: ODataBEP=,crp=,RAL=,st=,MedCacheHub=,codeployed=,softstate=
2019-11-15 08:59:16.903 DEBUG 15276 --- [nio-8080-exec-5] org.apache.http.headers : http-outgoing-0 << sap-server: true
2019-11-15 08:59:16.904 DEBUG 15276 --- [nio-8080-exec-5] org.apache.http.headers : http-outgoing-0 << sap-perf-fesrec: 49848.000000
2019-11-15 08:59:16.904 DEBUG 15276 --- [nio-8080-exec-5] o.a.http.impl.execchain.MainClientExec : Connection can be kept alive indefinitely
2019-11-15 08:59:16.904 DEBUG 15276 --- [nio-8080-exec-5] h.i.c.PoolingHttpClientConnectionManager : Connection [id: 0][route: {}->http://host:8091] can be kept alive indefinitely
2019-11-15 08:59:16.904 DEBUG 15276 --- [nio-8080-exec-5] h.i.c.DefaultManagedHttpClientConnection : http-outgoing-0: set socket timeout to 0
2019-11-15 08:59:16.904 DEBUG 15276 --- [nio-8080-exec-5] h.i.c.PoolingHttpClientConnectionManager : Connection released: [id: 0][route: {}->http://host:8091][total kept alive: 1; route allocated: 1 of 100; total allocated: 1 of 200]
2019-11-15 08:59:16.924 DEBUG 15276 --- [nio-8080-exec-5] o.a.h.client.protocol.RequestAddCookies : CookieSpec selected: default
2019-11-15 08:59:16.924 DEBUG 15276 --- [nio-8080-exec-5] o.a.h.client.protocol.RequestAddCookies : Cookie [version: 0][name: MYSAPSSO2][value:***][domain: ***][path: /][expiry: null] match [host:8091/sap/opu/odata/sap/API_SALES_ORDER_SRV/A_SalesOrder]
2019-11-15 08:59:16.924 DEBUG 15276 --- [nio-8080-exec-5] o.a.h.client.protocol.RequestAddCookies : Cookie [version: 0][name: SAP_SESSIONID_***_011][value: ***][domain: host][path: /][expiry: null] match [host:8091/sap/opu/odata/sap/API_SALES_ORDER_SRV/A_SalesOrder]
2019-11-15 08:59:16.925 DEBUG 15276 --- [nio-8080-exec-5] o.a.h.client.protocol.RequestAddCookies : Cookie [version: 0][name: sap-usercontext][value: sap-client=011][domain: host][path: /][expiry: null] match [host:8091/sap/opu/odata/sap/API_SALES_ORDER_SRV/A_SalesOrder]
2019-11-15 08:59:16.925 DEBUG 15276 --- [nio-8080-exec-5] o.a.h.client.protocol.RequestAuthCache : Auth cache not set in the context
2019-11-15 08:59:16.925 DEBUG 15276 --- [nio-8080-exec-5] h.i.c.PoolingHttpClientConnectionManager : Connection request: [route: {}->http://host:8091][total kept alive: 1; route allocated: 1 of 100; total allocated: 1 of 200]
2019-11-15 08:59:16.925 DEBUG 15276 --- [nio-8080-exec-5] h.i.c.PoolingHttpClientConnectionManager : Connection leased: [id: 0][route: {}->http://host:8091][total kept alive: 0; route allocated: 1 of 100; total allocated: 1 of 200]
2019-11-15 08:59:16.925 DEBUG 15276 --- [nio-8080-exec-5] h.i.c.DefaultManagedHttpClientConnection : http-outgoing-0: set socket timeout to 0
2019-11-15 08:59:16.926 DEBUG 15276 --- [nio-8080-exec-5] o.a.http.impl.execchain.MainClientExec : Executing request POST /sap/opu/odata/sap/API_SALES_ORDER_SRV/A_SalesOrder HTTP/1.1
2019-11-15 08:59:16.926 DEBUG 15276 --- [nio-8080-exec-5] o.a.http.impl.execchain.MainClientExec : Proxy auth state: UNCHALLENGED
2019-11-15 08:59:16.926 DEBUG 15276 --- [nio-8080-exec-5] org.apache.http.headers : http-outgoing-0 >> POST /sap/opu/odata/sap/API_SALES_ORDER_SRV/A_SalesOrder HTTP/1.1
2019-11-15 08:59:16.926 DEBUG 15276 --- [nio-8080-exec-5] org.apache.http.headers : http-outgoing-0 >> x-csrf-token: jgGDK5ILPjPZmMUDQJmvLg==
2019-11-15 08:59:16.926 DEBUG 15276 --- [nio-8080-exec-5] org.apache.http.headers : http-outgoing-0 >> Content-Type: application/json
2019-11-15 08:59:16.926 DEBUG 15276 --- [nio-8080-exec-5] org.apache.http.headers : http-outgoing-0 >> Accept: application/json
2019-11-15 08:59:16.926 DEBUG 15276 --- [nio-8080-exec-5] org.apache.http.headers : http-outgoing-0 >> com.sap.cloud.sdk.cloudplatform.connectivity.HttpClientWrapper$ApacheHttpHeader#f38e7be
2019-11-15 08:59:16.926 DEBUG 15276 --- [nio-8080-exec-5] org.apache.http.headers : http-outgoing-0 >> Content-Length: 218
2019-11-15 08:59:16.926 DEBUG 15276 --- [nio-8080-exec-5] org.apache.http.headers : http-outgoing-0 >> Host: host:8091
2019-11-15 08:59:16.926 DEBUG 15276 --- [nio-8080-exec-5] org.apache.http.headers : http-outgoing-0 >> Connection: Keep-Alive
2019-11-15 08:59:16.926 DEBUG 15276 --- [nio-8080-exec-5] org.apache.http.headers : http-outgoing-0 >> User-Agent: Apache-HttpClient/4.5.10 (Java/1.8.0_191)
2019-11-15 08:59:16.926 DEBUG 15276 --- [nio-8080-exec-5] org.apache.http.headers : http-outgoing-0 >> Cookie: MYSAPSSO2=***; SAP_SESSIONID_***_011=***; sap-usercontext=sap-client=011
2019-11-15 08:59:16.926 DEBUG 15276 --- [nio-8080-exec-5] org.apache.http.headers : http-outgoing-0 >> Accept-Encoding: gzip,deflate
2019-11-15 08:59:17.150 DEBUG 15276 --- [nio-8080-exec-5] org.apache.http.headers : http-outgoing-0 << HTTP/1.1 500 Internal Server Error
2019-11-15 08:59:17.150 DEBUG 15276 --- [nio-8080-exec-5] org.apache.http.headers : http-outgoing-0 << content-type: text/plain; charset=utf-8
2019-11-15 08:59:17.150 DEBUG 15276 --- [nio-8080-exec-5] org.apache.http.headers : http-outgoing-0 << content-length: 30
2019-11-15 08:59:17.150 DEBUG 15276 --- [nio-8080-exec-5] org.apache.http.headers : http-outgoing-0 << sap-processing-info: ODataBEP=,crp=,RAL=,st=,MedCacheHub=,codeployed=X,softstate=
2019-11-15 08:59:17.151 DEBUG 15276 --- [nio-8080-exec-5] org.apache.http.headers : http-outgoing-0 << sap-server: true
2019-11-15 08:59:17.151 DEBUG 15276 --- [nio-8080-exec-5] org.apache.http.headers : http-outgoing-0 << sap-perf-fesrec: 13762.000000
2019-11-15 08:59:17.151 DEBUG 15276 --- [nio-8080-exec-5] org.apache.http.headers : http-outgoing-0 << connection: close
2019-11-15 08:59:17.157 DEBUG 15276 --- [nio-8080-exec-5] h.i.c.DefaultManagedHttpClientConnection : http-outgoing-0: Close connection
2019-11-15 08:59:17.158 DEBUG 15276 --- [nio-8080-exec-5] o.a.http.impl.execchain.MainClientExec : Connection discarded
2019-11-15 08:59:17.158 DEBUG 15276 --- [nio-8080-exec-5] h.i.c.PoolingHttpClientConnectionManager : Connection released: [id: 0][route: {}->http://host:8091][total kept alive: 0; route allocated: 0 of 100; total allocated: 0 of 200]
2019-11-15 08:59:17.161 ERROR 15276 --- [nio-8080-exec-5] c.b.h.service.MySalesOrderService : The endpoint responded with HTTP error code 500.
DestinationUtil class
public class DestinationUtil {
// #Value("${destination.http.t4x}")
// private String destinationName;
public static HttpDestination getHttpDestinationT4X() {
Destination destination = DestinationAccessor.getDestination("***");
return destination.asHttp();
}
public static HttpDestination getHttpDestinationS4X() {
Destination destination = DestinationAccessor.getDestination("***");
return destination.asHttp();
}
}
Finally I found the root cause. It is due to the ICF Nodes configuration of sales order service on S4HANA system. By default, the parameter of GUI configuration is ~CHECK_CSRF_TOKEN 0. That means, xsrf check is disabled and switch to X-Requested-With. I need to provide parameter X-Requested-With in HTTP request header.

Jhipster-registry stop working

My jhipster-registry stopped working a couple of hours ago.
I followd these steps:
removed node_modules/ folder
npm install
./mvnw
When the registry is up and running again I get an error page with the following text:
??error.title_en??
And in the logs find:
2017-08-04 22:58:53.729 DEBUG 3203 --- [kground-preinit] org.jboss.logging : Logging Provider: org.jboss.logging.Slf4jLoggerProvider found via system property
██╗ ██╗ ██╗ ████████╗ ███████╗ ██████╗ ████████╗ ████████╗ ███████╗
██║ ██║ ██║ ╚══██╔══╝ ██╔═══██╗ ██╔════╝ ╚══██╔══╝ ██╔═════╝ ██╔═══██╗
██║ ████████║ ██║ ███████╔╝ ╚█████╗ ██║ ██████╗ ███████╔╝
██╗ ██║ ██╔═══██║ ██║ ██╔════╝ ╚═══██╗ ██║ ██╔═══╝ ██╔══██║
╚██████╔╝ ██║ ██║ ████████╗ ██║ ██████╔╝ ██║ ████████╗ ██║ ╚██╗
╚═════╝ ╚═╝ ╚═╝ ╚═══════╝ ╚═╝ ╚═════╝ ╚═╝ ╚═══════╝ ╚═╝ ╚═╝
:: JHipster Registry :: Running Spring Boot 1.5.4.RELEASE ::
:: http://jhipster.github.io ::
2017-08-04 22:58:56.117 INFO 3203 --- [ restartedMain] i.g.j.registry.JHipsterRegistryApp : The following profiles are active: dev,native
2017-08-04 22:58:59.313 DEBUG 3203 --- [ restartedMain] i.g.j.r.config.AsyncConfiguration : Creating Async Task Executor
2017-08-04 22:58:59.994 DEBUG 3203 --- [ restartedMain] i.g.j.r.config.MetricsConfiguration : Registering JVM gauges
2017-08-04 22:59:00.274 DEBUG 3203 --- [ restartedMain] i.g.j.r.config.MetricsConfiguration : Initializing Metrics JMX reporting
2017-08-04 22:59:03.135 DEBUG 3203 --- [ restartedMain] i.g.j.registry.config.WebConfigurer : Registering CORS filter
2017-08-04 22:59:03.327 WARN 3203 --- [ restartedMain] c.n.c.sources.URLConfigurationSource : No URLs will be polled as dynamic configuration sources.
2017-08-04 22:59:04.102 INFO 3203 --- [ restartedMain] i.g.j.registry.config.WebConfigurer : Web application configuration, using profiles: dev
2017-08-04 22:59:04.103 DEBUG 3203 --- [ restartedMain] i.g.j.registry.config.WebConfigurer : Initializing Metrics registries
2017-08-04 22:59:04.107 DEBUG 3203 --- [ restartedMain] i.g.j.registry.config.WebConfigurer : Registering Metrics Filter
2017-08-04 22:59:04.107 DEBUG 3203 --- [ restartedMain] i.g.j.registry.config.WebConfigurer : Registering Metrics Servlet
2017-08-04 22:59:04.113 INFO 3203 --- [ restartedMain] i.g.j.registry.config.WebConfigurer : Web application fully configured
2017-08-04 22:59:12.109 WARN 3203 --- [ restartedMain] c.n.c.sources.URLConfigurationSource : No URLs will be polled as dynamic configuration sources.
2017-08-04 22:59:12.551 INFO 3203 --- [ restartedMain] com.netflix.discovery.DiscoveryClient : Initializing Eureka in region us-east-1
2017-08-04 22:59:12.551 INFO 3203 --- [ restartedMain] com.netflix.discovery.DiscoveryClient : Client configured to neither register nor query for data.
2017-08-04 22:59:12.571 INFO 3203 --- [ restartedMain] com.netflix.discovery.DiscoveryClient : Discovery Client initialized at timestamp 1501880352571 with initial instances count: 0
2017-08-04 22:59:12.941 INFO 3203 --- [ restartedMain] c.n.d.provider.DiscoveryJerseyProvider : Using JSON encoding codec LegacyJacksonJson
2017-08-04 22:59:12.941 INFO 3203 --- [ restartedMain] c.n.d.provider.DiscoveryJerseyProvider : Using JSON decoding codec LegacyJacksonJson
2017-08-04 22:59:12.942 INFO 3203 --- [ restartedMain] c.n.d.provider.DiscoveryJerseyProvider : Using XML encoding codec XStreamXml
2017-08-04 22:59:12.942 INFO 3203 --- [ restartedMain] c.n.d.provider.DiscoveryJerseyProvider : Using XML decoding codec XStreamXml
2017-08-04 22:59:13.809 WARN 3203 --- [ restartedMain] o.s.j.e.a.AnnotationMBeanExporter : Bean with key 'zuulEndpoint' has been registered as an MBean but has no exposed attributes or operations
2017-08-04 22:59:14.606 DEBUG 3203 --- [pool-4-thread-1] i.g.j.r.aop.logging.LoggingAspect : Enter: io.github.jhipster.registry.service.ZuulUpdaterService.updateZuulRoutes() with argument[s] = []
2017-08-04 22:59:14.614 DEBUG 3203 --- [pool-4-thread-1] i.g.j.r.aop.logging.LoggingAspect : Exit: io.github.jhipster.registry.service.ZuulUpdaterService.updateZuulRoutes() with result = null
2017-08-04 22:59:14.740 INFO 3203 --- [ restartedMain] i.g.j.registry.JHipsterRegistryApp : Started JHipsterRegistryApp in 22.799 seconds (JVM running for 23.886)
2017-08-04 22:59:14.741 INFO 3203 --- [ restartedMain] i.g.j.registry.JHipsterRegistryApp :
----------------------------------------------------------
Application 'jhipster-registry' is running! Access URLs:
Local: http://localhost:8761
External: http://xxx.xxx.x.xxx:8761
Profile(s): [dev, native]
----------------------------------------------------------
2017-08-04 22:59:19.615 DEBUG 3203 --- [pool-4-thread-1] i.g.j.r.aop.logging.LoggingAspect : Enter: io.github.jhipster.registry.service.ZuulUpdaterService.updateZuulRoutes() with argument[s] = []
2017-08-04 22:59:19.616 DEBUG 3203 --- [pool-4-thread-1] i.g.j.r.aop.logging.LoggingAspect : Exit: io.github.jhipster.registry.service.ZuulUpdaterService.updateZuulRoutes() with result = null
2017-08-04 22:59:24.621 DEBUG 3203 --- [pool-4-thread-1] i.g.j.r.aop.logging.LoggingAspect : Enter: io.github.jhipster.registry.service.ZuulUpdaterService.updateZuulRoutes() with argument[s] = []
2017-08-04 22:59:24.622 DEBUG 3203 --- [pool-4-thread-1] i.g.j.r.aop.logging.LoggingAspect : Exit: io.github.jhipster.registry.service.ZuulUpdaterService.updateZuulRoutes() with result = null
2017-08-04 22:59:27.234 WARN 3203 --- [ XNIO-2 task-1] o.s.c.n.zuul.web.ZuulHandlerMapping : No routes found from RouteLocator
2017-08-04 22:59:27.438 DEBUG 3203 --- [ XNIO-2 task-1] freemarker.cache : Couldn't find template in cache for "error.ftl"("en", UTF-8, parsed); will try to load it.
2017-08-04 22:59:27.441 DEBUG 3203 --- [ XNIO-2 task-1] freemarker.cache : TemplateLoader.findTemplateSource("error_en.ftl"): Not found
2017-08-04 22:59:27.444 DEBUG 3203 --- [ XNIO-2 task-1] freemarker.cache : TemplateLoader.findTemplateSource("error.ftl"): Not found
2017-08-04 22:59:29.623 DEBUG 3203 --- [pool-4-thread-1] i.g.j.r.aop.logging.LoggingAspect : Enter: io.github.jhipster.registry.service.ZuulUpdaterService.updateZuulRoutes() with argument[s] = []
2017-08-04 22:59:29.623 DEBUG 3203 --- [pool-4-thread-1] i.g.j.r.aop.logging.LoggingAspect : Exit: io.github.jhipster.registry.service.ZuulUpdaterService.updateZuulRoutes()
I don't know where all this come from.
Edit-----------------------------------
The problem may be when I run npm install and it's postinstall script "postinstall": "yarn run webpack:build" an ERROR is thrown:
ERROR in ./~/css-loader!./~/postcss-loader!./~/sass-loader/lib/loader.js!./src/main/webapp/content/scss/vendor.scss
Module build failed: TypeError: Invalid PostCSS Plugin found: [0]
at /Users/xxxxxxx/dev/projects/registrytest/node_modules/postcss-load-plugins/lib/plugins.js:32:17
at Array.forEach (native)
at plugins (/Users/xxxxxxx/dev/projects/registrytest/node_modules/postcss-load-plugins/lib/plugins.js:21:15)
at /Users/xxxxxxx/dev/projects/registrytest/node_modules/postcss-load-config/index.js:64:18
at <anonymous>
# ./src/main/webapp/content/scss/vendor.scss 4:14-194
# ./src/main/webapp/app/vendor.ts
# dll vendor
error Command failed with exit code 2.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! jhipster-registry#3.1.0 postinstall: `yarn run webpack:build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the jhipster-registry#3.1.0 postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/xxxxxx/.npm/_logs/2017-08-05T07_44_08_129Z-debug.log
I run:
OS X 10.11.6
node: 8.2.1
npm: 5.3.0
It was a dependency issue. The solution for me was:
Downgrade node.js from version 8 to 6.11 because node-sass didn't support node.js 8. Then I upgraded sass-loader, node-sass and postcss-loader to latest versions.
I don't know if this is the way to go but it work for me.

JHIPSTER Registry and NODEJS eureka-js-client NullPointerException

I would like to add a node.js server as a microservice application on jhipster-registry.
I use eureka-js-client npm package
You can find a node test project "zhudan/node-eureka" on github
// ------------------ Eureka Config --------------------------------------------
var Eureka = require("eureka-js-client").Eureka;
var client = new Eureka({
filename: 'eureka-client',
cwd: __dirname
});
client.logger.level('debug');
client.start(function(error){
console.log(error || 'complete');
});
// ------------------ Server Config --------------------------------------------
var server = app.listen(9999, function () {
var host = server.address().address;
var port = server.address().port;
console.log('Listening at http://%s:%s', host, port);
});
I change the eureka-client.yml in order to work with jhipster-registery.
eureka:
heartbeatInterval: 10
maxRetries: 10
requestRetryDelay: 60
registryFetchInterval: 10
host: 'admin:admin#localhost'
port: 8761
servicePath: '/eureka/apps'
instance:
instanceId: "node-euraka"
app: 'node-eureka'
hostName: '127.0.0.1'
#ipAddr: '192.168.10.145'
statusPageUrl: 'http://127.0.0.1:9999'
port:
'$': 9999
'#enabled': 'true'
vipAddress: 'node-eureka'
dataCenterInfo:
'#class': 'com.netflix.appinfo.InstanceInfo$DefaultDataCenterInfo'
name: 'MyOwn'
It's working well i have a complete register and heartbeat working well
$ node app
Listening at http://:::9999
registered with eureka: node-eureka/node-euraka
retrieved registry successfully
complete
eureka heartbeat success
retrieved registry successfully
eureka heartbeat success
retrieved registry successfully
eureka heartbeat success
retrieved registry successfully
But after that on jhipster-registry i obtain a nullpointerexception.
2017-07-18 10:46:46.452 DEBUG 13124 --- [pool-4-thread-1] i.g.j.r.aop.logging.LoggingAspect : Enter: io.github.jhipster.registry.service.ZuulUpdaterService.updateZuulRoutes() with argument[s] = []
2017-07-18 10:46:46.454 DEBUG 13124 --- [pool-4-thread-1] i.g.j.r.aop.logging.LoggingAspect : Exit: io.github.jhipster.registry.service.ZuulUpdaterService.updateZuulRoutes() with result = null
2017-07-18 10:46:46.597 INFO 13124 --- [ XNIO-2 task-1] c.n.d.provider.DiscoveryJerseyProvider : Using JSON encoding codec LegacyJacksonJson
2017-07-18 10:46:46.597 INFO 13124 --- [ XNIO-2 task-1] c.n.d.provider.DiscoveryJerseyProvider : Using JSON decoding codec LegacyJacksonJson
2017-07-18 10:46:46.597 INFO 13124 --- [ XNIO-2 task-1] c.n.d.provider.DiscoveryJerseyProvider : Using XML encoding codec XStreamXml
2017-07-18 10:46:46.597 INFO 13124 --- [ XNIO-2 task-1] c.n.d.provider.DiscoveryJerseyProvider : Using XML decoding codec XStreamXml
2017-07-18 10:46:51.458 DEBUG 13124 --- [pool-4-thread-1] i.g.j.r.aop.logging.LoggingAspect : Enter: io.github.jhipster.registry.service.ZuulUpdaterService.updateZuulRoutes() with argument[s] = []
2017-07-18 10:46:51.460 DEBUG 13124 --- [pool-4-thread-1] i.g.j.r.service.ZuulUpdaterService : Checking instance node-euraka - null
2017-07-18 10:46:51.467 DEBUG 13124 --- [pool-4-thread-1] i.g.j.r.service.ZuulUpdaterService : Adding instance 'node-euraka' with URL: null
2017-07-18 10:46:51.489 INFO 13124 --- [pool-4-thread-1] i.g.j.r.service.ZuulUpdaterService : Zuul routes have changed - refreshing the configuration
2017-07-18 10:46:51.491 DEBUG 13124 --- [pool-4-thread-1] i.g.j.r.aop.logging.LoggingAspect : Exit: io.github.jhipster.registry.service.ZuulUpdaterService.updateZuulRoutes() with result = null
2017-07-18 10:46:56.492 DEBUG 13124 --- [pool-4-thread-1] i.g.j.r.aop.logging.LoggingAspect : Enter: io.github.jhipster.registry.service.ZuulUpdaterService.updateZuulRoutes() with argument[s] = []
2017-07-18 10:46:56.494 DEBUG 13124 --- [pool-4-thread-1] i.g.j.r.service.ZuulUpdaterService : Checking instance node-euraka - null
2017-07-18 10:46:56.494 DEBUG 13124 --- [pool-4-thread-1] i.g.j.r.service.ZuulUpdaterService : Instance 'node-euraka' already registered
2017-07-18 10:46:56.496 ERROR 13124 --- [pool-4-thread-1] i.g.j.r.aop.logging.LoggingAspect : Exception in io.github.jhipster.registry.service.ZuulUpdaterService.updateZuulRoutes() with cause = 'NULL' and exception = 'null'
java.lang.NullPointerException: null
at io.github.jhipster.registry.service.ZuulUpdaterService.updateZuulRoutes(ZuulUpdaterService.java:65)
At each refresh of JHipster-registery view of applications i obtain a nullpointerexception
PS : JHipster-registery is starting with ./mvnw command with no changes from your git repo
I provide you complete log of jhipster-registery
regitry-logs.txt
Regards,

logoutSuccessUrl not working in Spring Boot

I have a simple Gradle Spring Boot (v 1.3.3) WebMVC application I'm running from the command line via "Gradle bootrun". I am also including Spring Security and am overriding some default security configuration by including a java security config class. My build file is
buildscript {
ext {
springBootVersion = '1.3.3.RELEASE'
}
repositories {
mavenCentral()
}
dependencies {
classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
}
}
apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'spring-boot'
jar {
baseName = 'readinglist'
version = '0.0.1-SNAPSHOT'
}
sourceCompatibility = 1.8
targetCompatibility = 1.8
repositories {
mavenCentral()
}
dependencies {
compile('org.springframework.boot:spring-boot-starter-data-jpa')
compile('org.springframework.boot:spring-boot-starter-thymeleaf')
compile('org.springframework.boot:spring-boot-starter-web')
compile("org.springframework.boot:spring-boot-starter-security")
runtime('com.h2database:h2')
testCompile('org.springframework.boot:spring-boot-starter-test')
}
eclipse {
classpath {
containers.remove('org.eclipse.jdt.launching.JRE_CONTAINER')
containers 'org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8'
}
}
task wrapper(type: Wrapper) {
gradleVersion = '2.9'
}
My security configuration class is
package readinglist;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.security.core.userdetails.UserDetailsService;
import org.springframework.security.core.userdetails.UsernameNotFoundException;
#Configuration
public class SecurityConfig extends WebSecurityConfigurerAdapter {
#Autowired
private ReaderRepository readerRepository;
#Override
protected void configure(HttpSecurity http) throws Exception {
http
.authorizeRequests()
.antMatchers("/readingList").access("hasRole('READER')")
.antMatchers("/**").permitAll()
.and()
.formLogin()
.loginPage("/login")
.failureUrl("/login?error=true")
.and()
.logout()
.logoutSuccessUrl("/"); // Added .and()....logoutSuccessURL()
}
#Override
protected void configure(
AuthenticationManagerBuilder auth) throws Exception {
auth
.userDetailsService(new UserDetailsService() {
#Override
public UserDetails loadUserByUsername(String username)
throws UsernameNotFoundException {
UserDetails userDetails = readerRepository.findOne(username);
if (userDetails != null) {
return userDetails;
}
throw new UsernameNotFoundException("User '" + username + "' not found.");
}
});
}
}
I also have a home controller that maps the URL "/" to the view home.html
When I run the application and go to localhost:8080/ I get the home page.
When I try to access the URL "/readingList", I get the custom login page. If I enter incorrect credentials, I return to the login page for another try. If I enter valid credentials I get the readingList page. So far so good. The problem is with the logoutSuccessURL("/"). When I go to the URL "/logout" this should log me out and take me back to "/", but instead I get the following error showing in the browser:
Whitelabel Error Page
This application has no explicit mapping for /error, so you are seeing this as a fallback.
Thu Mar 03 19:31:24 PST 2016
There was an unexpected error (type=Not Found, status=404).
No message available
I turned on debug for security and when I hit my logout link I get the following:
2016-03-03 19:48:45.033 DEBUG 22401 --- [io-8080-exec-10] o.s.web.servlet.DispatcherServlet : DispatcherServlet with name 'dispatcherServlet' processing GET request for [/error]
2016-03-03 19:48:45.033 DEBUG 22401 --- [io-8080-exec-10] s.w.s.m.m.a.RequestMappingHandlerMapping : Looking up handler method for path /error
2016-03-03 19:48:45.036 DEBUG 22401 --- [io-8080-exec-10] s.w.s.m.m.a.RequestMappingHandlerMapping : Returning handler method [public org.springframework.web.servlet.ModelAndView org.springframework.boot.autoconfigure.web.BasicErrorController.errorHtml(javax.servlet.http.HttpServletRequest,javax.servlet.http.HttpServletResponse)]
2016-03-03 19:48:45.036 DEBUG 22401 --- [io-8080-exec-10] o.s.web.servlet.DispatcherServlet : Last-Modified value for [/error] is: -1
2016-03-03 19:48:45.046 DEBUG 22401 --- [io-8080-exec-10] o.s.w.s.v.ContentNegotiatingViewResolver : Requested media types are [text/html, text/html;q=0.8] based on Accept header types and producible media types [text/html])
2016-03-03 19:48:45.047 DEBUG 22401 --- [io-8080-exec-10] o.s.w.s.v.ContentNegotiatingViewResolver : Returning [org.springframework.boot.autoconfigure.web.ErrorMvcAutoConfiguration$SpelView#7ae1a0fb] based on requested media type 'text/html'
2016-03-03 19:48:45.047 DEBUG 22401 --- [io-8080-exec-10] o.s.web.servlet.DispatcherServlet : Rendering view [org.springframework.boot.autoconfigure.web.ErrorMvcAutoConfiguration$SpelView#7ae1a0fb] in DispatcherServlet with name 'dispatcherServlet'
2016-03-03 19:48:45.055 DEBUG 22401 --- [io-8080-exec-10] o.s.web.servlet.DispatcherServlet : Successfully completed request
I'm not sure why DispatcherServlet is trying to lookup "/error". I am also not being logged out since if I try to go to the URL "/readingList" again, I am not prompted for credentials.
I did a little more testing by loggin in, then going to the URL "/logout" manually. I got the following in my log:
2016-03-04 16:39:31.170 DEBUG 24395 --- [nio-8080-exec-6] o.s.security.web.FilterChainProxy : /logout reached end of additional filter chain; proceeding with original chain
2016-03-04 16:39:31.170 DEBUG 24395 --- [nio-8080-exec-6] o.s.web.servlet.DispatcherServlet : DispatcherServlet with name 'dispatcherServlet' processing GET request for [/logout]
2016-03-04 16:39:31.170 DEBUG 24395 --- [nio-8080-exec-6] s.w.s.m.m.a.RequestMappingHandlerMapping : Looking up handler method for path /logout
2016-03-04 16:39:31.171 DEBUG 24395 --- [nio-8080-exec-6] s.w.s.m.m.a.RequestMappingHandlerMapping : Did not find handler method for [/logout]
2016-03-04 16:39:31.171 DEBUG 24395 --- [nio-8080-exec-6] o.s.w.s.handler.SimpleUrlHandlerMapping : Matching patterns for request [/logout] are [/**]
2016-03-04 16:39:31.171 DEBUG 24395 --- [nio-8080-exec-6] o.s.w.s.handler.SimpleUrlHandlerMapping : URI Template variables for request [/logout] are {}
2016-03-04 16:39:31.172 DEBU G 24395 --- [nio-8080-exec-6] o.s.w.s.handler.SimpleUrlHandlerMapping : Mapping [/logout] to HandlerExecutionChain with handler [ResourceHttpRequestHandler [locations=[ServletContext resource [/], class path resource [META-INF/resources/], class path resource [resources/], class path resource [static/], class path resource [public/]], resolvers=[org.springframework.web.servlet.resource.PathResourceResolver#e146f93]]] and 1 interceptor
2016-03-04 16:39:31.172 DEBUG 24395 --- [nio-8080-exec-6] o.s.web.servlet.DispatcherServlet : Last-Modified value for [/logout] is: -1
2016-03-04 16:39:31.172 DEBUG 24395 --- [nio-8080-exec-6] o.s.web.servlet.DispatcherServlet : Null ModelAndView returned to DispatcherServlet with name 'dispatcherServlet': assuming HandlerAdapter completed request handling
2016-03-04 16:39:31.173 DEBUG 24395 --- [nio-8080-exec-6] o.s.web.servlet.DispatcherServlet : Successfully completed request
2016-03-04 16:39:31.173 DEBUG 24395 --- [nio-8080-exec-6] o.s.s.w.a.ExceptionTranslationFilter : Chain processed normally
2016-03-04 16:39:31.173 DEBUG 24395 --- [nio-8080-exec-6] s.s.w.c.SecurityContextPersistenceFilter : SecurityContextHolder now cleared, as request processing completed
2016-03-04 16:39:31.196 DEBUG 24395 --- [nio-8080-exec-6] o.s.web.servlet.DispatcherServlet : DispatcherServlet with name 'dispatcherServlet' processing GET request for [/error]
....
It seems like the "/logout" URL is not working which I don't undertand. I though the default logout URL is "/logout".
I found a solution in a similar project here, http://spr.com/part-5-integrating-spring-security-with-spring-boot-web/. In my security config I changed
.logout()
.logoutSuccessUrl("/")
.and()
...
to
.logout()
.logoutRequestMatcher(new AntPathRequestMatcher("/logout"))
.logoutSuccessUrl("/")
.and()
...
I'm not sure if this is the "preferred" solution, and I don't know why the call to logoutRequestMatcher(...) is needed. I have other (non-Spring-Boot) Spring Security projects that don't use the call to logoutRequestMatcher(...), and the .logout(...).logoutSuccessUrl(...) call works just fine.
.and()
.logout()
.invalidateHttpSession(true)
.logoutUrl("/logout")
.permitAll();
i prefer this solution because it wipe the session data so you can't access anymore try it yousrself to make sure open the developer tools in the browser and see the session !!

Resources