markus
I'm new here

ClassNotFoundException beim Aufruf einer Executable

Hallo,

ich habe ein Modul mit einer ExecutableClass die ich im Context-Menü aufrufe.

Bei dieser Konfiguration der Libraries in der module.xml :

<module>

.....

    <resources>

        <resource scope="module" >lib/jtds-1.2.5.jar</resource>

        <resource scope="module" >lib/openjpa-all-2.0.0.jar</resource>

        <resource scope="module" >lib/menu-editor-module.jar</resource>

    </resources>

</module>

bekomme ich diesen Fehler, wenn ich die Executable ausführen will:

FSVersion=4.2.437.44763#1597;JDK=1.6.0_24 32bit Sun Microsystems Inc.;OS=Windows 7 6.1 x86;Date=16.06.2011 17:09:56

de.espirit.firstspirit.access.script.SyntaxError: java.lang.ClassNotFoundException: com.communicode.menueditor.gui.MenuEditorAddExecutable

    at de.espirit.firstspirit.server.script.ClassCallerEngine.getExecutable(ClassCallerEngine.java:46)

    at de.espirit.firstspirit.common.ScriptUtil.getExecutable(ScriptUtil.java:68)

    at de.espirit.firstspirit.store.access.templatestore.ScriptImpl.getExecutable(ScriptImpl.java:270)

    at de.espirit.firstspirit.client.action.ScriptMenuAction$ScriptAction.actionPerformed(ScriptMenuAction.java:216)

    at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)

    at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)

    at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)

    at javax.swing.DefaultButtonModel.setPressed(Unknown Source)

    at javax.swing.AbstractButton.doClick(Unknown Source)

    at javax.swing.plaf.basic.BasicMenuItemUI.doClick(Unknown Source)

    at javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(Unknown Source)

    at java.awt.Component.processMouseEvent(Unknown Source)

    at javax.swing.JComponent.processMouseEvent(Unknown Source)

    at java.awt.Component.processEvent(Unknown Source)

    at java.awt.Container.processEvent(Unknown Source)

    at java.awt.Component.dispatchEventImpl(Unknown Source)

    at java.awt.Container.dispatchEventImpl(Unknown Source)

    at java.awt.Component.dispatchEvent(Unknown Source)

    at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)

    at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)

    at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)

    at java.awt.Container.dispatchEventImpl(Unknown Source)

    at java.awt.Window.dispatchEventImpl(Unknown Source)

    at java.awt.Component.dispatchEvent(Unknown Source)

    at java.awt.EventQueue.dispatchEventImpl(Unknown Source)

    at java.awt.EventQueue.access$000(Unknown Source)

    at java.awt.EventQueue$1.run(Unknown Source)

    at java.awt.EventQueue$1.run(Unknown Source)

    at java.security.AccessController.doPrivileged(Native Method)

    at java.security.AccessControlContext$1.doIntersectionPrivilege(Unknown Source)

    at java.security.AccessControlContext$1.doIntersectionPrivilege(Unknown Source)

    at java.awt.EventQueue$2.run(Unknown Source)

    at java.awt.EventQueue$2.run(Unknown Source)

    at java.security.AccessController.doPrivileged(Native Method)

    at java.security.AccessControlContext$1.doIntersectionPrivilege(Unknown Source)

    at java.awt.EventQueue.dispatchEvent(Unknown Source)

    at de.espirit.firstspirit.client.AWTDispatchingEventQueue.defaultDispatchEvent(AWTDispatchingEventQueue.java:130)

    at de.espirit.firstspirit.client.AWTDispatchingEventQueue._dispatchEvent(AWTDispatchingEventQueue.java:115)

    at de.espirit.firstspirit.client.AWTDispatchingEventQueue.dispatchEvent(AWTDispatchingEventQueue.java:108)

    at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)

    at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)

    at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)

    at java.awt.EventDispatchThread.pumpEvents(Unknown Source)

    at java.awt.EventDispatchThread.pumpEvents(Unknown Source)

    at java.awt.EventDispatchThread.run(Unknown Source)

Caused by: java.lang.ClassNotFoundException: com.communicode.menueditor.gui.MenuEditorAddExecutable

    at java.net.URLClassLoader$1.run(Unknown Source)

    at java.security.AccessController.doPrivileged(Native Method)

    at java.net.URLClassLoader.findClass(Unknown Source)

    at de.espirit.firstspirit.server.module.ExtendedUrlClassLoader.findClass(ExtendedUrlClassLoader.java:78)

    at de.espirit.firstspirit.server.module.ModuleClassesLoader.findClass(ModuleClassesLoader.java:132)

    at java.lang.ClassLoader.loadClass(Unknown Source)

    at java.lang.ClassLoader.loadClass(Unknown Source)

    at de.espirit.firstspirit.server.module.MutableClassLoader.loadClass(MutableClassLoader.java:121)

    at de.espirit.firstspirit.server.script.ClassCallerEngine.getExecutable(ClassCallerEngine.java:42)

    ... 44 more

siehe dazu auch:

https://community.e-spirit.com/message/5311#5311

0 Kudos
12 Replies
gockel
Crownpeak employee

Bitte die vollständige module.xml posten und die Skriptcodedefintion für das Executable.

0 Kudos

Hier die module.xml:

<!DOCTYPE module SYSTEM "../lib/module.dtd">

<module>

    <name>Menu-Editor</name>

    <version>0.9.0</version>

    <description>FirstSpirit Menu-Editor</description>

    <components>

        <project-app>

            <name>Menu-Editor Project</name>

            <description>Configuration for Menu-Editor</description>

            <class>com.communicode.menueditor.firstspirit.ProjectHandler</class>

            <configurable>com.communicode.menueditor.gui.ConfigurationApp</configurable>

            <resources>

                <resource>lib/menu-editor-module.jar</resource>

            </resources>

        </project-app>

        <service>

            <name>Menu-Editor Service</name>

            <description>The Menu-Editor Service implemenation</description>

            <class>com.communicode.menueditor.firstspirit.service.impl.MenuEditorServiceImpl</class>

        </service>

    </components>

     <resources>

          <resource scope="module">lib/jtds-1.2.5.jar</resource>

          <resource scope="module">lib/openjpa-all-2.0.0.jar</resource>

          <resource scope="module">lib/menu-editor-module.jar</resource>

     </resources>

</module>

Eigenschaften - Einblendelogik:

import de.espirit.firstspirit.store.access.pagestore.PageFolderImpl;

ele = context.getStoreElement();

if(ele instanceof PageFolderImpl)

    context.setProperty("visible", true);

HTML:

//!executable-class

com.communicode.menueditor.gui.MenuEditorAddExecutable

Diese Version der module.xml ist richtig. (Benötigte Resources als <resource> Tag und scope=module definiert)

0 Kudos

Es sollte klappen, wenn Sie ihre Executable als Public-Komponente defineren.

Also so etwas innerhalb von <components> hinzufügen:

<public>

 <name>MenuEditorAddExecutable</name>

 <class>com.communicode.menueditor.gui.MenuEditorAddExecutable</class>

</public>

und dann im Skript folgendes verwenden:

#! executable-class

MenuEditorAddExecutable

0 Kudos

Alle Executable Klassen sind nun als "public" in der module.xml definiert.

Diese werden nun auch gefunden und können aufgerufen werden.

Leider habe ich trotzdem noch ein ClassNotFoundException mit dieser Konfiguration der module.xml.

Ich hatte dem HelpDesk auch einen Fehler geschickt. Es wird wohl wahrscheinlich bald eine FS-Version geben,

bei der diese Fehler behoben sein sollten. Ich denke, ich warte auf diese Version.

0 Kudos

Hallo,

ich bekomme auch die ClassNotFoundException beim Aufruf meines Moduls. Die Version des FS-Servers ist 4.2.454.47473. Die Klasse im module.xml als Public-Komponente zu definieren hat leider nicht funktioniert. Habt ihr mittlerweile eine Lösung gefunden, bzw. gibt es ein Update, welches dieses Problem behebt?

Viele Grüße,

Michael

0 Kudos

Eine "ClassNotFoundException" kann verschiedene Ursachen haben. Es wäre hilfreich, den Stacktrace und die FirstSpirit-Version zu posten.

Peter
0 Kudos

Alles klar, der Stacktrace sieht folgendermaßen aus:

Client Version: 4.2.454.47473

Java Version: 1.6.0_31 Sun Microsystems Inc.

FSVersion=4.2.454.47473#1843;JDK=1.6.0_31 32bit Sun Microsystems Inc.;OS=Windows 7 6.1 x86;Date=29.02.2012 08:35:26

de.espirit.firstspirit.access.script.SyntaxError: java.lang.ClassNotFoundException: com.qperior.firstspirit.email.SendWorkflowEmail

    at de.espirit.firstspirit.server.script.ClassCallerEngine.getExecutable(ClassCallerEngine.java:46)

    at de.espirit.firstspirit.common.ScriptUtil.getExecutable(ScriptUtil.java:68)

    at de.espirit.firstspirit.store.access.templatestore.ScriptImpl.getExecutable(ScriptImpl.java:272)

    at de.espirit.firstspirit.server.taskmanagement.TaskImpl.doTransition(TaskImpl.java:1072)

    at de.espirit.firstspirit.server.taskmanagement.TaskImpl.doTransition(TaskImpl.java:1012)

    at de.espirit.firstspirit.client.action.WorkflowAction.startWorkflow(WorkflowAction.java:432)

    at de.espirit.firstspirit.client.action.WorkflowAction.startWorkflow(WorkflowAction.java:65)

    at de.espirit.firstspirit.client.action.WorkflowAction.startWorkflow(WorkflowAction.java:74)

    at de.espirit.firstspirit.client.action.WorkflowUtil.startWorkflow(WorkflowUtil.java:66)

    at de.espirit.firstspirit.client.action.WorkflowMenuAction$WFStartAction.actionPerformed(WorkflowMenuAction.java:272)

    at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)

    at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)

    at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)

    at javax.swing.DefaultButtonModel.setPressed(Unknown Source)

    at javax.swing.AbstractButton.doClick(Unknown Source)

    at javax.swing.plaf.basic.BasicMenuItemUI.doClick(Unknown Source)

    at javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(Unknown Source)

    at java.awt.Component.processMouseEvent(Unknown Source)

    at javax.swing.JComponent.processMouseEvent(Unknown Source)

    at java.awt.Component.processEvent(Unknown Source)

    at java.awt.Container.processEvent(Unknown Source)

    at java.awt.Component.dispatchEventImpl(Unknown Source)

    at java.awt.Container.dispatchEventImpl(Unknown Source)

    at java.awt.Component.dispatchEvent(Unknown Source)

    at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)

    at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)

    at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)

    at java.awt.Container.dispatchEventImpl(Unknown Source)

    at java.awt.Component.dispatchEvent(Unknown Source)

    at java.awt.EventQueue.dispatchEventImpl(Unknown Source)

    at java.awt.EventQueue.access$000(Unknown Source)

    at java.awt.EventQueue$1.run(Unknown Source)

    at java.awt.EventQueue$1.run(Unknown Source)

    at java.security.AccessController.doPrivileged(Native Method)

    at java.security.AccessControlContext$1.doIntersectionPrivilege(Unknown Source)

    at java.security.AccessControlContext$1.doIntersectionPrivilege(Unknown Source)

    at java.awt.EventQueue$2.run(Unknown Source)

    at java.awt.EventQueue$2.run(Unknown Source)

    at java.security.AccessController.doPrivileged(Native Method)

    at java.security.AccessControlContext$1.doIntersectionPrivilege(Unknown Source)

    at java.awt.EventQueue.dispatchEvent(Unknown Source)

    at de.espirit.firstspirit.client.AWTDispatchingEventQueue.defaultDispatchEvent(AWTDispatchingEventQueue.java:130)

    at de.espirit.firstspirit.client.AWTDispatchingEventQueue._dispatchEvent(AWTDispatchingEventQueue.java:115)

    at de.espirit.firstspirit.client.AWTDispatchingEventQueue.dispatchEvent(AWTDispatchingEventQueue.java:108)

    at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)

    at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)

    at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)

    at java.awt.EventDispatchThread.pumpEvents(Unknown Source)

    at java.awt.EventDispatchThread.pumpEvents(Unknown Source)

    at java.awt.EventDispatchThread.run(Unknown Source)

Caused by: java.lang.ClassNotFoundException: com.qperior.firstspirit.email.SendWorkflowEmail

    at java.net.URLClassLoader$1.run(Unknown Source)

    at java.security.AccessController.doPrivileged(Native Method)

    at java.net.URLClassLoader.findClass(Unknown Source)

    at de.espirit.firstspirit.server.module.ExtendedUrlClassLoader.findClass(ExtendedUrlClassLoader.java:101)

    at de.espirit.firstspirit.server.module.ModuleClassesLoader.findClass(ModuleClassesLoader.java:129)

    at java.lang.ClassLoader.loadClass(Unknown Source)

    at java.lang.ClassLoader.loadClass(Unknown Source)

    at de.espirit.firstspirit.server.module.MutableClassLoader.loadClass(MutableClassLoader.java:121)

    at de.espirit.firstspirit.server.script.ClassCallerEngine.getExecutable(ClassCallerEngine.java:42)

    ... 49 more

0 Kudos
gockel
Crownpeak employee

Hallo Michael,

Wie sieht die module.xml aus?

Wie sieht der Skript-Aufruf im Workflow-Skript aus, von dem aus das Executable angesprochen werden soll?

Gruss

0 Kudos

Hallo Sebastian,

die module.xml sieht so aus:

<!DOCTYPE module SYSTEM "lib/module.dtd">

        <module>

            <name>SendMail Module</name>

            <version>1</version>

            <description>FirstSpirit Module SendMail</description>

            <vendor>XXXX</vendor>

            <components>

                <library>

                    <name>SendMail</name>

                    <resources>

                        <resource scope="module">lib/SendMail.jar</resource>

                    </resources>

                </library>

            </components>

        </module>

und der Skript-Aufruf so:

#! executable-class

com.company.firstspirit.email.SendWorkflowEmail

Die SendWorkflowEmail.java liegt im Package com.company.firstspirit.email.

Viele Grüße,

Michael

0 Kudos