#Fitness Application ( Coach )

37 messages ยท Page 1 of 1 (latest)

alpine furnace
#

Does the user table exist in your DB with the correct columns?

alpine furnace
#

Make sure you are printing the stack trace

#

and show the said stack trace here

flint kernel
#

how ?

alpine furnace
#

Can you show your controller?

flint kernel
#

here is my controller

flint kernel
alpine furnace
#

That doesn't seem to do sign-in logic

flint kernel
alpine furnace
#

Can you show the controller doing the sign in?

flint kernel
alpine furnace
#

Are you getting any logs when making the request?

flint kernel
#

give me second i'll send the logs

alpine furnace
#

PSQLException: ERROR: relation "user" does not exist

#

that's in the logs

#

you don't have a user table in your DB

flint kernel
#

But i have user table
Let me double check again

alpine furnace
#

maybe it's in the wrong DB

flint kernel
# alpine furnace maybe it's in the wrong DB

i created a database (coachdb) and because i'm using JDBC i introduce my entity (User) to database using CrudRepository and when i check my database tables all of them are valid let me show you

alpine furnace
#

The application is using Postgres, not couchdb

flint kernel
#

NOT COUCH DB , Coach db as a Athlete and Coach

alpine furnace
#

ah ok

flint kernel
#

this is my database and tables

alpine furnace
#

How is your application connected to it?

flint kernel
alpine furnace
#

I meant the DB connection itself

#

probably in the application.properties

boreal mesaBOT
#
spring:
  main:
    web-application-type: servlet
  application:
    name: CoachBackend
    user-route: "api/v1/users/"
    auth-route: "api/v1/auth/"
  datasource:
    url: jdbc:postgresql://localhost:5432/coachdb
    username: amirgolmoradi
    password: password
    driver-class-name: org.postgresql.Driver
    hikari:
      minimum-idle: 5
      maximum-pool-size: 10
      idle-timeout: 30000
      connection-timeout: 20000
  jpa:
    hibernate:
      ddl-auto: validate
    show-sql: true
    properties:
      hibernate:
        format_sql: true

  # SECURITY CONFIG
  security:
    user:
      name: admin
      password: admin
    jwt:
      secret-key: 3d4d28498689bac821ec4b1718fe41ac93bc56e6540eaa76e09679184efc87d1
      expiration-time: 1_296_000_000 // 15 Days


    # Flyway Configuration
  flyway:
    enabled: true
    baseline-on-migrate: true
    locations: db/migration
  # Logging Configuration
logging:
  level:
    org.springframework.security: trace
flint kernel
#

If you still need more details , i'll be happy if you check the source code

all of my Dao / Repository /Security is on Infrastructure folder

Entity is on Domain Folder
Controller is on Presentation

alpine furnace
#

try setting the schema name to public

flint kernel
alpine furnace
#

it's just a different property

#

change the spring.datasource.url to jdbc:postgresql://localhost:5432/coachdb?currentSchema=public

flint kernel
#

hey buddy i fixed the problem