MagicDraw 18.3 developing plugins using Eclipse 4.5.2.M - eclipse

I am having trouble configurating Eclipse for MD 18.3 plugin development.
I have thoroughly followed the "MagicDraw 18.3 Developer Guide / Development in Eclipse" tutorial you can find inside MagicDraw\openapi section to set up Eclipse.
When launching MagicDraw with all plugins run configuration, it throws the following error and terminates:
!ENTRY org.eclipse.core.variables 4 120 2016-07-20 10:39:12.159
!MESSAGE Reference to undefined variable file_uri
caused by this line of the run configuration
-Dosgi.framework.extensions=reference:${file_uri:${workspace_loc:/MagicDraw/MAGIC_DRAW_INSTALL_DIRECTORY/lib/bundles}}/com.nomagic.magicdraw.osgi.fragment
However, \lib\bundles\com.nomagic.magicdraw.osgi.fragment_1.0.0.201601271815.jar
is existing
I'm running the demo license, but that shouldn't influence the configuration. Any suggestions?
UPDATE
Solved this issue, by replacing reference:${file_uri:${workspace_loc:/MagicDraw/MAGIC_DRAW_INSTALL_DIRECTORY/lib/bundles}}/com.nomagic.magicdraw.osgi.fragment with the actual path and enabling com.nomagic.magicdraw.platform.feature in the bundles tab of the run configuration.
Next Problem: The provided example plugins won't load, throwing
java.lang.NullPointerException at com.nomagic.magicdraw.plugins.XMLPluginDescriptorLoader.loadPluginDescriptorData(XMLPluginDescriptorLoader.java:172)
and therefore
ERROR PLUGINS - Failed to create plugin: My Plug-in 2
java.lang.ClassNotFoundException: myplugin2.MyPlugin2
Same message for both, the example plugins and my own plugin. I have checked the plugin.xml files and also experimentally enabled the run configurations > bundles > workspace checkbox.

Try to edit this line:
- Dosgi.framework.extensions=com.nomagic.magicdraw.osgi.fragment

Setting up a new clean Eclipse installation solved everything.

Related

"Could not run phased build action using connection to Gradle distribution"

I'm having various Gradle problems after a new clean Eclipse install.
They seem to be associated w/ this "Problem" message:
Could not run phased build action using connection to Gradle distribution 'https://services.gradle.org/distributions/gradle-7.1.1-bin.zip'.
Initialization script 'Z:\eclipse-workspace\.metadata\.plugins\org.eclipse.buildship.core\init.d\eclipsePlugin.gradle'
Could not compile initialization script 'Z:\eclipse-workspace\.metadata\.plugins\org.eclipse.buildship.core\init.d\eclipsePlugin.gradle'.
startup failed:
General error during semantic analysis: Unsupported class file major version 60
java.lang.IllegalArgumentException: Unsupported class file major version 60
at groovyjarjarasm.asm.ClassReader.<init>(ClassReader.java:196)
.....
at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:56)
at java.base/java.lang.Thread.run(Thread.java:831)
1 error
I've already tried deleting .gradle & "Gradle->Refresh Gradle Project".
I've also tried this:
stackoverflow
My Java install is clean:
java version "16.0.1" 2021-04-20
& confirmed Eclipse is pointing to it ("Preferences->Java->Installed JREs").
Installation details:
Buildship: Eclipse Plug-ins for Gradle 3.1.5.v20210113-0929
Eclipse IDE for Java Developers 4.20.0.20210612-1200
Windows 10.
Eclipse Install Err Log:
!ENTRY org.eclipse.buildship.core 2 2 2021-07-09 11:22:05.951
!MESSAGE Initialize project testgradleprj failed due to an error in the referenced Gradle build.
!STACK 0
org.gradle.tooling.BuildException: Could not execute build using connection to Gradle distribution 'https://services.gradle.org/distributions/gradle-7.1.1-bin.zip'.
Gradle 6.8 does not work with Java 16.
Java 16 supported starting with Gradle 7
"In previous Gradle versions, running Gradle itself on Java 16 resulted in an error."
https://docs.gradle.org/7.0/release-notes.html#java-16
Thanks to LMC. I changed the project prefs->Gradle from Wrapper to Specific=7.1.1 :
I have updated my gradle-warpper.properties file with
distributionUrl=https://services.gradle.org/distributions/gradle-6.4.1-bin.zip
from
distributionUrl=https://services.gradle.org/distributions/gradle-5.6.2-bin.zip
and refresh the gradlew project in eclipse. It's build successfull
Note : Java 11 version is installed in my machine
Change your gradle.properties file
distributionUrl=https\://services.gradle.org/distributions/gradle-7.0.2-all.zip
And build.gradle file
dependencies {
classpath 'com.android.tools.build:gradle:7.0.0'
}
In my case, it was because Eclipse was running upon a JVM that was different from the one used by my local Gradle.
I edited the eclipse.ini file so that Eclipse would run on the same JVM as my local Gradle (i.e. the one pointed by JAVA_HOME) and it worked!

Eclemma: Invalid Input Url Error in Eclipse

After starting Eclipe I see the following error message in the workspace/.metadata/.log
!ENTRY org.eclipse.core.runtime 4 0 2017-09-18 09:38:48.275
!MESSAGE Invalid input url:platform:/plugin/com.mountainminds.eclemma.ui/icons/full/eview16/coverage.gif
!STACK 0
java.io.IOException: Unable to resolve plug-in "platform:/plugin/com.mountainminds.eclemma.ui/icons/full/eview16/coverage.gif".
The message does not go away even after uninstalling or reinstalling the plugin.
Any ideas on how to resolve this?
Eclipse: Oxygen 4.7.0
EclEmma: 3.0.0
EclEmma became an Eclipse project and is now part of the Eclipse Java download packages. Due to the move, the plug-ins have been rename: com.mountainminds.eclemma.ui become org.eclipse.eclemma.ui.
If you use a workspace that have been used with EclEmma < 3.0.0 before,
start Eclipse with the option -clean and
reset all Java perspectives (coverage.gif is the icon of the Coverage view and could be referenced in the stored window/perspective layout).
This is the image the error is referring to.
Put it in the proper installation path on your machine and you'd be fine.

Eclipse Gradle Plugin 'could not fetch model of type'

I am running Eclipse Luna on OS X with Gradle IDE 3.6.1 and anytime I try to select a project from the gradle tasks panel I get the following error:
org.eclipse.osgi.internal.framework.EquinoxConfiguration$1
Could not fetch model of type 'EclipseProject' using Gradle distribution
'https://services.gradle.org/distributions/gradle-2.0-bin.zip'.
Has anyone else run into this error? I can get to the URL specified to download the file myself. So, network connectivity shouldn't be the problem.
The problem is for the java version configured by default on the IDE (Eclipse or Spring Tool Suite). The error is the following:
To fix it, you can set the Java version supported by the Gradle version in Configure Workspace Setting option.
Finally, you can refresh your project o continue with your creation. Later all will be perfect.
I had the same error in Eclipse Neon (version numbers were different, but otherwise same error). It looks like several different things can cause this error, but for me it was an incorrect property in [MyProject]/.settings/org.eclipse.buildship.core.prefs.
I had
connection.gradle.distribution=GRADLE_DISTRIBUTION(WRAPPER)
but it needed to be
connection.gradle.distribution=GRADLE_DISTRIBUTION(VERSION(2.13))
2.13 should be replaced with whatever version number output you get from gradle -version.
Coming back to add this:
It turns out, the actual root problem was an incompatibility between Gradle versions. My build.gradle file worked fine with an old version of Gradle, but uses things that were deprecated and removed in later versions.
Solution is to click Finish immediately in the wizard instead of Next, and then fix the issues in the build.gradle.
Bad reference in config.
Overwrite configuration:
Project -> Properties -> Gradle -> Override workspace settings ->
Specific Gradle version -> 4.x
You need to update Gradle
Goto:
Select 'Help > About Eclipse' (on Macs this is 'Eclipse > About Eclipse').
Click the 'Installation Details' button to display the installation details dialog. Look in the 'Installed Software' tab to see all the installed plugins.
Search for Gradle(Eclipse Plug-ins for Gradle) and Update.
It might take some time for first time after that.
Reason why it happens, cause new version of gradle is available to download. Once you download new version of gradle, your error will go away.
http://gradle.org/downloads
I had the same error message using Eclipse 4.5
In my case the build file was having a error and I had to modify this line
eclipse.classpath {
plusConfigurations += configurations.providedCompile
}
into this
eclipse.classpath {
plusConfigurations += [configurations.providedCompile]
}
After that everything worked again.
I met the same problem, somebody suggested that the gradle project may be build by a old version.
I solve the problem by the following step:
modify the configuration in Eclipse, perfrence ->gradle ->gradle distribution . point it to an older version.
delete the file in ./gradle/wrapper
reload the program
In my case, I forgot to put ending apostrophe ' for a value
I ran into a similar issue recently - even blowing away the project and repulling a fresh copy from git didn't fix it. I realized it wasn't specific to the project when I reproduced it outside of Eclipse:
$ ./gradlew tasks
FAILURE: Build failed with an exception.
* What went wrong:
Expecting a stack map frame
Exception Details:
Location:
build_euvk0e0guiuwrf8fgn8svi2fy.run()Ljava/lang/Object; #16: aconst_null
Reason:
Error exists in the bytecode
Bytecode:
0x0000000: 2abb 0022 592a 2ab7 0025 ba00 3300 00b0
0x0000010: 01b0
What did fix it was removing the gradle cache:
$ rm -r ~/.gradle/caches
$ ./gradlew tasks
Somehow the version of gradle there had become corrupted (possibly related to Eclipse groovy plugin - I had this issue regularly until uninstalling it), and blowing it away forced it to get a fresh copy.
Hopefully this answer helps someone else avoid pulling out their hair.
I had a very similar issue and removing the following from my build.gradle fixed it. The same bit of config works in all other Gradle projects I have but for some reason not this one...
allprojects {
...
apply plugin: 'eclipse-wtp'
...
// remove this eclipse config to make the error go away
eclipse {
classpath { defaultOutputDir = file('build-eclipse') }
}
...
}
Open the CMD and enter there gradle --gui, change the settings of the gradle gui in the register Setup to Stack trace Output: Full Stack trace [-S] and the log level to info. Then change the current directory to the directory your build.gradle file is located and then go to the first register and let process the gui this files.
An error message should be displayed. There you find out what is wrong with your build.gradle file. In my case there was a folder missing and this causes this error.
This error can also be caused by a syntax error in the previous line of build.gradle. If so, the error has nothing to do with the Gradle or Eclipse version you are running. See this question
In my case i changed the Gradle version from 4.7.rc2 to4.6 and then it started to work.
I am on eclipse Oxygen (4.7.2), I was getting similar exception while importing the project and this worked for me:
While importing on windows Import Options
Click Configure Workspace Setting (which will take to preference window)
Select Local Installation directory (for me 'graddle wrapper' was selected)
apply, close and continue import
Below is the error I was getting
Loading Gradle project preview failed due to an error in the referenced Gradle build.
Could not fetch model of type 'GradleBuild' using Gradle distribution 'https://services.gradle.org/distributions/gradle-3.5-bin.zip'.
_BuildScript_
org.gradle.tooling.BuildException: Could not fetch model of type 'GradleBuild' using Gradle distribution 'https://services.gradle.org/distributions/gradle-3.5-bin.zip'.
at org.gradle.tooling.internal.consumer.ExceptionTransformer.transform(ExceptionTransformer.java:51)
at org.gradle.tooling.internal.consumer.ExceptionTransformer.transform(ExceptionTransformer.java:29)
at org.gradle.tooling.internal.consumer.ResultHandlerAdapter.onFailure(ResultHandlerAdapter.java:41)
at org.gradle.tooling.internal.consumer.async.DefaultAsyncConsumerActionExecutor$1$1.run(DefaultAsyncConsumerActionExecutor.java:57)
at Caused by: java.lang.ClassNotFoundException: _BuildScript_
at org.gradle.groovy.scripts.internal.DefaultScriptCompilationHandler$ScriptClassLoader.loadClass(DefaultScriptCompilationHandler.java:386)
... 77 more
None of the solutions worked for me and I'm having the same errors on STS 4 with eclipse Version: 2.2.600.v20190605-1800. My steps were:
Delete the project from my workspace
./gradlew cleanEclipseWtp cleanEclipse eclipseWtp eclipse
Import the project as an existing eclipse project (not an existing gradle import)
That worked!
Deleting .gradle folder from the project resolved my problem.
I got this error with Eclipse 2021-06, Java 1.8.0, gradle 4.4.
I tried deleting gradle wrapper binary folder, predefining gradle version, etc.
The thing that helped was just specifying gradle home directory and java home directory after selecting overriding workspace configuration.
Eclipse 4.4.1 broke Gradle Eclipse support with non-string values in system properties.This is fixed in the latest Gradle for the 3.6.2 release. Update your Gradle form this update-site: http://dist.springsource.com/snapshot/TOOLS/gradle/nightly

Eclipse CDT failure to debug in Ubuntu 11.10, throwing java.lang.NullPointerException

I've recently done a fresh install of Ubuntu 11.10, installing the latest version of Eclipse CDT. I'm trying to debug an existing C++ project with makefiles and Eclipse project files generated by CMake. Upon attempting to debug (with all of the correct settings given in the Debug Configuration), the launch fails with error:
An internal error occurred during: "Launching mops-app".
java.lang.NullPointerException
This does not occur when trying to debug a minimal Hello World project. The project could be successfully debugged on Ubuntu 11.04 with the latest version of Eclipse CDT. The java version on my machine is:
java version "1.6.0_23"
OpenJDK Runtime Environment (IcedTea6 1.11pre) (6b23~pre10-0ubuntu5)
OpenJDK 64-Bit Server VM (build 20.0-b11, mixed mode)
And the Eclipse output from trying to launch the debug configuration is:
!ENTRY org.eclipse.core.jobs 4 2 2011-10-31 11:50:24.211
!MESSAGE An internal error occurred during: "Launching mops-app".
!STACK 0
java.lang.NullPointerException
at org.eclipse.cdt.debug.internal.core.model.CDebugTarget.getSourceLookupPath(CDebugTarget.java:1837)
at org.eclipse.cdt.debug.internal.core.model.CDebugTarget.getSourceLookupPath(CDebugTarget.java:1848)
at org.eclipse.cdt.debug.internal.core.model.CDebugTarget.getSourceLookupPath(CDebugTarget.java:1848)
at org.eclipse.cdt.debug.internal.core.model.CDebugTarget.setSourceLookupPath(CDebugTarget.java:1815)
at org.eclipse.cdt.debug.internal.core.model.CDebugTarget.initializeSourceLookupPath(CDebugTarget.java:383)
at org.eclipse.cdt.debug.internal.core.model.CDebugTarget.initialize(CDebugTarget.java:282)
at org.eclipse.cdt.debug.internal.core.model.CDebugTarget.<init>(CDebugTarget.java:275)
at org.eclipse.cdt.debug.core.CDIDebugModel$1.run(CDIDebugModel.java:100)
at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2344)
at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2326)
at org.eclipse.cdt.debug.core.CDIDebugModel.newDebugTarget(CDIDebugModel.java:105)
at org.eclipse.cdt.launch.internal.LocalCDILaunchDelegate.launchLocalDebugSession(LocalCDILaunchDelegate.java:162)
at org.eclipse.cdt.launch.internal.LocalCDILaunchDelegate.launchDebugger(LocalCDILaunchDelegate.java:112)
at org.eclipse.cdt.launch.internal.LocalCDILaunchDelegate.launch(LocalCDILaunchDelegate.java:72)
at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:854)
at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:703)
at org.eclipse.debug.internal.ui.DebugUIPlugin.buildAndLaunch(DebugUIPlugin.java:928)
at org.eclipse.debug.internal.ui.DebugUIPlugin$8.run(DebugUIPlugin.java:1132)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)
The issue was associated with upgrading the version of CMake. CMake 2.8.5 generated 'Subproject' entries in the Eclipse .cproject and .project files. For some reason, CMake by default told Eclipse to ignore the Subproject paths, thus confusing Eclipse's indexer when it tried to debug code.
The problem is easily resolved by commenting-out the <linkedResources> entry of the .project file, e.g.
<!--link>
<name>[Subprojects]/MOPS</name>
<type>2</type>
<location>/home/user/mops-c-Git/src/mopsc</location>
</link-->
and commenting-out the Subproject portion <pathentry> entry of the .cproject file, e.g.
<!--pathentry kind="src" path="MOPS"/>
<pathentry excluding="MOPS/|**/CMakeFiles/" kind="out" path=""/-->
Make sure to have selected the executable to run in the Run/Run or Run/Debug menu.
I had a similar problem (Ubuntu 14.04, SBT 13.1.0) - launching Debugger caused a java.lang.NullPointerException. Checking the log by starting Eclipse with eclipse-nios2 -consoleLog, I had similar entries:
java.lang.NullPointerException
at org.eclipse.cdt.debug.internal.core.model.CDebugTarget.getSourceLookupPath(CDebugTarget.java:1843)
at org.eclipse.cdt.debug.internal.core.model.CDebugTarget.getSourceLookupPath(CDebugTarget.java:1864)
at org.eclipse.cdt.debug.internal.core.model.CDebugTarget.getSourceLookupPath(CDebugTarget.java:1864)
at org.eclipse.cdt.debug.internal.core.model.CDebugTarget.setSourceLookupPath(CDebugTarget.java:1817)
at org.eclipse.cdt.debug.internal.core.model.CDebugTarget.initializeSourceLookupPath(CDebugTarget.java:385)
at org.eclipse.cdt.debug.internal.core.model.CDebugTarget.initialize(CDebugTarget.java:286)
at org.eclipse.cdt.debug.internal.core.model.CDebugTarget.<init>(CDebugTarget.java:279)
I believe the cause is the same; I found another fix and wanted to share it for completeness.
I have linked resources in my project, and the log made me suspect they were the cause. I had linked the resources with Import->General->File system->[... Create links in workspace...].
I removed these links and instead linked to the sources by Project Properties->C/C++ General->Paths and Symbols->[tab] Source Location->Link folder....
This made the Debugger run fine without complaining.

problem installing eclipse groovy plugin in galileo

I'm trying to install groovy plugin in eclipse 3.5 using this update site.
It does install but when it tries to restart I get an exception.
!SESSION Sat Aug 29 15:47:17 PDT 2009 ------------------------------------------
!ENTRY org.eclipse.equinox.launcher 4 0 2009-08-29 15:47:17.287
!MESSAGE Exception launching the Eclipse Platform:
!STACK java.lang.ClassNotFoundException: org.eclipse.core.runtime.adaptor.EclipseStarter
at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
at java.security.AccessController.doPrivileged(Native Method)
I tried to start using -clean options,deleted workspace no luck
Did anyone get this too??
It looks like you're missing a class or a jar required by the plugin; I'm not sure which one though, since the stacktrace does not indicate any such plugin specific class. You could attempt the following:
Examine the .log file of the workspace to view any additional details of the exception.
Verify if all the Groovy Eclipse plugin jars are present in the plugins and features directory of the Eclipse installation.
Start Eclipse with the consolelog and debug switches, and pipe the output to a debug log file. Examine for anything indicative of the problem in the logfile; if needed post the log file. The command to start Eclipse in this mode would be $eclipse -consolelog -debug | tee debugfile.log
Install the plugin on a clean installation of Eclipse.
OK now finally i fixed it after 2 days of war with eclipse, so for some reason when groovy plugin was installed eclipse modified config.ini file inside configuration folder
so I have to modify config.ini file to replace osgi.bundles value with
osgi.bundles=reference\:file\:org.eclipse.equinox.simpleconfigurator_1.0.100.v20090520-1905.jar#1\:start,reference\:file\:plugins/org.eclipse.jdt.core_3.5.0.xx-20090828-1900-e35.jar#4,reference\:file\:/Applications/galileo/plugins/org.apache.commons.collections_3.2.1.jar#4,reference\:file\:/Applications/galileo/plugins/org.apache.commons.lang_2.3.0.v200803061910.jar#4,reference\:file\:/Applications/galileo/plugins/org.codehaus.groovy_1.7.0.xx-20090828-1900-e35/#4,reference\:file\:/Applications/galileo/plugins/org.codehaus.groovy.eclipse.ant_2.0.0.xx-20090828-1900-e35/#4,reference\:file\:/Applications/galileo/plugins/org.codehaus.groovy.eclipse.codeassist.completion_2.0.0.xx-20090828-1900-e35.jar#4,reference\:file\:/Applications/galileo/plugins/org.codehaus.groovy.eclipse.codebrowsing_2.0.0.xx-20090828-1900-e35.jar#4,reference\:file\:/Applications/galileo/plugins/org.codehaus.groovy.eclipse.core_2.0.0.xx-20090828-1900-e35.jar#4,reference\:file\:/Applications/galileo/plugins/org.codehaus.groovy.eclipse.core.help_2.0.0.xx-20090828-1900-e35/#4,reference\:file\:/Applications/galileo/plugins/org.codehaus.groovy.eclipse.cstviewer_2.0.0.xx-20090828-1900-e35.jar#4,reference\:file\:/Applications/galileo/plugins/org.codehaus.groovy.eclipse.refactoring_2.0.0.xx-20090828-1900-e35.jar#4,reference\:file\:/Applications/galileo/plugins/org.codehaus.groovy.eclipse.ui_2.0.0.xx-20090828-1900-e35.jar#4,reference\:file\:/Applications/galileo/plugins/org.eclipse.jdt.groovy.core_1.0.0.xx-20090828-1900-e35.jar#4
By default osgi.bundles value is osgi.bundles=reference\:file\:org.eclipse.equinox.simpleconfigurator_1.0.100.v20090520-1905.jar#1\:start but as soon as I installed groovy plugin I had a modified value which caused eclipse fali to start.
now my eclipse starts and i see the groovy features too..
I had the same problem with installing the CVS plugin on a Eclipse Platform installation running TeXlipse. Turns out, after installing CVS, the installer had modified not the osgi.bundles, but the osgi.framework.
/Applications/TeXlipse/configuration/config.ini said:
osgi.framework=file\:/Applications/TeXlipse/Eclipse.app/Contents/MacOS/plugins/org.eclipse.osgi_3.5.2.R35x_v20100126.jar
and it was supposed to say
osgi.framework=file\:/Applications/TeXlipse/plugins/org.eclipse.osgi_3.5.2.R35x_v20100126.jar