slabiak / AppointmentScheduler

Application to schedule appointments written in Java (Spring Boot)
MIT License
166 stars 94 forks source link

com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException: Unrecognized field "timePeroidsWithBreaksExcluded" (class com.example.slabiak.appointmentscheduler.model.DayPlan) #39

Open ptilli79 opened 1 year ago

ptilli79 commented 1 year ago

Hi, I cloned your AppointmentScheduler Repo, and followed the README for project setup. I am able to run the application, I can create a retail user, but when login in as a retail user and try to setup an appointment, the following error pups up:

On the broser: Tue Jun 06 18:18:32 EDT 2023 There was an unexpected error (type=Internal Server Error, status=500). The given string value: {"workingHours":{"start":[6,0],"end":[18,0]},"breaks":[],"timePeroidsWithBreaksExcluded":[{"start":[6,0],"end":[18,0]}]} cannot be transformed to Json object; nested exception is java.lang.IllegalArgumentException: The given string value: {"workingHours":{"start":[6,0],"end":[18,0]},"breaks":[],"timePeroidsWithBreaksExcluded":[{"start":[6,0],"end":[18,0]}]} cannot be transformed to Json object

On the IDE log: 2023-06-06 18:18:32.912 ERROR 31572 --- [nio-8080-exec-6] o.a.c.c.C.[.[.[/].[dispatcherServlet] : Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is org.springframework.dao.InvalidDataAccessApiUsageException: The given string value: {"workingHours":{"start":[6,0],"end":[18,0]},"breaks":[],"timePeroidsWithBreaksExcluded":[{"start":[6,0],"end":[18,0]}]} cannot be transformed to Json object; nested exception is java.lang.IllegalArgumentException: The given string value: {"workingHours":{"start":[6,0],"end":[18,0]},"breaks":[],"timePeroidsWithBreaksExcluded":[{"start":[6,0],"end":[18,0]}]} cannot be transformed to Json object] with root cause

com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException: Unrecognized field "timePeroidsWithBreaksExcluded" (class com.example.slabiak.appointmentscheduler.model.DayPlan), not marked as ignorable (2 known properties: "breaks", "workingHours"]) at [Source: (String)"{"workingHours":{"start":[6,0],"end":[18,0]},"breaks":[],"timePeroidsWithBreaksExcluded":[{"start":[6,0],"end":[18,0]}]}"; line: 1, column: 91] (through reference chain: com.example.slabiak.appointmentscheduler.model.DayPlan["timePeroidsWithBreaksExcluded"])

peterboivin commented 1 year ago

If you are using my most recent checkin, I corrected the spelling of period. It is originally spelled as "peroid" . In your error message it is showing the misspelled version.

On Tue, Jun 6, 2023, 6:23 PM ptilli79 @.***> wrote:

Hi, I cloned your AppointmentScheduler Repo, and followed the README for project setup. I am able to run the application, I can create a retail user, but when login in as a retail user and try to setup an appointment, the following error pups up:

On the broser: Tue Jun 06 18:18:32 EDT 2023 There was an unexpected error (type=Internal Server Error, status=500). The given string value: {"workingHours":{"start":[6,0],"end":[18,0]},"breaks":[],"timePeroidsWithBreaksExcluded":[{"start":[6,0],"end":[18,0]}]} cannot be transformed to Json object; nested exception is java.lang.IllegalArgumentException: The given string value: {"workingHours":{"start":[6,0],"end":[18,0]},"breaks":[],"timePeroidsWithBreaksExcluded":[{"start":[6,0],"end":[18,0]}]} cannot be transformed to Json object

On the IDE log: 2023-06-06 18:18:32.912 ERROR 31572 --- [nio-8080-exec-6] o.a.c.c.C.[.[.[/].[dispatcherServlet] : Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is org.springframework.dao.InvalidDataAccessApiUsageException: The given string value: {"workingHours":{"start":[6,0],"end":[18,0]},"breaks":[],"timePeroidsWithBreaksExcluded":[{"start":[6,0],"end":[18,0]}]} cannot be transformed to Json object; nested exception is java.lang.IllegalArgumentException: The given string value: {"workingHours":{"start":[6,0],"end":[18,0]},"breaks":[],"timePeroidsWithBreaksExcluded":[{"start":[6,0],"end":[18,0]}]} cannot be transformed to Json object] with root cause

com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException: Unrecognized field "timePeroidsWithBreaksExcluded" (class com.example.slabiak.appointmentscheduler.model.DayPlan), not marked as ignorable (2 known properties: "breaks", "workingHours"]) at [Source: (String)"{"workingHours":{"start":[6,0],"end":[18,0]},"breaks":[],"timePeroidsWithBreaksExcluded":[{"start":[6,0],"end":[18,0]}]}"; line: 1, column: 91] (through reference chain: com.example.slabiak.appointmentscheduler.model.DayPlan["timePeroidsWithBreaksExcluded"])

— Reply to this email directly, view it on GitHub https://github.com/slabiak/AppointmentScheduler/issues/39, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAO6UB7UEN6MGFSVG7JRPCTXJ6UVBANCNFSM6AAAAAAY5A5U34 . You are receiving this because you are subscribed to this thread.Message ID: @.***>

peterboivin commented 1 year ago

Ignore this comment. I didn't notice that you aren't using my forked branch.

On Tue, Jun 6, 2023, 6:38 PM Peter Boivin @.***> wrote:

If you are using my most recent checkin, I corrected the spelling of period. It is originally spelled as "peroid" . In your error message it is showing the misspelled version.

On Tue, Jun 6, 2023, 6:23 PM ptilli79 @.***> wrote:

Hi, I cloned your AppointmentScheduler Repo, and followed the README for project setup. I am able to run the application, I can create a retail user, but when login in as a retail user and try to setup an appointment, the following error pups up:

On the broser: Tue Jun 06 18:18:32 EDT 2023 There was an unexpected error (type=Internal Server Error, status=500). The given string value: {"workingHours":{"start":[6,0],"end":[18,0]},"breaks":[],"timePeroidsWithBreaksExcluded":[{"start":[6,0],"end":[18,0]}]} cannot be transformed to Json object; nested exception is java.lang.IllegalArgumentException: The given string value: {"workingHours":{"start":[6,0],"end":[18,0]},"breaks":[],"timePeroidsWithBreaksExcluded":[{"start":[6,0],"end":[18,0]}]} cannot be transformed to Json object

On the IDE log: 2023-06-06 18:18:32.912 ERROR 31572 --- [nio-8080-exec-6] o.a.c.c.C.[.[.[/].[dispatcherServlet] : Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is org.springframework.dao.InvalidDataAccessApiUsageException: The given string value: {"workingHours":{"start":[6,0],"end":[18,0]},"breaks":[],"timePeroidsWithBreaksExcluded":[{"start":[6,0],"end":[18,0]}]} cannot be transformed to Json object; nested exception is java.lang.IllegalArgumentException: The given string value: {"workingHours":{"start":[6,0],"end":[18,0]},"breaks":[],"timePeroidsWithBreaksExcluded":[{"start":[6,0],"end":[18,0]}]} cannot be transformed to Json object] with root cause

com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException: Unrecognized field "timePeroidsWithBreaksExcluded" (class com.example.slabiak.appointmentscheduler.model.DayPlan), not marked as ignorable (2 known properties: "breaks", "workingHours"]) at [Source: (String)"{"workingHours":{"start":[6,0],"end":[18,0]},"breaks":[],"timePeroidsWithBreaksExcluded":[{"start":[6,0],"end":[18,0]}]}"; line: 1, column: 91] (through reference chain: com.example.slabiak.appointmentscheduler.model.DayPlan["timePeroidsWithBreaksExcluded"])

— Reply to this email directly, view it on GitHub https://github.com/slabiak/AppointmentScheduler/issues/39, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAO6UB7UEN6MGFSVG7JRPCTXJ6UVBANCNFSM6AAAAAAY5A5U34 . You are receiving this because you are subscribed to this thread.Message ID: @.***>

ptilli79 commented 1 year ago

Ohh didn't notice that, thanks for bringing that up! So, you would recomend to use your forked branch?

peterboivin commented 1 year ago

my forked branch is working for me. There were a few things I needed to change to make it work. https://github.com/peterboivin/AppointmentScheduler

On Tue, Jun 6, 2023 at 7:11 PM ptilli79 @.***> wrote:

Ohh didn't notice that, thanks for bringing that up! So, you would recomend to use your forked branch?

— Reply to this email directly, view it on GitHub https://github.com/slabiak/AppointmentScheduler/issues/39#issuecomment-1579580195, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAO6UB2FPX5LWIEOGXMDXCLXJ62LJANCNFSM6AAAAAAY5A5U34 . You are receiving this because you commented.Message ID: @.***>

-- Peter Boivin PH#: 508 755 1721 http://voice.google.com/calls?a=nc,%2B15087551721 https://bit.ly/xscranberry-grape http://www.linkedin.com/in/peterboivin

ptilli79 commented 1 year ago

I checked your branch, but I still see the spelling incorrectly in some DayPlan (for instance):

public List<TimePeroid> time**Peroids**WithBreaksExcluded() {
    ArrayList<TimePeroid> timePeroidsWithBreaksExcluded = new ArrayList<>();
    time**Peroids**WithBreaksExcluded.add(getWorkingHours());
    List<TimePeroid> breaks = getBreaks();

    if (!breaks.isEmpty()) {
        ArrayList<TimePeroid> toAdd = new ArrayList();
        for (**TimePeroid** break1 : breaks) {
            if (break1.getStart().isBefore(workingHours.getStart())) {
                break1.setStart(workingHours.getStart());
            }
            if (break1.getEnd().isAfter(workingHours.getEnd())) {
                break1.setEnd(workingHours.getEnd());
            }
            for (TimePeroid peroid : time**Peroids**WithBreaksExcluded) {
peterboivin commented 1 year ago

try "spelling_corrections" branch and see if that helps.

On Tue, Jun 6, 2023 at 7:56 PM ptilli79 @.***> wrote:

I checked your branch, but I still see the spelling incorrectly in some DayPlan (for instance):

public List timePeroidsWithBreaksExcluded() { ArrayList timePeroidsWithBreaksExcluded = new ArrayList<>(); timePeroidsWithBreaksExcluded.add(getWorkingHours()); List breaks = getBreaks();

if (!breaks.isEmpty()) {
    ArrayList<TimePeroid> toAdd = new ArrayList();
    for (**TimePeroid** break1 : breaks) {
        if (break1.getStart().isBefore(workingHours.getStart())) {
            break1.setStart(workingHours.getStart());
        }
        if (break1.getEnd().isAfter(workingHours.getEnd())) {
            break1.setEnd(workingHours.getEnd());
        }
        for (TimePeroid peroid : time**Peroids**WithBreaksExcluded) {

— Reply to this email directly, view it on GitHub https://github.com/slabiak/AppointmentScheduler/issues/39#issuecomment-1579615252, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAO6UBYQK4ANBZINV56I3BDXJ67TVANCNFSM6AAAAAAY5A5U34 . You are receiving this because you commented.Message ID: @.***>

-- Peter Boivin PH#: 508 755 1721 http://voice.google.com/calls?a=nc,%2B15087551721 https://bit.ly/xscranberry-grape http://www.linkedin.com/in/peterboivin

ptilli79 commented 1 year ago

Same error but correctly spelled jajaja.... I am using your "spelling_corrections" branch. Not sure what to do now?

2023-06-06 21:43:47.552 ERROR 33336 --- [nio-8080-exec-3] o.a.c.c.C.[.[.[/].[dispatcherServlet] : Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is org.springframework.dao.InvalidDataAccessApiUsageException: The given string value: {"workingHours":{"start":[6,0],"end":[18,0]},"breaks":[],"timePeriodsWithBreaksExcluded":[{"start":[6,0],"end":[18,0]}]} cannot be transformed to Json object; nested exception is java.lang.IllegalArgumentException: The given string value: {"workingHours":{"start":[6,0],"end":[18,0]},"breaks":[],"timePeriodsWithBreaksExcluded":[{"start":[6,0],"end":[18,0]}]} cannot be transformed to Json object] with root cause

com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException: Unrecognized field "timePeriodsWithBreaksExcluded" (class com.example.slabiak.appointmentscheduler.model.DayPlan), not marked as ignorable (2 known properties: "breaks", "workingHours"]) at [Source: (String)"{"workingHours":{"start":[6,0],"end":[18,0]},"breaks":[],"timePeriodsWithBreaksExcluded":[{"start":[6,0],"end":[18,0]}]}"; line: 1, column: 91] (through reference chain: com.example.slabiak.appointmentscheduler.model.DayPlan["timePeriodsWithBreaksExcluded"])

peterboivin commented 1 year ago

You might have wrong data in your dB. I noticed that myself. When testing I had to clean my data often.

On Tue, Jun 6, 2023, 9:55 PM ptilli79 @.***> wrote:

Same error but correctly spelled jajaja.... I am using your "spelling_corrections" branch. Not sure what to do now?

2023-06-06 21:43:47.552 ERROR 33336 --- [nio-8080-exec-3] o.a.c.c.C.[.[.[/].[dispatcherServlet] : Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is org.springframework.dao.InvalidDataAccessApiUsageException: The given string value: {"workingHours":{"start":[6,0],"end":[18,0]},"breaks":[],"timePeriodsWithBreaksExcluded":[{"start":[6,0],"end":[18,0]}]} cannot be transformed to Json object; nested exception is java.lang.IllegalArgumentException: The given string value: {"workingHours":{"start":[6,0],"end":[18,0]},"breaks":[],"timePeriodsWithBreaksExcluded":[{"start":[6,0],"end":[18,0]}]} cannot be transformed to Json object] with root cause

com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException: Unrecognized field "timePeriodsWithBreaksExcluded" (class com.example.slabiak.appointmentscheduler.model.DayPlan), not marked as ignorable (2 known properties: "breaks", "workingHours"]) at [Source: (String)"{"workingHours":{"start":[6,0],"end":[18,0]},"breaks":[],"timePeriodsWithBreaksExcluded":[{"start":[6,0],"end":[18,0]}]}"; line: 1, column: 91] (through reference chain: com.example.slabiak.appointmentscheduler.model.DayPlan["timePeriodsWithBreaksExcluded"])

— Reply to this email directly, view it on GitHub https://github.com/slabiak/AppointmentScheduler/issues/39#issuecomment-1579741098, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAO6UB3ZP3JKG3VOSAFJ73TXJ7NRZANCNFSM6AAAAAAY5A5U34 . You are receiving this because you commented.Message ID: @.***>

ptilli79 commented 1 year ago

Hi, yes I cleaned up the DB and make sure I was using your "spelling_corrections" branch, but still got stuck with that error. I then tried to modify the "appointmentscheduler.sql" by deleting the "timePeriodsWithBreaksExcluded" attribute, and the app started to work. I am now able to book appointments, create works, providers, customers, etc. But now I am curious about Mail Service. I resgistered myself as a retail customer and configured my email, and was expecting that when booking an appointment a confirmation email should be received, but that is not happening. Any advises on that particular? Thanks!

slabiak commented 1 year ago

@ptilli79 sorry for late reply, do you still need some help with this?