6 Replies Latest reply on Jan 9, 2009 12:04 AM by jeffdelong

    Problems with H2 runing Purchasing example

    jeffdelong

      I got the following exception when I ran the purchasingClient:

      org.jboss.soa.esb.actions.ActionProcessingException: Unexpected invocation target exception from processor
      at org.jboss.soa.esb.listeners.message.ActionProcessorMethodInfo.processMethods(ActionProcessorMethodInfo.java:137)
      at org.jboss.soa.esb.listeners.message.OverriddenActionLifecycleProcessor.process(OverriddenActionLifecycleProcessor.java:74)
      at org.jboss.soa.esb.listeners.message.ActionProcessingPipeline.process(ActionProcessingPipeline.java:316)
      at org.jboss.soa.esb.listeners.message.MessageAwareListener$TransactionalRunner.run(MessageAwareListener.java:530)
      at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
      at java.lang.Thread.run(Thread.java:595)
      Caused by: java.lang.Exception: Error in process message: org.hibernate.exception.SQLGrammarException: could not initialize a collection: [org.jboss.soa.overlord.jbossesb.Session.properties#3]
      at org.jboss.soa.overlord.jbossesb.actions.ConversationAction.process(ConversationAction.java:143)
      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.jboss.soa.esb.listeners.message.ActionProcessorMethodInfo.processMethods(ActionProcessorMethodInfo.java:102)
      ... 6 more
      Caused by: org.hibernate.exception.SQLGrammarException: could not initialize a collection: [org.jboss.soa.overlord.jbossesb.Session.properties#3]
      at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:67)
      at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
      at org.hibernate.loader.Loader.loadCollection(Loader.java:2001)
      at org.hibernate.loader.collection.CollectionLoader.initialize(CollectionLoader.java:36)
      at org.hibernate.persister.collection.AbstractCollectionPersister.initialize(AbstractCollectionPersister.java:565)
      at org.hibernate.event.def.DefaultInitializeCollectionEventListener.onInitializeCollection(DefaultInitializeCollectionEventListener.java:60)
      at org.hibernate.impl.SessionImpl.initializeCollection(SessionImpl.java:1716)
      at org.hibernate.collection.AbstractPersistentCollection.initialize(AbstractPersistentCollection.java:344)
      at org.hibernate.collection.AbstractPersistentCollection.read(AbstractPersistentCollection.java:86)
      at org.hibernate.collection.AbstractPersistentCollection.readElementByIndex(AbstractPersistentCollection.java:161)
      at org.hibernate.collection.PersistentMap.get(PersistentMap.java:146)
      at org.jboss.soa.overlord.jbossesb.SessionManager.injectParentReference(SessionManager.java:201)
      at org.jboss.soa.overlord.jbossesb.SessionManager.retrieveSession(SessionManager.java:119)
      at org.jboss.soa.overlord.jbossesb.actions.ConversationAction.getSession(ConversationAction.java:241)
      at org.jboss.soa.overlord.jbossesb.actions.ConversationAction.getSession(ConversationAction.java:351)
      at org.jboss.soa.overlord.jbossesb.actions.ConversationAction.process(ConversationAction.java:109)
      ... 11 more
      Caused by: org.h2.jdbc.JdbcSQLException: Table CDL_SESSION_PROPERTY not found; SQL statement:
      select properties0_.SESSION_ID as SESSION1_0_, properties0_.property_value as property2_0_, properties0_.property_key as property3_0_ from CDL_SESSION_PROPERTY properties0_ where properties0_.SESSION_ID=? [42102-68]
      at org.h2.message.Message.getSQLException(Message.java:91)
      at org.h2.message.Message.getSQLException(Message.java:95)
      at org.h2.message.Message.getSQLException(Message.java:73)
      at org.h2.command.Parser.readTableOrView(Parser.java:4024)
      at org.h2.command.Parser.readTableFilter(Parser.java:910)
      at org.h2.command.Parser.parseSelectSimpleFromPart(Parser.java:1401)
      at org.h2.command.Parser.parseSelectSimple(Parser.java:1499)
      at org.h2.command.Parser.parseSelectSub(Parser.java:1395)
      at org.h2.command.Parser.parseSelectUnion(Parser.java:1274)
      at org.h2.command.Parser.parseSelect(Parser.java:1262)
      at org.h2.command.Parser.parsePrepared(Parser.java:389)
      at org.h2.command.Parser.parse(Parser.java:285)
      at org.h2.command.Parser.parse(Parser.java:257)
      at org.h2.command.Parser.prepareCommand(Parser.java:229)
      at org.h2.engine.Session.prepareLocal(Session.java:224)
      at org.h2.engine.Session.prepareCommand(Session.java:206)
      at org.h2.jdbc.JdbcConnection.prepareCommand(JdbcConnection.java:1020)
      at org.h2.jdbc.JdbcPreparedStatement.(JdbcPreparedStatement.java:1217)
      at org.h2.jdbc.JdbcConnection.prepareStatement(JdbcConnection.java:524)
      at org.jboss.resource.adapter.jdbc.BaseWrapperManagedConnection.doPrepareStatement(BaseWrapperManagedConnection.java:449)
      at org.jboss.resource.adapter.jdbc.BaseWrapperManagedConnection.prepareStatement(BaseWrapperManagedConnection.java:437)
      at org.jboss.resource.adapter.jdbc.WrappedConnection.prepareStatement(WrappedConnection.java:243)
      at org.hibernate.jdbc.AbstractBatcher.getPreparedStatement(AbstractBatcher.java:505)
      at org.hibernate.jdbc.AbstractBatcher.getPreparedStatement(AbstractBatcher.java:423)
      at org.hibernate.jdbc.AbstractBatcher.prepareQueryStatement(AbstractBatcher.java:139)
      at org.hibernate.loader.Loader.prepareQueryStatement(Loader.java:1547)
      at org.hibernate.loader.Loader.doQuery(Loader.java:673)
      at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:236)
      at org.hibernate.loader.Loader.loadCollection(Loader.java:1994)
      ... 24 more
      1

        • 1. Re: Problems with H2 runing Purchasing example
          jeffdelong

          Also, the Traiblazer example runs fine, so I believe that the H2 database tables are created and accessible.

          I don't see a CDL_SESSION_PROPERTY table created in the cdl-sql script.

          Jeff

          • 2. Re: Problems with H2 runing Purchasing example
            jeff.yuchang

            Hi Jeff,

            We do have CDL_SESSION_PROPERTY table creation script in the cdl-sql/cdl.hsqdb.sql file. As you can see it from here: http://anonsvn.jboss.org/repos/soag/cdl/tags/1.0-M1/runtime/jbossesb-assembly/src/main/resources/cdl-sql/cdl.hsqldb.sql. I also checked it from the released 1.0-M1 zip ball, it is the same.

            So if you still haven't seen it in your zip ball, can you download it from http://www.jboss.org/overlord/downloads/ again to make sure to get the correct one. After that remove the JBoss AS's temp folders, like (log, tmp, work), so that the hsql script can be repopulated.

            Thanks for trying, please let me know if you still have problems.

            Thanks
            Jeff Yu

            • 3. Re: Problems with H2 runing Purchasing example
              jeffdelong

              My version of jboss-4.2.3.GA/server/default/deploy/overlord-cdl-runtime.esb/cdl-sql contains the following:

              create table CDL_EPRS (ID bigint generated by default as identity (start with 1),name varchar(255),EPR longvarchar,SESSION_ID bigint,primary key (ID));

              create table CDL_IDENTITY (ID bigint generated by default as identity (start with 1),TYPE varchar(255),PROPERTY_VALUE varchar(255),SERVICE_NAME varchar(255),SESSION_ID bigint not null,primary key (ID));

              create table CDL_JOIN_STATES (ID bigint generated by default as identity (start with 1),CATEGORY varchar(255) not null,NAME varchar(255) not null,ITEM_COUNT integer,SESSION_ID bigint,primary key (ID));

              create table CDL_SCHEDULE_ITEM (ID bigint generated by default as identity (start with 1),CATEGORY varchar(255) not null,NAME varchar(255) not null,SESSION_ID bigint,primary key (ID));

              create table CDL_SESSION (SESSION_ID bigint generated by default as identity (start with 1),STATUS varchar(255),POJO_CLASS varchar(255),SERVICE_NAME varchar(255),CONVERSATION_TYPE varchar(255),Business_OBJECT longvarbinary,PARENT_ID bigint,primary key (SESSION_ID));

              alter table CDL_EPRS add constraint FKC42217E088C85D6A foreign key (SESSION_ID)references CDL_SESSION;

              alter table CDL_IDENTITY add constraint FK41FEEA7288C85D6A foreign key (SESSION_ID) references CDL_SESSION;

              alter table CDL_JOIN_STATES add constraint FKBBDE508388C85D6A foreign key (SESSION_ID) references CDL_SESSION;

              alter table CDL_SCHEDULE_ITEM add constraint FKA523168788C85D6A foreign key (SESSION_ID) references CDL_SESSION;

              alter table CDL_SESSION add constraint FKD597E42A1212ED6 foreign key (PARENT_ID) references CDL_SESSION;

              • 4. Re: Problems with H2 runing Purchasing example
                jeff.yuchang

                Hi Jeff,

                Thats not the M1 release version, it should be SNAPSHOT somtime before the M1 release. I add the CDL_SESSION_PROPERTY table in the late phase of M1 release.

                Where did you get this one? build from the SVN repo? ;-), Make sure others didn't have the same issue.

                Thanks
                Jeff Yu

                • 5. Re: Problems with H2 runing Purchasing example
                  jeffdelong

                  Must have been left over from a prior deployment. as modules folder has the correct script. I re-ran ant and the new script is correctly deployed.

                  • 6. Re: Problems with H2 runing Purchasing example
                    jeffdelong

                    Ok, CDL tables are correctly deployed.