I am using the hibernate 3.0 with weblogic server 8.1 and oracle. I am getting the following exception, when I try to execute the program.
Created the data source and deployed on the server.
Here is the exception:
Process started
Attached successfully.
Test.java ....
log4j:WARN No appenders could be found for logger (org.hibernate.cfg.Environment).
log4j:WARN Please initialize the log4j system properly.
Could not find datasource org.hibernate.HibernateException: Could not find datasource
at org.hibernate.connection.DatasourceConnectionProvider.configure(Ljava.util.Properties;)V(DatasourceConnectionProvider.java:48)
at org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(Ljava.util.Properties;)Lorg.hibernate.connection.ConnectionProvider;(ConnectionProviderFactory.java:80)
at org.hibernate.cfg.SettingsFactory.createConnectionProvider(Ljava.util.Properties;)Lorg.hibernate.connection.ConnectionProvider;(SettingsFactory.java:362)
at org.hibernate.cfg.SettingsFactory.buildSettings(Ljava.util.Properties;)Lorg.hibernate.cfg.Settings;(SettingsFactory.java:60)
at org.hibernate.cfg.Configuration.buildSettings()Lorg.hibernate.cfg.Settings;(Configuration.java:1463)
at org.hibernate.cfg.Configuration.buildSessionFactory()Lorg.hibernate.SessionFactory;(Configuration.java:1004)
at Test.main([Ljava.lang.String;)V(Test.java:20)
Caused by: 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(Ljava.util.Hashtable;)Ljavax.naming.Context;(NamingManager.java:640)
at javax.naming.InitialContext.getDefaultInitCtx()Ljavax.naming.Context;(InitialContext.java:243)
at javax.naming.InitialContext.getURLOrDefaultInitCtx(Ljava.lang.String;)Ljavax.naming.Context;(InitialContext.java:280)
at javax.naming.InitialContext.lookup(Ljava.lang.String;)Ljava.lang.Object;(InitialContext.java:347)
at org.hibernate.connection.DatasourceConnectionProvider.configure(Ljava.util.Properties;)V(DatasourceConnectionProvider.java:44)
... 6 more
Could not find datasource
java.lang.NullPointerException
at Test.main([Ljava.lang.String;)V(Test.java:38)
at Test.main([Ljava.lang.String;)V(Test.java:35)
Debugging Finished
|