jndi « Development « JPA Q&A





1. Problem with Hibernate Shards & JNDI    stackoverflow.com

I'm trying to run a sample program for hibernate shards. I'm all done with it but whenever I run the test program I get an Exception javax.naming.NoInitialContextException: Need to specify class ...

2. ClassCastException with jetty and jpa    stackoverflow.com

When I try to execute my application based on jersey, guice, and jpa on jetty (7.2.0 or 8.0.0.M1) I get the following error, even if I don't use JNDI.

   ...

3. hibernate JNDI error    stackoverflow.com

I've got the error:

INFO: building session factory
May 28, 2011 2:28:05 PM org.hibernate.impl.SessionFactoryObjectFactory addInstance
INFO: Not binding factory to JNDI, no JNDI name configured
Exception in thread "main" org.hibernate.HibernateException: No CurrentSessionContext configured!
   ...

4. Hibernate DS/JNDI in Weblogic    coderanch.com

I am trying to use hibernate.cfg.xml. What works using hibernate.properties is: I have a startup class and the following works when I hardocde in the program: private static void doBind() throws Exception { Properties environment = null; InitialContext context = null; try { environment = new Properties(); environment.put("java.naming.factory.initial", "weblogic.jndi.WLInitialContextFactory"); environment.put("java.naming.provider.url", "t3://localhost:7001"); System.out.println("Constructing an Initial Directory Context object"); context = new InitialContext(environment); ...

5. Doubt in using JNDI with Hibernate.    coderanch.com

A similar post was answered at hibernate.org: JNDI and Hibernate Session Question Well, it's a great idea to bind a Hibernate Session to you JNDI (Java Naming and Directory Interface) server. This way, rather than having to maintain the Session yourself, the JNDI server will, and that resource can then be accessed by any resource that has access and the rights ...

6. challenges and gotchas, using multiple JNDI implementations.    forum.hibernate.org

I thought I would share this with the group, in case you are ever in a position of having to use multiple JNDI implementations because you are using multiple application servers. We have a packaged application called @task which has to run on JBoss, however we decided to use glassfish for our custom web applications, because of the superior, free support. ...

7. Configuring Hibernate with JNDI    forum.hibernate.org

8. Cacho Resin JNDI & Hibernate    forum.hibernate.org

Hi there, i would like to use hibernate within my caucho resin connection pool. I have defined the resin connection pool inside web.xml as following: jdbc/mpdb javax.sql.DataSource and inside hibernate.properties with: hibernate.connection.datasource java:comp/env/jdbc/mydb hibernate.connection.username root hibernate.connection.password ...





10. jndi.url and jndi.class to access SAR via JNDI    forum.hibernate.org

I asked the same question about JNDI under Tomcat. After new InitialContext(), I did a: Context ctx = new InitialiContext(); SessionFactory sf = (SessionFactory)ctx.lookup("dgf:/made/up/jndiName"); I used my sessionFactory normally after that. I put it into that context by using a hibernate.cfg.xml and in the opening sessionfactory statement doing this: Hibernate created that non-existent context for me. I didn't have ...

11. How to lookup hibernate jndi?    forum.hibernate.org

eh? I have no idea. I don't know anything about your appserver and unless its WebSphere I wouldn't have a clue anyway. Please don't address questions to me directly - there are lots of other people in the forum who will be much better equipped to help you if you give sufficient information.

12. static vs. JNDI    forum.hibernate.org

Could someone explain the pros and cons of placing a Hibernate SessionFactory into a static variable in the VM vs. inside JNDI for a web application? Our application places SessionFactory into JNDI and we've found this to be problematic for testing our business logic with JUnit. We're consider just storing SessionFactory as a static in a singleton helper class. Is there ...

13. hibernate.jndi.url    forum.hibernate.org

14. Hibernate + JNDI - problems    forum.hibernate.org

Use Hibernate 2.1.*, don't set a "name" for (Hibernate can't bind anything to the readonly JNDI context in Tomcat) and verify that Tomcat binds the datasource you configured in JNDI at startup. I also think you got some serious confusion with JNDI names and configuration, the exception you have shown says "User Database", this apparently is a failed JNDI object ...

15. JNDI lookup problem    forum.hibernate.org

16. no JNDI name configured - But not a problem    forum.hibernate.org

Well the message and the documentation pointed at state it pretty clearly, I think. But just to reiterate (since I have nothing better to do): The Hibernate SessionFactory has the ability to bind itself into JNDI so that the application can later reference it from there. In order to do so, one would set the "hibernate.session_factory_name" config property. P.S., in case ...





17. JNDI problem    forum.hibernate.org

Hibernate version :2.1 Mapping documents: ZY_PERSON_ID_SEQ Code between sessionFactory.openSession() and session.close(): package firsthibernate; import net.sf.hibernate.Session; import net.sf.hibernate.SessionFactory; import net.sf.hibernate.cfg.Configuration; import net.sf.hibernate.Query; public class TestPersonModel3 { //private static SessionFactory sessionFactory; public static void main(String[] args) throws Exception{ ...

18. Hibernate and Weblogic JNDI integration problems    forum.hibernate.org

[b]Hibernate version: 2.1[/b] [b]Weblogic version: 8.1[/b] Hi, All: Integrating Weblogic and Hibernate can be a little bit of a struggle. I am trying to place the SessionFactroy in the JNDI tree but having trouble. Is there a good example online on how to do this? This is what I've done: added this line to my hibernate.cfg.xml file hibernate/HibernateFactory Then I ...

19. hibernate standalone and jndi    forum.hibernate.org

jdbc:oracle:thin:@cogito:1521:cogito oracle.jdbc.OracleDriver snortdb snortdb net.sf.hibernate.dialect.OracleDialect false true net.sf.hibernate.transaction.JDBCTransactionFactory

20. JNDI lookup in a standalone application    forum.hibernate.org

Newbie Joined: Tue Feb 08, 2005 3:30 am Posts: 6 Location: Bangalore Hello There! I have a class called monitor which monitors the product inventory and sends an email to Admin if the inventory is below threshold. Basically, this (client) program runs fine in the web-context. I instantiated the client class in one of the action class to make sure that ...

21. JNDI implementation with Weblogic 8.1 and C3P0 Pool    forum.hibernate.org

Author Message Anoob Post subject: JNDI implementation with Weblogic 8.1 and C3P0 Pool Posted: Tue Mar 08, 2005 10:59 am Newbie Joined: Sat Mar 05, 2005 7:11 am Posts: 3 Read the rules before posting! http://www.hibernate.org/ForumMailingli ... AskForHelp These are the parameters used, hibernate.c3p0.max_size 100 hibernate.c3p0.min_size 10 hibernate.c3p0.timeout 0 hibernate.c3p0.max_statements 0 hibernate.c3p0.idle_test_period 100 hibernate.c3p0.acquire_increment 1 hibernate.connection.datasource = java:comp/env/jdbc/test hibernate.connection.username ...

22. How to setup JNDI/DS in Weblogic    forum.hibernate.org

I am trying to use hibernate.cfg.xml. What works using hibernate.properties is: I have a startup class and the following works when I hardocde in the program: private static void doBind() throws Exception { Properties environment = null; InitialContext context = null; try { environment = new Properties(); environment.put("java.naming.factory.initial", "weblogic.jndi.WLInitialContextFactory"); environment.put("java.naming.provider.url", "t3://localhost:7001"); System.out.println("Constructing an Initial Directory Context object"); context = new InitialContext(environment); ...

23. ThreadLocal without JNDI in standalone application?    forum.hibernate.org

Hi! I'm trying to run Hibernate in a standealone application with the Threadlocal pattern (HibernateUtil). But i want to keep it simple and so i don't want to use an appserver with JNDI. When i start my Testapplication, it throws a "Could not bind factory to JNDI" Warning and exits. I did _not_ configure a hibernate.session_factory_name in my xml properties but ...

24. Weblogic JNDI - Hibernate3.0    forum.hibernate.org

Can someone please help me in setting up hibernate application with weblogic 7.0. I'm using the following configuraton information. hibernate.cfg.xml t3://localhost:7001 weblogic.jndi.WLInitialContextFactory jdbc/lossforecast false org.hibernate.dialect.SQLServerDialect Class where I'm getting the SessionFactory: public class HibernateUtil { private static final SessionFactory sessionFactory; private static Log log = LogFactory.getLog(HibernateUtil.class.getName()); ...

26. Unable to run hibernate when using JNDI with websphere    forum.hibernate.org

Author Message t_subramanian80 Post subject: Unable to run hibernate when using JNDI with websphere Posted: Sat Feb 04, 2006 6:49 pm Newbie Joined: Sat Feb 04, 2006 6:31 pm Posts: 3 Location: india hi, I am not able to run the hibernate using websphere 5.1 test server with JNDI ... i am using following in my sample proj struts ...

27. Hibernate and JNDI with Websphere Portal    forum.hibernate.org

Newbie Joined: Fri Jul 14, 2006 3:19 am Posts: 12 I'll have to make a db connection with JNDI to Hibernate. Can anybody help me to find out what is wrong in my source. my properties: Code: hibernate.connection.datasource = java:/comp/env/jdbc/jndiUrlaubsplaner hibernate.jndi.url = jdbc:oracle:thin:@AT-LXAUSW01.benteler.net:1521:wsphprod hibernate.connection.username = urlaubsplaner hibernate.connection.password = urlaubsplaner hibernate.transaction.factory_class = \ org.hibernate.transaction.JTATransactionFactory hibernate.transaction.manager_lookup_class ...

28. Hibernate and JNDI with Websphere Portal    forum.hibernate.org

Newbie Joined: Fri Jul 14, 2006 3:19 am Posts: 12 I'll have to make a db connection with JNDI to Hibernate. Can anybody help me to find out what is wrong in my source. my properties: Code: hibernate.connection.datasource = java:/comp/env/jdbc/jndiUrlaubsplaner hibernate.jndi.url = jdbc:oracle:thin:@AT-LXAUSW01.benteler.net:1521:wsphprod hibernate.connection.username = urlaubsplaner hibernate.connection.password = urlaubsplaner hibernate.transaction.factory_class = \ org.hibernate.transaction.JTATransactionFactory hibernate.transaction.manager_lookup_class ...

29. no JNDI name configured    forum.hibernate.org

30. Using Webloging JNDI with Hibernate    forum.hibernate.org

Hi All, I am developing my application in Eclipse using Hibernate and trying to use Hibernate JNDi datasource to access the database. But I m gettin error: "org.hibernate.HibernateException: Could not find datasource [hibernatetool] javax.naming.NoInitialContextException: Need to specify class name in environment or system property....." Below is the snippet from "hibernate.cfg.xml" file, where "mysqllocalhostbase" is JNDI in Weblogic. t3://localhost:7001/mysqllocalhostbase ...

31. no JNDI name configured    forum.hibernate.org

i creat a main class to store a table into oracle , it is ok.but i juin the hibernate active module to the tomcat server , the consoln message printing "no JNDI name configured",some body can tell me why ?? the install logs is bellow: 2006-8-16 12:57:14 net.sf.hibernate.cfg.Environment : Hibernate 2.1.2 2006-8-16 12:57:14 net.sf.hibernate.cfg.Environment : hibernate.properties not found 2006-8-16 ...

32. Hibernate JNDI failure...    forum.hibernate.org

Hello, I am trying to set up a web application that uses Spring and Hibernate on JBoss 4.0.5. The Hibernate classes are placed inside a .HAR inside the .EAR, and referenced in jboss-app.xml. I have placed jboss-service.xml inside the HAR: Code: jboss:service=Naming ...

33. JNDI naming problem    forum.hibernate.org

i have set up JNDI before on tomcat. you should install the admin module for tomcat. It's a breeze to configure your tomcat through that. also, just to eliminate issues, you should try to access jndi through other means other than hibernate, just to make sure it's not your hibernate config. hth, pali

34. Could not unbind factory from JNDI at JbossIDE console    forum.hibernate.org

when I open SessionFactory at JbossIDE console I get follow exception. WARN ModalContext org.hibernate.impl.SessionFactoryObjectFactory - Could not unbind factory from JNDI Thank for in advace. JBossIDE 2.0 BATA2 Full stack trace of any exception that occurs: avax.naming.NoInitialContextException: Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file: java.naming.factory.initial at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:645) ...

35. Is JNDI really needed?    forum.hibernate.org

15:19:43,451 WARN SessionFactoryObjectFactory:98 - Could not bind factory to JNDI javax.naming.NoInitialContextException: Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file: java.naming.factory.initial at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:645) at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:247) at javax.naming.InitialContext.getURLOrDefaultInitCtx(InitialContext.java:284) at javax.naming.InitialContext.getNameParser(InitialContext.java:439) at org.hibernate.util.NamingHelper.bind(NamingHelper.java:52) ...

36. Hibernate 3 and WebLogic 9.2 JNDI    forum.hibernate.org

I am new to both Hibernate and WebLogic 9.2. I have read of many problems getting Hibernate to work with older versions of WebLogic because of the way in which WebLogic implemented JNDI. My fundamental question is simple. Can Hibernate 3 be configured to work with WebLogic using JNDI without other server configuration changes? I have set up a JNDI service ...

37. how to configure JNDI in hibernate    forum.hibernate.org

38. JNDI error.. in hibernate    forum.hibernate.org

Hi i get the follwoing error when i try connecting database from hibernate through JNDI . Code: java.lang.ClassCastException: org.jboss.resource.adapter.jdbc.WrapperDataSource at com.test.hibernate.generated.InsuranceHome.getSessionFactory(InsuranceHome.java:48) at com.tes.thibernate.generated.InsuranceHome.(InsuranceHome.java:24) at com.test.hibernate.generated.InsuranceDao.getdata(InsuranceDao.java:29) at test.FirstBeanController.retriveData(FirstBeanController.java:16) Can any body hepl me out in this.. My hibernate cfg file Code:

39. JNDI troubles    forum.hibernate.org

I was making a hello world with hibernate and the program throws the exception: WARNING: Could not bind factory to JNDI javax.naming.NoInitialContextException: Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file: java.naming.factory.initial at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:645) at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:288) at javax.naming.InitialContext.getURLOrDefaultInitCtx(InitialContext.java:325) at javax.naming.InitialContext.getNameParser(InitialContext.java:480) at org.hibernate.util.NamingHelper.bind(NamingHelper.java:52) at org.hibernate.impl.SessionFactoryObjectFactory.addInstance(SessionFactoryObjectFactory.java:90) at org.hibernate.impl.SessionFactoryImpl.(SessionFactoryImpl.java:291) at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1176) at ...

40. JNDI provider URL    forum.hibernate.org

Hi, my application is running in OAS 10.1.2 middle tier with portal,discover and sso enabled. i have problem with jndi look up in this environment. from oracle documentaion i found we have to provide jndi.properties i followed that my jndi.properties files contains java.naming.factory.initial=com.evermind.server.ApplicationClientInitialContextFactory java.naming.provider.url=opmn:ormi://localhost/RM_Application java.naming.security.principal=admin java.naming.security.credentials=mypassword but it is not wokring still i am getting the same problem java:comp/pm/TransactionManager Not found ...

41. Hibernate and jndi    forum.hibernate.org

42. Excessive NamingHelper JNDI log statements in log file    forum.hibernate.org

I am using Hibernate 3.2 with a DB2 Datasource configured in websphere. After I started using the data source with Hibernate, I am seeing large number of lines logged by NamingHelper in the websphere app server log file. These are causing the log file size to blow up very fast. Could someone please tell me how to stop these lines coming ...

43. Doubt in using JNDI with Hibernate.    forum.hibernate.org

org.hibernate.ejb.HibernatePersistence ...

44. JNDI Error    forum.hibernate.org

Beginner Joined: Sun Aug 22, 2004 5:32 pm Posts: 40 I am having a strange problem and all the common solutions don't seem to work. I am trying to run the runStore task from the ant build below, and getting an error: WARNING: Could not bind factory to JNDI javax.naming.NoInitialContextException: The full stack is below. I am running netbeans 6.5, with ...

45. Hibernate JNDI    forums.oracle.com

46. Error in hibernate & JNDI    forums.oracle.com

47. JNDI in hibernate    forums.oracle.com

49. Hibernate JNDI failure...    forums.oracle.com

12:12:00,657 INFO [Configuration] Searching for mapping documents in jar: tmp55321bm.ear 12:12:00,657 INFO [Configuration] Searching for mapping documents in jar: bm.felles-1.0-SNAPSHOT.jar 12:12:00,659 INFO [NamingHelper] JNDI InitialContext properties:{} 12:12:00,661 INFO [DatasourceConnectionProvider] Using datasource: java:/BMDS 12:12:01,391 INFO [SettingsFactory] RDBMS: Oracle, version: Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - 64bit Production With the Partitioning, OLAP and Data Mining options 12:12:01,392 INFO [SettingsFactory] JDBC driver: ...