Hibernate version: - Hibernate Core 3.2.0.CR4
- Hibernate Entity Manager 3.2.0.CR2
Mapping documents:- NONE (Programmatic Configuration)
Code between sessionFactory.openSession() and session.close():- NONE (Entity Manager)
Full stack trace of any exception that occurs:Code:
[16:42:42.046] java.lang.IllegalArgumentException: unknown handler key
[16:42:42.046] at javax.security.jacc.PolicyContext.getContext(PolicyContext.java:280)
[16:42:42.046] at org.hibernate.secure.JACCPermissions$3.getContextSubject(JACCPermissions.java:88)
[16:42:42.046] at org.hibernate.secure.JACCPermissions.getContextSubject(JACCPermissions.java:97)
[16:42:42.046] at org.hibernate.secure.JACCPermissions.checkPermission(JACCPermissions.java:36)
[16:42:42.046] at org.hibernate.secure.JACCPreLoadEventListener.onPreLoad(JACCPreLoadEventListener.java:30)
[16:42:42.046] at org.hibernate.engine.TwoPhaseLoad.initializeEntity(TwoPhaseLoad.java:125)
[16:42:42.046] at org.hibernate.loader.Loader.initializeEntitiesAndCollections(Loader.java:842)
[16:42:42.046] at org.hibernate.loader.Loader.doQuery(Loader.java:717)
[16:42:42.046] at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:224)
[16:42:42.046] at org.hibernate.loader.Loader.doList(Loader.java:2144)
[16:42:42.046] at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2028)
[16:42:42.046] at org.hibernate.loader.Loader.list(Loader.java:2023)
[16:42:42.046] at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:393)
[16:42:42.046] at org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:338)
[16:42:42.046] at org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java:172)
[16:42:42.046] at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1121)
[16:42:42.046] at org.hibernate.impl.QueryImpl.list(QueryImpl.java:79)
[16:42:42.046] at org.hibernate.ejb.QueryImpl.getResultList(QueryImpl.java:64)
[16:42:42.046] at product.test.DummyAction.start(DummyAction.java:33)
[16:42:42.046] at product.web.action.VelocityAction.handleRequest(VelocityAction.java:40)
[16:42:42.046] at product.web.ProductRequestHandlerImpl.handleRequest(ProductRequestHandlerImpl.java:42)
[16:42:42.046] at product.web.ProductServlet2.service(ProductServlet2.java:109)
[16:42:42.046] at javax.servlet.http.HttpServlet.service(HttpServlet.java:92)
[16:42:42.046] at com.caucho.server.dispatch.ServletFilterChain.doFilter(ServletFilterChain.java:106)
[16:42:42.046] at com.caucho.server.cache.CacheFilterChain.doFilter(CacheFilterChain.java:209)
[16:42:42.046] at com.caucho.server.webapp.WebAppFilterChain.doFilter(WebAppFilterChain.java:173)
[16:42:42.046] at com.caucho.server.dispatch.ServletInvocation.service(ServletInvocation.java:229)
[16:42:42.046] at com.caucho.server.http.HttpRequest.handleRequest(HttpRequest.java:274)
[16:42:42.046] at com.caucho.server.port.TcpConnection.run(TcpConnection.java:511)
[16:42:42.046] at com.caucho.util.ThreadPool.runTasks(ThreadPool.java:516)
[16:42:42.046] at com.caucho.util.ThreadPool.run(ThreadPool.java:442)
[16:42:42.046] at java.lang.Thread.run(Thread.java:595)
Name and version of the database you are using:Mysql 5.0.22
The generated SQL (show_sql=true):select testentity0_.id as id0_, testentity0_.name as name0_ from testtest testentity0_
Hi all,
i am already working with hibernate, and i want to switch to the EntityManager.
First try today, and i get this stragen exception. I surfed through the sourcecode, but i dont't have a clue what causes this exception. I configure my EntityManagerFactory programmatically:
Code:
Ejb3Configuration cfg = new Ejb3Configuration();
cfg.addAnnotatedClass(TestEntity.class);
cfg.setProperty("hibernate.show_sql", "true");
cfg.setProperty("hibernate.hbm2ddl.auto", "update");
cfg.setProperty("hibernate.bytecode.use_reflection_optimizer", "true");
cfg.setProperty("hibernate.dialect", "org.hibernate.dialect.MySQLDialect");
cfg.setProperty("hibernate.connection.driver_class", "com.mysql.jdbc.Driver");
cfg.setProperty("hibernate.connection.username", "root");
cfg.setProperty("hibernate.connection.password", "xxxxx");
cfg.setProperty("hibernate.connection.url", "jdbc:mysql://localhost/mydb?zeroDateTimeBehavior=round&autoReconnect=true");
entityManagerFactory = cfg.buildEntityManagerFactory();
the configuration runs fine, but with the first query (em.createQuery()) this exception occurs. My TestEntity has two fields: long id and String name.
The whole thing runs under a servlet, i use a ThreadLocal for my EntityManager instance. The second request to the site causes no exception, but id gets read out of the database (id 1 & id 2), but the getName() method of my testEntity always returns null.
is this a bug?
thank you very much
-- felix