Hibernate version:
Hibernate version 3.1 beta 3, 13 September 2005
EntityManager 3.1 beta 3, 14 September 2005
Annotations 3.1 beta 5, 14 September 2005
Mapping documents:
not importanint
Code between sessionFactory.openSession() and session.close():
Failure while trying to create EntityManagerFactory.
Full stack trace of any exception that occurs:
Code:
org.hibernate.AssertionFailure: Unsupported protocol while reading jar/par: bundleresource://14
at org.hibernate.ejb.packaging.JarVisitor.getVisitor(JarVisitor.java:86)
at org.hibernate.ejb.Ejb3Configuration.createEntityManagerFactory(Ejb3Configuration.java:126)
at org.hibernate.ejb.HibernatePersistence.createEntityManagerFactory(HibernatePersistence.java:73)
at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:37)
at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:27)
at org.openaccount.utils.EntityManagerResource.getEntityManagerFactory(EntityManagerResource.aj:106)
at org.openaccount.utils.EntityManagerResource.createEntityManager(EntityManagerResource.aj:119)
at org.openaccount.utils.EntityManagerResource.aroundGet(EntityManagerResource.aj:58)
at org.openaccount.ui.AccountListView$ViewContentProvider.getElements(AccountListView.java:109)
at org.eclipse.jface.viewers.StructuredViewer.getRawChildren(StructuredViewer.java:848)
at org.eclipse.jface.viewers.TableViewer.getRawChildren(TableViewer.java:1086)
.... more stack available....
Name and version of the database you are using:hsqldb 1.8.0
The generated SQL (show_sql=true):not applicable
Debug level Hibernate log excerpt:not applicable
Just curious if anyone has success with using entitymanager in an eclipse plugin for purpose of rcp application.
I put entitymanager and annotations in a single plugin. I have a model plugin (with annotated classes) that depends on the em/anno plugin. I have a jface ui plugin which tries to get a EntityMangerFactory (through a utility class in model plugin's jar file). A view's content provider will be performing a query on the entity manager, but I don't get that far.
The first problem I had was that
Code:
META-INF/services/javax.persistence.spi.PersistenceProvider
could not be found. This is probably due to eclipse classloading scheme against the javax.persistence.Persistence context loader mechanism to find it. My workaround is to copy this file up into my ui plugin's classpath.
The second problem doesn't seem to be as easily worked around. The entitymanager wants to build a visitor for the jar file that contains the persistence.xml. But eclipse has reconstituted the url for this jar file and repalced 'jar' protocol with 'bundleresource' protocol.
Is there anyway I can get this to work or should I forget about it for now.
Thanks,
John