geraldhumphries / generator-jhipster-elasticsearch-reindexer Goto Github PK
View Code? Open in Web Editor NEWA JHipster module that inserts all your data into Elasticsearch and helps solve mapping and maintenance issues.
License: Other
A JHipster module that inserts all your data into Elasticsearch and helps solve mapping and maintenance issues.
License: Other
Hello ,
Could you please let me know how can I add reference data into elastic search using re indexing and these are not part of jhipster table, could you please suggest me what can be done in those cases
I am working with mongodb, so after installing the es reindexer generator, I find that it is using spring data jpa :(
Apps generated with JH v2 add 'App' to the end of their app names in Angular. This should be accounted for in the generator.
Hi,
I have created 3 microservices project. The UUA, a backend microservice and gateway.
I installed this package though 'yarn global add generator-jhipster-elasticsearch-reindexer', then executed on the 3 projects, these are the ouputs:
OAuth2
Welcome to the JHipster elasticsearch-reindexer generator! v1.1.0
WARNING no entities found
WARNING clientFramework is missing in JHipster configuration, using angular1 as fallback
WARNING angularAppName is missing in JHipster configuration, using baseName as fallback
identical src/main/java/com/cme/budderfly/authenticate/web/rest/ElasticsearchIndexResource.java
identical src/main/java/com/cme/budderfly/authenticate/service/ElasticsearchIndexService.java
End of elasticsearch-reindexer generator
Microservice
Welcome to the JHipster elasticsearch-reindexer generator! v1.1.0
ls: no such file or directory: .jhipster
WARNING no entities found
WARNING clientFramework is missing in JHipster configuration, using angular1 as fallback
WARNING angularAppName is missing in JHipster configuration, using baseName as fallback
create src/main/java/com/cme/budderfly/management/web/rest/ElasticsearchIndexResource.java
create src/main/java/com/cme/budderfly/management/service/ElasticsearchIndexService.java
create .jhipster/modules/jhi-hooks.json
End of elasticsearch-reindexer generator
Gateway
Welcome to the JHipster elasticsearch-reindexer generator! v1.1.0
ls: no such file or directory: .jhipster
WARNING no entities found
create src/main/java/com/cme/budderfly/management/gateway/web/rest/ElasticsearchIndexResource.java
create src/main/java/com/cme/budderfly/management/gateway/service/ElasticsearchIndexService.java
create src/main/webapp/app/admin/elasticsearch-reindex/elasticsearch-reindex-modal.component.html
create src/main/webapp/app/admin/elasticsearch-reindex/elasticsearch-reindex-modal.component.ts
create src/main/webapp/app/admin/elasticsearch-reindex/elasticsearch-reindex.component.html
create src/main/webapp/app/admin/elasticsearch-reindex/elasticsearch-reindex.component.ts
create src/main/webapp/app/admin/elasticsearch-reindex/elasticsearch-reindex.module.ts
create src/main/webapp/app/admin/elasticsearch-reindex/elasticsearch-reindex.route.ts
create src/main/webapp/app/admin/elasticsearch-reindex/elasticsearch-reindex.service.ts
create src/main/webapp/app/admin/elasticsearch-reindex/index.ts
conflict src/main/webapp/app/admin/admin.module.ts
? Overwrite src/main/webapp/app/admin/admin.module.ts? overwrite this and all others
force src/main/webapp/app/admin/admin.module.ts
force src/main/webapp/app/layouts/navbar/navbar.component.html
force src/main/webapp/i18n/en/global.json
create src/main/webapp/i18n/en/elasticsearch-reindex.json
create .jhipster/modules/jhi-hooks.json
End of elasticsearch-reindexer generator
I can start OAuth2 and microservice apps without issues (./mvnw), but the gateway app is throwing this exception:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.7.0:compile (default-compile) on project managementgateway: Compilation failure: Compilation failure:
[ERROR] /home/daniel/workspace/budderfly/budderfly.cloud/management.gateway/src/main/java/com/cme/budderfly/management/gateway/service/ElasticsearchIndexService.java:[40,19] cannot find symbol
[ERROR] symbol: class UserRepository
[ERROR] location: class com.cme.budderfly.management.gateway.service.ElasticsearchIndexService
[ERROR] /home/daniel/workspace/budderfly/budderfly.cloud/management.gateway/src/main/java/com/cme/budderfly/management/gateway/service/ElasticsearchIndexService.java:[42,19] cannot find symbol
[ERROR] symbol: class UserSearchRepository
[ERROR] location: class com.cme.budderfly.management.gateway.service.ElasticsearchIndexService
[ERROR] /home/daniel/workspace/budderfly/budderfly.cloud/management.gateway/src/main/java/com/cme/budderfly/management/gateway/service/ElasticsearchIndexService.java:[49,9] cannot find symbol
[ERROR] symbol: class UserRepository
[ERROR] location: class com.cme.budderfly.management.gateway.service.ElasticsearchIndexService
[ERROR] /home/daniel/workspace/budderfly/budderfly.cloud/management.gateway/src/main/java/com/cme/budderfly/management/gateway/service/ElasticsearchIndexService.java:[50,9] cannot find symbol
[ERROR] symbol: class UserSearchRepository
[ERROR] location: class com.cme.budderfly.management.gateway.service.ElasticsearchIndexService
[ERROR] -> [Help 1]
Can you please help? Thanks!
Does not look like this is compatible with the latest jhipster. 7.0.1
It uses deprecated methods etc..
I think this was installed with JHipster if using a version of NodeJS that had a flat dependency structure, but would not be present with older versions.
I experienced exceptions during reindexing (v 1.0.2) with high number of instances, especially when these contained clob / lob / blob.
Re-Indexing works comparably fast, if performed in bunches of, say, 1000 objects. This can easily be achieved by adding a Pageable as parameter.
Change in method reindexForClass
:
...
if (jpaRepository.count() > 0) {
log.info(entityClass + ": " + jpaRepository.count());
int size = 100;
for (int i = 0; i <= jpaRepository.count() / size; i++) {
Pageable page = new PageRequest(i, size);
log.info("Indexing page : " + i + " , nr " + size);
try {
Method m = jpaRepository.getClass().getMethod("findAllWithEagerRelationships", Pageable.class);
List<T> paged = (List<T>) m.invoke(jpaRepository, page);
elasticsearchRepository.save(paged);
}
catch (NoSuchMethodException ex) {
log.info(ex.getLocalizedMessage());
elasticsearchRepository.save(jpaRepository.findAll(page));
} catch (Exception ex) {
log.error(ex.getMessage());
ex.printStackTrace(System.out);
}
}
}
...
Looks like it's caused by a missing variable.
Hi @geraldhumphries,
Just to let you know that, with the release of JHipster 5, they can be some breaking changes.
You need to test if your module works well, and if it's the case, you need to add jhipster-5
in keywords: https://github.com/geraldhumphries/generator-jhipster-elasticsearch-reindexer/blob/master/package.json#L5-L8
With that, your module will be displayed at this question: ? Would you like to install other generators from the JHipster Marketplace? (y/N)
See jhipster/generator-jhipster#7408
Thank you for this module ;)
This happens when indexing a large list of complex entities, maybe with a chain of eagerly loaded relationships.
What I think is happening: The GC never has a chance to clean up already-indexed objects because elasticsearchRepository is working with the whole list. Jackson initializes any lazily-loaded fields on the entities one-by-one growing the memory usage as time goes on.
Using pagination for this is probably not an option because the generated findAllWithEagerRelationships
does not use pagination.
Maybe split the results up into subLists and index the subLists, to allow the GC to do its job?
This generator (jhipster-elasticsearch-reindexer:app) requires yeoman-environment at least 3.0.0, current version is 2.10.3, try reinstalling latest version of 'yo' or use '--ignore-version-check' option
^ Error that I am getting even after installing yo and yeoman-environment to the latest version locally
The index mapping is lost when calling the method "reindexAll".
Replace "deleteIndex" with "deleteAll" if searchRepository.count()>0
Right now, when using the generator on a microservice or gateway, the resulting services will not compile because of missing entities. Gateways have the User entity, and microservices do not.
During the composing of configuration in the JH4 the issue is occuring
Unable to find src/main/webapp/app/layouts/navbar/navbar.component.html or missing required jhipster-needle. Reference to elasticsearch-reindex not added to in menu.
But
src\main\webapp\app\layouts\navbar\navbar.html
is on the its place
and the comment
<!-- jhipster-needle-add-element-to-admin-menu - JHipster will add entities to the admin menu here -->
is present too
when i am trying to click on the re indexing link in admin which was created after using command yo jhipster-elasticsearch-reindexer is not working, the navigation to page is not working code inside it is there
{
"generator-jhipster": {
"promptValues": {
"packageName": "com.caf.valididty"
},
"jhipsterVersion": "4.7.0",
"baseName": "ca",
"packageName": "com.caf.valididty",
"packageFolder": "com/caf/valididty",
"serverPort": "8080",
"authenticationType": "jwt",
"hibernateCache": "ehcache",
"clusteredHttpSession": false,
"websocket": false,
"databaseType": "sql",
"devDatabaseType": "mysql",
"prodDatabaseType": "mysql",
"searchEngine": "elasticsearch",
"messageBroker": false,
"serviceDiscoveryType": false,
"buildTool": "maven",
"enableSocialSignIn": false,
"enableSwaggerCodegen": false,
"jwtSecretKey": "e6209413147382cdf9befb930e1ad7e8debc054a",
"clientFramework": "angular1",
"useSass": false,
"clientPackageManager": "yarn",
"applicationType": "monolith",
"testFrameworks": [],
"jhiPrefix": "jhi",
"otherModules": [],
"enableTranslation": false
}
}
I have updated jhipster-elasticsearch-reindexer , could you please suggest me what can be done.
Sample:
...
import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReentrantLock;
@Service
public class ElasticsearchIndexService {
...
private static final Lock reindexLock = new ReentrantLock();
...
@Async
@Timed
public void reindexAll() {
if(reindexLock.tryLock()) {
try {
reindexForClass(Entity1.class, entity1Repository, entity1SearchRepository);
reindexForClass(Entity2.class, entity2Repository, entity2SearchRepository);
...
log.info("Elasticsearch: Successfully performed reindexing");
} finally {
reindexLock.unlock();
}
} else {
log.info("Elasticsearch: concurrent reindexing attempt");
}
}
...
}
This should be similar to what JHipster UML does.
Hello, I tried using this module with jhipster 6.
After following the instructions in the documentation, and running
yo jhipster-elasticsearch-reindexer
I got the following errors:
[INFO] ERROR Failed to compile with 2 errors12:51:11 PM
[INFO]
[INFO] error in /mnt/c/Users/Usuario/Documents/GitHub/fasm/src/main/webapp/app/admin/elasticsearch-reindex/elasticsearch-reindex.route.ts
[INFO]
[INFO] ERROR in /mnt/c/Users/Usuario/Documents/GitHub/fasm/src/main/webapp/app/admin/elasticsearch-reindex/elasticsearch-reindex.route.ts(2,10):
[INFO] TS2305: Module '"../../shared"' has no exported member 'UserRouteAccessService'.
[INFO]
[INFO] error in /mnt/c/Users/Usuario/Documents/GitHub/fasm/src/main/webapp/app/admin/elasticsearch-reindex/elasticsearch-reindex.service.ts
[INFO]
[INFO] ERROR in /mnt/c/Users/Usuario/Documents/GitHub/fasm/src/main/webapp/app/admin/elasticsearch-reindex/elasticsearch-reindex.service.ts(4,10):
[INFO] TS2305: Module '"../../../../../../node_modules/rxjs/Rx"' has no exported member 'Observable'.
[INFO]
[INFO] 784 modules
[INFO]
[INFO] WARNING in ./src/main/webapp/app/admin/elasticsearch-reindex/elasticsearch-reindex.route.ts 10:18-40
[INFO] "export 'UserRouteAccessService' was not found in '../../shared'
[INFO]
[INFO] ERROR in /mnt/c/Users/Usuario/Documents/GitHub/fasm/src/main/webapp/app/admin/elasticsearch-reindex/elasticsearch-reindex.route.ts
[INFO] ERROR in /mnt/c/Users/Usuario/Documents/GitHub/fasm/src/main/webapp/app/admin/elasticsearch-reindex/elasticsearch-reindex.route.ts(2,10):
[INFO] TS2305: Module '"../../shared"' has no exported member 'UserRouteAccessService'.
[INFO]
[INFO] ERROR in /mnt/c/Users/Usuario/Documents/GitHub/fasm/src/main/webapp/app/admin/elasticsearch-reindex/elasticsearch-reindex.service.ts
[INFO] ERROR in /mnt/c/Users/Usuario/Documents/GitHub/fasm/src/main/webapp/app/admin/elasticsearch-reindex/elasticsearch-reindex.service.ts(4,10):
[INFO] TS2305: Module '"../../../../../../node_modules/rxjs/Rx"' has no exported member 'Observable'.
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 05:08 min
[INFO] Finished at: 2019-09-11T11:52:13Z
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.github.eirslett:frontend-maven-plugin:1.7.6:npm (webpack build dev) on project fasm: Failed to run task: 'npm run webpack:build' failed. org.apache.commons.exec.ExecuteException: Process exited with an error: 2 (Exit value: 2) -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
There is a small change to the reindex method I mentioned in #20 that should support non-Long entity IDs.
Entities that own many-to-many relationships should contain the relationship in their index, with the list of related entities:
entityOne: {
id: 1,
entityTwos: [{
id: 1
},
{
id: 2
}]
}
When saving the entity through the API, the entity in the Elasticsearch index is saved properly with the second entity's objects in the relationship. However, since the reindexer just uses jpaRepository.findAll()
and never fetches those relationships, the reindexer will save the entities with an empty relationship:
entityOne: {
id: 1,
entityTwos: []
}
The reindexer needs to call jpaRepository.findAllWithEagerRelationships()
for entites that own a many-to-many.
I tried to use this plugin with an application generated using jhipster 6.5.0.
If you have no time or intention to upgrade it, can you suggest an alternative.
Thanks.
Installed jhipster-elasticsearch-reindexer successfully:
λ npm install -g generator-jhipster-elasticsearch-reindexer
[email protected] postinstall C:\Users\Catz\AppData\Roaming\npm\node_modules\generator-jhipster-elasticsearch-reindexer\node_modules\spawn-sync
node postinstall
[email protected]
added 379 packages in 57.62s
tried running the command yo jhipster-elasticsearch-reindexer to start reindexing existing data in my database, and got the following error:
λ yo jhipster-elasticsearch-reindexer
C:\Users\Catz\AppData\Roaming\npm\node_modules\generator-jhipster-elasticsearch-reindexer\generators\app\index.js:27
JhipsterGenerator = generator.Base.extend({});
^
TypeError: Cannot read property 'extend' of undefined
at Object. (C:\Users\Catz\AppData\Roaming\npm\node_modules\generator-jhipster-elasticsearch-reindexer\generators\app\index.js:27:37)
at Module._compile (module.js:569:30)
at Object.Module._extensions..js (module.js:580:10)
at Module.load (module.js:503:32)
at tryModuleLoad (module.js:466:12)
at Function.Module._load (module.js:458:3)
at Module.require (module.js:513:17)
at require (internal/module.js:11:18)
at Object.get [as jhipster-elasticsearch-reindexer:app] (C:\Users\Catz\AppData\Local\Yarn\config\global\node_modules\yo\node_modules\yeoman-environment\lib\store.js:38:27)
at Store.get (C:\Users\Catz\AppData\Local\Yarn\config\global\node_modules\yo\node_modules\yeoman-environment\lib\store.js:61:39)
JH added Angular 2 support in version 4. Following #21, A2 frontend files should be added.
Probably requires a new javascript service/controller.
When setting up Jhipster with elasticsearch and reindex, following error has shown:
ERROR in [at-loader] ./src/main/webapp/app/admin/elasticsearch-reindex/elasticsearch-reindex.service.ts:2:10 TS2305: Module '"c:/***/node_modules/@angular/common/http"' has no exported member 'Http'.
I've changed the service file 'elasticsearch-reindex/elasticsearch-reindex.service.ts' to attached file due to Angular 5 on my project and 'http' deprecated has to be replaced with HttpClient
elasticsearch-reindex.service.ts.zip
Not sure if it's right but it might help
regards
The last version of Spring Boot to include a version of Spring Framework less than 4.3 is 1.3.8.RELEASE. We need to find the last version of JHipster using this version of Spring Boot and take it into account when generating the resource.
I noticed that one of my entities was not being indexed properly. When the entity was being indexed, entityRepository.findAll()
was getting hibernate proxies. When AbstractElasticsearchRepository.save() was called on these proxies, query.setId(stringIdRepresentation(extractIdFromBean(entity)));
was setting _id
to null for the query causing every new document to overwrite the last one. Bug in Spring Data Elasticsearch?
This was happening because another entity had a ManyToOne relationship to it with a join table, and was being indexed first. This was creating proxies for the first entity, and when findAll()
was called for the first entity it just used those proxies. The solution is to reindex each entity in its own transaction.
Is this module compatible with JHipster 3.0? No: any planned dates yet?
After install generator-jhipster-elasticsearch-reindexer "yo jhipster-elasticsearch-reindexer" this file "index.html" not is alter how seen in image below:
For fix this bug, must be include this lines in file "index.html" how that example:
<script src="app/admin/elasticsearch-reindex/elasticsearch-reindex-dialog.controller.js"></script>
<script src="app/admin/elasticsearch-reindex/elasticsearch-reindex.controller.js"></script>
<script src="app/admin/elasticsearch-reindex/elasticsearch-reindex.service.js"></script>
<script src="app/admin/elasticsearch-reindex/elasticsearch-reindex.state.js"></script>
After changes this module will work perfect.
The following javascript error is thrown with last version of JHipster,
ERROR in ./src/main/webapp/app/admin/elasticsearch-reindex/elasticsearch-reindex.service.ts
Module not found: Error: Can't resolve '@angular/http' in '/home/daniel/workspace/budderfly/budderfly.cloud/management.gateway/src/main/webapp/app/admin/elasticsearch-reindex'
@ ./src/main/webapp/app/admin/elasticsearch-reindex/elasticsearch-reindex.service.ts 13:13-37
@ ./src/main/webapp/app/admin/elasticsearch-reindex/elasticsearch-reindex-modal.component.ts
@ ./src/main/webapp/app/admin/elasticsearch-reindex/elasticsearch-reindex.component.ts
@ ./src/main/webapp/app/admin/elasticsearch-reindex/elasticsearch-reindex.route.ts
@ ./src/main/webapp/app/admin/elasticsearch-reindex/index.ts
@ ./src/main/webapp/app/admin/elasticsearch-reindex/elasticsearch-reindex.module.ts
@ ./src/main/webapp/app/admin/admin.module.ts
@ ./src/main/webapp/app/app.module.ts
@ ./src/main/webapp/app/app.main.ts
@ multi (webpack)-dev-server/client?http://localhost:9060 webpack/hot/dev-server ./src/main/webapp/app/app.main
ERROR in [at-loader] ./src/main/webapp/app/admin/elasticsearch-reindex/elasticsearch-reindex.service.ts:2:32
I fixed it by changing elasticsearch-reindex.service.ts
to the following in order to accomodate to Angular 5
import { Injectable } from '@angular/core';
import { HttpClient, HttpResponse } from '@angular/common/http';
import { Observable } from 'rxjs/Rx';
@Injectable()
export class ElasticsearchReindexService {
constructor(
private http: HttpClient
) { }
reindex(): Observable<HttpResponse<any>> {
return this.http.post<any>('api/elasticsearch/index', {});
}
}
This modules seems out of date. Any plans to update it to work with the latest version of jHipster?
in the js component it is gettting the name of the module and adding 'App' as a suffix but the module name already has the App added by Jhipster Generator. So once you try to test you got an error.
Backwards compatibility with old versions of JHipster is a priority in this project. Proper tests would significantly improve confidence with old (and new) versions of JHipster. It would also be cool to periodically test against master
and be notified of any breaking changes.
Not to mention all the features that are accounted for - i18n support, A1/A2+ support, different styles of dependency injection, microservices etc. Testing each of these features should be pretty straightforward.
Looks like testing against different versions of JHipster can be achieved on Travis using environment variables. Instructions in the readme here: https://github.com/sonicdoe/judge
Hi, first of all, thanks a lot for your reindexer. What do you think about invoking reindexAll after server startup so that reindexing is done automatically without admin doing manually? This can solve 2 issues: 1) In the UI, if you search for an entity where there is no row inserted in database, elastic search server will throw error which will be shown as internal server error in the UI. 2) Entity resource tests invoke *SearchRepository.deleteAll() in initTest() method which throws exception saying no index found. How about this code in ElasticsearchIndexService.java itself?
@PostConstruct public void reindexAllAfterServerStartup(){ this.reindexAll(); }
I could be wrong, please see if you can throw some light on this.
➜ blog npm install -g generator-jhipster-elasticsearch-reindexer
/Users/qk/.nvm/versions/node/v7.7.4/lib
└─┬ [email protected]
└─┬ [email protected]
└─┬ [email protected]
└─┬ [email protected]
└─┬ [email protected]
└── [email protected]
➜ blog git:(master) jhipster import-jdl /Users/qk/myosgit/blog/src/main/resources/dsl/equipment-jdl.jh
Executing jhipster:import-jdl /Users/qk/myosgit/blog/src/main/resources/dsl/equipment-jdl.jh
The jdl is being parsed.
Writing entity JSON files.
Generating entities.
Found the .jhipster/MxpmsSearchEquipment.json configuration file, entity can be automatically generated!
The entity MxpmsSearchEquipment is being updated.
identical src/main/resources/config/liquibase/changelog/20170910070621_added_entity_MxpmsSearchEquipment.xml
identical src/main/java/com/sgcc/pms/domain/MxpmsSearchEquipment.java
identical src/main/java/com/sgcc/pms/repository/MxpmsSearchEquipmentRepository.java
identical src/main/java/com/sgcc/pms/web/rest/MxpmsSearchEquipmentResource.java
identical src/main/java/com/sgcc/pms/service/dto/MxpmsSearchEquipmentDTO.java
identical src/main/java/com/sgcc/pms/service/mapper/EntityMapper.java
identical src/main/java/com/sgcc/pms/service/mapper/MxpmsSearchEquipmentMapper.java
identical src/test/java/com/sgcc/pms/web/rest/MxpmsSearchEquipmentResourceIntTest.java
identical src/main/resources/config/liquibase/master.xml
Running post run module hooks
Could not compose module generator-jhipster-elasticsearch-reindexer.
Make sure you have installed the module with 'npm -g generator-jhipster-elasticsearch-reindexer'
Execution complete
the source code is here
I have installed this plugin and once it creates this file, it creates in
src/main/webapp/app/components/util/elasticsearch-index-util.service.js
is not a better place the
src/main/webapp/scripts/components/util/elasticsearch-index-util.service.js
with jh 4.6.2
➜ blog jhipster import-jdl ~/Downloads/jhipster-jdl.jh
Executing jhipster:import-jdl /Users/qk/Downloads/jhipster-jdl.jh
The jdl is being parsed.
Writing entity JSON files.
Generating entities.
Found the .jhipster/RegionS.json configuration file, entity can be automatically generated!
The entity RegionS is being updated.
create src/main/resources/config/liquibase/changelog/20170913062135_added_entity_RegionS.xml
create src/main/java/com/sgcc/pms/domain/RegionS.java
create src/main/java/com/sgcc/pms/repository/RegionSRepository.java
create src/main/java/com/sgcc/pms/web/rest/RegionSResource.java
create src/main/java/com/sgcc/pms/repository/search/RegionSSearchRepository.java
create src/test/java/com/sgcc/pms/web/rest/RegionSResourceIntTest.java
conflict src/main/resources/config/liquibase/master.xml
? Overwrite src/main/resources/config/liquibase/master.xml? overwrite this and all others
force src/main/resources/config/liquibase/master.xml
create src/main/webapp/app/entities/region-s/region-s.component.html
create src/main/webapp/app/entities/region-s/region-s-detail.component.html
create src/main/webapp/app/entities/region-s/region-s-dialog.component.html
create src/main/webapp/app/entities/region-s/region-s-delete-dialog.component.html
create src/main/webapp/app/entities/region-s/index.ts
create src/main/webapp/app/entities/region-s/region-s.module.ts
create src/main/webapp/app/entities/region-s/region-s.route.ts
create src/main/webapp/app/entities/region-s/region-s.model.ts
create src/main/webapp/app/entities/region-s/region-s.component.ts
create src/main/webapp/app/entities/region-s/region-s-dialog.component.ts
create src/main/webapp/app/entities/region-s/region-s-delete-dialog.component.ts
create src/main/webapp/app/entities/region-s/region-s-detail.component.ts
create src/main/webapp/app/entities/region-s/region-s.service.ts
create src/main/webapp/app/entities/region-s/region-s-popup.service.ts
create src/test/javascript/spec/app/entities/region-s/region-s-detail.component.spec.ts
force src/main/webapp/app/entities/entity.module.ts
force src/main/webapp/app/layouts/navbar/navbar.component.html
create src/main/webapp/i18n/en/regionS.json
force src/main/webapp/i18n/en/global.json
Running webpack:build
to update client app
Execution complete
yarn run v0.27.5
$ yarn run cleanup && yarn run webpack:build:main
10% building modules 1/4 modules 3 active ...rc/main/webapp/content/css/global.cssWarning: The 'no-use-before-declare' rule requires type infomation.
[at-loader] Using [email protected] from typescript and "tsconfig.json" from /Users/qk/myosgit/blog/tsconfig.json.
10029ms building modules
19ms sealing
0ms optimizing
0ms basic module optimization
21ms module optimization
0ms advanced module optimization
14ms basic chunk optimization
0ms chunk optimization
0ms advanced chunk optimization
0ms module and chunk tree optimization
0ms chunk modules optimization
0ms advanced chunk modules optimization
8ms module reviving
5ms module order optimization
9ms module id optimization
2ms chunk reviving
0ms chunk order optimization
15ms chunk id optimization
50ms hashing
1ms module assets processing
4737ms chunk assets processing
122ms additional chunk assets processing
1ms recording
0ms additional asset processing
0ms chunk asset optimization
94% asset optimization
[at-loader] Checking started in a separate process...
[at-loader] Checking finished with 3 errors
112ms asset optimization
Hash: 854143efe785237db7c7
Version: webpack 3.3.0
Time: 15186ms
[./node_modules/css-loader/index.js!./src/main/webapp/content/css/global.css] ./node_modules/css-loader!./src/main/webapp/content/css/global.css 4.8 kB {3} [built]
[] -> factory:174ms building:2154ms = 2328ms
[./src/main/webapp/app/account/account.module.ts] ./src/main/webapp/app/account/account.module.ts 1.89 kB {1} [built]
[] -> factory:376ms building:189ms dependencies:622ms = 1187ms
[./src/main/webapp/app/admin/admin.module.ts] ./src/main/webapp/app/admin/admin.module.ts 2.72 kB {1} [built]
[] -> factory:376ms building:167ms dependencies:644ms = 1187ms
[./src/main/webapp/app/app.constants.ts] ./src/main/webapp/app/app.constants.ts 513 bytes {1} [built]
[] -> factory:612ms building:69ms = 681ms
[./src/main/webapp/app/app.main.ts] ./src/main/webapp/app/app.main.ts 583 bytes {1} [built]
factory:285ms building:2304ms = 2589ms
[./src/main/webapp/app/app.module.ts] ./src/main/webapp/app/app.module.ts 2.71 kB {1} [built]
[] -> factory:85ms building:79ms = 164ms
[./src/main/webapp/app/blocks/config/prod.config.ts] ./src/main/webapp/app/blocks/config/prod.config.ts 391 bytes {1} [built]
[] -> factory:88ms building:97ms dependencies:617ms = 802ms
[./src/main/webapp/app/blocks/config/uib-pagination.config.ts] ./src/main/webapp/app/blocks/config/uib-pagination.config.ts 1.5 kB {1} [built]
[] -> factory:374ms building:95ms dependencies:169ms = 638ms
[./src/main/webapp/app/blocks/interceptor/http.provider.ts] ./src/main/webapp/app/blocks/interceptor/http.provider.ts 1.6 kB {1} [built]
[] -> factory:378ms building:234ms dependencies:27ms = 639ms
[./src/main/webapp/app/entities/entity.module.ts] ./src/main/webapp/app/entities/entity.module.ts 1.36 kB {1} [built]
[] -> factory:377ms building:210ms dependencies:51ms = 638ms
[./src/main/webapp/app/polyfills.ts] ./src/main/webapp/app/polyfills.ts 202 bytes {2} [built]
factory:36ms building:2499ms = 2535ms
[./src/main/webapp/app/shared/index.ts] ./src/main/webapp/app/shared/index.ts 1.35 kB {1} [built]
[] -> factory:623ms building:39ms = 662ms
[./src/main/webapp/app/vendor.ts] ./src/main/webapp/app/vendor.ts 283 bytes {1} [built]
[] -> factory:25ms building:421ms = 446ms
[./src/main/webapp/content/css/global.css] ./src/main/webapp/content/css/global.css 1.05 kB {3} [built]
factory:287ms building:29ms = 316ms
[./src/main/webapp/manifest.webapp] ./src/main/webapp/manifest.webapp 61 bytes {2} [built]
[] -> factory:600ms dependencies:1ms building:584ms = 1185ms
+ 666 hidden modules
ERROR in [at-loader] ./src/main/webapp/app/entities/region-s/region-s-delete-dialog.component.ts:58:23
TS2559: Type 'typeof RegionSDeleteDialogComponent' has no properties in common with type 'Component'.
ERROR in [at-loader] ./src/main/webapp/app/entities/region-s/region-s-dialog.component.ts:95:27
TS2559: Type 'typeof RegionSDialogComponent' has no properties in common with type 'Component'.
ERROR in [at-loader] ./src/main/webapp/app/entities/region-s/region-s-dialog.component.ts:98:27
TS2559: Type 'typeof RegionSDialogComponent' has no properties in common with type 'Component'.
error Command failed with exit code 2.
error Command failed with exit code 1.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
Hi there,
Sorry if I post a question in this issue tracker. I'm working with JHipster 3.9.1, and try to use this elasticsearch-reindexer. Everything is fine until I try:
curl -X POST --header "Content-Type: application/json" --header "Accept: text/plain" --header "X-CSRF-TOKEN: e43e570d-e7d7-4b11-b026-b30eef275bc8" "http://localhost:8080/api/elasticsearch/index"
where the X-CSRF-TOKEN value is actual token value from my application. The problem is, I always get:
2016-10-17 01:13:41.206 DEBUG 19564 --- [ XNIO-2 task-4] c.t.u.aop.logging.LoggingAspect : Enter: <packages>.errors.ExceptionTranslator.processRuntimeException() with argument[s] = [org.springframework.web.HttpMediaTypeNotAcceptableException: Could not find acceptable representation]
2016-10-17 01:13:41.207 DEBUG 19564 --- [ XNIO-2 task-4] c.t.u.aop.logging.LoggingAspect : Exit: <packages>.errors.ExceptionTranslator.processRuntimeException() with result = <500 Internal Server Error, <packages>.web.rest.errors.ErrorVM@3ef6873,{}>
2016-10-17 01:13:41.207 WARN 19564 --- [ XNIO-2 task-4] .w.s.m.s.DefaultHandlerExceptionResolver : Resolved exception caused by Handler execution: org.springframework.web.HttpMediaTypeNotAcceptableException: Could not find acceptable representation
when invoking CURL command above.
I tried to change text/plain
to application/json
, and this is what I got:
{
"timestamp" : "2016-10-16T17:20:24.251+0000",
"status" : 403,
"error" : "Forbidden",
"message" : "Could not verify the provided CSRF token because your session was not found.",
"path" : "/api/elasticsearch/index"
}
My question is, how to make this CURL invocation work?
Thanks for any comments and or suggestions.
Register as post entity hook during first run so that the generator will be automatically invoked during entity creation refer http://jhipster.github.io/modules/marketplace/#/details/generator-jhipster-entity-audit for example
Hi,
Could somebody please list the version numbers of each component for this awesome generator to work flawlessly ?
Thanks
Having got a basic jhipster app working with some generated entities and your reindexer I'm trying to target a pre-existing mysql schema where the pk is not an auto-generated id.
I've changed my domain class Gn_client from...
@id
@GeneratedValue(strategy = GenerationType.AUTO)
private Long id;
to...
@id
@SiZe(max = 5)
@column(name = "instanceId", length = 5)
private String instanceId;
and to reflect the change of type of the id I've changed the generated ElasticsearchIndexService.reindexAll() replacing...
reindexForClass(Gn_client.class, gn_clientRepository, gn_clientSearchRepository) with ...
reindexForStringClass(Gn_client.class, gn_clientRepository, gn_clientSearchRepository)
within which I use <T, String> rather than <T, Long>
However I get a runtime error at startup...
Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'elasticsearchIndexService': Unsatisfied dependency expressed through field 'gn_clientSearchRepository'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'gn_clientSearchRepository': Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: No id property found for class com.dan.jh.domain.Gn_client!
The Gn_clientSearchRepository has Long changed to String...
public interface Gn_clientSearchRepository extends ElasticsearchRepository<Gn_client, String>
Any pointers as to why it still seems to be looking for an "id property" would be much appreciated.
Dan
ElasticsearchIndexResource:
import com.mycompany.myapp.web.rest.util.HeaderUtil;
import com.codahale.metrics.annotation.Timed;
ElasticsearchIndexService:
import com.codahale.metrics.annotation.Timed;
import org.elasticsearch.indices.IndexAlreadyExistsException;
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.