Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

After that you can build the image with debugging WS turned on.

Update Process in docker-compose debugging ???

Imas Inotify in docker-compose debugging ???

Mysql in docker-compose debbuging ???



Local single-container debugging

If you are a Catalog WS developer the easiest and most comfortable way to debug code is use single container as a base image.

You can debug code in two ways:

  • in IDE - you can see only the stack trace of WebServices, which is relevant in most cases
  • inside container - it helps you find out what's happening inside docker while all of the components are working.


IDE debugging

To debug code in IDE  you should prepare your enviroment in such way:

your catalog_qt_2/server/catalog-ws-server/src/main/resources/application.properties  should look like this:

Code Block
languagejava
themeEclipse
firstline1
linenumberstrue
spring.datasource.url=jdbc:mysql://localhost:3306/itm_catalog_qt?serverTimezone=UTC

spring.datasource.username=itm_catalog_rw
spring.datasource.password=itm_catalog_rw
spring.jpa.properties.hibernate.jdbc.time_zone=UTC

server.error.include-message=always

spring.jpa.show-sql=false
spring.jpa.hibernate.ddl-auto=none

# This is additional http handler, on another port
# We need this one, in case we plan to use https
server.port=8081  # We have to change ports on our local instance, because 8080 is taken by container
server.http.port=8082
server.http.interface=0.0.0.0

keycloak.realm = ******** 
keycloak.auth-server-url= *******
keycloak.resource= *********
keycloak.realm-key= ********
keycloak.bearer-only = true
keycloak.public-client=true
keycloak.principal-attribute=preferred_username

spring.mvc.dispatch-options-request=true

# These need to be commented
# If you plan to use HTTPS, make sure to uncomment this one
#server.ssl.key-store=file:///home/imas/cert/keystore.p12
#server.ssl.key-store-password=catalogqt
#server.ssl.keyStoreType=PKCS12
#server.ssl.keyAlias=tomcat

swagger-ui.authorization.header=true 


and then run this command

Code Block
docker run -i \
  -p 8080:8080 \ 
  -p 3306:3306 \
  -v `pwd`/imasdb:/home/imas/public/imasdb \
  --name catalogqt_debug_ide -t catalogqt


And in your IDE connect properly to DB and run application in debug mode.






Running tests

You can run unit tests by changing directory to: ws/catalog-ws and running.

...