[Ikvm-developers] Class problems with hibernate at runtime.
Brought to you by:
jfrijters
|
From: Eric B. <eri...@gm...> - 2009-04-30 09:44:01
|
Hello.
I'm having some trubles with Hibernate generated classes under IKVM.
I can declare and use the generated classes from .NET however hibernate itself
can't find them.
To be more specific:
I have a class named LiloadSnapshot, This class was generated using hibernate
on java.
I bundled LiLoadSnapshot using IKVMC.
I can declare and use LiLoadSnapshot in my C# application but when I try to
look it up Hibernate can't find the entity class
Here's the C# code I try to run
=======================
Entities.EntitiesAdapter ea = new Entities.EntitiesAdapter();
EntityManager entityManager = ea.getEm();
LiloadSnapshot rs = new LiloadSnapshot();
string name = rs.getClass().getName(); // Returns
Ladix.Entuitions.entities.LiLoadSnapshot
//Query query = entityManager.createQuery("from LiloadSnapshot");
Query query = entityManager.createNativeQuery("select * from
LiloadSnapshot",rs.getClass()); //This actually get the list
List list = query.getResultList(); // <--- This line causes the
exception.
=================
Hibernate Annotations 3.3.1.GA
org.hibernate.cfg.annotations.Version
Hibernate 3.2.5
org.hibernate.cfg.Environment
hibernate.properties not found
org.hibernate.cfg.Environment
Bytecode provider name : cglib
org.hibernate.cfg.Environment
using JDK 1.4 java.sql.Timestamp handling
org.hibernate.cfg.Environment
Hibernate Commons Annotations 3.1.0.CR1
org.hibernate.annotations.common.Version
Hibernate EntityManager 3.3.2.GA
org.hibernate.ejb.Version
Unable to find file (ignored): ikvmres://EntitiesProvider-1.0-SNAPSHOT,
%20Version=0.0.0.0,%20Culture=neutral,%20PublicKeyToken=null
org.hibernate.ejb.packaging.InputStreamZippedJarVisitor
java.net.MalformedURLException: ikvmres://EntitiesProvider-1.0-SNAPSHOT,
%20Version=0.0.0.0,%20Culture=neutral,%20PublicKeyToken=null
at
gnu.java.net.protocol.ikvmres.IkvmresURLConnection.connect(Handler.java:49)
at
gnu.java.net.protocol.ikvmres.IkvmresURLConnection.getInputStream(Handler.java:75)
at java.net.URL.openStream(URL.java:1027)
at
org.hibernate.ejb.packaging.InputStreamZippedJarVisitor.doProcessElements(InputStreamZippedJarVisitor.java:38)
at
org.hibernate.ejb.packaging.AbstractJarVisitor.getMatchingEntries(AbstractJarVisitor.java:140)
at
org.hibernate.ejb.Ejb3Configuration.addScannedEntries(Ejb3Configuration.java:287)
at
org.hibernate.ejb.Ejb3Configuration.addMetadataFromVisitor(Ejb3Configuration.java:283)
at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:248)
at
org.hibernate.ejb.HibernatePersistence.createEntityManagerFactory(HibernatePersistence.java:126)
at
javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:52)
at
javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:34)
at Entities.EntitiesAdapter.initEntityManager(EntitiesAdapter.java:38)
at Entities.EntitiesAdapter.<init>(EntitiesAdapter.java:28)
at cli.Test.Program.Main(Program.cs:24)
Hibernate Validator not found: ignoring
org.hibernate.cfg.AnnotationConfiguration
Using Hibernate built-in connection pool (not for production use!)
org.hibernate.connection.DriverManagerConnectionProvider
Hibernate connection pool size: 20
org.hibernate.connection.DriverManagerConnectionProvider
autocommit mode: true
org.hibernate.connection.DriverManagerConnectionProvider
using driver: org.postgresql.Driver at URL:
jdbc:postgresql://dbdev2.Ladix2/revDB2
org.hibernate.connection.DriverManagerConnectionProvider
connection properties: {user=postgres, password=****, autocommit=true,
release_mode=auto}
org.hibernate.connection.DriverManagerConnectionProvider
RDBMS: PostgreSQL, version: 8.3.1
org.hibernate.cfg.SettingsFactory
JDBC driver: PostgreSQL Native Driver, version: PostgreSQL 8.3 JDBC3 with SSL
(build 603)
org.hibernate.cfg.SettingsFactory
Using dialect: org.hibernate.dialect.PostgreSQLDialect
org.hibernate.dialect.Dialect
Transaction strategy: org.hibernate.transaction.JDBCTransactionFactory
org.hibernate.transaction.TransactionFactoryFactory
No TransactionManagerLookup configured (in JTA environment, use of read-write
or transactional second-level cache is not recommended)
org.hibernate.transaction.TransactionManagerLookupFactory
Automatic flush during beforeCompletion(): disabled
org.hibernate.cfg.SettingsFactory
Automatic session close at end of transaction: disabled
org.hibernate.cfg.SettingsFactory
JDBC batch size: 15
org.hibernate.cfg.SettingsFactory
JDBC batch updates for versioned data: disabled
org.hibernate.cfg.SettingsFactory
Scrollable result sets: enabled
org.hibernate.cfg.SettingsFactory
JDBC3 getGeneratedKeys(): disabled
org.hibernate.cfg.SettingsFactory
Connection release mode: auto
org.hibernate.cfg.SettingsFactory
Default batch fetch size: 1
org.hibernate.cfg.SettingsFactory
Generate SQL with comments: disabled
org.hibernate.cfg.SettingsFactory
Order SQL updates by primary key: disabled
org.hibernate.cfg.SettingsFactory
Order SQL inserts for batching: disabled
org.hibernate.cfg.SettingsFactory
Query translator: org.hibernate.hql.ast.ASTQueryTranslatorFactory
org.hibernate.cfg.SettingsFactory
Using ASTQueryTranslatorFactory
org.hibernate.hql.ast.ASTQueryTranslatorFactory
Query language substitutions: {}
org.hibernate.cfg.SettingsFactory
JPA-QL strict compliance: enabled
org.hibernate.cfg.SettingsFactory
Second-level cache: enabled
org.hibernate.cfg.SettingsFactory
Query cache: disabled
org.hibernate.cfg.SettingsFactory
Cache provider: org.hibernate.cache.NoCacheProvider
org.hibernate.cfg.SettingsFactory
Optimize cache for minimal puts: disabled
org.hibernate.cfg.SettingsFactory
Structured second-level cache entries: disabled
org.hibernate.cfg.SettingsFactory
Echoing all SQL to stdout
org.hibernate.cfg.SettingsFactory
Statistics: disabled
org.hibernate.cfg.SettingsFactory
Deleted entity synthetic identifier rollback: disabled
org.hibernate.cfg.SettingsFactory
Default entity-mode: pojo
org.hibernate.cfg.SettingsFactory
Named query checking : enabled
org.hibernate.cfg.SettingsFactory
building session factory
org.hibernate.impl.SessionFactoryImpl
Not binding factory to JNDI, no JNDI name configured
org.hibernate.impl.SessionFactoryObjectFactory
Unhandled Exception: javax.persistence.PersistenceException:
org.hibernate.MappingException: Unknown entity:
Ladix.Entuitions.entities.LiloadSnapshot
=================================
I'll appreciate any help.
Eric.
|