Hi all,
I use Hibernate2.1 with JBOSS-3.2.2, using MBean hibernate service.
using this mapping:
Code:
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE hibernate-mapping SYSTEM "http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd" >
<hibernate-mapping>
<class name="com.yse.ledger.value.impl.AccountDataObject" table="Account">
<id name="AccountID" type="string" column="AccountID" length="32">
<generator class="uuid.hex"/>
</id>
<property name="AccountName" type="string" column="AccountName" length="255" not-null="true" unique="true" />
<property name="AccountNumber" type="string" column="AccountNumber" length="255" unique="true"/>
<property name="AccountType" type="string" column="AccountType" length="255" not-null="true"/>
</class>
</hibernate-mapping>
code:
Code:
...
session = getSession();
session.save(account);
session.flush();
...
it works using oracle data source, but it always generate following errors since i change to mySQL (InnoDB table)
Code:
2004-03-01 20:35:20,625 ERROR [org.jboss.ejb.plugins.LogInterceptor] RuntimeException:
java.lang.NullPointerException
at org.jboss.mx.loading.LoadMgr3.beginLoadTask(LoadMgr3.java:119)
at org.jboss.mx.loading.UnifiedClassLoader3.loadClassImpl(UnifiedClassLoader3.java:169)
at org.jboss.mx.loading.UnifiedClassLoader3.loadClass(UnifiedClassLoader3.java:123)
at java.lang.ClassLoader.loadClass(ClassLoader.java:235)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302)
at com.mysql.jdbc.Connection.prepareStatement(Connection.java:1379)
at com.mysql.jdbc.Connection.prepareStatement(Connection.java:1353)
at org.jboss.resource.adapter.jdbc.BaseWrapperManagedConnection.prepareStatement(BaseWrapperManagedConnection.java:348)
at org.jboss.resource.adapter.jdbc.WrappedConnection.prepareStatement(WrappedConnection.java:209)
at net.sf.hibernate.impl.BatcherImpl.getPreparedStatement(BatcherImpl.java:233)
at net.sf.hibernate.impl.BatcherImpl.prepareStatement(BatcherImpl.java:57)
at net.sf.hibernate.impl.BatcherImpl.prepareBatchStatement(BatcherImpl.java:105)
at net.sf.hibernate.persister.EntityPersister.insert(EntityPersister.java:506)
at net.sf.hibernate.persister.EntityPersister.insert(EntityPersister.java:489)
at net.sf.hibernate.impl.ScheduledInsertion.execute(ScheduledInsertion.java:28)
at net.sf.hibernate.impl.SessionImpl.executeAll(SessionImpl.java:2306)
at net.sf.hibernate.impl.SessionImpl.execute(SessionImpl.java:2259)
at net.sf.hibernate.impl.SessionImpl.flush(SessionImpl.java:2185)
at com.yse.ledger.dao.account.AccountDLBean.addAccount(AccountDLBean.java:29)
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:324)
at org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.invoke(StatelessSessionContainer.java:683)
at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:185)
at org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(StatelessSessionInstanceInterceptor.java:72)
at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:84)
at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:267)
at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:128)
at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:118)
at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:191)
at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor.java:122)
at org.jboss.ejb.StatelessSessionContainer.internalInvoke(StatelessSessionContainer.java:331)
at org.jboss.ejb.Container.invoke(Container.java:700)
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:324)
at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:546)
at org.jboss.invocation.jrmp.server.JRMPInvoker.invoke(JRMPInvoker.java:367)
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:324)
at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:261)
at sun.rmi.transport.Transport$1.run(Transport.java:148)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.Transport.serviceCall(Transport.java:144)
at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:460)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:701)
at java.lang.Thread.run(Thread.java:534)
any comments will be appreciated.
tia.
regards,
yudy