Skip to content

Bug: Error when writing as an iCal file #13

@JerJohn15

Description

@JerJohn15

I am trying to create a small demo of bi weekly to see if I can get it to work before implementing it into Demo 2. I've been following the getting started guide but have been unable to successfully see a ics file when I click run. Instead I get the following output:

Exception in thread "main" java.lang.NoClassDefFoundError: com/github/mangstadt/vinnie/SyntaxStyle
	at biweekly.ICalVersion.<clinit>(ICalVersion.java:39)
	at biweekly.io.text.ICalWriter.<init>(ICalWriter.java:137)
	at biweekly.io.chain.ChainingTextWriter.go(ChainingTextWriter.java:162)
	at biweekly.io.chain.ChainingTextWriter.go(ChainingTextWriter.java:151)
	at Tests.TestApp.main(TestApp.java:48)
Caused by: java.lang.ClassNotFoundException: com.github.mangstadt.vinnie.SyntaxStyle
	at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
	... 5 more

At first I thought there was something wrong with the way I had been implementing the date object into "DateStart" (many of the Date functions have been deprecated) but I found that not to be the case when I had debugged the file. So far I have not discovered the root cause of this, but the line in question is java Biweekly.write(ical).go(file). This is the entire class:

package Tests;

import biweekly.Biweekly;
import biweekly.ICalendar;
import biweekly.component.VEvent;
import biweekly.property.DateStart;
import biweekly.property.Summary;
import java.io.File;
import java.io.IOException;
import java.util.Calendar;
import java.util.Date;
/**
 *
 * @author Jeremiah
 */
public class TestApp {
    
    
    
    public static void main(String[] args) throws IOException{
         String title = "Workout: Chest Day";
    String description = "Benchpress - 3 sets 10 reps \n "
            + "Dips - 3 sets 10 reps \n" + "Pushups - 2 sets 20 reps \n";
    String fileName = "workout_chest.ics";

    Calendar cal = Calendar.getInstance();
    cal.setTimeInMillis(0);
    cal.set(2016,11,28,0,0,0);
    Date dateVal = cal.getTime();
    
        ICalendar ical = new ICalendar();
        VEvent event = new VEvent();
        
          Summary summary = event.setSummary(title);
          summary.setLanguage("en-us");
          
        DateStart startDate = new DateStart(dateVal, false);
        event.setDateStart(startDate);
        
        ical.addEvent(event);  
        
        File file = new File(fileName);
        Biweekly.write(ical).go(file);
    }
    
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions