-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 7 posts ] 
Author Message
 Post subject: Cannot set autocommit during a managed transaction
PostPosted: Mon Nov 24, 2003 8:18 pm 
Newbie

Joined: Mon Nov 24, 2003 7:56 pm
Posts: 5
Location: Brisbane, Australia
I am new to Hibernate and am trying to put it into my current project which uses JBoss 3.0.6, MySQL 4.0.16, MySQL Java Connector 3.0.9, XDoclet 1.2b3 and Hibernate 2.0.3.

When the create method of the session bean detailed below gets executed, the following exception occurs:

2003-11-25 09:21:15,873 ERROR [net.sf.hibernate.transaction.JDBCTransaction] Begin failed
java.sql.SQLException: You cannot set autocommit during a managed transaction!
at org.jboss.resource.adapter.jdbc.local.LocalManagedConnection.setJdbcAutoCommit(LocalManagedConnection.java:456)
at org.jboss.resource.adapter.jdbc.local.LocalConnection.setAutoCommit(LocalConnection.java:426)
at net.sf.hibernate.transaction.JDBCTransaction.begin(JDBCTransaction.java:40)
at net.sf.hibernate.transaction.JDBCTransactionFactory.beginTransaction(JDBCTransactionFactory.java:22)
at net.sf.hibernate.impl.SessionImpl.beginTransaction(SessionImpl.java:1981)
at cf.com.shinzawaikulgan.ejb.stock.session.ItemSessionBean.create(ItemSessionBean.java:238)
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:660)
at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:186)
at org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(StatelessSessionInstanceInterceptor.java:77)
at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:107)
at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:228)
at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:92)
at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:130)
at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:204)
at org.jboss.ejb.StatelessSessionContainer.invoke(StatelessSessionContainer.java:313)
at org.jboss.ejb.Container.invoke(Container.java:712)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:517)
at org.jboss.invocation.jrmp.server.JRMPInvoker.invoke(JRMPInvoker.java:382)
at sun.reflect.GeneratedMethodAccessor66.invoke(Unknown Source)
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:536)


Can someone explain to me what is causing this exception and what I can do to fix it?


I have set up Hibernate to run as a service in JBoss with the following jboss-service.xml:

<server>
<mbean code="net.sf.hibernate.jmx.HibernateService" name="jboss.jca:service=HibernateFactory, name=HibernateFactory">
<depends>jboss.jca:service=RARDeployer</depends>
<depends>jboss.jca:service=LocalTxCM,name=ShinzawaiKulganDS</depends>
<!-- Make it deploy ONLY after DataSource had been started -->
<attribute name="MapResources">cf/com/shinzawaikulgan/hibernate/stock/Item.hbm.xml</attribute>
<attribute name="JndiName">java:/hibernate/shinzawaikulgan/HibernateFactory</attribute>
<attribute name="Datasource">java:/ShinzawaiKulgan</attribute>
<attribute name="Dialect">net.sf.hibernate.dialect.MySQLDialect</attribute>
<attribute name="TransactionStrategy">net.sf.hibernate.transaction.JTATransactionFactory</attribute>
<attribute name="TransactionManagerLookupStrategy">net.sf.hibernate.transaction.JBossTransactionManagerLookup</attribute>
<attribute name="UseOuterJoin">true</attribute>
<attribute name="ShowSql">false</attribute>
</mbean>
</server>


I have a InnoDB table in my database called Item with the matching java file Item.java:

/**
* The class represents an Item
*
* @author $Author:$
* @version $Revision:$
*
* @hibernate.class table="Item"
*
*/

public class Item {
// Constants -----------------------------------------------

// Attributes ----------------------------------------------
private Integer id; // identifier
private String name;
private String description;
private String stockTypeCode;
private String itemCategoryCode;
private String itemQBId;
private Float price;
private char includesTax;
private String supplierId;
private String salesTaxCode;
private char active;
private String addUsername;
private Timestamp addTimestamp;
private String updateUsername;
private Timestamp updateTimestamp;

// Static --------------------------------------------------

// Constructors --------------------------------------------

// Public --------------------------------------------------

/**
* @hibernate.id generator-class="native"
* column="id"
*
* @jboss:column-name name="id"
**/
public Integer getId() {
return id;
}

public void setId( Integer pId ) {
this.id = pId;
}

/**
* @hibernate.property column="name"
* not-null="true"
*
* @jboss:column-name name="name"
**/
public String getName() {
return name;
}

public void setName( String pName ) {
this.name = pName;
}

/**
* @hibernate.property column="description"
* not-null="true"
*
* @jboss:column-name name="description"
**/
public String getDescription() {
return description;
}

public void setDescription( String pDescription ) {
this.description = pDescription;
}

/**
* @hibernate.property column="stockTypeCode"
* not-null="true"
*
* @jboss:column-name name="stockTypeCode"
**/
public String getStockTypeCode() {
return stockTypeCode;
}

public void setStockTypeCode( String pStockTypeCode ) {
this.stockTypeCode = pStockTypeCode;
}

/**
* @hibernate.property column="itemCategoryCode"
*
* @jboss:column-name name="itemCategoryCode"
**/
public String getItemCategoryCode() {
return itemCategoryCode;
}

public void setItemCategoryCode( String pItemCategoryCode ) {
this.itemCategoryCode = pItemCategoryCode;;
}

/**
* @hibernate.property column="itemQBId"
* not-null="true"
*
* @jboss:column-name name="itemQBId"
**/
public String getItemQBId() {
return itemQBId;
}

public void setItemQBId( String pItemQBId ) {
this.itemQBId = pItemQBId;
}

/**
* @hibernate.property column="price"
*
* @jboss:column-name name="price"
**/
public Float getPrice() {
return price;
}

public void setPrice( Float pPrice ) {
this.price = pPrice;
}

/**
* @hibernate.property column="includesTax"
* not-null="true"
*
* @jboss:column-name name="includesTax"
**/
public char getIncludesTax() {
return includesTax;
}

public void setIncludesTax( char pIncludesTax ) {

this.includesTax = pIncludesTax;
}

/**
* @hibernate.property column="supplierId"
*
* @jboss:column-name name="supplierId"
**/
public String getSupplierId() {
return supplierId;
}

public void setSupplierId( String pSupplierId ) {
this.supplierId = pSupplierId;

}

/**
* @hibernate.property column="salesTaxCode"
*
* @jboss:column-name name="salesTaxCode"
**/
public String getSalesTaxCode() {
return salesTaxCode;
}

public void setSalesTaxCode( String pSalesTaxCode ) {
this.salesTaxCode = pSalesTaxCode;
}

/**
* @hibernate.property column="active"
* not-null="true"
*
* @jboss:column-name name="active"
**/
public char getActive() {
return active;
}

public void setActive( char pActive ) {
this.active = pActive;
}

/**
* @hibernate.property column="addUsername"
*
* @jboss:column-name name="addUsername"
**/
public String getAddUsername() {
return addUsername;
}

public void setAddUsername( String pAddUsername ) {
this.addUsername = pAddUsername;
}

/**
* @hibernate.property column="addTimestamp"
*
* @jboss:column-name name="addTimestamp"
**/
public Timestamp getAddTimestamp() {
return addTimestamp;
}

public void setAddTimestamp( Timestamp pAddTimestamp ) {
this.addTimestamp = pAddTimestamp;
}

/**
* @hibernate.property column="updateUsername"
*
* @jboss:column-name name="updateUsername"
**/
public String getUpdateUsername() {
return updateUsername;
}

public void setUpdateUsername( String pUpdateUsername ) {
this.updateUsername = pUpdateUsername;
}

/**
* @hibernate.property column="updateTimestamp"
*
* @jboss:column-name name="updateTimestamp"
**/
public Timestamp getUpdateTimestamp() {
return updateTimestamp;
}

public void setUpdateTimestamp( Timestamp pUpdateTimestamp ) {
this.updateTimestamp = pUpdateTimestamp;
}


The Item class is being used in the following EJB Session Bean:

/**
* The Session bean represents the Item interface
*
* @author $Author:$
* @version $Revision:$
*
* @ejb:bean name="ItemSession"
* display-name="Item Session"
* type="Stateless"
* view-type="remote"
* jndi-name="ejb/shinzawaikulgan/ItemSession"
*
* @ejb:interface extends="javax.ejb.EJBObject"
*
* @ejb:home extends="javax.ejb.EJBHome"
*
* @ejb:pk extends="java.lang.Object"
*
* @ejb:transaction type="None"
*
*/
// * @ejb:ejb-ref ejb-name="Item"
public class ItemSessionBean
extends SessionSupport implements SessionBean
{

// Constants -----------------------------------------------------

// Attributes ----------------------------------------------------
private SessionFactory _sessions;

// Static --------------------------------------------------------

// Constructors --------------------------------------------------

// Private -------------------------------------------------------

private void configureHibernate() throws NamingException /*HibernateException*/ {
Context ctx = new InitialContext();
_sessions = (SessionFactory) ctx.lookup("java:/hibernate/shinzawaikulgan/HibernateFactory");
}

// Public --------------------------------------------------------

/**
* @ejb:interface-method view-type="remote"
**/
public Item create( String pName, String pDescription,
String pStockTypeCode, String pItemCategoryCode, String pItemQBId, Float pPrice,
char pIncludesTax, String pSupplierId, String pSalesTaxCode, char pActive,
String pAddUsername, Timestamp pAddTimestamp )
throws HibernateException, RemoteException, NamingException, SQLException {

System.out.println("Starting Item.create()");
if ( _sessions == null ) configureHibernate();
System.out.println("configured hibernate");

Item item = new Item();
item.setName( pName );
item.setDescription( pDescription );
item.setStockTypeCode( pStockTypeCode );
item.setItemCategoryCode( pItemCategoryCode );
item.setItemQBId( pItemQBId );
item.setPrice( pPrice );
item.setIncludesTax( pIncludesTax );
item.setSupplierId( pSupplierId );
item.setSalesTaxCode( pSalesTaxCode );
item.setActive( pActive );
item.setAddUsername( pAddUsername );
item.setAddTimestamp( pAddTimestamp );

System.out.println("item created");
Session session = _sessions.openSession();
System.out.println("session opened");
Transaction tx = null;
try {
tx = session.beginTransaction();
System.out.println("begin transaction");
session.save(item);
System.out.println("item saved");
tx.commit();
System.out.println("transaction committed");
} catch ( HibernateException he ) {
if ( tx!=null ) tx.rollback();
throw he;
} finally {
session.close();
}

return item;
}

// SessionBean implementation ------------------------------------
public void setSessionContext(SessionContext context)
{
super.setSessionContext(context);
}
}

Any help would be appreciated.
Code:
Code:


Top
 Profile  
 
 Post subject:
PostPosted: Mon Nov 24, 2003 11:02 pm 
Newbie

Joined: Mon Nov 24, 2003 7:56 pm
Posts: 5
Location: Brisbane, Australia
I am not getting the exception anymore and I think it is because I changed the Session EJB to not use a transaction.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Nov 25, 2003 7:32 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 7:19 pm
Posts: 2364
Location: Brisbane, Australia
It is better if you use CMT since you have the J2EE EJB server. In this case the Container will manage the transaction for you, eg don't start the transaction, or commit it, you only need to provide the rollback hint if you want the container to rollback the transaction. Hibernate plays nicely in this environment.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Nov 25, 2003 5:52 pm 
Newbie

Joined: Mon Nov 24, 2003 7:56 pm
Posts: 5
Location: Brisbane, Australia
Thanks! I wasn't aware I could do that but I agree it is a much better option.

Since I fixed this problem I have run into another one which confuses me.

I get exceptions when I do use save and load. The exceptions look like they both stem from the same problem but I don't know what that problem is exactly.

Here is the exception from a save:

net.sf.hibernate.MappingException: No persister for: cf.com.shinzawaikulgan.hibernate.stock.Item
at net.sf.hibernate.impl.SessionFactoryImpl.getPersister(SessionFactoryImpl.java:420)
at net.sf.hibernate.impl.SessionImpl.getPersister(SessionImpl.java:2302)
at net.sf.hibernate.impl.SessionImpl.getPersister(SessionImpl.java:2309)
at net.sf.hibernate.impl.SessionImpl.save(SessionImpl.java:599)
at cf.com.shinzawaikulgan.ejb.stock.session.ItemSessionBean.create(ItemSessionBean.java:241)
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:660)
at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:186)
at org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(StatelessSessionInstanceInterceptor.java:77)
at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:107)
at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:228)
at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:92)
at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:130)
at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:204)
at org.jboss.ejb.StatelessSessionContainer.invoke(StatelessSessionContainer.java:313)
at org.jboss.ejb.Container.invoke(Container.java:712)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:517)
at org.jboss.invocation.jrmp.server.JRMPInvoker.invoke(JRMPInvoker.java:382)
at sun.reflect.GeneratedMethodAccessor79.invoke(Unknown Source)
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:536)
at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:247)
at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:223)
at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:133)
at org.jboss.invocation.jrmp.server.JRMPInvoker_Stub.invoke(Unknown Source)
at org.jboss.invocation.jrmp.interfaces.JRMPInvokerProxy.invoke(JRMPInvokerProxy.java:138)
at org.jboss.invocation.InvokerInterceptor.invoke(InvokerInterceptor.java:108)
at org.jboss.proxy.TransactionInterceptor.invoke(TransactionInterceptor.java:77)
at org.jboss.proxy.SecurityInterceptor.invoke(SecurityInterceptor.java:80)
at org.jboss.proxy.ejb.StatelessSessionInterceptor.invoke(StatelessSessionInterceptor.java:111)
at org.jboss.proxy.ClientContainer.invoke(ClientContainer.java:76)
at $Proxy7.create(Unknown Source)
at cf.com.shinzawaikulgan.client.stock.StockItemMaintenanceDataModel.add(StockItemMaintenanceDataModel.java:276)
at cf.com.shinzawaikulgan.client.stock.StockItemMaintenanceEventHandle$21.actionPerformed(StockItemMaintenanceEventHandle.java:248)
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1764)
at javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(AbstractButton.java:1817)
at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:419)
at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:257)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:245)
at java.awt.Component.processMouseEvent(Component.java:5093)
at java.awt.Component.processEvent(Component.java:4890)
at java.awt.Container.processEvent(Container.java:1566)
at java.awt.Component.dispatchEventImpl(Component.java:3598)
at java.awt.Container.dispatchEventImpl(Container.java:1623)
at java.awt.Component.dispatchEvent(Component.java:3439)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:3450)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3165)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3095)
at java.awt.Container.dispatchEventImpl(Container.java:1609)
at java.awt.Window.dispatchEventImpl(Window.java:1585)
at java.awt.Component.dispatchEvent(Component.java:3439)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:450)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:197)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:150)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:144)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:136)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:99)

and here is the exception from a load:

java.lang.ClassCastException: cf.com.shinzawaikulgan.hibernate.stock.Item
at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:292)
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:536)
at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:247)
at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:223)
at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:133)
at org.jboss.invocation.jrmp.server.JRMPInvoker_Stub.invoke(Unknown Source)
at org.jboss.invocation.jrmp.interfaces.JRMPInvokerProxy.invoke(JRMPInvokerProxy.java:138)
at org.jboss.invocation.InvokerInterceptor.invoke(InvokerInterceptor.java:108)
at org.jboss.proxy.TransactionInterceptor.invoke(TransactionInterceptor.java:77)
at org.jboss.proxy.SecurityInterceptor.invoke(SecurityInterceptor.java:80)
at org.jboss.proxy.ejb.StatelessSessionInterceptor.invoke(StatelessSessionInterceptor.java:111)
at org.jboss.proxy.ClientContainer.invoke(ClientContainer.java:76)
at $Proxy7.getItem(Unknown Source)
at cf.com.shinzawaikulgan.client.stock.StockItemMaintenanceDataModel.submit(StockItemMaintenanceDataModel.java:168)
at cf.com.shinzawaikulgan.client.stock.StockItemMaintenanceEventHandle$17.actionPerformed(StockItemMaintenanceEventHandle.java:210)
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1764)
at javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(AbstractButton.java:1817)
at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:419)
at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:257)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:245)
at java.awt.Component.processMouseEvent(Component.java:5093)
at java.awt.Component.processEvent(Component.java:4890)
at java.awt.Container.processEvent(Container.java:1566)
at java.awt.Component.dispatchEventImpl(Component.java:3598)
at java.awt.Container.dispatchEventImpl(Container.java:1623)
at java.awt.Component.dispatchEvent(Component.java:3439)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:3450)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3165)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3095)
at java.awt.Container.dispatchEventImpl(Container.java:1609)
at java.awt.Window.dispatchEventImpl(Window.java:1585)
at java.awt.Component.dispatchEvent(Component.java:3439)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:450)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:197)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:150)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:144)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:136)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:99)

On the load I have check the object being returned by printing it out and it is a cf.com.shinzawaikulgan.hibernate.stock.Item object.

Can you tell me why I am getting these exceptions?


Top
 Profile  
 
 Post subject:
PostPosted: Wed Nov 26, 2003 10:13 am 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
cf.com.shinzawaikulgan.hibernate.stock.Item seems not to be mapped.

_________________
Emmanuel


Top
 Profile  
 
 Post subject:
PostPosted: Wed Nov 26, 2003 7:28 pm 
Newbie

Joined: Mon Nov 24, 2003 7:56 pm
Posts: 5
Location: Brisbane, Australia
Yes, it seems that way but as you can see from my jboss-service.xml above I have mapped the Item.hbm.xml. Is there more that I need to do in order to map the class?


Top
 Profile  
 
 Post subject:
PostPosted: Wed Nov 26, 2003 8:00 pm 
Newbie

Joined: Mon Nov 24, 2003 7:56 pm
Posts: 5
Location: Brisbane, Australia
Here is some info from my log file to show that it seems as though the class is mapped:

2003-11-27 09:57:34,351 INFO [net.sf.hibernate.cfg.Configuration] Mapping resource: cf/com/shinzawaikulgan/hibernate/stock/Item.hbm.xml
2003-11-27 09:57:34,365 INFO [net.sf.hibernate.cfg.Binder] Mapping class: cf.com.shinzawaikulgan.hibernate.stock.Item -> Item

Does it matter what directory the hbm.xml files are in? Should I put them somewhere else?


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 7 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.