Bonjour,
Donc, j'utilise les méthodes loadClass, getMethod et Method.invok(Object obj, Object args) pour charger des classes et lancer des méthodes. Tout marche correctement quand toutes mes classes invokées sont dans le même package.
Le problème c'est quand je veux exécuter une méthode d'une classe du package qui fait appel à une autre classe située dans une autre package, dans ce cas j'ai une erreur de type NoClassDefFoundError :
Donc, y-a-t-il moyen de contourner ce problème ou non ?
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29 java.lang.reflect.InvocationTargetException at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at com.monpackage.installer.InstallCom.completeInstall(InstallHandlerPython.java:65) at org.eclipse.update.internal.core.InstallHandlerProxy.completeInstall(InstallHandlerProxy.java:227) at org.eclipse.update.core.Feature.install(Feature.java:507) at org.eclipse.update.internal.core.SiteFile.install(SiteFile.java:96) at org.eclipse.update.internal.core.ConfiguredSite.install(ConfiguredSite.java:155) at org.eclipse.update.internal.core.ConfiguredSite.install(ConfiguredSite.java:119) at org.eclipse.update.internal.operations.InstallOperation.execute(InstallOperation.java:92) at org.eclipse.update.internal.operations.BatchInstallOperation.execute(BatchInstallOperation.java:84) at org.eclipse.update.internal.ui.wizards.InstallWizard2.install(InstallWizard2.java:375) at org.eclipse.update.internal.ui.wizards.InstallWizard2.access$1(InstallWizard2.java:372) at org.eclipse.update.internal.ui.wizards.InstallWizard2$1.run(InstallWizard2.java:485) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:58) Caused by: java.lang.NoClassDefFoundError: com/monpackage/installer/implement/InstallerComplete at com.monpackage.installer.InstallerFact.newInstaller(InstallerFactory.java:27) ... 16 more Root exception: java.lang.NoClassDefFoundError: com/monpackage/installer/implement/InstallerComplete at com.monpackage.installer.InstallerFact.newInstaller(InstallerFactory.java:27) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at
Merci
Partager