Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NoSuchMethodError: net.fortuna.ical4j.model.PropertyList.add #137

Open
sysmat opened this issue Sep 9, 2020 · 6 comments
Open

NoSuchMethodError: net.fortuna.ical4j.model.PropertyList.add #137

sysmat opened this issue Sep 9, 2020 · 6 comments

Comments

@sysmat
Copy link

sysmat commented Sep 9, 2020

Reproduce

CalendarRequest calendarRequest = new CalendarRequest();
calendarRequest.setCalendar(event);
VEvent event = new VEvent(start, end, "adding new event");
Property orginizer = new Organizer("mailto:moj.ver@regin.si");
event.add(orginizer);
CalendarRequest calendarRequest = new CalendarRequest();
calendarRequest.setCalendar(event);

Steps to reproduce the issue:

  • caldav4j 1.0.1
  • ical4j 4.0.0-alpha6
  • server name and version | url
  • link to code, including:
  • gists with proper highlight/indent, avoid inline code without highlight/indent
  • pull requests or git patches useful to reproduce the issue
  • link to HTTP trace (it's useful because not all servers implement ALL the specs)

I expect

to send event to sogo

Instead

run time exception

Notes

Further notes you want to attach

@TheAntimist
Copy link
Member

@sysmat I need more detail on the error and stack trace for it

@sysmat
Copy link
Author

sysmat commented Sep 9, 2020

  • I'm struggling for logging http 4 client(In netbeans) I try java switches, log4j nothing work
  • stack
    calendarRequest.setCalendar(event); // this is error
Exception in thread "main" java.lang.NoSuchMethodError: net.fortuna.ical4j.model.PropertyList.add(Lnet/fortuna/ical4j/model/Property;)Z
	at com.github.caldav4j.model.request.CalendarRequest.setCalendar(CalendarRequest.java:112)
	at com.github.caldav4j.model.request.CalendarRequest.setCalendar(CalendarRequest.java:127)

  • when I use previuese error gone but http status=500
net.fortuna.ical4j.model.Calendar calendar = new net.fortuna.ical4j.model.Calendar();
calendar.add(event);
CalendarRequest calendarRequest = new CalendarRequest();
calendarRequest.setCalendar(event);

status=500
response=the called object returned no result

@TheAntimist
Copy link
Member

TheAntimist commented Sep 9, 2020

Can you try this with ical4j 3.x? That could be the issue in this case.

@sysmat
Copy link
Author

sysmat commented Sep 9, 2020

  • but version 3 dosen't have some methods to create event
net.fortuna.ical4j.model.Calendar calendar = new net.fortuna.ical4j.model.Calendar();

        Temporal start = LocalDate.now().atTime(8, 0);
        Temporal end = LocalDate.now().atTime(9, 0);
        VEvent event = new VEvent(start, end, "ZZZZ1111");


        Property orginizer = new Organizer("mailto:aaa.bbb@cccc.si");
        event.add(orginizer);

        ParameterList plist = new ParameterList();
        plist.add(new PartStat("NEED-ACTION"));
        Property attende = new Attendee(plist, "mailto:ddd.nnn@cccc.si");
        event.add(attende);

        calendar.add(event);

        CalendarRequest calendarRequest = new CalendarRequest();
        calendarRequest.setCalendar(event);

        HttpClient client = buildHttpClient(username, password);
        HttpPutMethod put = factory.createPutMethod(uri, calendarRequest);

        HttpResponse response = client.execute(put);
        int status = response.getStatusLine().getStatusCode();
        System.out.println("status="+status);
        System.out.println("response="+mapInputStream(response.getEntity().getContent()));

@sysmat
Copy link
Author

sysmat commented Sep 9, 2020

this is PUT req:

BEGIN:VCALENDAR
BEGIN:VEVENT
DTSTAMP:20200909T122214Z
DTSTART:20200909T080000
DTEND:20200909T090000
SUMMARY:ZZZZ1111
ORGANIZER:mailto:xxx@xxx
ATTENDEE:mailto:xxx@xxx
END:VEVENT
END:VCALENDAR

@ioggstream
Copy link
Member

@sysmat can you please link a complete stack trace?

1- paste your full stack trace (without personal information :P ) to a website like https://pastebin.com/
2- link your full stack trace here :)

Have a nice day, R.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants