Разница между страницами «JHipster» и «JMC»

Материал из Home Wiki
(Различия между страницами)
Перейти к навигации Перейти к поиску
 
 
Строка 1: Строка 1:
[[:Категория:Работа]]
Видео: https://www.youtube.com/watch?v=wm2JNlaJJ5k


== Применение material-design ==
GIST: https://gist.github.com/aragozin/6ac622de6328a1b6ee58a1bf6f2e523d
npm install -g generator-jhipster-bootstrap-material-design
yo jhipster-bootstrap-material-design


== Добавление/редактирование сущности ==
JMC: https://download.oracle.com/otn-pub/java/jmc/7.1.2+04/a4634525489241b9a9e1aa73d9e118e6/jmc-7.1.2_windows-x64.zip
yo jhipster:entity points


[[Категория:Java]]
Для подключения к weblogic нужно докинуть  wlclient.jar, wljmxclient.jar в катоалог с jmc и настроить jmc.ini:
[[Категория:JHipster]]
[[Категория:Работа]]


== Angular4 ==
<nowiki>
=== Использование привязки на своей новой странице ===
-Djmx.remote.protocol.provider.pkgs=weblogic.management.remote
Прописать в родительский модуль
-Djava.naming.factory.initial=weblogic.jndi.WLInitialContextFactory
# <syntaxhighlight>
-Xbootclasspath/a:wlclient.jar;wljmxclient.jar
import { ProzvonSharedLibsModule } from '../shared';
</nowiki>
</syntaxhighlight>
# <syntaxhighlight>
@NgModule({
  imports: [
    ...
    ProzvonSharedLibsModule
  ],
  ...
});
</syntaxhighlight>
 
=== Пересобрать клиентскую часть ===
<syntaxhighlight lang="bash">
yarn run cleanup && yarn run webpack:build:main
</syntaxhighlight>
В production режиме:
<syntaxhighlight lang="bash">
yarn run cleanup && yarn run webpack:prod
</syntaxhighlight>
 
 
=== Запустить e2e тесты ===
# Запустить приложение и проверить, что админский доступ работает по admin/admin
# <syntaxhighlight lang="bash">
yarn e2e
</syntaxhighlight>
 
== Запустить без liquibase ==
 
Чтобы выставить профиль запуска без Liquibase нужно добавить к gradle параметр -Pno-liquibase
 
[https://www.jhipster.tech/profiles/ Профили запуска]
 
== Запуск и отладка тестов в Eclipse ==
Если не работает запуск и вываливается с ошибкой:
<syntaxhighlight>
Caused by: org.hibernate.cache.NoCacheRegionFactoryAvailableException: Second-level cache is used in the application, but property hibernate.cache.region.factory_class is not given; please either disable second level cache or set correct region factory using the hibernate.cache.region.factory_class setting and make sure the second level cache provider (hibernate-infinispan, e.g.) is available on the classpath.
</syntaxhighlight>
 
# открыть файл src/test/resources/config/application.yml
# отредактировать (добавить перевод)
# сохранить
# вернуть (удалить перевод)
# сохранить
 
и пробовать запустить заново.
 
== gulp itest в фоне ==
'''<big>!!! Не актуально с версии 4.9.0, используется chrome в headless режиме !!!</big>'''
 
 
https://gist.github.com/praphull27/6950d2a6c76a6e68acb7
 
Подготовительная часть 1 (установить компоненты в Ubuntu):
<syntaxhighlight>
sudo apt-get install libxpm4 libxrender1 libgtk2.0-0 libnss3 libgconf-2-4
sudo apt-get install google-chrome-stable
sudo apt-get install xvfb gtk2-engines-pixbuf
sudo apt-get install xfonts-cyrillic xfonts-100dpi xfonts-75dpi xfonts-base xfonts-scalable
sudo apt-get install imagemagick x11-apps
</syntaxhighlight>
 
Подготовительная часть 2 (запуск из корня проекта):
<syntaxhighlight>
npm install protractor
./node_modules/protractor/bin/webdriver-manager update
</syntaxhighlight>
 
Запуск тестов в фоне, чтобы не мешали:
<syntaxhighlight>
Xvfb -ac :99 -screen 0 1280x1024x16 &
disown $1
export DISPLAY=:99
gulp itest
</syntaxhighlight>
Если Xvfb уже запущен на 99 консоли, то просто ругнется и дальше все заработает.
 
Если необходимо отследить прохождение теста в браузере, это можно сделать так:
<syntaxhighlight>
x11vnc -display :99 -localhost &
vncviewer :0
</syntaxhighlight>
 
== Jenkins e2e test script  ==
<syntaxhighlight>
/usr/bin/yarn add webpack
/usr/bin/yarn test
 
/opt/gradle/bin/gradle clean
/usr/bin/yarn run cleanup
/opt/gradle/bin/gradle assemble
/usr/bin/yarn run webpack:build:main
 
/opt/gradle/bin/gradle &
bootPid=$!
/bin/sleep 30s
/usr/bin/yarn e2e
/bin/kill $bootPid
</syntaxhighlight>
 
== Update kafka version ==
 
UPDATE KAFKA 0.10.1.1 -> 0.10.2.1 + UPDATE Spring cloud 1.1.X -> 1.2.0
<syntaxhighlight>
docker pull wurstmeister/kafka:0.10.2.1
</syntaxhighlight>
 
Поправить версию в kafka.yml (0.10.1.1 -> 0.10.2.1)
<syntaxhighlight>
~/telestat$ docker-compose -f src/main/docker/kafka.yml up -d
</syntaxhighlight>
 
== Ошибки ==
 
=== outputBindingLifecycle ===
Когда не работает Kafka возникает ошибка:
<syntaxhighlight>
org.springframework.context.ApplicationContextException: Failed to start bean 'outputBindingLifecycle'; nested exception is org.springframework.cloud.stream.binder.BinderException: Exception thrown while building outbound endpoint
</syntaxhighlight>
Решение: перезапустить docker
 
=== inputBindingLifecycle ===
Проблема на стороне zookeeper:
<syntaxhighlight>
KafkaTopicProvisioner: The number of expected partitions was: 1, but 0 has been found instead.There will be 1 idle consumers
Failed to start bean 'inputBindingLifecycle'; nested exception is org.springframework.cloud.stream.binder.BinderException: Exception thrown while starting
consumer
</syntaxhighlight>
Решение: пересоздать docker с zookeeper и kafka.
 
== Ошибки Eclipse ==
 
JHipster IDE не работает: надо поставить XText
http://download.eclipse.org/modeling/tmf/xtext/updates/composite/releases/
http://download.eclipse.org/modeling/tmf/xtext/updates/composite/milestones/
 
В Oxygen.2 (4.7.2) установилась версия 2.13.0 и все заработало, устанавливалось минут 5.
 
== Update PlantUML ==
Найти и заменить файл plantuml-epl-8059.jar
 
https://wolf-a.ru/plantuml/plantuml-epl-8059.jar
 
Внутри заменен plantuml на свежую версию.
 
[[Категория:Работа]]
[[Категория:Java]]
[[Категория:JHipster]]
[[Категория:Gradle]]
[[Категория:Docker]]

Версия 12:54, 26 ноября 2020

Видео: https://www.youtube.com/watch?v=wm2JNlaJJ5k

GIST: https://gist.github.com/aragozin/6ac622de6328a1b6ee58a1bf6f2e523d

JMC: https://download.oracle.com/otn-pub/java/jmc/7.1.2+04/a4634525489241b9a9e1aa73d9e118e6/jmc-7.1.2_windows-x64.zip

Для подключения к weblogic нужно докинуть wlclient.jar, wljmxclient.jar в катоалог с jmc и настроить jmc.ini:

-Djmx.remote.protocol.provider.pkgs=weblogic.management.remote -Djava.naming.factory.initial=weblogic.jndi.WLInitialContextFactory -Xbootclasspath/a:wlclient.jar;wljmxclient.jar