markus
I'm new here

ResourceConflictException bei der Modulinstallation

Jump to solution

Hallo Community,

ich habe zwei Module, die die selbe Bibliothek (JAR-Datei) einbinden und benutzen.

Bei der Installation des ersten Moduls gibt es keine Probleme.

Sobald ich das zweite Modul mit der gleichen Bibliothek installieren will, kommt folgende Meldung:

ERROR 24.05.2011 17:27:08.314 (de.espirit.firstspirit.server.module.ModuleManagerImpl): module Menu-Editor: conflict detected, resource will be ignored (lib/openjpa-all-2.1.0.jar): de.espirit.firstspirit.server.module.ResourceConflictException: duplicate resource: lib/openjpa-all-2.1.0.jar

Gibt es evtl. dafür eine Lösung?

Danke schonmal

   Markus

23 Replies

entweder:

1.)

<module>

...

...

<service>

            <name>Menu-Editor Service</name>

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

</service>

            <resources>

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

                <resource>lib/jtds-1.2.5.jar</resource>

                <resource>lib/openjpa-all-2.1.0.jar</resource>

            </resources>

</module>

oder:

2)

<module>

...

...

<service>

            <name>Menu-Editor Service</name>

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

               <resources>

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

                <resource>lib/jtds-1.2.5.jar</resource>

                <resource>lib/openjpa-all-2.1.0.jar</resource>

            </resources>

</service>

</module>

0 Kudos

Ich habe mal die zwei Varianten ausprobiert, mit folgendem Ergebnis:

Variante 1, abhängige Bibliotheken in dem <library> Tag

<service>

            <name>Menu-Editor Service</name>

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

</service>

<library>

    <resources>

        <resource>lib/jtds-1.2.5.jar</resource>

        <resource>lib/openjpa-all-2.1.0.jar</resource>

    </resources>

</library>

Fehlermeldung Variante 1)

ERROR 25.05.2011 11:31:41.981 (de.espirit.firstspirit.server.module.ModuleManagerImpl): module Menu-Editor: conflict detected, resource will be ignored (lib/openjpa-all-2.1.0.jar): de.espirit.firstspirit.server.module.ResourceConflictException: duplicate resource: lib/openjpa-all-2.1.0.jar

  Variante 2, abhängige Bibliotheken in dem <serice> Tag

<service>

    <name>Menu-Editor Service</name>

    <resource>lib/jtds-1.2.5.jar</resource>

    <resource>lib/openjpa-all-2.1.0.jar</resource>

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

</service>

Fehlermeldung Variante 2)

Caused by: java.lang.ClassNotFoundException: net.sourceforge.jtds.jdbc.Driver

0 Kudos
Ich habe mal die zwei Varianten ausprobiert, mit folgendem Ergebnis:

Variante 1, abhängige Bibliotheken in dem <library> Tag

Das war nicht die von André beschriebene Variante.

Fehlermeldung Variante 2)

Caused by: java.lang.ClassNotFoundException: net.sourceforge.jtds.jdbc.Driver

War die auch mit <library>..</library> ? Wie sieht der komplette Trace der Exception aus?

Peter
0 Kudos

Wenn die <resources> direkt unter dem <service> deklariert werden, wie in Variante 1 beschriben,

dann ist die module.xml nicht valide:

<module>

...

...

<service>

            <name>Menu-Editor Service</name>

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

</service>

            <resources>

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

                <resource>lib/jtds-1.2.5.jar</resource>

                <resource>lib/openjpa-all-2.1.0.jar</resource>

            </resources>

</module>

Fehlermeldung Variante 1)

java.lang.IllegalArgumentException: invalid module xml, unknown component <resource>!

    at de.espirit.firstspirit.module.descriptor.ModuleDescriptor.getComponents(ModuleDescriptor.java:101)

    at de.espirit.firstspirit.module.descriptor.ModuleDescriptor.create(ModuleDescriptor.java:67)

    at de.espirit.firstspirit.module.descriptor.ModuleDescriptor.create(ModuleDescriptor.java:48)

    at de.espirit.firstspirit.server.module.ModuleManagerProxy$ClientModuleManager.checkModuleVersion(ModuleManagerProxy.java:211)

    at de.espirit.firstspirit.admin.gui.ModuleConfigurationPanel$1.run(ModuleConfigurationPanel.java:304)

    at java.lang.Thread.run(Unknown Source)

Variante 2)

<module>

<service>

            <name>Menu-Editor Service</name>

            <resources>

                <resource>lib/jtds-1.2.5.jar</resource>

                <resource>lib/openjpa-all-2.1.0.jar</resource>

            </resources>

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

</service>

</module>

Fehlermeldung Variante 2)

ERROR 25.05.2011 13:06:04.828 (de.espirit.firstspirit.server.module.ModuleManagerImpl): module Menu-Editor: conflict detected, resource will be ignored (lib/openjpa-all-2.1.0.jar): de.espirit.firstspirit.server.module.ResourceConflictException: duplicate resource: lib/openjpa-all-2.1.0.jar

0 Kudos

Variante 2) muss dann modul-lokal definiert werden, also <resource scope="module">lib/openjpa-all-2.1.0.jar</resource>

0 Kudos

Variante 2)

<service>

            <name>Menu-Editor Service</name>

            <resources>

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

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

            </resources>

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

        </service>

Fehlermeldung Variante 2)

de.espirit.firstspirit.access.ServiceNotFoundException: Service 'Menu-Editor Service' not found

    at de.espirit.firstspirit.server.module.ServiceManagerImpl.getService(ServiceManagerImpl.java:204)

    at de.espirit.firstspirit.server.module.ServiceManagerImpl.startService(ServiceManagerImpl.java:139)

    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:597)

    at de.espirit.firstspirit.server.io.handler.ManagerCall.doCall(ManagerCall.java:93)

    at de.espirit.firstspirit.server.io.handler.CompactCall.handle(CompactCall.java:67)

    at de.espirit.firstspirit.server.io.ManagerCallWorker.run(ManagerCallWorker.java:108)

    at de.espirit.firstspirit.server.ExecutionManagerImpl$RunnableWrapper.call(ExecutionManagerImpl.java:553)

    at de.espirit.firstspirit.server.ExecutionManagerImpl$ExtendedCallable.call(ExecutionManagerImpl.java:520)

    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)

    at java.util.concurrent.FutureTask.run(FutureTask.java:138)

    at de.espirit.common.util.BoundedExecutorService$RunnableWrapper.run(BoundedExecutorService.java:419)

    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)

    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)

    at java.util.concurrent.FutureTask.run(FutureTask.java:138)

    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)

    at de.espirit.firstspirit.client.io.ServerCaller.callManager(ServerCaller.java:372)

    at de.espirit.firstspirit.io.DefaultClientHandler.callManager(DefaultClientHandler.java:49)

    at de.espirit.firstspirit.client.io.RemoteManagerCaller.invoke(RemoteManagerCaller.java:52)

    at $Proxy21.startService(Unknown Source)

    at de.espirit.firstspirit.server.module.ServiceManagerProxy$ClientServiceManager.startService(ServiceManagerProxy.java:75)

    at de.espirit.firstspirit.admin.gui.ModuleConfigurationPanel$1.run(ModuleConfigurationPanel.java:343)

0 Kudos

und die Klickreihenfolge war wie? gabs es Fehler bei/während der Installation des Moduls? was passiert bei/nach  einem Server-Neustart? welche FirstSpirit-Version wird genutzt? bitte mal die komletten Modul-Descriptoren beider Varianten posten.

danke, gruss

andre

0 Kudos

Hallo,

Server-Version: 4.2.437.44763

Startzustand: keine eigenen Module installiert

Modul 1 kann erfolgreich installiert werden, dann Frage ob der Service automatisch gestartet werden soll.

Beantwortung mit JA

Fehlermeldung:

FSVersion=4.2.437.44763#1597;JDK=1.6.0_24 32bit Sun Microsystems Inc.;OS=Windows 7 6.1 x86;Date=26.05.2011 12:02:20

de.espirit.firstspirit.access.ServiceNotFoundException: Service 'Menu-Editor Service' not found

    at de.espirit.firstspirit.server.module.ServiceManagerImpl.getService(ServiceManagerImpl.java:204)

    at de.espirit.firstspirit.server.module.ServiceManagerImpl.startService(ServiceManagerImpl.java:139)

Moduldescriptor Modul1:

<!DOCTYPE module SYSTEM "../lib/module.dtd">
<module>
    <name>Menu-Editor</name>
    <version>0.9.0</version>
    <description>FirstSpirit Menü-Editor</description>
    <components>

        <library>
            <name>Menu-Editor Library</name>
            <version>0.9.0</version>
            <description>all used Libraries in Menu-Editor</description>
            <resources>
                <resource>lib/menu-editor-module.jar</resource>
            </resources>
        </library>

        <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>
            <resources>
                <resource scope="module">lib/sqljdbc4.jar</resource>
                <resource scope="module">lib/openjpa-all-2.1.0.jar</resource>
            </resources>
            <class>com.communicode.menueditor.firstspirit.service.impl.MenuEditorServiceImpl</class>
        </service>

    </components>
</module>

Bei der Installation des anderen Moduls (Modul2) genau die selbe Abfolge und die selben Fehler

Moduldescriptor Modul2:

<!DOCTYPE module SYSTEM "../lib/module.dtd">
<module>
    <name>TMS-Connect</name>
    <version>0.9.4</version>
    <description>FirstSpirit-Across Anbindung</description>
    <components>
        <public>
            <name>TMS-Connect PDF</name>
            <class>com.communicode.tmsconnect.uniporter.content.pdf.URLCreator</class>
            <description>PDF PathCreator</description>
        </public>

        <library>
            <name>TMS-Connect Library</name>
            <version>0.9.4</version>
            <description>all used Libraries in TMS-Connect</description>
            <resources>
                <resource>lib/tms-connect-module.jar</resource>
                <resource>lib/jaxrpc.jar</resource>
                <resource>lib/axis.jar</resource>
                <resource>lib/commons-discovery-0.2.jar</resource>
                <resource>lib/wsdl4j-1.5.1.jar</resource>
            </resources>
        </library>

        <project-app>
            <name>TMS-Connect Project</name>
            <description>Configuration for TMS-Connect</description>
            <class>com.communicode.tmsconnect.firstspirit.ScriptHandler</class>
            <configurable>com.communicode.tmsconnect.gui.modulepanel.ConfigurationLoginApp</configurable>
            <resources>
                <resource>lib/tms-connect-module.jar</resource>
            </resources>
        </project-app>

        <service>
            <name>TMS-Connect Service</name>
            <description>The TMS-Connect Service implemenation</description>
            <resources>
                <resource scope="module">lib/openjpa-all-2.1.0.jar</resource>
                <resource scope="module">lib/mysql-connector-java-5.1.6-bin.jar</resource>
                <resource scope="module">lib/sqljdbc4.jar</resource>
            </resources>
            <class>com.communicode.tmsconnect.firstspirit.service.impl.TMSConnectServiceImpl</class>
        </service>

    </components>
</module>

fs-server.log

INFO  26.05.2011 12:02:17.111 (de.espirit.firstspirit.server.module.ModuleManagerImpl): installing module 'Menu-Editor, version='0.9.0' ...
ERROR 26.05.2011 12:02:17.607 (de.espirit.firstspirit.server.module.ServiceManagerImpl): cannot start service 'Menu-Editor'.'Menu-Editor Service'
FSVersion=4.2.437.44763#1597;JDK=1.6.0_18 32bit Sun Microsystems Inc.;OS=Windows 7 6.1 x86;Date=26.05.2011 12:02:17
java.lang.NoClassDefFoundError: org/apache/openjpa/enhance/PersistenceCapable
    at java.lang.ClassLoader.defineClass1(Native Method)
    at java.lang.ClassLoader.defineClassCond(ClassLoader.java:632)

<!DOCTYPE module SYSTEM "../lib/module.dtd">
<module>
    <name>TMS-Connect</name>
    <version>0.9.4</version>
    <description>FirstSpirit-Across Anbindung</description>
    <components>
        <public>
            <name>TMS-Connect PDF</name>
            <class>com.communicode.tmsconnect.uniporter.content.pdf.URLCreator</class>
            <description>PDF PathCreator</description>
        </public>

        <library>
            <name>TMS-Connect Library</name>
            <version>0.9.4</version>
            <description>all used Libraries in TMS-Connect</description>
            <resources>
                <resource>lib/tms-connect-module.jar</resource>
                <resource>lib/jaxrpc.jar</resource>
                <resource>lib/axis.jar</resource>
                <resource>lib/commons-discovery-0.2.jar</resource>
                <resource>lib/wsdl4j-1.5.1.jar</resource>
            </resources>
        </library>

        <project-app>
            <name>TMS-Connect Project</name>
            <description>Configuration for TMS-Connect</description>
            <class>com.communicode.tmsconnect.firstspirit.ScriptHandler</class>
            <configurable>com.communicode.tmsconnect.gui.modulepanel.ConfigurationLoginApp</configurable>
            <resources>
                <resource>lib/tms-connect-module.jar</resource>
            </resources>
        </project-app>

        <service>
            <name>TMS-Connect Service</name>
            <description>The TMS-Connect Service implemenation</description>
            <resources>
                <resource scope="module">lib/openjpa-all-2.1.0.jar</resource>
                <resource scope="module">lib/mysql-connector-java-5.1.6-bin.jar</resource>
                <resource scope="module">lib/sqljdbc4.jar</resource>
            </resources>
            <class>com.communicode.tmsconnect.firstspirit.service.impl.TMSConnectServiceImpl</class>
        </service>

    </components>
</module>

0 Kudos

Variante 1)

sollte so definiert werden (also resources nach components). siehe auch 3.8.1 Modul-Developer-Dokumentation

<module>

    <name>....</name>

    <class>...</class>

    <components>

        <service>

...

        </service>

    </components>

    <resources>

        <resource scope="module">....</resource>

    </resources>

</module>

0 Kudos

das der Service nicht gestartet wird ist vermutlich ein Folgeproblem von "java.lang.NoClassDefFoundError: org/apache/openjpa/enhance"

fuer eine weitere Evaluierung, bitte an den Helpdesk wenden und das Modul "Menu-Editor" zu verfügung stellen.

was passiert wenn die Service-Komponente wie folgt definiert wird?

<service>

            <name>Menu-Editor Service</name>

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

            <resources>

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

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

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

            </resources>

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

        </service>

und bitte den kompletten stack posten.

-------

ava.lang.NoClassDefFoundError: org/apache/openjpa/enhance/PersistenceCapable

    at java.lang.ClassLoader.defineClass1(Native Method)

    at java.lang.ClassLoader.defineClassCond(ClassLoader.java:632)

-------

0 Kudos