Seite 1 von 1

WARNUNG: Loading plugin file failed

Verfasst: 22 Dez 2006, 11:59
von stefan_OSX
Hallo,
ich habe mir das CalendarExportPlugin ein bisschen umgeschrieben, aber wenn ich es benutzen will, bekomme ich folgende Fehlermeldung beim starten vom TV-Browser:
11:54:28 WARNUNG: Loading plugin file failed: /Library/Application Support/TV-Browser/plugins/CalendarDirectExportPlugin.jar
util.exc.TvBrowserException: [PluginLoader.error.2#Could not load plugin /Library/Application Support/TV-Browser/plugins/CalendarDirectExportPlugin.jar.]
at tvbrowser.core.PluginLoader.loadJavaPlugin(PluginLoader.java:273)
at tvbrowser.core.PluginLoader.loadPlugin(PluginLoader.java:133)
at tvbrowser.core.PluginLoader.loadPlugins(PluginLoader.java:199)
at tvbrowser.core.PluginLoader.loadAllPlugins(PluginLoader.java:237)
at tvbrowser.TVBrowser.main(TVBrowser.java:278)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at apple.launcher.LaunchRunner.run(LaunchRunner.java:88)
at apple.launcher.LaunchRunner.callMain(LaunchRunner.java:50)
at apple.launcher.JavaApplicationLauncher.launch(JavaApplicationLauncher.java:52)
Caused by: java.lang.ClassNotFoundException: calendardirectexportplugin.CalendarDirectExportPlugin
at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at java.net.FactoryURLClassLoader.loadClass(URLClassLoader.java:580)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at tvbrowser.core.PluginLoader.loadJavaPlugin(PluginLoader.java:269)
... 11 more
11:54:28 WARNUNG: Key 'PluginLoader.error.2' not found in resource bundle 'tvbrowser.core.core'
util.exc.TvBrowserException: [PluginLoader.error.2#Could not load plugin /Library/Application Support/TV-Browser/plugins/CalendarDirectExportPlugin.jar.]
at tvbrowser.core.PluginLoader.loadJavaPlugin(PluginLoader.java:273)
at tvbrowser.core.PluginLoader.loadPlugin(PluginLoader.java:133)
at tvbrowser.core.PluginLoader.loadPlugins(PluginLoader.java:199)
at tvbrowser.core.PluginLoader.loadAllPlugins(PluginLoader.java:237)
at tvbrowser.TVBrowser.main(TVBrowser.java:278)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at apple.launcher.LaunchRunner.run(LaunchRunner.java:88)
at apple.launcher.LaunchRunner.callMain(LaunchRunner.java:50)
at apple.launcher.JavaApplicationLauncher.launch(JavaApplicationLauncher.java:52)
Caused by: java.lang.ClassNotFoundException: calendardirectexportplugin.CalendarDirectExportPlugin
at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at java.net.FactoryURLClassLoader.loadClass(URLClassLoader.java:580)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at tvbrowser.core.PluginLoader.loadJavaPlugin(PluginLoader.java:269)
... 11 more
11:54:28 WARNUNG: Key 'PluginLoader.error.2' not found in resource bundle 'tvbrowser.core.core'
Weiß jemand an was das liegen kann?

Wenn es euch was hilft kann ich euch auch den neuen Quellcode hier reinstellen.

mfg Stefan

Verfasst: 22 Dez 2006, 17:28
von ds10
Wenn du den Namen eines Plugins änderst musst du auch das package auf genau diesen Namen ändern.

Verfasst: 22 Dez 2006, 18:20
von Gast
Ja das habe ich gemacht.
hab überall das CalendarExport in CalendarDirectExport geändert.

mfg Stefan

Verfasst: 22 Dez 2006, 18:24
von ds10
Du bekommst aber den Fehler

Code: Alles auswählen

Caused by: java.lang.ClassNotFoundException: calendardirectexportplugin.CalendarDirectExportPlugin
als ursächlichen Fehler, d.h. dass TVB die Klasse CalendarDirectExportPlugin nicht im package calendardirectexportplugin finden kann.

Verfasst: 22 Dez 2006, 18:45
von Gast
Die Klasse gibts aber
hier mal der Quellcode der einen Datei wo die Klasse realisiert wird.

Code: Alles auswählen

/*
 * Created on 18.06.2004
 */
package calendardirectexportplugin;

import java.awt.event.ActionEvent;
import java.io.File;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.util.Properties;

import javax.swing.AbstractAction;
import javax.swing.Action;
import javax.swing.JFileChooser;
import javax.swing.JOptionPane;

import util.ui.ExtensionFileFilter;
import util.ui.Localizer;
import devplugin.ActionMenu;
import devplugin.Plugin;
import devplugin.PluginInfo;
import devplugin.Program;
import devplugin.SettingsTab;
import devplugin.ThemeIcon;
import devplugin.Version;

/**
 * This Plugin exports vCal and iCal Files
 * 
 * @author bodo
 */
public class CalendarDirectExportPlugin extends devplugin.Plugin {
    /** Translator */
    private static final Localizer mLocalizer = Localizer.getLocalizerFor(CalendarDirectExportPlugin.class);

    /** The Exporter to use */
    private CalendarDirectExporter mExport = new CalendarDirectExporter();

    /** Path for saving the File */
    private String mSavePath;
    
    /** Settings */
    private Properties mSettings;
    
    /** The Default-Parameters */
    public static final String DEFAULT_PARAMETER = "{channel_name} - {title}\n{leadingZero(start_day,\"2\")}.{leadingZero(start_month,\"2\")}.{start_year} {leadingZero(start_hour,\"2\")}:{leadingZero(start_minute,\"2\")}-{leadingZero(end_hour,\"2\")}:{leadingZero(end_minute,\"2\")}\n\n{splitAt(short_info,\"78\")}\n\n";
    
    /*
     * (non-Javadoc)
     * 
     * @see devplugin.Plugin#getInfo()
     */
    public PluginInfo getInfo() {
        String name = mLocalizer.msg("pluginName", "Calendar direct export");
        String desc = mLocalizer.msg("description","Exports a Program as a vCal/iCal File. This File can easily imported in other Calendar Applications. Without asking for the file.");
        String author = "Stefan Hoelzl";
        return new PluginInfo(name, desc, author, new Version(0, 1));
    }

    public ThemeIcon getMarkIconFromTheme() {
      return new ThemeIcon("apps", "office-calendar", 16);
    }
    
    /*
     *  (non-Javadoc)
     * @see devplugin.Plugin#getContextMenuActions(devplugin.Program)
     */
    public ActionMenu getContextMenuActions(final Program program) {
        AbstractAction action = new AbstractAction() {

            public void actionPerformed(ActionEvent evt) {
                Program[] programArr = { program };
                doExport(programArr);
            }
        };
        action.putValue(Action.NAME, mLocalizer.msg("contextMenuText","Export direct to Calendar-File"));
        action.putValue(Action.SMALL_ICON, createImageIcon("apps", "office-calendar", 16));
        
        return new ActionMenu(action);
    }
    
    /*
     * (non-Javadoc)
     * 
     * @see devplugin.Plugin#canReceivePrograms()
     */
    public boolean canReceivePrograms() {
        return true;
    }    
    
    /**
     * This method is invoked for multiple program execution.
     * 
     * @see #canReceivePrograms()
     */
    public void receivePrograms(Program[] programArr) {
        doExport(programArr);
    }

    /**
     * Get Settings-Tab
     * @return SettingsTab
     */
    public SettingsTab getSettingsTab() {
        return new CalendarDirectSettingsTab(this, mSettings);
    }    
    
    /**
     * Stores the Settings
     * @return Settings
     */
    public Properties storeSettings() {
        return mSettings;
    }

    /**
     * Loads the Settings
     * @param settings Settings for this Plugin
     */
    public void loadSettings(Properties settings) {
        if (settings == null) {
            settings = new Properties();
        }

        this.mSettings = settings;
    }    
    
    /**
     * Called by the host-application during start-up.
     * 
     * @see #writeData(ObjectOutputStream)
     */
    public void readData(ObjectInputStream in) throws IOException,
            ClassNotFoundException {

        try {
            int version = in.readInt();
            mSavePath = (String) in.readObject();
        } catch (Exception e) {
           // e.printStackTrace();
            mSavePath = "";
        }
    }

    /**
     * Counterpart to loadData. Called when the application shuts down.
     * 
     * @see #readData(ObjectInputStream)
     */
    public void writeData(ObjectOutputStream out) throws IOException {
        out.writeInt(1);
        out.writeObject(mSavePath);
    }
    
    
    /**
     * Starts the Export
     * @param programArr Array of Programs to export
     */
    private void doExport(Program[] programArr) {
        File file = getFile();
        if (file != null) {
            
            if (file.exists()) {
                int result = JOptionPane.showConfirmDialog(getParentFrame(), 
                        mLocalizer.msg("overwriteMessage", "The File \n{0}\nalready exists. Overwrite it?", file.getAbsolutePath()),
                        mLocalizer.msg("overwriteTitle", "Overwrite?"),
                        JOptionPane.YES_NO_OPTION
                        );
                if (result != JOptionPane.YES_OPTION) {
                    return;
                }
            }

            mSavePath = file.getAbsolutePath();
    
			mExport.exportICal(file, programArr, mSettings);
        }
    }

	public File getFile() {
		return new File("/Users/stefan/kal.ics");
	}
}

Verfasst: 22 Dez 2006, 18:53
von ds10
Stimmen denn die Pfade in der CalendarDirectExportPlugin.jar?

Verfasst: 22 Dez 2006, 19:46
von Gast
welche pfade?

Verfasst: 22 Dez 2006, 20:50
von ds10
In der jar-Datei liegen die class-Dateien in Ordnern, also müsste auf unterer Ebene ein Ordner calendardirectexportplugin existieren, in dem dann die Datei CalendarDirectExportPlugin.class liegt.