7 Replies Latest reply on Nov 28, 2007 6:33 AM by John Gerevich

    Data access / persistence - could you help?

    John Gerevich Newbie

      I am setting up a JBoss Portal for evaluation purposes at my company.

      I am new to JBoss, Portal, Hibernate and more or less to the J2EE scene too.

      I am reading documentation whenever I can, if I run into something and I know where to find the docs.

      I have set up the new bundle, wrote a few simple portlets, tested IPC.

      I want to do the following - please tell me if I'm on the wrong track:

      I am creating two portlets:

      SelectDocument portlet show a list of documents the user can select. It gets the list from an underlying database.

      ShowDocument portlet listens for selection at SelectDocument and displays the selected document content from the underlying database.

      I have got stuck on how to access the underlying database, what API to use, what docs to read. JDBC, Hibernate, EJB3 persistence etc. I need the simplest and minimal resource consuming (there might be a lot of users accessing the page at a time - Connection pooling, caching would be handy) solution.

      I will have no problem if someone just gives me a hint at where to start (concerning data access, not j2ee principles) - I tried HibernateUtil.getSession(jndiname), but didn't find the jar that contains HibernateUtil.

      Thank you

      John

        • 1. Re: Data access / persistence - could you help?
          John Gerevich Newbie

          According to the JBoss API at org.jboss.portal.cms.util.HibernateUtil thw following function should return a Hibernate SessionFactory:

          static org.hibernate.SessionFactory getSessionFactory(java.lang.String jndiName)


          But I get the following error:

          java.lang.ClassCastException: org.jboss.resource.adapter.jdbc.WrapperDataSource
           at org.jboss.portal.cms.util.HibernateUtil.getSessionFactory(HibernateUtil.java:42)
          


          What do I have to do, to get / create a Hibernate Session?

          Thanks,
          John

          • 2. Re: Data access / persistence - could you help?
            Alejandro Montenegro Novice

            What I normally do is to use EJBs to access my database, I create a Session Bean which interact with Entities (former Entity Beans). So my portlet make a JNDI lookup of the Session Bean and through these interact with the Database.

            • 3. Re: Data access / persistence - could you help?
              John Gerevich Newbie

              Thank you for answering,
              I am moving step by step, but moving nontheless.

              I tried creating and persisting EJB beans, but there where too many unknown errors, so know I'm trying to just persist a simple class with Hibernate.

              But I am still unable to persist a class, because of the following exception:

              org.hibernate.PropertyAccessException: IllegalArgumentException occurred calling getter of a.b.c.Cikk.cim
              org.hibernate.property.BasicPropertyAccessor$BasicGetter.get(BasicPropertyAccessor.java:171)
              org.hibernate.PropertyAccessException: IllegalArgumentException occurred calling getter of a.b.c.Cikk.cim
              org.hibernate.property.BasicPropertyAccessor$BasicGetter.getForInsert(BasicPropertyAccessor.java:182)
              org.hibernate.PropertyAccessException: IllegalArgumentException occurred calling getter of a.b.c.Cikk.cim
              org.hibernate.tuple.entity.AbstractEntityTuplizer.getPropertyValuesToInsert(AbstractEntityTuplizer.java:271)
              org.hibernate.PropertyAccessException: IllegalArgumentException occurred calling getter of a.b.c.Cikk.cim
              ....
              


              If anyone could lend a hand, I would be happy.

              I created my Hibernate mbean in my .har in the jboss-service.xml file:

              </mbean>
              <mbean code="org.jboss.hibernate.jmx.Hibernate"
               name="jboss.har:service=Hibernate">
               <attribute name="DatasourceName">java:/DefaultDS</attribute>
               <attribute name="Dialect">
               org.hibernate.dialect.HSQLDialect
               </attribute>
               <attribute name="SessionFactoryName">
               java:/hibernate/SessionFactory
               </attribute>
              
               <attribute name="ScanForMappingsEnabled">true</attribute>
               <attribute name="Hbm2ddlAuto">create</attribute>
               </mbean>
              
              


              My simple class I want to be able to persist:
              package a.b.c;
              
              import java.io.Serializable;
              import javax.persistence.Id;
              import javax.persistence.*;
              
              /*@Entity
              @Table(name = "cikk")*/
              public class Cikk implements Serializable{
               private Long id;
               private String cim="Alapérték";
               private String valami="Alapérték";
              
               /** Creates a new instance of Cikk */
               public Cikk() {
               }
              
               public Cikk(Long id,String cim) {
               setId(id);
               setCim(cim);
               }
              
               public Cikk(String cim) {
               setCim(cim);
               }
              
               //@Id
               public Long getId() { return id; }
              
               public void setId(Long id) {
               this.id = id;
               }
              
               public String getCim() {
               return cim;
               }
              
               public void setCim(String cim) {
               this.cim = cim;
               }
              
               public String getValami() {
               return valami;
               }
              
               public void setValami(String valami) {
               this.valami = valami;
               }
              
              }
              


              I wanted to use annotations for persistance, but Hibernate was unable to find them, I didn't find how to use the Annotation SessionFactory or something like that. (I tried a persistance.xml with mapping class, but that didn't help)

              So I created my mapping file cikk.hbm.xml instead:
              <?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="a.b.c.Cikk" table="cikk">
               <id name="id">
               <generator class="native"/>
               </id>
               <property name="cim"/>
               <property name="valami"/>
               </class>
              </hibernate-mapping>
              



              I do not know why I get the exception.
              I tried taking properties out from the mapping file, until only the id remained, but the error persisted, except it said:
              org.hibernate.PropertyAccessException: IllegalArgumentException occurred calling setter of a.b.c.Cikk.id


              I must be missing something basic, can anyone help?

              • 4. Re: Data access / persistence - could you help?
                John Gerevich Newbie

                I forgot to attach the code that throws the exception:

                 InitialContext ctx = new InitialContext();
                 SessionFactory factory = (SessionFactory)ctx.lookup("java:/hibernate/SessionFactory");
                 Session session = factory.openSession();
                
                 Cikk c = new Cikk("Ez az első db cikk");
                
                
                 Transaction tx=null;
                 try {
                 tx = session.beginTransaction();
                 //do some work
                 session.save(c);
                 tx.commit();
                 return true;
                 } catch (Exception e) {
                 if (tx!=null) tx.rollback();
                 response.setRenderParameter("error",e.getMessage());
                 throw e;
                 } finally {
                 if(session.isOpen()) session.close();
                 }
                
                


                • 5. Re: Data access / persistence - could you help?
                  Antoine Herzog Master

                  This is an hibernate problem, not a portal problem...
                  may be look on hibernate forum (no need to post : easy problem, you 'll find an answer yet in the forum).

                  globally : the portal is in JBoss
                  the access to DB is done with "usual" j2ee features... not really in the portal.

                  look at the user portlet, and all the portlet that manage the identity (user, roles, etc...).

                  it is a good example how to get all this in a portlet.
                  (and the portlet/portal does not really care of that... it is more a hibernate/j2ee feature...)

                  just think of adding the "transaction" in your portlet definition (jboss-portlet.xml).
                  this to provide a transaction injection for all the portlet sub process...
                  this may not be requiered if you use ejb (ejb3...). but it is a "classic" problem when starting with portlets and DB.
                  see the way the definition of user portlet, cms portlet... are done in the portal...


                  • 6. Re: Data access / persistence - could you help?
                    John Gerevich Newbie

                    Thank you for answering.

                    I put

                    <trans-attribute>Required</trans-attribute>

                    tags into jboss-portlet.xml and into portlet.xml also
                    (jboss-portlet.xml is a copy of portlet.xml)

                    didn't help unfortunatly.

                    I searched hibernate forums and docs for my PropertyAccessException, but didn't find anything other then people pointing to bugs in hibernate or to things I have done.

                    The end of my stacktrace is:
                    The end of the above mentioned stacktrace is:

                    Caused by: java.lang.IllegalArgumentException: object is not an instance of declaring class
                     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:585)
                     at org.hibernate.property.BasicPropertyAccessor$BasicGetter.get(BasicPropertyAccessor.java:145)
                     ... 213 more
                    



                    And line 145 of the BasicPropertyAccessor.java is:
                    return method.invoke(target, null);

                    it seems that BasicPropertyAccessor is invoking a method of a different class then the object in the first argument?

                    I don't know if the source of my problem is:

                    - in my code

                    - in my config (xml) files

                    - in the hibernate config files

                    - in the hibernate implementation

                    - in the Jboss config files

                    - In the Jboss portal config files

                    Or just some random bug created by for exampla a corrupted file somewhere.

                    Naturally I'd think the problem is in my code, but I haven't seen anyone having the same problem, which would in case of a newbie code.

                    Anyone see anything relevant I can clutch onto?

                    • 7. Re: Data access / persistence - could you help?
                      John Gerevich Newbie

                      I've gotton a little step further, and my new exception may be more related to JBoss.

                      I tried persistence with a new class (TestData) and the program got further than with my first class, even though there is hardly any difference between the two classes.

                      The new exception when saving is:

                      org.hibernate.exception.GenericJDBCException: Cannot open connection
                       at org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:103)
                       at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:91)
                       at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
                       at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:29)
                       at org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:426)
                       at org.hibernate.jdbc.ConnectionManager.getConnection(ConnectionManager.java:144)
                       at org.hibernate.jdbc.AbstractBatcher.prepareStatement(AbstractBatcher.java:94)
                       at org.hibernate.id.insert.AbstractSelectingDelegate.performInsert(AbstractSelectingDelegate.java:30)
                       at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2158)
                       at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2638)
                       at org.hibernate.action.EntityIdentityInsertAction.execute(EntityIdentityInsertAction.java:48)
                       at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:250)
                       at org.hibernate.event.def.AbstractSaveEventListener.performSaveOrReplicate(AbstractSaveEventListener.java:298)
                       at org.hibernate.event.def.AbstractSaveEventListener.performSave(AbstractSaveEventListener.java:181)
                       at org.hibernate.event.def.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:107)
                       at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.saveWithGeneratedOrRequestedId(DefaultSaveOrUpdateEventListener.java:187)
                       at org.hibernate.event.def.DefaultSaveEventListener.saveWithGeneratedOrRequestedId(DefaultSaveEventListener.java:33)
                       at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.entityIsTransient(DefaultSaveOrUpdateEventListener.java:172)
                       at org.hibernate.event.def.DefaultSaveEventListener.performSaveOrUpdate(DefaultSaveEventListener.java:27)
                       at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.onSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:70)
                       at org.hibernate.impl.SessionImpl.fireSave(SessionImpl.java:535)
                       at org.hibernate.impl.SessionImpl.save(SessionImpl.java:523)
                       at org.hibernate.impl.SessionImpl.save(SessionImpl.java:519)
                       at woodpecker.portlet.test.JanosCikkPortlet.someMethod(JanosCikkPortlet.java:52)
                       at woodpecker.portlet.test.JanosCikkPortlet.processAction(JanosCikkPortlet.java:106)
                       at org.jboss.portal.portlet.impl.jsr168.PortletContainerImpl.invokeAction(PortletContainerImpl.java:458)
                       at org.jboss.portal.portlet.impl.jsr168.PortletContainerImpl.dispatch(PortletContainerImpl.java:401)
                       at org.jboss.portal.portlet.container.PortletContainerInvoker$1.invoke(PortletContainerInvoker.java:86)
                       at org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:131)
                       at org.jboss.portal.core.aspects.portlet.TransactionInterceptor.org$jboss$portal$core$aspects$portlet$TransactionInterceptor$invokeRequired$aop(TransactionInterceptor.java:106)
                       at org.jboss.portal.core.aspects.portlet.TransactionInterceptor$invokeRequired_9103964459766407072.invokeNext(TransactionInterceptor$invokeRequired_9103964459766407072.java)
                       at org.jboss.aspects.tx.TxPolicy.invokeInCallerTx(TxPolicy.java:126)
                       at org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java:195)
                       at org.jboss.portal.core.aspects.portlet.TransactionInterceptor$invokeRequired_9103964459766407072.invokeNext(TransactionInterceptor$invokeRequired_9103964459766407072.java)
                       at org.jboss.aspects.tx.TxPolicy.invokeInCallerTx(TxPolicy.java:126)
                       at org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java:195)
                       at org.jboss.portal.core.aspects.portlet.TransactionInterceptor$invokeRequired_9103964459766407072.invokeNext(TransactionInterceptor$invokeRequired_9103964459766407072.java)
                       at org.jboss.portal.core.aspects.portlet.TransactionInterceptor.invokeRequired(TransactionInterceptor.java)
                       at org.jboss.portal.core.aspects.portlet.TransactionInterceptor.invoke(TransactionInterceptor.java:72)
                       at org.jboss.portal.portlet.invocation.PortletInterceptor.invoke(PortletInterceptor.java:38)
                       at org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:115)
                       at org.jboss.portal.core.aspects.portlet.HeaderInterceptor.invoke(HeaderInterceptor.java:50)
                       at org.jboss.portal.portlet.invocation.PortletInterceptor.invoke(PortletInterceptor.java:38)
                       at org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:115)
                       at org.jboss.portal.portlet.aspects.portlet.ProducerCacheInterceptor.invoke(ProducerCacheInterceptor.java:53)
                       at org.jboss.portal.portlet.invocation.PortletInterceptor.invoke(PortletInterceptor.java:38)
                       at org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:115)
                       at org.jboss.portal.core.aspects.portlet.AjaxInterceptor.invoke(AjaxInterceptor.java:51)
                       at org.jboss.portal.portlet.invocation.PortletInterceptor.invoke(PortletInterceptor.java:38)
                       at org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:115)
                       at org.jboss.portal.portlet.aspects.portlet.ModesInterceptor.invoke(ModesInterceptor.java:62)
                       at org.jboss.portal.portlet.invocation.PortletInterceptor.invoke(PortletInterceptor.java:38)
                       at org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:115)
                       at org.jboss.portal.portlet.bridge.BridgeInterceptor.invoke(BridgeInterceptor.java:47)
                       at org.jboss.portal.portlet.invocation.PortletInterceptor.invoke(PortletInterceptor.java:38)
                       at org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:115)
                       at org.jboss.portal.portlet.aspects.portlet.WindowStatesInterceptor.invoke(WindowStatesInterceptor.java:55)
                       at org.jboss.portal.portlet.invocation.PortletInterceptor.invoke(PortletInterceptor.java:38)
                       at org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:115)
                       at org.jboss.portal.portlet.aspects.portlet.PortletSessionSynchronizationInterceptor.invoke(PortletSessionSynchronizationInterceptor.java:80)
                       at org.jboss.portal.portlet.invocation.PortletInterceptor.invoke(PortletInterceptor.java:38)
                       at org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:115)
                       at org.jboss.portal.portlet.aspects.portlet.ContextTrackerInterceptor.invoke(ContextTrackerInterceptor.java:46)
                       at org.jboss.portal.portlet.invocation.PortletInterceptor.invoke(PortletInterceptor.java:38)
                       at org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:115)
                       at org.jboss.portal.portlet.aspects.portlet.ContextDispatcherInterceptor$1.doCallback(ContextDispatcherInterceptor.java:104)
                       at org.jboss.portal.web.command.CommandDispatcher$CallbackCommand.execute(CommandDispatcher.java:74)
                       at sun.reflect.GeneratedMethodAccessor350.invoke(Unknown Source)
                       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                       at java.lang.reflect.Method.invoke(Method.java:585)
                       at org.jboss.portal.web.command.CommandServlet.doGet(CommandServlet.java:131)
                       at javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
                       at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
                       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
                       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
                       at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:687)
                       at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:590)
                       at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:505)
                       at org.jboss.portal.web.command.CommandServlet.include(CommandServlet.java:80)
                       at org.jboss.portal.web.command.CommandDispatcher.include(CommandDispatcher.java:50)
                       at org.jboss.portal.web.jboss.JBossWebContext.include(JBossWebContext.java:65)
                       at org.jboss.portal.web.ServletContainer.include(ServletContainer.java:182)
                       at org.jboss.portal.portlet.impl.spi.AbstractRequestContext.dispatch(AbstractRequestContext.java:81)
                       at org.jboss.portal.portlet.aspects.portlet.ContextDispatcherInterceptor.invoke(ContextDispatcherInterceptor.java:76)
                       at org.jboss.portal.portlet.invocation.PortletInterceptor.invoke(PortletInterceptor.java:38)
                       at org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:115)
                       at org.jboss.portal.portlet.aspects.portlet.SecureTransportInterceptor.invoke(SecureTransportInterceptor.java:68)
                       at org.jboss.portal.portlet.invocation.PortletInterceptor.invoke(PortletInterceptor.java:38)
                       at org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:115)
                       at org.jboss.portal.portlet.aspects.portlet.ValveInterceptor.invoke(ValveInterceptor.java:60)
                       at org.jboss.portal.portlet.invocation.PortletInterceptor.invoke(PortletInterceptor.java:38)
                       at org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:115)
                       at org.jboss.portal.common.invocation.Invocation.invoke(Invocation.java:157)
                       at org.jboss.portal.portlet.container.PortletContainerInvoker.invoke(PortletContainerInvoker.java:198)
                       at org.jboss.portal.portlet.state.producer.ProducerPortletInvoker.invoke(ProducerPortletInvoker.java:233)
                       at org.jboss.portal.core.impl.portlet.state.ProducerPortletInvoker.org$jboss$portal$core$impl$portlet$state$ProducerPortletInvoker$invoke$aop(ProducerPortletInvoker.java:53)
                       at org.jboss.portal.core.impl.portlet.state.ProducerPortletInvoker$invoke_N8654503705355129869.invokeNext(ProducerPortletInvoker$invoke_N8654503705355129869.java)
                       at org.jboss.aspects.tx.TxPolicy.invokeInCallerTx(TxPolicy.java:126)
                       at org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java:195)
                       at org.jboss.portal.core.impl.portlet.state.ProducerPortletInvoker$invoke_N8654503705355129869.invokeNext(ProducerPortletInvoker$invoke_N8654503705355129869.java)
                       at org.jboss.aspects.tx.TxPolicy.invokeInCallerTx(TxPolicy.java:126)
                       at org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java:195)
                       at org.jboss.portal.core.impl.portlet.state.ProducerPortletInvoker$invoke_N8654503705355129869.invokeNext(ProducerPortletInvoker$invoke_N8654503705355129869.java)
                       at org.jboss.portal.core.impl.portlet.state.ProducerPortletInvoker.invoke(ProducerPortletInvoker.java)
                       at org.jboss.portal.portlet.federation.impl.FederatedPortletInvokerService.invoke(FederatedPortletInvokerService.java:147)
                       at org.jboss.portal.portlet.federation.impl.FederatingPortletInvokerService.invoke(FederatingPortletInvokerService.java:150)
                       at org.jboss.portal.core.impl.model.instance.InstanceContainerImpl$1.invoke(InstanceContainerImpl.java:98)
                       at org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:131)
                       at org.jboss.portal.portlet.management.PortletContainerManagementInterceptorImpl.invoke(PortletContainerManagementInterceptorImpl.java:58)
                       at org.jboss.portal.portlet.invocation.PortletInterceptor.invoke(PortletInterceptor.java:38)
                       at org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:115)
                       at org.jboss.portal.portlet.aspects.portlet.PortalSessionSynchronizationInterceptor.invoke(PortalSessionSynchronizationInterceptor.java:116)
                       at org.jboss.portal.portlet.invocation.PortletInterceptor.invoke(PortletInterceptor.java:38)
                       at org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:115)
                       at org.jboss.portal.core.model.instance.InstanceSecurityInterceptor.invoke(InstanceSecurityInterceptor.java:91)
                       at org.jboss.portal.portlet.invocation.PortletInterceptor.invoke(PortletInterceptor.java:38)
                       at org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:115)
                       at org.jboss.portal.portlet.aspects.portlet.ConsumerCacheInterceptor.invoke(ConsumerCacheInterceptor.java:175)
                       at org.jboss.portal.portlet.invocation.PortletInterceptor.invoke(PortletInterceptor.java:38)
                       at org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:115)
                       at org.jboss.portal.common.invocation.Invocation.invoke(Invocation.java:157)
                       at org.jboss.portal.core.impl.model.instance.InstanceContainerImpl.org$jboss$portal$core$impl$model$instance$InstanceContainerImpl$invoke$aop(InstanceContainerImpl.java:413)
                       at org.jboss.portal.core.impl.model.instance.InstanceContainerImpl$invoke_N8654503705355129869.invokeNext(InstanceContainerImpl$invoke_N8654503705355129869.java)
                       at org.jboss.aspects.tx.TxPolicy.invokeInCallerTx(TxPolicy.java:126)
                       at org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java:195)
                       at org.jboss.portal.core.impl.model.instance.InstanceContainerImpl$invoke_N8654503705355129869.invokeNext(InstanceContainerImpl$invoke_N8654503705355129869.java)
                       at org.jboss.aspects.tx.TxPolicy.invokeInCallerTx(TxPolicy.java:126)
                       at org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java:195)
                       at org.jboss.portal.core.impl.model.instance.InstanceContainerImpl$invoke_N8654503705355129869.invokeNext(InstanceContainerImpl$invoke_N8654503705355129869.java)
                       at org.jboss.portal.core.impl.model.instance.InstanceContainerImpl.invoke(InstanceContainerImpl.java)
                       at org.jboss.portal.core.impl.model.instance.AbstractInstance.invoke(AbstractInstance.java:234)
                       at org.jboss.portal.core.model.portal.command.action.InvokePortletWindowActionCommand.execute(InvokePortletWindowActionCommand.java:174)
                       at org.jboss.portal.core.controller.ControllerCommand$1.invoke(ControllerCommand.java:68)
                       at org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:131)
                       at org.jboss.portal.core.aspects.controller.node.EventBroadcasterInterceptor.invoke(EventBroadcasterInterceptor.java:123)
                       at org.jboss.portal.core.controller.ControllerInterceptor.invoke(ControllerInterceptor.java:40)
                       at org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:115)
                       at org.jboss.portal.core.aspects.controller.ControlInterceptor.invoke(ControlInterceptor.java:57)
                       at org.jboss.portal.core.controller.ControllerInterceptor.invoke(ControllerInterceptor.java:40)
                       at org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:115)
                       at org.jboss.portal.core.aspects.controller.PageCustomizerInterceptor.invoke(PageCustomizerInterceptor.java:133)
                       at org.jboss.portal.core.controller.ControllerInterceptor.invoke(ControllerInterceptor.java:40)
                       at org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:115)
                       at org.jboss.portal.core.aspects.controller.PolicyEnforcementInterceptor.invoke(PolicyEnforcementInterceptor.java:77)
                       at org.jboss.portal.core.controller.ControllerInterceptor.invoke(ControllerInterceptor.java:40)
                       at org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:115)
                       at org.jboss.portal.core.aspects.controller.node.PortalNodeInterceptor.invoke(PortalNodeInterceptor.java:81)
                       at org.jboss.portal.core.controller.ControllerInterceptor.invoke(ControllerInterceptor.java:40)
                       at org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:115)
                       at org.jboss.portal.core.aspects.controller.NavigationalStateInterceptor.invoke(NavigationalStateInterceptor.java:42)
                       at org.jboss.portal.core.controller.ControllerInterceptor.invoke(ControllerInterceptor.java:40)
                       at org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:115)
                       at org.jboss.portal.core.controller.ajax.AjaxInterceptor.invoke(AjaxInterceptor.java:51)
                       at org.jboss.portal.core.controller.ControllerInterceptor.invoke(ControllerInterceptor.java:40)
                       at org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:115)
                       at org.jboss.portal.core.aspects.controller.ResourceAcquisitionInterceptor.invoke(ResourceAcquisitionInterceptor.java:50)
                       at org.jboss.portal.core.controller.ControllerInterceptor.invoke(ControllerInterceptor.java:40)
                       at org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:115)
                       at org.jboss.portal.common.invocation.Invocation.invoke(Invocation.java:157)
                       at org.jboss.portal.core.controller.ControllerContext.execute(ControllerContext.java:134)
                       at org.jboss.portal.core.controller.Controller.processCommand(Controller.java:235)
                       at org.jboss.portal.core.controller.Controller.processHandlerResponse(Controller.java:294)
                       at org.jboss.portal.core.controller.Controller.processCommand(Controller.java:239)
                       at org.jboss.portal.core.controller.Controller.handle(Controller.java:218)
                       at org.jboss.portal.server.RequestControllerDispatcher.invoke(RequestControllerDispatcher.java:51)
                       at org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:131)
                       at org.jboss.portal.core.cms.aspect.IdentityBindingInterceptor.invoke(IdentityBindingInterceptor.java:47)
                       at org.jboss.portal.server.ServerInterceptor.invoke(ServerInterceptor.java:38)
                       at org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:115)
                       at org.jboss.portal.server.aspects.server.ContentTypeInterceptor.invoke(ContentTypeInterceptor.java:68)
                       at org.jboss.portal.server.ServerInterceptor.invoke(ServerInterceptor.java:38)
                       at org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:115)
                       at org.jboss.portal.core.aspects.server.LocaleInterceptor.invoke(LocaleInterceptor.java:96)
                       at org.jboss.portal.server.ServerInterceptor.invoke(ServerInterceptor.java:38)
                       at org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:115)
                       at org.jboss.portal.core.aspects.server.UserInterceptor.invoke(UserInterceptor.java:245)
                       at org.jboss.portal.server.ServerInterceptor.invoke(ServerInterceptor.java:38)
                       at org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:115)
                       at org.jboss.portal.server.aspects.server.SignOutInterceptor.invoke(SignOutInterceptor.java:98)
                       at org.jboss.portal.server.ServerInterceptor.invoke(ServerInterceptor.java:38)
                       at org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:115)
                       at org.jboss.portal.core.impl.api.user.UserEventBridgeTriggerInterceptor.invoke(UserEventBridgeTriggerInterceptor.java:65)
                       at org.jboss.portal.server.ServerInterceptor.invoke(ServerInterceptor.java:38)
                       at org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:115)
                       at org.jboss.portal.core.aspects.server.TransactionInterceptor.org$jboss$portal$core$aspects$server$TransactionInterceptor$invoke$aop(TransactionInterceptor.java:49)
                       at org.jboss.portal.core.aspects.server.TransactionInterceptor$invoke_N5143606530999904530.invokeNext(TransactionInterceptor$invoke_N5143606530999904530.java)
                       at org.jboss.aspects.tx.TxPolicy.invokeInOurTx(TxPolicy.java:79)
                       at org.jboss.aspects.tx.TxInterceptor$RequiresNew.invoke(TxInterceptor.java:253)
                       at org.jboss.portal.core.aspects.server.TransactionInterceptor$invoke_N5143606530999904530.invokeNext(TransactionInterceptor$invoke_N5143606530999904530.java)
                       at org.jboss.aspects.tx.TxPolicy.invokeInOurTx(TxPolicy.java:79)
                       at org.jboss.aspects.tx.TxInterceptor$RequiresNew.invoke(TxInterceptor.java:262)
                       at org.jboss.portal.core.aspects.server.TransactionInterceptor$invoke_N5143606530999904530.invokeNext(TransactionInterceptor$invoke_N5143606530999904530.java)
                       at org.jboss.portal.core.aspects.server.TransactionInterceptor.invoke(TransactionInterceptor.java)
                       at org.jboss.portal.server.ServerInterceptor.invoke(ServerInterceptor.java:38)
                       at org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:115)
                       at org.jboss.portal.server.aspects.LockInterceptor$InternalLock.invoke(LockInterceptor.java:70)
                       at org.jboss.portal.server.aspects.LockInterceptor.invoke(LockInterceptor.java:131)
                       at org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:115)
                       at org.jboss.portal.common.invocation.Invocation.invoke(Invocation.java:157)
                       at org.jboss.portal.server.servlet.PortalServlet.service(PortalServlet.java:380)
                       at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
                       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
                       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
                       at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
                       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
                       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
                       at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
                       at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
                       at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:179)
                       at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:433)
                       at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
                       at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
                       at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
                       at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
                       at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
                       at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:241)
                       at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
                       at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:580)
                       at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
                       at java.lang.Thread.run(Thread.java:595)
                      Caused by: org.jboss.util.NestedSQLException: Could not enlist in transaction on entering meta-aware object!; - nested throwable: (javax.transaction.SystemException: java.lang.Throwable: Unabled to enlist resource, see the previous warnings. tx=TransactionImple < ac, BasicAction: -3f57feca:c7da:474d4825:97a status: ActionStatus.ABORT_ONLY >); - nested throwable: (org.jboss.resource.JBossResourceException: Could not enlist in transaction on entering meta-aware object!; - nested throwable: (javax.transaction.SystemException: java.lang.Throwable: Unabled to enlist resource, see the previous warnings. tx=TransactionImple < ac, BasicAction: -3f57feca:c7da:474d4825:97a status: ActionStatus.ABORT_ONLY >))
                       at org.jboss.resource.adapter.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:94)
                       at org.hibernate.connection.DatasourceConnectionProvider.getConnection(DatasourceConnectionProvider.java:69)
                       at org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:423)
                       ... 215 more
                      Caused by: org.jboss.resource.JBossResourceException: Could not enlist in transaction on entering meta-aware object!; - nested throwable: (javax.transaction.SystemException: java.lang.Throwable: Unabled to enlist resource, see the previous warnings. tx=TransactionImple < ac, BasicAction: -3f57feca:c7da:474d4825:97a status: ActionStatus.ABORT_ONLY >)
                       at org.jboss.resource.connectionmanager.TxConnectionManager.managedConnectionReconnected(TxConnectionManager.java:343)
                       at org.jboss.resource.connectionmanager.BaseConnectionManager2.reconnectManagedConnection(BaseConnectionManager2.java:518)
                       at org.jboss.resource.connectionmanager.BaseConnectionManager2.allocateConnection(BaseConnectionManager2.java:399)
                       at org.jboss.resource.connectionmanager.BaseConnectionManager2$ConnectionManagerProxy.allocateConnection(BaseConnectionManager2.java:842)
                       at org.jboss.resource.adapter.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:88)
                       ... 217 more
                      Caused by: javax.transaction.SystemException: java.lang.Throwable: Unabled to enlist resource, see the previous warnings. tx=TransactionImple < ac, BasicAction: -3f57feca:c7da:474d4825:97a status: ActionStatus.ABORT_ONLY >
                       at org.jboss.resource.connectionmanager.TxConnectionManager$TxConnectionEventListener$TransactionSynchronization.checkEnlisted(TxConnectionManager.java:744)
                       at org.jboss.resource.connectionmanager.TxConnectionManager$TxConnectionEventListener.enlist(TxConnectionManager.java:577)
                       at org.jboss.resource.connectionmanager.TxConnectionManager.managedConnectionReconnected(TxConnectionManager.java:337)
                       ... 221 more
                      



                      I am using the packaged hsqldb-ds.xml
                      , my hibernate-service.xml mbean is:

                      <server>
                       <mbean code="org.jboss.hibernate.jmx.Hibernate"
                       name="jboss.har:service=Hibernate">
                       <attribute name="DatasourceName">java:/DefaultDS</attribute>
                       <attribute name="Dialect">
                       org.hibernate.dialect.HSQLDialect
                       </attribute>
                       <attribute name="SessionFactoryName">
                       java:/hibernate/SessionFactory
                       </attribute>
                      
                       <attribute name="ScanForMappingsEnabled">true</attribute>
                       <attribute name="Hbm2ddlAuto">create</attribute>
                       </mbean>
                      </server>
                      



                      my portlet definition in portlet.xml and jboss-portlet.xml files:
                      <portlet>
                       <description>JanosCikkPortlet</description>
                       <portlet-name>JanosCikkPortlet</portlet-name>
                       <transaction>
                       <trans-attribute>Required</trans-attribute>
                       </transaction>
                       <display-name>JanosCikkPortlet</display-name>
                       <portlet-class>woodpecker.portlet.test.JanosCikkPortlet</portlet-class>
                       <expiration-cache>0</expiration-cache>
                       <supports>
                       <mime-type>text/html</mime-type>
                       <portlet-mode>VIEW</portlet-mode>
                       </supports>
                       <portlet-info>
                       <title>JanosCikkPortlet</title>
                       <short-title>JanosCikkPortlet</short-title>
                       </portlet-info>
                       </portlet>
                      


                      Can anyone help me with understanding:
                      "Could not enlist in transaction on entering meta-aware object!"