jpa libraries in Eclipse Indigo SR1 - eclipselink

The Eclipse Indigo SR1 (on windows XP) has File/new/JPA project template etc. I see
some 9 persistence .jar-s under eclipse/Plugins directory( i did download of Eclipse
and
unzipped the eclipse , then ran it) . yet project/java build path/libraries shows none
of the JPA jar files.It shows just the Jre library .
When i try to compose a JPA entity class
all the JPA annotations are unresolved .Tried Help/install new softwarefrom Eclipselink
repository.It was completed ok but did not change anything .Instead I now have double
versions plugins under eclipse/Plugins - so I uninstalled the EclipseLink .
The cure was to download Eclipselink zip file , unzip it somewhereand add some
externals jar persistance jars from there to the java build path/libraries .
But that seems not the correct solution.
Also : when I right click project name /JPA tools /generate Tables from entities .
it says : "This is not supported by the generic platform" .
The other way : generate entities from tables works but not good for me .
Under the JPA tools I see only 3 options (also: 'make persistent'). Should'nt I
see more ?
Any advice what was wrong in the install /setup process?
EclipseLink site says to do download eclipselink.zip for Eclipse EE
, unzip and set the ECLIPSLINK_HOME environment to point to it - that does nothing to
the project 'java build path/libraries'.
Anyhow that does not seem the solution if JPA is integral part of the Indigo SR1 (or
not)?

In the New JPA Project wizard you can select your JPA implementation. I'd recommend setting the platform to EclipseLink (see 2 below ) and then you can either select a user defined library in the list box (if you have any defined) or you can download a version of EclipseLink using the download icon to the right of the list box and a user library will be defined for you. You can define a user library comprised of the EclipseLink plugins from the Eclipse plugins folder but it may be better to explicitly select a specific version for your project as the version in the plugins will change with future releases of Eclipse.
When you are in the New JPA Project wizard, select one of the EclipseLink versions as your platform--this will enable DDL generation as this is delegated to the runtime. You can also set this after the project is created on the JPA section of the project properties.

Related

Plugin Compatibility Issue Eclipse Oxygen (4.7) and Java 9

We upgraded one of our Eclipse 3.x plugins to work with Java 9.
But when we generated the plugin update site content, and used Eclipse Update functionality to install the new version of the plugin, we encountered the following error in Eclipse Oxygen.
Removing part descriptor with the 'pluginxxx.bla.bla' id and the 'bla bla' description. Points to the invalid 'bundleclass://org.eclipse.ui.workbench/org.eclipse.ui.internal.e4.compatibility.CompatibilityView' class.
This error also appears due to some of the bundled plugins of Eclipse Oxygen itself.
After a hard week we had to
Uninstall our plugin
Remove the older versions of the plugin from the Eclipse/plugins folder
Export the plugin as a deployable plugin under the eclipse plugins directory. (Eclipse/plugins/blabla.jar)
Restart Eclipse and it worked.
Right click the eclipse plugin project and Run as "Eclipse Application" works fine, but installing the plugin from an "Update Site" causes the plugin to fail loading.
We could not find a solution yet, but it certainly effects our delivery of the plugin. The plugin is used by almost 500 CS students on their personal computers, and 200 lab computers. So the update should be installed using regular Eclipse Update functionality, not by copying the jar into the plugins directory.
Was there a better way to fix this, or something quicker we could've tried (in case this happens again)?
Update (7 days into the problem)
We have a workaround:
Export the feature project with the following settings in the Export Wizard
Destination/ Directory: Folder of your Plugin Update Site project
Options/ Package as individual JAR archieves (selected)
Options/ Generate p2 repository (selected)
Options/ Allow for binary cycles in target platform (selected)
Options/ Use class files compiled in the workspace (essentially selected)
Install (or update) the plugin from the local (or remote) plugin update site, and the CompatibilityView problem is solved.
In order to have the category listing displayed correctly during install/update new software operations, we added a category.xml file (File/New/Other/Plugin-in Development/Category Definition) in the update site project, defined the categories, and added the feature (versioned as "qualifier").
This is certainly not the way it should be, and we just hope it will be solved in the future Eclipse releases.
By the way current Eclipse Photon integration version has the same problem unfortunately.

Not ableto migrate from eclipse 3.x to eclipse 4.x

We've an RCP application based on 3.x api we are trying to migrate it to eclipse 4.x.
The problem is some part of the code was using eclipse internal classes present in the workbench.jar . SO i added the workbench.jar JAR from the previous eclipse(HELIOS) to my new eclipse(KEPLER) this resolved the errors .But my application is not able to start.So just wanted to know is it the correct approach
1.Can I have two workbench.jar JARS(3.105 and 3.6) in my application.
2.If no then is there a way to search for the internal classes which I was using previously in the new jars I was mainly using the internal classes related to layout and prespectives(like : org.eclise.ui.internal.layyoutPart ,org.eclipse.internal.ui.perspectives)
3.Is there a way using which I can avoid rewriting the code.
Eclipse 4.x is a very substantial rewrite so there is very little chance that internal classes from 3.x are going to work. Multiple workbench jars is not going to work in any case.
The layout and perspective classes you mention do not exist in Eclipse 4.x, you are going to have to rewrite your code.
See also Eclipse API Rules of Engagement

How to add facets to an IntelliJ Java/Gradle project to create a self-sufficient war

Background
Download and install IntelliJ 12.04 Community Edition
Create project from external source (point to Gradle build script)
Specify JDK 7 as project's SDK
Note: Project is open source at github: Netflix/karyon
Problem
Want to simply war the project. In playing on the commercial version with GAE plugin installed, I was able to specify the Web Application facet, and create the war via the artifact functionality. With the setup described above, the only available facet is Android.
Question
How can I create a self sufficient war (includes all dependencies and hence can be dropped in any container without additional classpath requirements) from within the IDE?
IntelliJ IDEA Community edition doesn't have Java EE support, you need to use some other tool for packaging the war (e.g. Maven).

Force Eclipse (Helios) to use a newer version of SWT at application runtime

I'm developing an RCP project using Eclipse-Helios.
The version of SWT that is installed (in the plugins directory) is [org.eclipse.swt-win32-3.6.2, & org.eclipse.swt.jar]
I require new API functionality that is only available from swt-3.8. (specifically, I wish to set the custom colours, for an SWT color dialog before opening.)
I have downloaded 3.8.1 from the SWT/Eclipse downloads site [ http://download.eclipse.org/eclipse/downloads/drops/R-3.8-201206081200/#SWT ]
The SWT download is NOT a plugin (couple of jars, src.zip and some readme files), so I am unable to add it to my "Target Platform" (it doesn't appear as an available jar even after adding the containing directory in "locations")
I was unable to find an update site for SWT (or any site where i could get a plugin for the newer version)
If I add the swt.3.8.jar to my classpath (and then increase it's order-priority in the project build-path), I am able to access the newer api functionality from my code (as well as view the source).
When I run the application however, it seems as though the runtime is still using the older SWT jar, as i get an unknown method error, when attempting to access the newer functionality.
Questions:
Is there an SWT repository location that I can use to download a newer version of SWT using the eclipse install manager?
If not, is there a way I can force the runtime to ignore the older version (I assume via plugin.xml)?
Is there a better way to achieve what I am trying to do?
What is the difference between the two SWT jars currently in the helios plugins directory (as the 3.8 download only contains the win-32 version)?
Thanks in advance.
SWT is downloadable as a separate plugin here:
http://download.eclipse.org/eclipse/downloads/drops/R-3.8-201206081200/#SWT
Eclipse 3.8 contains regular plugins including the SWT (the win32 specific as well as the generic "org.eclipse.swt_.jar"). I am currently using the 3.8 version and they appear as plugins.
I also have Eclipse 3.6 (Helios) and I was able to import the swt plugins using the "File->Import->Plug-in Development->Plug-ins and Fragments" wizard. I just specified the eclipse 3.8 directory and could import them in my workspace. Once imported I can of-course use them to be included in the runtime environment. Eclipse should use the latest version automatically.

Link Maven OSGi to Maven NetBeans Platform Project

I am using NetBeans 6.9 Beta and I would like to accomplish the following:
Set up a project representing the main application using Maven (for instance "Maven Project", "Maven NetBeans Application")
Ideally, the project should only contain the necessary libraries to run in Apache Felix (I would like to be able to right-click the project and select "Run in Felix")
I do not want that the project contains all the NetBean Platform APIs
I would prefer to implement the modules using OSGi. For instance "Maven OSGi Bundle", "Maven NetBeans Module" + OSGi
These are the problems, which I have at the moment:
The standard Maven archetype ("Maven NetBeans Application") seems always to select all APIs and I have not found a way to deselect APIs - in normal NetBeans Platform Applications that can be accomplished by going to the project properties and deselected the platform modules) - I guess it has something to do with the NetBeans repository (http://bits.netbeans.org/maven2)? Do I have to create another repository?
When creating normal "NetBeans Module" with OSGi support, the modules contain both NetBeans Module and OSGi meta data, which is nice. So, for instance the tool support in NetBeans is available for both technologies. But the "Maven NetBeans Modules" have only NetBeans meta data and the Maven OSGi Bundles have only OSGi meta data).
3. I figured out how to add modules to the project by using project / new and then placing the modules in the Maven project folder. However, I do not quite know yet how I could link to modules from other locations (NetBeans uses Maven modules, which have to be in the same directory as the project?).
Below some useful links for Maven + OSGi in NetBeans
wiki.netbeans.org/STS_69_Maven_OSGI NetBeans Maven OSGi Test Specification
platform.netbeans.org/tutorials/nbm-maven-quickstart.html NetBeans Platform Quick Start Using Maven (6.9)
wiki.netbeans.org/MavenBestPractices NetBeans Maven BestPractices
maven.apache.org/pom.html#Aggregation Maven Documentation Multi-Module Projects
(sorry about the missing protocol but couldn't post the message otherwise)
your nbm-application project depends on all platform projects.. just use the regular maven dependency management (adding/removing dependencies, adding dependency excludes to limit your platform
configure the nbm plugin and the bundle plugin yourself to sequentially append content to the manifest file.. I think Fabrizio Guidici's forceten and bluemarine projects do that in some way..
I don't understand the problem entirely. maven modules are a different thing than netbeans modules. you can for sure compose the application from multiple independently build nb module artifacts.