Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp
[b]Hibernate version:hibernate3.0
[b]Mapping documents:
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping>
<class name="newtry_test.class" table="newtry_test">
<id name="Name" type="string" unsaved-value="null" >
<column name="Name" sql-type="varchar(20)" not-null="true"/>
<generator class="assigned"/>
</id>
</class>
</hibernate-mapping>
[b]Code between sessionFactory.openSession() and session.close():
class HelloClient{
public static void main(String args[]){
try{
Hashtable env=new Hashtable();
env.put(Context.PROVIDER_URL,"jnp://localhost:1099");
env.put(Context.INITIAL_CONTEXT_FACTORY,"org.jnp.interfaces.NamingContextFactory");
Context ctx=new InitialContext(env);
System.out.println("Got Context");
Object objref1=(HelloHome)ctx.lookup("Hello");
System.out.println("Got Reference");
HelloHome home=(HelloHome)javax.rmi.PortableRemoteObject.narrow(objref1,HelloHome.class);
HelloBean hello=home.create();
//hello.greet();
System.out.println(hello.greet(args[0]));
} catch (Exception e) {
//JOptionPane.showMessageDialog(null,e.toString());
System.out.println(e);
}
}
}
[b]Full stack trace of any exception that occurs:
11:19:26,875 INFO [STDOUT] setSessionContext()
11:19:26,875 INFO [STDOUT] ejbcreate()
11:19:26,875 INFO [STDOUT] MaitriHello From StateLess Session Bean
11:19:26,906 INFO [Environment] Hibernate 3.0rc1
11:19:26,921 INFO [Environment] hibernate.properties not found
11:19:26,921 INFO [Environment] using CGLIB reflection optimizer
11:19:26,921 INFO [Environment] using JDK 1.4 java.sql.Timestamp handling
11:19:26,921 INFO [Configuration] configuring from file: hibernate.cfg.xml
11:19:27,015 INFO [Configuration] Mapping resource: newtry_test.hbm.xml
11:19:27,140 INFO [HbmBinder] Mapping class: newtry_test.class -> newtry_test
11:19:27,156 INFO [Configuration] Configured SessionFactory: null
11:19:27,156 INFO [STDOUT] hjhk
11:19:27,156 INFO [STDOUT] null
11:19:27,156 INFO [STDOUT] null sessionfactory
11:19:27,156 INFO [Configuration] processing extends queue
11:19:27,156 INFO [Configuration] processing collection mappings
11:19:27,156 INFO [Configuration] processing association property references
11:19:27,156 INFO [Configuration] processing foreign key constraints
11:19:27,296 INFO [Dialect] Using dialect: org.hibernate.dialect.SQLServerDiale
ct
11:19:27,312 INFO [SettingsFactory] Default batch fetch size: 1
11:19:27,312 INFO [SettingsFactory] Generate SQL with comments: disabled
11:19:27,328 INFO [SettingsFactory] Order SQL updates by primary key: disabled
11:19:27,328 INFO [SettingsFactory] Query translator: org.hibernate.hql.ast.AST
QueryTranslatorFactory
11:19:27,328 INFO [ASTQueryTranslatorFactory] Using ASTQueryTranslatorFactory
11:19:27,328 INFO [SettingsFactory] Query language substitutions: {}
11:19:27,328 INFO [DriverManagerConnectionProvider] Using Hibernate built-in co
nnection pool (not for production use!)
11:19:27,328 INFO [DriverManagerConnectionProvider] Hibernate connection pool s
ize: 10
11:19:27,343 INFO [DriverManagerConnectionProvider] autocommit mode: false
11:19:27,343 INFO [DriverManagerConnectionProvider] using driver: com.microsoft
.jdbc.sqlserver.SQLServerDriver at URL: jdbc:microsoft:sqlserver://localhost:143
3
11:19:27,343 INFO [DriverManagerConnectionProvider] connection properties: {use
r=sa, password=sa}
11:19:27,765 INFO [SettingsFactory] Scrollable result sets: enabled
11:19:27,765 INFO [SettingsFactory] JDBC3 getGeneratedKeys(): disabled
11:19:27,765 INFO [TransactionFactoryFactory] Transaction strategy: org.hiberna
te.transaction.JDBCTransactionFactory
11:19:27,765 INFO [TransactionManagerLookupFactory] instantiating TransactionMa
nagerLookup: org.hibernate.transaction.JBossTransactionManagerLookup
11:19:27,781 INFO [TransactionManagerLookupFactory] instantiated TransactionMan
agerLookup
11:19:27,781 INFO [SettingsFactory] Automatic flush during beforeCompletion():
disabled
11:19:27,781 INFO [SettingsFactory] Automatic session close at end of transacti
on: disabled
11:19:27,781 INFO [SettingsFactory] Cache provider: org.hibernate.cache.EhCache
Provider
11:19:27,781 INFO [SettingsFactory] Second-level cache: enabled
11:19:27,781 INFO [SettingsFactory] Optimize cache for minimal puts: disabled
11:19:27,781 INFO [SettingsFactory] Structured second-level cache entries: enab
led
11:19:27,781 INFO [SettingsFactory] Query cache: disabled
11:19:27,781 INFO [SettingsFactory] Echoing all SQL to stdout
11:19:27,781 INFO [SettingsFactory] Statistics: disabled
11:19:27,781 INFO [SettingsFactory] Deleted entity synthetic identifier rollbac
k: disabled
11:19:27,781 INFO [SettingsFactory] Default entity-mode: pojo
11:19:28,078 INFO [SessionFactoryImpl] building session factory
11:19:28,093 WARN [Configurator] No configuration found. Configuring ehcache fr
om ehcache-failsafe.xml found in the classpath: jar:file:/C:/jboss-3.2.7/server/
all/lib/ehcache-1.1.jar!/ehcache-failsafe.xml
11:19:28,234 INFO [STDOUT] java.lang.NullPointerException
11:19:28,343 INFO [DriverManagerConnectionProvider] cleaning up connection pool
: jdbc:microsoft:sqlserver://localhost:1433
[b]Name and version of the database you are using:MSSql server
[b]The generated SQL (show_sql=true):Not genarate
[b]Debug level Hibernate log excerpt:log 4j