Getting error when using Test plugin

MagicDraw OpenAPI, scripting related questions and discussions

Moderator: Moderators

Getting error when using Test plugin

Postby saiskee@gmail.com » Thu May 23, 2019 12:46 pm

I’ve been having trouble understanding the process between developing a plugin on eclipse, then integrating it into MagicDraw. The zip file of the sample plugin that I’ve been trying to work with is attached. I’ve tried compiling jar files from my .java and .class files and I’m using the out of the box plugin.xml, however I keep getting an error in the log files that says:
java.lang.ClassNotFoundException: myplugin1.MyPlugin1
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:348)
at com.nomagic.magicdraw.plugins.q.I(q.java:412)
at com.nomagic.magicdraw.core.c.t(c.java:40)
at com.nomagic.rcpf.product.o.a(o.java:268)
at com.nomagic.rcpf.product.p.b(p.java:91)
at com.nomagic.rcpf.product.p.a(p.java:75)
at com.nomagic.magicdraw.core.Application.internalStart(Application.java:656)
at com.nomagic.magicdraw.core.Application.start(Application.java:441)
at com.nomagic.magicdraw.MagicDrawApplicationLauncher.launch(MagicDrawApplicationLauncher.java:24)
at com.nomagic.magicdraw.ApplicationGateway.start(ApplicationGateway.java:46)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:380)
at com.nomagic.osgi.launcher.FrameworkLauncher$DefaultApplication.run(FrameworkLauncher.java:226)
at com.nomagic.osgi.launcher.FrameworkLauncher.runFrameworkApplication(FrameworkLauncher.java:176)
at com.nomagic.osgi.launcher.FrameworkLauncher.run(FrameworkLauncher.java:113)
at com.nomagic.osgi.launcher.FrameworkLauncher.run(FrameworkLauncher.java:92)
at com.nomagic.osgi.launcher.ProductionFrameworkLauncher.run(ProductionFrameworkLauncher.java:70)
at com.nomagic.osgi.launcher.ProductionFrameworkLauncher.main(ProductionFrameworkLauncher.java:57)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at com.nomagic.launcher.Launcher.startMainClass(Launcher.java:337)
at com.nomagic.launcher.Launcher.start(Launcher.java:108)
at com.nomagic.launcher.Launcher.main(Launcher.java:70)
2019-05-23 13:00:03,262 [main] INFO PLUGINS - Created: Projects and Modules Map
2019-05-23 13:00:03,269 [main] INFO PLUGINS - Created: Maple Engine
2019-05-23 13:00:03,285 [main] INFO PLUGINS - Created: MOF Export/Import
2019-05-23 13:00:03,434 [main] INFO PLUGINS - Created: Project Merge (build:20171212_1428-92213f53)
2019-05-23 13:00:03,454 [main] INFO PLUGINS - Created: Report Wizard
2019-05-23 13:00:03,461 [main] INFO PLUGINS - Created: Web report plugin
2019-05-23 13:00:03,473 [main] INFO PLUGINS - Created: Content Diagram
2019-05-23 13:00:03,478 [main] INFO PLUGINS - Created: Use Case descriptions extensions used for modeling use cases and generating reports for them.
2019-05-23 13:00:03,485 [main] INFO PLUGINS - Created: User Interface Modeling
2019-05-23 13:00:03,489 [main] INFO PLUGINS - Created: ModelTransformations
2019-05-23 13:00:03,501 [main] INFO PLUGINS - Created: Dependency Matrix
2019-05-23 13:00:03,525 [main] INFO PLUGINS - Created: Cameo Requirements Modeler (build:20171212_1208-92213f53)
2019-05-23 13:00:03,525 [main] ERROR PLUGINS - Failed to create plugin: My Plugin THAT ISNT WORKING
java.lang.ClassNotFoundException: myplugin.myplugin1
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:348)
at com.nomagic.magicdraw.plugins.q.I(q.java:412)
at com.nomagic.magicdraw.core.c.t(c.java:40)
at com.nomagic.rcpf.product.o.a(o.java:268)
at com.nomagic.rcpf.product.p.b(p.java:91)
at com.nomagic.rcpf.product.p.a(p.java:75)
at com.nomagic.magicdraw.core.Application.internalStart(Application.java:656)
at com.nomagic.magicdraw.core.Application.start(Application.java:441)
at com.nomagic.magicdraw.MagicDrawApplicationLauncher.launch(MagicDrawApplicationLauncher.java:24)
at com.nomagic.magicdraw.ApplicationGateway.start(ApplicationGateway.java:46)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:380)
at com.nomagic.osgi.launcher.FrameworkLauncher$DefaultApplication.run(FrameworkLauncher.java:226)
at com.nomagic.osgi.launcher.FrameworkLauncher.runFrameworkApplication(FrameworkLauncher.java:176)
at com.nomagic.osgi.launcher.FrameworkLauncher.run(FrameworkLauncher.java:113)
at com.nomagic.osgi.launcher.FrameworkLauncher.run(FrameworkLauncher.java:92)
at com.nomagic.osgi.launcher.ProductionFrameworkLauncher.run(ProductionFrameworkLauncher.java:70)
at com.nomagic.osgi.launcher.ProductionFrameworkLauncher.main(ProductionFrameworkLauncher.java:57)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at com.nomagic.launcher.Launcher.startMainClass(Launcher.java:337)
at com.nomagic.launcher.Launcher.start(Launcher.java:108)
at com.nomagic.launcher.Launcher.main(Launcher.java:70)

I highlighted the specific problems in the log file. I’ve tried following the OpenUser API guide and the forum posts I’ve seen online, but none of those have worked.



Thank you.
You do not have the required permissions to view the files attached to this post.
saiskee@gmail.com
Forum Newbie
Forum Newbie
 
Posts: 1
Posts Rating:0
Joined: Thu May 23, 2019 8:29 am

Re: Getting error when using Test plugin

Postby jjjames@miners.utep.edu » Thu Jun 13, 2019 9:09 pm

SaisKee,

Are you using an IDE to compile your JAR file or are you doing it manually? Eclipse does a pretty good job of creating JAR files. I know you mentioned using the "out of the box" plugin xml but it might help to make sure the class listed in your xml matches the classpath in your plugins directory. Sorry in advance if I repeated something you already knew.
jjjames@miners.utep.edu
Forum Newbie
Forum Newbie
 
Posts: 2
Posts Rating:0
Joined: Thu Jun 13, 2019 8:44 pm


Return to Programmatic Extendibility

Who is online

Users browsing this forum: No registered users and 0 guests