Hibernat 2.1.6+Jboss 3.2.5:
I made a hibernate Mbean of jboss. It's sar, not har. I failed to make a call from a client app. to a session bean which uses the Hibernate Mbean by the
Lazy instantiation problem at last. Looking at the steps I passed, there are some info. usful to you guys to help me go out the problem. Thanks ahead
The Mban was deployed with
two possible problems ( marked in red color) as follows:
-----------------------------------------------------------------------------------------------------------
2004-11-04 18:35:45,286 INFO [net.sf.hibernate.util.NamingHelper] JNDI InitialContext properties:{}
2004-11-04 18:35:45,287 DEBUG [net.sf.hibernate.impl.SessionFactoryObjectFactory] JNDI lookup: GmmsHibernateFactory
2004-11-04 18:35:45,287 DEBUG [net.sf.hibernate.impl.SessionFactoryObjectFactory] lookup: uid=402882950005557f010005557f280000
2004-11-04 18:35:45,903 INFO [net.sf.hibernate.jmx.HibernateServiceMBean] starting service at JNDI name: GmmsHibernateFactory
2004-11-04 18:35:45,904 INFO [net.sf.hibernate.jmx.HibernateServiceMBean] service properties: {hibernate.session_factory_name=GmmsHibernateFactory, hibernate.transaction.manager_lookup_class=net.sf.hibernate.transaction.JBossTransactionManagerLookup, hibernate.dialect=net.sf.hibernate.dialect.MySQLDialect, hibernate.show_sql=true, hibernate.transaction.factory_class=net.sf.hibernate.transaction.JTATransactionFactory, hibernate.connection.datasource=java:/MySqlDS, jta.UserTransaction=UserTransaction}
2004-11-04 18:35:45,921 INFO [net.sf.hibernate.cfg.Environment] Hibernate 2.1.6
2004-11-04 18:35:45,923 INFO [net.sf.hibernate.cfg.Environment] loaded properties from resource hibernate.properties: {hibernate.cglib.use_reflection_optimizer=true, hibernate.cache.provider_class=net.sf.hibernate.cache.EhCacheProvider, hibernate.cache.use_query_cache=true, hibernate.max_fetch_depth=1, hibernate.jdbc.use_streams_for_binary=true, hibernate.query.substitutions=true 1, false 0, yes 'Y', no 'N', hibernate.jdbc.batch_size=0, hibernate.proxool.pool_alias=pool1, hibernate.cache.region_prefix=hibernate.test, hibernate.jdbc.batch_versioned_data=true, hibernate.connection.pool_size=1}
2004-11-04 18:35:45,926 INFO [net.sf.hibernate.cfg.Environment] using java.io streams to persist binary types
2004-11-04 18:35:45,926 INFO [net.sf.hibernate.cfg.Environment] using CGLIB reflection optimizer
2004-11-04 18:35:45,935 INFO [net.sf.hibernate.cfg.Configuration] Mapping resource: com/gmms/hibernate/Route.hbm.xml
2004-11-04 18:35:46,536 DEBUG [net.sf.hibernate.util.DTDEntityResolver] trying to locate
http://hibernate.sourceforge.net/hibern ... ng-2.0.dtd in classpath under net/sf/hibernate/
.............
2004-11-04 18:35:55,870 DEBUG [net.sf.hibernate.cfg.Configuration] resolving reference to class: com.gmms.hibernate.NotificationScheme
2004-11-04 18:35:55,874 INFO [net.sf.hibernate.jmx.HibernateServiceMBean] Could not build SessionFactory using the MBean classpath - will try again using client classpath: property mapping has wrong number of columns: com.gmms.hibernate.ActionPanicHistory.subscriberId type: object
2004-11-04 18:35:55,875 DEBUG [net.sf.hibernate.jmx.HibernateServiceMBean] Error was
net.sf.hibernate.MappingException: property mapping has wrong number of columns: com.gmms.hibernate.ActionPanicHistory.subscriberId type: object
at net.sf.hibernate.mapping.PersistentClass.validate(PersistentClass.java:269)
at net.sf.hibernate.mapping.RootClass.validate(RootClass.java:169)
at net.sf.hibernate.cfg.Configuration.validate(Configuration.java:619)
at net.sf.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:785)
at net.sf.hibernate.jmx.HibernateService.buildSessionFactory(HibernateService.java:163)
at net.sf.hibernate.jmx.HibernateService.start(HibernateService.java:130)
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.server.ReflectedDispatcher.dispatch(ReflectedDispatcher.java:60)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:61)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:53)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:185)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:473)
at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:849)
at $Proxy52.start(Unknown Source)
at org.jboss.system.ServiceController.start(ServiceController.java:367)
at sun.reflect.GeneratedMethodAccessor6.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at org.jboss.mx.server.ReflectedDispatcher.dispatch(ReflectedDispatcher.java:60)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:61)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:53)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:185)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:473)
at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:176)
at $Proxy4.start(Unknown Source)
at org.jboss.deployment.SARDeployer.start(SARDeployer.java:251)
at org.jboss.deployment.MainDeployer.start(MainDeployer.java:836)
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:645)
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:608)
at sun.reflect.GeneratedMethodAccessor16.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at org.jboss.mx.server.ReflectedDispatcher.dispatch(ReflectedDispatcher.java:60)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:61)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:53)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:185)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:473)
at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:176)
at $Proxy51.deploy(Unknown Source)
at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:304)
at org.jboss.ha.framework.server.FarmMemberService.deploy(FarmMemberService.java:374)
at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:460)
at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(AbstractDeploymentScanner.java:201)
at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.loop(AbstractDeploymentScanner.java:212)
at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.run(AbstractDeploymentScanner.java:191)
2004-11-04 18:35:56,476 DEBUG [net.sf.hibernate.impl.SessionFactoryObjectFactory] initializing class SessionFactoryObjectFactory
2004-11-04 18:35:56,480 DEBUG [net.sf.hibernate.impl.SessionFactoryObjectFactory] registered: 40288295000696880100069688b80000 (GmmsHibernateFactory)
2004-11-04 18:35:56,480 INFO [net.sf.hibernate.impl.SessionFactoryObjectFactory] Factory name: GmmsHibernateFactory
2004-11-04 18:35:56,483 INFO [net.sf.hibernate.util.NamingHelper] JNDI InitialContext properties:{}
2004-11-04 18:35:56,527 DEBUG [net.sf.hibernate.util.NamingHelper] binding: GmmsHibernateFactory
2004-11-04 18:35:56,527 DEBUG [net.sf.hibernate.util.NamingHelper] Bound name: GmmsHibernateFactory
2004-11-04 18:35:56,527 INFO [net.sf.hibernate.impl.SessionFactoryObjectFactory] Bound factory to JNDI name: GmmsHibernateFactory
2004-11-04 18:35:56,528 WARN [net.sf.hibernate.impl.SessionFactoryObjectFactory] InitialContext did not implement EventContext
I don't know if the two red errors are fatal for my next step to use the Mbean.
the jboss-service.xml is like this:
----------------------------------------------------------------
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE server>
<!-- Generated file - Do not edit! -->
<server>
<mbean code="net.sf.hibernate.jmx.HibernateService" name="jboss.jca:service=GmmsHibernate">
<depends>jboss.jca:service=RARDeployer</depends>
<depends>jboss.jca:service=LocalTxCM,name=MySqlDS</depends>
<attribute name="MapResources">com/gmms/hibernate/Route.hbm.xml,com/gmms/hibernate/BwpPlan.hbm.xml,com/gmms/hibernate/Stepp1.hbm.xml,com/gmms/hibernate/JmsRole.hbm.xml,com/gmms/hibernate/SmsAudit.hbm.xml,com/gmms/hibernate/ActionAwpHistory.hbm.xml,com/gmms/hibernate/Daylightsaving.hbm.xml,com/gmms/hibernate/Caretaker.hbm.xml,com/gmms/hibernate/Customer.hbm.xml,com/gmms/hibernate/ScheduleOnetime.hbm.xml,com/gmms/hibernate/AirceptDataAudit.hbm.xml,com/gmms/hibernate/ScheduleOnetimeHistory.hbm.xml,com/gmms/hibernate/ActionHonkhornHistory.hbm.xml,com/gmms/hibernate/Timezone.hbm.xml,com/gmms/hibernate/AlarmQueue.hbm.xml,com/gmms/hibernate/KoreSim.hbm.xml,com/gmms/hibernate/EventImpact.hbm.xml,com/gmms/hibernate/EventPowercut.hbm.xml,com/gmms/hibernate/EventLocation.hbm.xml,com/gmms/hibernate/Subscriber.hbm.xml,com/gmms/hibernate/Icon.hbm.xml,com/gmms/hibernate/ActionTrackFreqHistory.hbm.xml,com/gmms/hibernate/ActionZoneCircleHistory.hbm.xml,com/gmms/hibernate/ScheduleMonthly.hbm.xml,com/gmms/hibernate/ActionTrackNoFreq.hbm.xml,com/gmms/hibernate/ActionSm.hbm.xml,com/gmms/hibernate/Picture.hbm.xml,com/gmms/hibernate/EventIndex.hbm.xml,com/gmms/hibernate/EventIgnition.hbm.xml,com/gmms/hibernate/AlarmQueueHistory.hbm.xml,com/gmms/hibernate/DisallowedFeature.hbm.xml,com/gmms/hibernate/DependentHistory.hbm.xml,com/gmms/hibernate/ActionVoicecall.hbm.xml,com/gmms/hibernate/CustomerBmodelBwp.hbm.xml,com/gmms/hibernate/EventVoltchange.hbm.xml,com/gmms/hibernate/JmsTransaction.hbm.xml,com/gmms/hibernate/ActionAuxalarmHistory.hbm.xml,com/gmms/hibernate/Asset.hbm.xml,com/gmms/hibernate/ActionZoneRectHistory.hbm.xml,com/gmms/hibernate/CustomerHistory.hbm.xml,com/gmms/hibernate/ActionDoorunlockHistory.hbm.xml,com/gmms/hibernate/Beacon.hbm.xml,com/gmms/hibernate/NotificationScheme.hbm.xml,com/gmms/hibernate/ConflictFeature.hbm.xml,com/gmms/hibernate/ActionVoltageHistory.hbm.xml,com/gmms/hibernate/IncidentOperatorNote.hbm.xml,com/gmms/hibernate/Followit.hbm.xml,com/gmms/hibernate/Scenario.hbm.xml,com/gmms/hibernate/Skypatrol.hbm.xml,com/gmms/hibernate/Iden.hbm.xml,com/gmms/hibernate/ActionSpeedThresholdHistory.hbm.xml,com/gmms/hibernate/ZoneMonitoringAudit.hbm.xml,com/gmms/hibernate/TrackingLocate.hbm.xml,com/gmms/hibernate/JmsMessage.hbm.xml,com/gmms/hibernate/ActionAlarmcall.hbm.xml,com/gmms/hibernate/ActionVoicecallHistory.hbm.xml,com/gmms/hibernate/LoginAudit.hbm.xml,com/gmms/hibernate/ActionZoneCircle.hbm.xml,com/gmms/hibernate/BeaconAudit.hbm.xml,com/gmms/hibernate/UserPrivilege.hbm.xml,com/gmms/hibernate/Beaconmodel.hbm.xml,com/gmms/hibernate/ActionDoorunlock.hbm.xml,com/gmms/hibernate/ScenarioSchemeHistory.hbm.xml,com/gmms/hibernate/LoginHistory.hbm.xml,com/gmms/hibernate/ActionTrackFreq.hbm.xml,com/gmms/hibernate/EventMaxspdexceeded.hbm.xml,com/gmms/hibernate/ActionIgnition.hbm.xml,com/gmms/hibernate/JmsUser.hbm.xml,com/gmms/hibernate/ScenarioHistory.hbm.xml,com/gmms/hibernate/ActionPowercutHistory.hbm.xml,com/gmms/hibernate/AirceptPageRequest.hbm.xml,com/gmms/hibernate/ActionSpeedThreshold.hbm.xml,com/gmms/hibernate/ActionDoorlockHistory.hbm.xml,com/gmms/hibernate/EventPanic.hbm.xml,com/gmms/hibernate/CustomerPlanHistory.hbm.xml,com/gmms/hibernate/ZoneMonitoring.hbm.xml,com/gmms/hibernate/RoutePoint.hbm.xml,com/gmms/hibernate/PlanAudit.hbm.xml,com/gmms/hibernate/Sentrigger.hbm.xml,com/gmms/hibernate/ActionIgnitionHistory.hbm.xml,com/gmms/hibernate/EventAuxalarm.hbm.xml,com/gmms/hibernate/SpeedMonitoring.hbm.xml,com/gmms/hibernate/ActionAlarmcallHistory.hbm.xml,com/gmms/hibernate/EventZone.hbm.xml,com/gmms/hibernate/AssetAudit.hbm.xml,com/gmms/hibernate/CustomerBmodelBwpHistory.hbm.xml,com/gmms/hibernate/GuardianHistory.hbm.xml,com/gmms/hibernate/QuartzJobState.hbm.xml,com/gmms/hibernate/IncidentLoginAudit.hbm.xml,com/gmms/hibernate/ActionPowercut.hbm.xml,com/gmms/hibernate/Phone.hbm.xml,com/gmms/hibernate/NotificationActionHistory.hbm.xml,com/gmms/hibernate/ScheduleAlltime.hbm.xml,com/gmms/hibernate/Email.hbm.xml,com/gmms/hibernate/Guardian.hbm.xml,com/gmms/hibernate/ActionSmsHistory.hbm.xml,com/gmms/hibernate/Session.hbm.xml,com/gmms/hibernate/Sen.hbm.xml,com/gmms/hibernate/ActionMaxspdexceedHistory.hbm.xml,com/gmms/hibernate/ActionArrive.hbm.xml,com/gmms/hibernate/ActionInit.hbm.xml,com/gmms/hibernate/PlanHistory.hbm.xml,com/gmms/hibernate/BeaconInventoryAudit.hbm.xml,com/gmms/hibernate/TrackerSequence.hbm.xml,com/gmms/hibernate/ActionDepartHistory.hbm.xml,com/gmms/hibernate/Login.hbm.xml,com/gmms/hibernate/AssetHistory.hbm.xml,com/gmms/hibernate/OrganizationHistory.hbm.xml,com/gmms/hibernate/Incident.hbm.xml,com/gmms/hibernate/ScheduleWeekly.hbm.xml,com/gmms/hibernate/IdenMessageAudit.hbm.xml,com/gmms/hibernate/Tipoftheday.hbm.xml,com/gmms/hibernate/AirceptPageAudit.hbm.xml,com/gmms/hibernate/IdenCommand.hbm.xml,com/gmms/hibernate/ActionPanic.hbm.xml,com/gmms/hibernate/Sendum.hbm.xml,com/gmms/hibernate/SenEvent.hbm.xml,com/gmms/hibernate/ActionVoltage.hbm.xml,com/gmms/hibernate/ScheduleWeeklyHistory.hbm.xml,com/gmms/hibernate/EventAirbag.hbm.xml,com/gmms/hibernate/EventArrivelocate.hbm.xml,com/gmms/hibernate/ScheduleAlltimeHistory.hbm.xml,com/gmms/hibernate/EventSpeed.hbm.xml,com/gmms/hibernate/MasterUser.hbm.xml,com/gmms/hibernate/DependentAudit.hbm.xml,com/gmms/hibernate/User.hbm.xml,com/gmms/hibernate/ScenarioAction.hbm.xml,com/gmms/hibernate/InvalidLoginAudit.hbm.xml,com/gmms/hibernate/ActionInitHistory.hbm.xml,com/gmms/hibernate/ActionMonStn.hbm.xml,com/gmms/hibernate/IdenMessage.hbm.xml,com/gmms/hibernate/AuthAudit.hbm.xml,com/gmms/hibernate/ScenarioActionHistory.hbm.xml,com/gmms/hibernate/ActionMonStnHistory.hbm.xml,com/gmms/hibernate/IncidentAudit.hbm.xml,com/gmms/hibernate/Plan.hbm.xml,com/gmms/hibernate/SubscriberHistory.hbm.xml,com/gmms/hibernate/Country.hbm.xml,com/gmms/hibernate/NotificationSchemeHistory.hbm.xml,com/gmms/hibernate/SpeedMonitoringAudit.hbm.xml,com/gmms/hibernate/ActionAwp.hbm.xml,com/gmms/hibernate/ViolationAudit.hbm.xml,com/gmms/hibernate/UserHistory.hbm.xml,com/gmms/hibernate/ActionIndex.hbm.xml,com/gmms/hibernate/ActionEmail.hbm.xml,com/gmms/hibernate/ActionMaxspdexceed.hbm.xml,com/gmms/hibernate/NotificationAction.hbm.xml,com/gmms/hibernate/Locate.hbm.xml,com/gmms/hibernate/Feature.hbm.xml,com/gmms/hibernate/ActionDoorlock.hbm.xml,com/gmms/hibernate/EventTrunkopened.hbm.xml,com/gmms/hibernate/Privilege.hbm.xml,com/gmms/hibernate/ScheduleHistory.hbm.xml,com/gmms/hibernate/BwpPlanHistory.hbm.xml,com/gmms/hibernate/Dependent.hbm.xml,com/gmms/hibernate/Schedule.hbm.xml,com/gmms/hibernate/Tracking.hbm.xml,com/gmms/hibernate/ActionArriveHistory.hbm.xml,com/gmms/hibernate/EventAwp.hbm.xml,com/gmms/hibernate/ActionTrackNoFreqHistory.hbm.xml,com/gmms/hibernate/Organization.hbm.xml,com/gmms/hibernate/EventDooropened.hbm.xml,com/gmms/hibernate/New.hbm.xml,com/gmms/hibernate/StateProvince.hbm.xml,com/gmms/hibernate/JmsSubscription.hbm.xml,com/gmms/hibernate/ActionEvent.hbm.xml,com/gmms/hibernate/SenHistory.hbm.xml,com/gmms/hibernate/PointLocate.hbm.xml,com/gmms/hibernate/ActionZoneRect.hbm.xml,com/gmms/hibernate/ActionAuxalarm.hbm.xml,com/gmms/hibernate/Aircept.hbm.xml,com/gmms/hibernate/SkypatrolMessageAudit.hbm.xml,com/gmms/hibernate/SenEventHistory.hbm.xml,com/gmms/hibernate/ActionHonkhorn.hbm.xml,com/gmms/hibernate/BeaconStateAudit.hbm.xml,com/gmms/hibernate/ScheduleDaily.hbm.xml,com/gmms/hibernate/CustomerPlan.hbm.xml,com/gmms/hibernate/ActionEmailHistory.hbm.xml,com/gmms/hibernate/AerisMin.hbm.xml,com/gmms/hibernate/Stepp2.hbm.xml,com/gmms/hibernate/ScenarioScheme.hbm.xml,com/gmms/hibernate/ScheduleMonthlyHistory.hbm.xml,com/gmms/hibernate/ActionPanicHistory.hbm.xml,com/gmms/hibernate/ScheduleDailyHistory.hbm.xml,com/gmms/hibernate/SkypatrolMessage.hbm.xml,com/gmms/hibernate/ActionDepart.hbm.xml,com/gmms/hibernate/EventDepartlocate.hbm.xml</attribute>
<attribute name="JndiName">GmmsHibernateFactory</attribute>
<attribute name="Datasource">java:/MySqlDS</attribute>
<attribute name="Dialect">net.sf.hibernate.dialect.MySQLDialect</attribute>
<attribute name="ShowSql">true</attribute>
<attribute name="UserTransactionName">UserTransaction</attribute>
<attribute name="TransactionStrategy">net.sf.hibernate.transaction.JTATransactionFactory</attribute>
<attribute name="TransactionManagerLookupStrategy">net.sf.hibernate.transaction.JBossTransactionManagerLookup</attribute>
</mbean>
</server>
---------------------------------------------
When I make a call from the client app. to a session bean, using code like this:
try {
com.gmms.ee.session.HibernateTest myBean = getHome().create();
System.out.println("1. create bean");
Sen sen = (Sen)myBean.load(Sen.class, new Long(166));
System.out.println("2 find Sen");
String str = sen.getStatus();
System.out.println("3 call Sen.get(.)");
System.out.println("Sen status="+sen.getName());
....
------------
The session bean is like this:
public void ejbCreate() throws javax.ejb.CreateException
{
}
private SessionFactory getSessionFactory() throws NamingException
{
if( _sessionFactory == null )
{
InitialContext initialContext = new InitialContext();
Object factoryRef = initialContext.lookup("GmmsHibernateFactory");
_sessionFactory = ( SessionFactory) PortableRemoteObject.narrow( factoryRef, SessionFactory.class );
}
return _sessionFactory;
}
/**
* @return
* @exception java.sql.SQLException
* @exception NamingException
*/
private Session getSession() throws HibernateException,NamingException
{
return getSessionFactory().openSession();
}
/**
* comment of the fuction.
*
* @ejb.interface-method
* tview-type="remote"
*/
public Object load( Class c, Serializable id )
{
Object ret = null;
logger.debug( "loading object by identity" );
try
{
Session sess = getSession();
ret = sess.load( c, id, LockMode.NONE );
sess.close();
}
catch( Exception ex )
{
logger.error( "load failed " + ex );
}
return ret;
}
------------------------------------- end of session bean ----
At last when I make a call from the client app. the the session bean, The Mbean shows errors like this:
-----------------------------------------------
2004-11-05 14:15:18,204 DEBUG [HibernateTestBean] loading object by identity
2004-11-05 14:15:18,204 INFO [net.sf.hibernate.jmx.HibernateServiceMBean] starting service at JNDI name: GmmsHibernateFactory
2004-11-05 14:15:18,204 INFO [net.sf.hibernate.jmx.HibernateServiceMBean] service properties: {hibernate.session_factory_name=GmmsHibernateFactory, hibernate.transaction.manager_lookup_class=net.sf.hibernate.transaction.JBossTransactionManagerLookup, hibernate.dialect=net.sf.hibernate.dialect.MySQLDialect, hibernate.show_sql=true, hibernate.transaction.factory_class=net.sf.hibernate.transaction.JTATransactionFactory, hibernate.connection.datasource=java:/MySqlDS, jta.UserTransaction=UserTransaction}
2004-11-05 14:15:18,205 INFO [net.sf.hibernate.cfg.Configuration] Mapping resource: com/gmms/hibernate/Route.hbm.xml
2004-11-05 14:15:18,210 DEBUG [net.sf.hibernate.util.DTDEntityResolver] trying to locate
http://hibernate.sourceforge.net/hibern ... ng-2.0.dtd in classpath under net/sf/hibernate/
2004-11-05 14:15:18,210 DEBUG [net.sf.hibernate.util.DTDEntityResolver] found
http://hibernate.sourceforge.net/hibern ... ng-2.0.dtd in classpath
2004-11-05 14:15:18,215 INFO [net.sf.hibernate.cfg.Binder] Mapping class: com.gmms.hibernate.Route -> ROUTE
....
2004-11-05 14:15:22,655 DEBUG [net.sf.hibernate.cfg.Configuration] resolving reference to class: com.gmms.hibernate.Beacon
2004-11-05 14:15:22,655 DEBUG [net.sf.hibernate.cfg.Configuration] resolving reference to class: com.gmms.hibernate.NotificationScheme
2004-11-05 14:15:22,655 ERROR [HibernateTestBean] load failed net.sf.hibernate.LazyInitializationException: Hibernate lazy instantiation problem
--------
The client app log is as bellow:
------------
1. create bean
2 find Sen
Exception in thread "main" java.lang.NullPointerException
at com.gmms.ee.client.HibernateTestClient.testBean(HibernateTestClient.java:55)
at com.gmms.ee.client.HibernateTestClient.main(HibernateTestClient.java:79)
-------------------
logs of both sides show the there is no problem on the topics published on Hibernate and Jboss web site. --> The session bean get the JNDI of the mbean and even get the object of the table row. Unfortunately, When the session really retrieve the data properties of the class, the Hibernate is broken.
Another peice info may be usful: for The SEN table is the test, there is a CMP bean is deployed in the JBoss server. Does it matter? CMP and Hibernate share one DS?
Any idea is appreciated.
Charles Wang