Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within Object Relational Mapping
Search Coderanch
Advance search
Google search
Register / Login
Help coderanch get a
new server
by contributing to the
fundraiser
Post Reply
Bookmark Topic
Watch Topic
New Topic
programming forums
Java
Mobile
Certification
Databases
Caching
Books
Engineering
Micro Controllers
OS
Languages
Paradigms
IDEs
Build Tools
Frameworks
Application Servers
Open Source
This Site
Careers
Other
Pie Elite
all forums
this forum made possible by our volunteer staff, including ...
Marshals:
Campbell Ritchie
Ron McLeod
Paul Clapham
Devaka Cooray
Liutauras Vilda
Sheriffs:
Jeanne Boyarsky
paul wheaton
Henry Wong
Saloon Keepers:
Stephan van Hulst
Tim Holloway
Tim Moores
Carey Brown
Mikalai Zaikin
Bartenders:
Lou Hamers
Piet Souris
Frits Walraven
Forum:
Object Relational Mapping
Session factory Error
mano ranjan
Ranch Hand
Posts: 102
posted 17 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Hi
Iam getting an error when i try to configure my session factory using JNDI
15:14:22,750 INFO [TransactionManagerLookupFactory] instantiated TransactionManagerLookup 15:14:22,750 INFO [SettingsFactory] Automatic flush during beforeCompletion(): disabled 15:14:22,750 INFO [SettingsFactory] Automatic session close at end of transaction: disabled 15:14:22,750 INFO [SettingsFactory] JDBC batch size: 15 15:14:22,750 INFO [SettingsFactory] JDBC batch updates for versioned data: disabled 15:14:22,750 INFO [SettingsFactory] Scrollable result sets: enabled 15:14:22,750 INFO [SettingsFactory] JDBC3 getGeneratedKeys(): enabled 15:14:22,750 INFO [SettingsFactory] Connection release mode: auto 15:14:22,750 INFO [SettingsFactory] Maximum outer join fetch depth: 2 15:14:22,750 INFO [SettingsFactory] Default batch fetch size: 1 15:14:22,750 INFO [SettingsFactory] Generate SQL with comments: disabled 15:14:22,750 INFO [SettingsFactory] Order SQL updates by primary key: disabled 15:14:22,750 INFO [SettingsFactory] Query translator: org.hibernate.hql.ast.ASTQueryTranslatorFactory 15:14:22,750 INFO [ASTQueryTranslatorFactory] Using ASTQueryTranslatorFactory 15:14:22,750 INFO [SettingsFactory] Query language substitutions: {} 15:14:22,750 INFO [SettingsFactory] JPA-QL strict compliance: disabled 15:14:22,750 INFO [SettingsFactory] Second-level cache: enabled 15:14:22,750 INFO [SettingsFactory] Query cache: disabled 15:14:22,750 INFO [SettingsFactory] Cache provider: org.hibernate.cache.NoCacheProvider 15:14:22,750 INFO [SettingsFactory] Optimize cache for minimal puts: disabled 15:14:22,750 INFO [SettingsFactory] Structured second-level cache entries: disabled 15:14:22,750 INFO [SettingsFactory] Statistics: disabled 15:14:22,750 INFO [SettingsFactory] Deleted entity synthetic identifier rollback: disabled 15:14:22,750 INFO [SettingsFactory] Default entity-mode: pojo 15:14:22,765 INFO [SessionFactoryImpl] building session factory 15:14:22,765 INFO [SessionFactoryObjectFactory] Not binding factory to JNDI, no JNDI name configured 15:14:22,765 INFO [NamingHelper] JNDI InitialContext properties:{} 15:14:22,765 INFO [STDOUT] CONFIGURATION SESSION FACTORY 1234 15:14:22,765 INFO [STDOUT] ><<<<<<<>>>>>>>>>>>>>>>>>>>>>org.jboss.resource.adapter.jdbc.WrapperDataSource@601f3f 15:14:22,765 ERROR [InsuranceHome] java.lang.NullPointerException at test.InsuranceHome.getSessionFactory(InsuranceHome.java:67) at test.InsuranceDao.getdata(InsuranceDao.java:29) at test.Insurance.getInsuranceName(Insurance.java:22) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585)
and this my hibernate.xml
<?xml version='1.0' encoding='utf-8'?> <!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd"> <hibernate-configuration> <session-factory name="java:comp/env/hibernate/SessionFactory"> <property name="hibernate.session_factory_name">java:comp/env/hibernate/SessionFactory</property> <property name="hibernate.connection.datasource">java:/MySqlDS</property> <property name="hibernate.transaction.factory_class">org.hibernate.transaction.JTATransactionFactory</property> <property name="hibernate.transaction.manager_lookup_class">org.hibernate.transaction.JBossTransactionManagerLookup</property> <property name="hibernate.dialect">org.hibernate.dialect.MySQLInnoDBDialect</property> <property name="hibernate.cglib.use_reflection_optimizer">false</property> <property name="show_sql">true</property> <property name="hibernate.format_sql">true</property> <property name="hbm2ddl.auto">none</property> <property name="cache.use_second_level_cache">false</property> <property name="hibernate.current_session_context_class">thread</property> <property name="hibernate.query.factory_class">org.hibernate.hql.classic.ClassicQueryTranslatorFactory</property> <!-- Disable the second-level cache --> <property name="cache.provider_class">org.hibernate.cache.NoCacheProvider</property> <property name="hibernate.cache.use_query_cache">false</property> <property name="hibernate.cache.use_second_level_cache">false</property> <!-- Echo all executed SQL to stdout --> <property name="show_sql">true</property> <!--<property name="hibernate.max_fetch_depth">1</property> --> <!-- Drop and re-create the database schema on startup --> <!-- <property name="hbm2ddl.auto">create</property>--> <!-- mapping resource="events/Person.hbm.xml"/--> </session-factory> </hibernate-configuration>
Mark Spritzler
ranger
Posts: 17347
11
I like...
posted 17 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
So what is at this line
InsuranceHome.java:67
That is where the NPE is being thrown, so what is the instance that it is trying to call a method on. That instance var is null.
Mark
Perfect World Programming, LLC
-
iOS Apps
How to Ask Questions the Smart Way FAQ
mano ranjan
Ranch Hand
Posts: 102
posted 17 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Hi
I solved that problem . but iam getting another error
javax.naming.NameNotFoundException: hibernate not bound at org.jnp.server.NamingServer.getBinding(NamingServer.java:529) at org.jnp.server.NamingServer.getBinding(NamingServer.java:537) at org.jnp.server.NamingServer.getObject(NamingServer.java:543) at org.jnp.server.NamingServer.lookup(NamingServer.java:267) at org.jnp.server.NamingServer.lookup(NamingServer.java:270) at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:625) at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:716) at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:587) at javax.naming.InitialContext.lookup(InitialContext.java:351)
thanks
mano ranjan
Ranch Hand
Posts: 102
posted 17 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Hi
Can anybody help me out in this error??
thanks
Shailesh Kini
Ranch Hand
Posts: 153
posted 17 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Hi Mano,
A NameNotFound exception is usually thrown when the name you have used to register your MySql datasource is not found in your app server directory service. Which app server are you using?
Shailesh Kini.
Consider Paul's
rocket mass heater
.
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
Hibernate3.0 with Weblogic7.0
Exception while running hibernate - nubie
org.hibernate.exception.SQLGrammarException: could not insert:
Problem with inserting data.
JNDI error message
More...