Skip to main content
Jump to: navigation, search

Difference between revisions of "Teneo/Hibernate/Download and Install"

(Usage in Eclipse/OSGI: download and install using the update manager)
 
(37 intermediate revisions by 3 users not shown)
Line 3: Line 3:
  
 
The installation method for Teneo depends on the target environment(Eclipse/OSGI or web container). Both cases are discussed on this page. This page also describes where to find the example projects used in the tutorials in the wiki.  
 
The installation method for Teneo depends on the target environment(Eclipse/OSGI or web container). Both cases are discussed on this page. This page also describes where to find the example projects used in the tutorials in the wiki.  
 
Teneo is build and tested on Eclipse 3.5 (Teneo 1.1.*) and Eclipse 3.6 (Teneo 1.2.*). This page assumes that you have a running Eclipse 3.5/3.6 instance available.
 
  
 
== Dependencies ==
 
== Dependencies ==
  
 
To run Teneo you need the following software:
 
To run Teneo you need the following software:
* EMF 2.5 (Teneo 1.1.*) or 2.6 (Teneo 1.2.*)
+
* EMF  
* Hibernate 3.3.2 and its dependencies
+
* Hibernate
* Apache commons logging
+
 
* JDBC driver
 
* JDBC driver
  
Some dependencies can not be downloaded from eclipse.org because of licensing differences. Teneo provides an update site with the required dependencies: http://www.elver.org/eclipse/update.  
+
Some dependencies can not be downloaded from eclipse.org because of licensing differences. Teneo provide update sites with the required dependencies (see below for the correct update site depending on your version).
  
== Download and install using the update manager (for usage in Eclipse/OSGI) ==
+
== Usage in Eclipse/OSGI: download and install using the update manager ==
  
To download and install Teneo and its dependencies, use the following update sites:
+
=== Plugins and dependencies, update site locations ===
* EMF 2.5: http://download.eclipse.org/modeling/emf/updates/releases/ (this site also lists Teneo builds, but is better to use a recent maintenance build, see the interim site below)
+
* EMF 2.6: http://download.eclipse.org/modeling/emf/updates/interim/
+
* Teneo (1.1.2 and 1.2.*): http://download.eclipse.org/modeling/emf/updates/interim/
+
* Hibernate and other dependencies: http://www.elver.org/eclipse/update
+
  
It is best to combine EMF 2.5 with a Teneo 1.1.2 maintenance build.
+
Teneo is delivered in the following versions:
 +
 
 +
* '''2.1.0: EMF 2.10/Eclipse 4.4/Hibernate 4.3.*/JPA 2.0:'''
 +
** Teneo: http://download.eclipse.org/modeling/emf/teneo/updates/2.1.0/interim/
 +
** EMF: http://download.eclipse.org/releases/luna
 +
** Hibernate and other dependencies: http://www.elver.org/eclipse/2.1.0/update
 +
 
 +
* '''2.0.0: EMF 2.7-2.8-2.9/Eclipse 3.7-3.8-4.2-4.3/Hibernate 4.1/JPA 2.0:'''
 +
** Teneo: http://download.eclipse.org/modeling/emf/teneo/updates/2.0.0/interim/
 +
** EMF: http://download.eclipse.org/releases/kepler
 +
** Hibernate and other dependencies: http://www.elver.org/eclipse/2.0.0/update
 +
 
 +
'''The following update sites are no longer available''':
 +
** http://www.elver.org/eclipse/1.2.0/update
 +
** http://www.elver.org/eclipse/1.1.2/update
 +
 
 +
'''Note: update site urls in the screenshots below maybe outdated, use the update site urls listed above.'''
  
 
The EMF update site, select the EMF/XSD SDK:
 
The EMF update site, select the EMF/XSD SDK:
Line 31: Line 40:
  
  
The Teneo update site will look similar to this image. Select the Teneo Hibernate SDK, for EMF 2.6 select the 1.2.* versions):
+
The Teneo update site will look similar to this image. Select the Teneo Hibernate SDK:
  
[[Image:org.eclipse.emf.teneo.install_teneo.png|center|600px]]
 
  
 +
[[Image:org.eclipse.emf.teneo.update.site.png|center|700px]]
  
The elver update site lists the Hibernate, dom4j and a number of JDBC plugins (select them all):
 
  
[[Image:org.eclipse.emf.teneo.install_dependency.png|center]]
+
The elver update site lists the Hibernate, dom4j and a number of JDBC plugins. Select the followings, plus some connectors, depending on your needs :
  
== Download directly ==
 
  
Teneo can be downloaded directly from [http://www.eclipse.org/modeling/emf/downloads/?project=teneo this page]. Note that it is always better to use a maintenance build, also for maintenance builds all the test cases pass. Maintenance builds are listed a bit lower on the download page.
+
[[Image:org.eclipse.emf.teneo.install_dependency.png|center]]
  
== Creating your own Hibernate plugin ==
+
=== Creating your own Hibernate plugin ===
  
 
If you want to make your own Hibernate/library plugin there is one specific setting which needs to be set in your plugin: make sure to add the following line to the MANIFEST.MF of the Hibernate/libraries plugin you create:
 
If you want to make your own Hibernate/library plugin there is one specific setting which needs to be set in your plugin: make sure to add the following line to the MANIFEST.MF of the Hibernate/libraries plugin you create:
Line 52: Line 59:
 
This is required otherwise the Hibernate libraries can not find your model classes when performing runtime class enhancement. See [http://manuelselva.wordpress.com/2008/04/03/eclipse-and-hibernate-and-class-loaders/ here] for more information. Note that also other Eclipse-BuddyPolicy settings can be used (and can make sense in production environments) but the 'dependent' setting is the safest one.
 
This is required otherwise the Hibernate libraries can not find your model classes when performing runtime class enhancement. See [http://manuelselva.wordpress.com/2008/04/03/eclipse-and-hibernate-and-class-loaders/ here] for more information. Note that also other Eclipse-BuddyPolicy settings can be used (and can make sense in production environments) but the 'dependent' setting is the safest one.
  
== Install Teneo for usage within a Web Container ==
+
=== Teneo, import-packages and ClassNotFoundException when running junit testcases ===
  
For usage within a web container the following jar files are required. You can find these files in the download zips (within the eclipse/plugins directory of the zip file) or in the plugins folder of your eclipse installation, after installing through the update manager:
+
The Teneo and Hibernate plugins declare dependencies using import-packages. When running junit testcases as normal Java applications or standard junit tests then there is no OSGI environment which takes care of resolving these import-packages. This means that the import-package dependencies are not resolved and ClassNotFoundExceptions are thrown.
  
* '''EMF jar files''':
+
This can be solved by explicitly declaring the dependency in the MANIFEST.MF of your test or model project. As an example: these are the dependendencies set in the examples project:
** org.eclipse.emf.ecore
+
<source lang="javascript">
** org.eclipse.emf.common
+
Require-Bundle: org.eclipse.core.runtime,
** org.eclipse.emf.ecore.xmi
+
org.eclipse.emf.ecore;visibility:=reexport,
 +
org.eclipse.emf.ecore.xmi;visibility:=reexport,
 +
org.eclipse.emf.teneo.hibernate;bundle-version="1.1.2",
 +
org.hibernate;bundle-version="3.3.2",
 +
org.eclipse.emf.ecore.change,
 +
org.apache.commons.logging,
 +
org.dom4j,
 +
org.hsqldb,
 +
com.mysql.jdbc
 +
</source>
 +
 
 +
== Usage in a Web Container - Maven ==
 +
 
 +
For usage within a web container the following jar files are required. You can download these files from the plugins section on the [http://download.eclipse.org/modeling/emf/teneo/updates/1.2.0/interim/ update site] using your web browser, or you can use Maven (see below):
 +
 
 +
=== Jars and Dependencies ===
  
 
* '''Teneo jar files''':
 
* '''Teneo jar files''':
 
** org.eclipse.emf.teneo
 
** org.eclipse.emf.teneo
 
** org.eclipse.emf.teneo.annotations
 
** org.eclipse.emf.teneo.annotations
** org.eclipse.emf.teneo.hibernate: this plugin is probably installed as a folder in Eclipse, you can create a jar file by zipping this folder and changing the extension to .jar.
+
** org.eclipse.emf.teneo.hibernate
** org.eclipse.emf.teneo.hibernate.extra.jar
+
 
** org.eclipse.emf.teneo.hibernate.mapper
 
** org.eclipse.emf.teneo.hibernate.mapper
  
* '''Dependencies''': it is probably best to download [http://www.hibernate.org hibernate], [http://commons.apache.org/logging/ commons-logging] and a jdbc driver directly from their respective websites. You can however also find these jar files in the eclipse/plugins directory after installing through the update manager.
+
* '''EMF jar files''':
 +
** org.eclipse.emf.ecore
 +
** org.eclipse.emf.common
 +
** org.eclipse.emf.ecore.xmi
 +
 
 +
* '''Dependencies''': Teneo depends on the [http://www.hibernate.org hibernate] and [http://commons.apache.org/logging/ commons-logging] jars (and a jdbc jar). You can find them in maven central or you can download directly from their respective websites.
 +
 
 +
=== Maven ===
 +
 
 +
Teneo and related EMF jar files are published in [http://search.maven.org/#search%7Cga%7C1%7Corg.eclipse.emf.teneo central maven] and in the [https://oss.sonatype.org/content/repositories/releases/org/eclipse/emf/ sonatype-snapshot] repository. All of them are published in the [http://search.maven.org/#search%7Cga%7C1%7Cg%3A%22org.eclipse.emf%22 org.eclipse.emf] group.
 +
 
 +
'''The Teneo pom files do not define explicit dependencies. This means that your pom files should list the EMF, commons-logging and hibernate jar file as dependencies.'''
 +
 
 +
== Download Example Project for Tutorials ==
 +
 
 +
The example project (org.eclipse.emf.teneo.hibernate.examples) can be found in git [http://git.eclipse.org/c/teneo/org.eclipse.emf.teneo.git/tree/hibernate/org.eclipse.emf.teneo.hibernate.examples here]. To clone the Teneo git repository execute this action:
 +
 
 +
git clone git://git.eclipse.org/gitroot/teneo/org.eclipse.emf.teneo.git
 +
 
 +
See [[Git|this page]] on how to work with Eclipse GIT repositories.
 +
 
 +
The main examples project used in the tutorials is the: '''org.eclipse.emf.teneo.hibernate.examples''' project.
 +
 
 +
This example project uses an extended version of the well-known EMF library example. The example project contains the generated model code and a number of tutorial classes showing how to work with EMF, Teneo and Hibernate.
  
For a web container these jar files should be placed in the WEB-INF/lib directory of your web application.
+
Some more details regarding the example project. The example project consists of the following:
 +
* an ecore model and genmodel (in the model subfolder)
 +
* generated model code (no manual changes done, so you can change the ecore model and regenerate the code)
 +
* a number of tutorial java classes in the org.eclipse.emf.teneo.hibernate.examples package
  
== Download and Install Example Projects for Tutorials ==
+
The MANIFEST.MF of the examples project lists dependencies on several plugins, see the next section for more information on this.

Latest revision as of 19:23, 5 August 2015


The installation method for Teneo depends on the target environment(Eclipse/OSGI or web container). Both cases are discussed on this page. This page also describes where to find the example projects used in the tutorials in the wiki.

Dependencies

To run Teneo you need the following software:

  • EMF
  • Hibernate
  • JDBC driver

Some dependencies can not be downloaded from eclipse.org because of licensing differences. Teneo provide update sites with the required dependencies (see below for the correct update site depending on your version).

Usage in Eclipse/OSGI: download and install using the update manager

Plugins and dependencies, update site locations

Teneo is delivered in the following versions:

The following update sites are no longer available:

Note: update site urls in the screenshots below maybe outdated, use the update site urls listed above.

The EMF update site, select the EMF/XSD SDK:

Org.eclipse.emf.teneo.install emf.png


The Teneo update site will look similar to this image. Select the Teneo Hibernate SDK:


Org.eclipse.emf.teneo.update.site.png


The elver update site lists the Hibernate, dom4j and a number of JDBC plugins. Select the followings, plus some connectors, depending on your needs :


Org.eclipse.emf.teneo.install dependency.png

Creating your own Hibernate plugin

If you want to make your own Hibernate/library plugin there is one specific setting which needs to be set in your plugin: make sure to add the following line to the MANIFEST.MF of the Hibernate/libraries plugin you create:

Eclipse-BuddyPolicy: dependent

This is required otherwise the Hibernate libraries can not find your model classes when performing runtime class enhancement. See here for more information. Note that also other Eclipse-BuddyPolicy settings can be used (and can make sense in production environments) but the 'dependent' setting is the safest one.

Teneo, import-packages and ClassNotFoundException when running junit testcases

The Teneo and Hibernate plugins declare dependencies using import-packages. When running junit testcases as normal Java applications or standard junit tests then there is no OSGI environment which takes care of resolving these import-packages. This means that the import-package dependencies are not resolved and ClassNotFoundExceptions are thrown.

This can be solved by explicitly declaring the dependency in the MANIFEST.MF of your test or model project. As an example: these are the dependendencies set in the examples project:

Require-Bundle: org.eclipse.core.runtime,
 org.eclipse.emf.ecore;visibility:=reexport,
 org.eclipse.emf.ecore.xmi;visibility:=reexport,
 org.eclipse.emf.teneo.hibernate;bundle-version="1.1.2",
 org.hibernate;bundle-version="3.3.2",
 org.eclipse.emf.ecore.change,
 org.apache.commons.logging,
 org.dom4j,
 org.hsqldb,
 com.mysql.jdbc

Usage in a Web Container - Maven

For usage within a web container the following jar files are required. You can download these files from the plugins section on the update site using your web browser, or you can use Maven (see below):

Jars and Dependencies

  • Teneo jar files:
    • org.eclipse.emf.teneo
    • org.eclipse.emf.teneo.annotations
    • org.eclipse.emf.teneo.hibernate
    • org.eclipse.emf.teneo.hibernate.mapper
  • EMF jar files:
    • org.eclipse.emf.ecore
    • org.eclipse.emf.common
    • org.eclipse.emf.ecore.xmi
  • Dependencies: Teneo depends on the hibernate and commons-logging jars (and a jdbc jar). You can find them in maven central or you can download directly from their respective websites.

Maven

Teneo and related EMF jar files are published in central maven and in the sonatype-snapshot repository. All of them are published in the org.eclipse.emf group.

The Teneo pom files do not define explicit dependencies. This means that your pom files should list the EMF, commons-logging and hibernate jar file as dependencies.

Download Example Project for Tutorials

The example project (org.eclipse.emf.teneo.hibernate.examples) can be found in git here. To clone the Teneo git repository execute this action:

git clone git://git.eclipse.org/gitroot/teneo/org.eclipse.emf.teneo.git

See this page on how to work with Eclipse GIT repositories.

The main examples project used in the tutorials is the: org.eclipse.emf.teneo.hibernate.examples project.

This example project uses an extended version of the well-known EMF library example. The example project contains the generated model code and a number of tutorial classes showing how to work with EMF, Teneo and Hibernate.

Some more details regarding the example project. The example project consists of the following:

  • an ecore model and genmodel (in the model subfolder)
  • generated model code (no manual changes done, so you can change the ecore model and regenerate the code)
  • a number of tutorial java classes in the org.eclipse.emf.teneo.hibernate.examples package

The MANIFEST.MF of the examples project lists dependencies on several plugins, see the next section for more information on this.

Back to the top