Trying to use JPA in OSGI always gives me the error “javax.persistence.PersistenceException: No Persistence provider for EntityManager named …”. Reason: Persistence.createEntityManagerFactory() uses the ClassLoader to load resources. It seems to be the ThreadContext ClassLoader. So in OSGI it fails due to the OSGI classloader tricks. Using the tricks given in http://lsd.luminis.nl/jpa-persistence-in-osgi-with-openjpa/ I got this to work. That […]

Read More OSGI, JPA


another set of points -ran into trouble trying to get hibernate to check my 2nd entity that is referencing the first one. the mysql create broke on the wrong innodb syntax noted before. and could not just leave the second one in as i wanted to reference the first one. solution. org.hibernate.dialect.MySQL5InnoDBDialect is a correct dialect […]

Read More hiiiibernateee

some hibernate twinkies

notes to self, -JPA is the standard java annotation thingy for hibernate type things -hibernate reference document lists nicely all configuration options. to get a list of relevant ones to set better to google for tutorial for hibernate and that db, then check the docs for what the options are. -“hibernate.hbm2ddl.auto”, “create” leads to breaking […]

Read More some hibernate twinkies

another fix to hibernate error

well, now i got another error along the lines of check the manual that corresponds to your MySQL server version for the right syntax to use near ‘type=InnoDB’ –>hibernate generates a script that is wrong in defining “type=” where it should be “engine=”. whooppee so it seems i can only create the tables myself..

Read More another fix to hibernate error