2 Replies Latest reply on Apr 3, 2008 6:23 PM by Eric Smith

    SQL Server 2000 error on startup and for CMS on access

    Oleg Lebedko Newbie

      I have SQLGrammarException when starting JBoss 4.2.2 with JBoss Portal 2.6.4 and database changed to SQL Server 2000
      I updated all hibernate configs to force org.hibernate.dialect.SQLServerDialect as recommended in the manual. The portal was working fine out of the box with HSQL. When I switched to MS SQL Server, I first did not get any errors (it created tables), but on the second startup it gave me the exception below. Similar exception, but for column "id" is thrown when I access CMS tab in the portal. Other parts of the portal seem to work fine. I use the DS configuration supplied with the portal (only server/user/password changed).

      My env:
      JBoss 4.2.2 GA,
      JBoss Portal 2.6.4 GA
      OS: Windows XP Pro
      JVM: 1.5.0_14
      DB: SQL Server 2000
      JDBC: jtds (latest version)


      15:11:56,046 INFO [DefaultLoadEventListener] Error performing load command
      org.hibernate.exception.SQLGrammarException: could not initialize a collection: [org.jboss.portal.wsrp.consumer.RegistrationInfo.persistentRegistrationProperties#1]
      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.forceInitialization(AbstractPersistentCollection.java:454)
      at org.hibernate.engine.StatefulPersistenceContext.initializeNonLazyCollections(StatefulPersistenceContext.java:797)
      at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:241)
      at org.hibernate.loader.Loader.loadEntity(Loader.java:1860)
      at org.hibernate.loader.entity.AbstractEntityLoader.load(AbstractEntityLoader.java:48)
      at org.hibernate.loader.entity.AbstractEntityLoader.load(AbstractEntityLoader.java:42)
      at org.hibernate.persister.entity.AbstractEntityPersister.load(AbstractEntityPersister.java:3044)
      at org.hibernate.event.def.DefaultLoadEventListener.loadFromDatasource(DefaultLoadEventListener.java:395)
      at org.hibernate.event.def.DefaultLoadEventListener.doLoad(DefaultLoadEventListener.java:375)
      at org.hibernate.event.def.DefaultLoadEventListener.load(DefaultLoadEventListener.java:139)
      at org.hibernate.event.def.DefaultLoadEventListener.onLoad(DefaultLoadEventListener.java:98)
      at org.hibernate.impl.SessionImpl.fireLoad(SessionImpl.java:878)
      at org.hibernate.impl.SessionImpl.immediateLoad(SessionImpl.java:836)
      at org.hibernate.proxy.AbstractLazyInitializer.initialize(AbstractLazyInitializer.java:66)
      at org.hibernate.proxy.AbstractLazyInitializer.getImplementation(AbstractLazyInitializer.java:111)
      at org.hibernate.proxy.pojo.javassist.JavassistLazyInitializer.invoke(JavassistLazyInitializer.java:166)
      at org.jboss.portal.wsrp.consumer.ProducerInfo_$$_javassist_106.setRegistry(ProducerInfo_$$_javassist_106.java)
      at org.jboss.portal.wsrp.consumer.ConsumerRegistryService.org$jboss$portal$wsrp$consumer$ConsumerRegistryService$startService$aop(ConsumerRegistryService.java:280)
      at org.jboss.portal.wsrp.consumer.ConsumerRegistryService$startService_N522319811864268586.invokeNext(ConsumerRegistryService$startService_N522319811864268586.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.wsrp.consumer.ConsumerRegistryService$startService_N522319811864268586.invokeNext(ConsumerRegistryService$startService_N522319811864268586.java)
      at org.jboss.aspects.tx.TxPolicy.invokeInOurTx(TxPolicy.java:79)
      at org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java:191)
      at org.jboss.portal.wsrp.consumer.ConsumerRegistryService$startService_N522319811864268586.invokeNext(ConsumerRegistryService$startService_N522319811864268586.java)
      at org.jboss.portal.wsrp.consumer.ConsumerRegistryService.startService(ConsumerRegistryService.java)
      at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:289)
      at org.jboss.system.ServiceMBeanSupport.start(ServiceMBeanSupport.java:196)
      at org.jboss.portal.jems.as.system.AbstractJBossService.start(AbstractJBossService.java:73)
      at sun.reflect.GeneratedMethodAccessor22.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:585)
      at org.jboss.portal.jems.as.system.JBossServiceModelMBean$ServiceMixin.execute(JBossServiceModelMBean.java:486)
      at org.jboss.portal.jems.as.system.JBossServiceModelMBean$ServiceMixin.startService(JBossServiceModelMBean.java:452)
      at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:289)
      at org.jboss.system.ServiceMBeanSupport.start(ServiceMBeanSupport.java:196)
      at org.jboss.portal.jems.as.system.JBossServiceModelMBean$6.invoke(JBossServiceModelMBean.java:374)
      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
      at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
      at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
      at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
      at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:995)
      at $Proxy0.start(Unknown Source)
      at org.jboss.system.ServiceController.start(ServiceController.java:417)
      at org.jboss.system.ServiceController.start(ServiceController.java:435)
      at org.jboss.system.ServiceController.start(ServiceController.java:435)
      at org.jboss.system.ServiceController.start(ServiceController.java:435)
      at org.jboss.system.ServiceController.start(ServiceController.java:435)
      at org.jboss.system.ServiceController.start(ServiceController.java:435)
      at sun.reflect.GeneratedMethodAccessor9.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:585)
      at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
      at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
      at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
      at $Proxy4.start(Unknown Source)
      at org.jboss.deployment.SARDeployer.start(SARDeployer.java:302)
      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.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
      at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
      at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
      at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
      at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
      at $Proxy192.start(Unknown Source)
      at org.jboss.deployment.XSLSubDeployer.start(XSLSubDeployer.java:197)
      at org.jboss.deployment.MainDeployer.start(MainDeployer.java:1025)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:819)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:782)
      at sun.reflect.GeneratedMethodAccessor25.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:585)
      at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
      at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
      at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
      at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
      at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
      at $Proxy9.deploy(Unknown Source)
      at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:421)
      at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:634)
      at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(AbstractDeploymentScanner.java:263)
      at org.jboss.deployment.scanner.AbstractDeploymentScanner.startService(AbstractDeploymentScanner.java:336)
      at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:289)
      at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:245)
      at sun.reflect.GeneratedMethodAccessor3.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:585)
      at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
      at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
      at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:978)
      at $Proxy0.start(Unknown Source)
      at org.jboss.system.ServiceController.start(ServiceController.java:417)
      at sun.reflect.GeneratedMethodAccessor9.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:585)
      at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
      at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
      at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
      at $Proxy4.start(Unknown Source)
      at org.jboss.deployment.SARDeployer.start(SARDeployer.java:302)
      at org.jboss.deployment.MainDeployer.start(MainDeployer.java:1025)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:819)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:782)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:766)
      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.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
      at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
      at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
      at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
      at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
      at $Proxy5.deploy(Unknown Source)
      at org.jboss.system.server.ServerImpl.doStart(ServerImpl.java:482)
      at org.jboss.system.server.ServerImpl.start(ServerImpl.java:362)
      at org.jboss.Main.boot(Main.java:200)
      at org.jboss.Main$1.run(Main.java:508)
      at java.lang.Thread.run(Thread.java:595)
      Caused by: java.sql.SQLException: Invalid column name 'name'.
      at net.sourceforge.jtds.jdbc.SQLDiagnostic.addDiagnostic(SQLDiagnostic.java:365)
      at net.sourceforge.jtds.jdbc.TdsCore.tdsErrorToken(TdsCore.java:2781)
      at net.sourceforge.jtds.jdbc.TdsCore.nextToken(TdsCore.java:2224)
      at net.sourceforge.jtds.jdbc.TdsCore.getMoreResults(TdsCore.java:628)
      at net.sourceforge.jtds.jdbc.JtdsStatement.executeSQLQuery(JtdsStatement.java:418)
      at net.sourceforge.jtds.jdbc.JtdsPreparedStatement.executeQuery(JtdsPreparedStatement.java:693)
      at org.jboss.resource.adapter.jdbc.WrappedPreparedStatement.executeQuery(WrappedPreparedStatement.java:236)
      at org.hibernate.jdbc.AbstractBatcher.getResultSet(AbstractBatcher.java:186)
      at org.hibernate.loader.Loader.getResultSet(Loader.java:1787)
      at org.hibernate.loader.Loader.doQuery(Loader.java:674)
      at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:236)
      at org.hibernate.loader.Loader.loadCollection(Loader.java:1994)
      ... 149 more

        • 1. Re: SQL Server 2000 error on startup and for CMS on access
          Brian Carothers Apprentice

          I don't have a copy of SQL Server 2K around to test on, but you may want to try replacing jboss-portal.sar\portal-cms.sar\conf\hibernate\cms\domain.hbm.xml with this file:



          
          <?xml version="1.0"?>
          <!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           ~ JBoss, a division of Red Hat ~
           ~ Copyright 2006, Red Hat Middleware, LLC, and individual ~
           ~ contributors as indicated by the @authors tag. See the ~
           ~ copyright.txt in the distribution for a full listing of ~
           ~ individual contributors. ~
           ~ ~
           ~ This is free software; you can redistribute it and/or modify it ~
           ~ under the terms of the GNU Lesser General Public License as ~
           ~ published by the Free Software Foundation; either version 2.1 of ~
           ~ the License, or (at your option) any later version. ~
           ~ ~
           ~ This software is distributed in the hope that it will be useful, ~
           ~ but WITHOUT ANY WARRANTY; without even the implied warranty of ~
           ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ~
           ~ Lesser General Public License for more details. ~
           ~ ~
           ~ You should have received a copy of the GNU Lesser General Public ~
           ~ License along with this software; if not, write to the Free ~
           ~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA ~
           ~ 02110-1301 USA, or see the FSF site: http://www.fsf.org. ~
           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
          
          <!DOCTYPE hibernate-mapping PUBLIC
           "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
           "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
          <hibernate-mapping>
           <class name="org.jboss.portal.cms.hibernate.state.VersionBinVal" table="jbp_cms_version_binval" lazy="true">
           <id
           name="key"
           column="PK"
           type="java.lang.Integer">
           <generator class="native"/>
           </id>
           <property
           name="id"
           column="BINVAL_ID"
           type="string"
           length="255"/>
           <property
           name="data"
           column="BINVAL_DATA"
           type="blob"
           length="100000000"
           not-null="true"/>
           </class>
           <class name="org.jboss.portal.cms.hibernate.state.VersionNode" table="jbp_cms_version_node" lazy="true">
           <id
           name="key"
           column="PK"
           type="java.lang.Integer">
           <generator class="native"/>
           </id>
           <property
           name="nodeId"
           column="NODE_ID"
           type="string"
           length="36"/>
           <property
           name="data"
           column="NODE_DATA"
           type="binary"
           length="100000000"
           not-null="true"/>
           </class>
           <class name="org.jboss.portal.cms.hibernate.state.VersionProp" table="jbp_cms_version_prop" lazy="true">
           <id
           name="key"
           column="PK"
           type="java.lang.Integer">
           <generator class="native"/>
           </id>
           <property
           name="propId"
           column="PROP_ID"
           type="string"
           length="255"/>
           <property
           name="data"
           column="PROP_DATA"
           type="binary"
           length="100000000"
           not-null="true"/>
           </class>
           <class name="org.jboss.portal.cms.hibernate.state.VersionRefs" table="jbp_cms_version_refs" lazy="true">
           <id
           name="key"
           column="PK"
           type="java.lang.Integer">
           <generator class="native"/>
           </id>
           <property
           name="refId"
           column="NODE_ID"
           type="string"
           length="36"/>
           <property
           name="data"
           column="REFS_DATA"
           type="binary"
           length="100000000"
           not-null="true"/>
           </class>
           <class name="org.jboss.portal.cms.hibernate.state.WSPBinVal" table="jbp_cms_wsp_binval" lazy="true">
           <id
           name="key"
           column="PK"
           type="java.lang.Integer">
           <generator class="native"/>
           </id>
           <property
           name="id"
           column="BINVAL_ID"
           type="string"
           length="255"/>
           <property
           name="data"
           column="BINVAL_DATA"
           type="blob"
           length="100000000"
           not-null="true"/>
           </class>
           <class name="org.jboss.portal.cms.hibernate.state.WSPNode" table="jbp_cms_wsp_node" lazy="true">
           <id
           name="key"
           column="PK"
           type="java.lang.Integer">
           <generator class="native"/>
           </id>
           <property
           name="nodeId"
           column="NODE_ID"
           type="string"
           length="36"/>
           <property
           name="data"
           column="NODE_DATA"
           type="binary"
           length="100000000"
           not-null="true"/>
           </class>
           <class name="org.jboss.portal.cms.hibernate.state.WSPProp" table="jbp_cms_wsp_prop" lazy="true">
           <id
           name="key"
           column="PK"
           type="java.lang.Integer">
           <generator class="native"/>
           </id>
           <property
           name="propId"
           column="PROP_ID"
           type="string"
           length="255"/>
           <property
           name="data"
           column="PROP_DATA"
           type="binary"
           length="100000000"
           not-null="true"/>
           </class>
           <class name="org.jboss.portal.cms.hibernate.state.WSPRefs" table="jbp_cms_wsp_refs" lazy="true">
           <id
           name="key"
           column="PK"
           type="java.lang.Integer">
           <generator class="native"/>
           </id>
           <property
           name="refId"
           column="NODE_ID"
           type="string"
           length="36"/>
           <property
           name="data"
           column="REFS_DATA"
           type="binary"
           length="100000000"
           not-null="true"/>
           </class>
           <class name="org.jboss.portal.cms.hibernate.CMSEntry" table="jbp_cms_cmsentry" lazy="true">
           <id
           name="key"
           column="PK"
           type="java.lang.Integer">
           <generator class="native"/>
           </id>
           <property
           name="name"
           column="FSENTRY_NAME"
           type="string"
           length="255"
           not-null="false"/>
           <property name="path"
           column="FSENTRY_PATH"
           type="string"
           not-null="true"
           length="245"/>
           <property name="data"
           column="FSENTRY_DATA"
           type="blob"
           length="100000000"
           not-null="false"/>
           <property name="lastmod"
           column="FSENTRY_LASTMOD"
           type="long"
           not-null="true"/>
           <property name="length"
           column="FSENTRY_LENGTH"
           type="long"
           not-null="true"/>
           </class>
           <class name="org.jboss.portal.cms.hibernate.RepositoryEntry" table="jbp_cms_repositoryentry" lazy="true">
           <id
           name="key"
           column="PK"
           type="java.lang.Integer">
           <generator class="native"/>
           </id>
           <property
           name="name"
           column="FSENTRY_NAME"
           type="string"
           length="255"
           not-null="false"/>
           <property name="path"
           column="FSENTRY_PATH"
           type="string"
           not-null="true"
           length="245"/>
           <property name="data"
           column="FSENTRY_DATA"
           type="blob"
           length="100000000"
           not-null="false"/>
           <property name="lastmod"
           column="FSENTRY_LASTMOD"
           type="long"
           not-null="true"/>
           <property name="length"
           column="FSENTRY_LENGTH"
           type="long"
           not-null="true"/>
           </class>
           <class name="org.jboss.portal.cms.hibernate.VersionEntry" table="jbp_cms_versionentry" lazy="true">
           <id
           name="key"
           column="PK"
           type="java.lang.Integer">
           <generator class="native"/>
           </id>
           <property
           name="name"
           column="FSENTRY_NAME"
           type="string"
           length="255"
           not-null="false"/>
           <property name="path"
           column="FSENTRY_PATH"
           type="string"
           not-null="true"
           length="245"/>
           <property name="data"
           column="FSENTRY_DATA"
           type="blob"
           length="100000000"
           not-null="false"/>
           <property name="lastmod"
           column="FSENTRY_LASTMOD"
           type="long"
           not-null="true"/>
           <property name="length"
           column="FSENTRY_LENGTH"
           type="long"
           not-null="true"/>
           </class>
          
           <!-- mapping to persist CMS Fine Grained Security related objects -->
           <class name="org.jboss.portal.cms.security.PermRoleAssoc" table="jbp_cms_perm_role">
           <cache usage="read-write"/>
           <id
           name="id"
           column="[ID]"
           type="java.lang.Long">
           <generator class="native"/>
           </id>
           <property
           name="roleId"
           column="ROLE_ID"
           type="string"
           not-null="true"
           />
           </class>
           <class name="org.jboss.portal.cms.security.PermUserAssoc" table="jbp_cms_perm_user">
           <cache usage="read-write"/>
           <id
           name="id"
           column="[ID]"
           type="java.lang.Long">
           <generator class="native"/>
           </id>
           <property
           name="userId"
           column="USER_ID"
           type="string"
           not-null="true"
           />
           </class>
           <class name="org.jboss.portal.cms.security.Criteria" table="jbp_cms_perm_criteria">
           <cache usage="read-write"/>
           <id
           name="id"
           column="[ID]"
           type="java.lang.Long">
           <generator class="native"/>
           </id>
           <property
           name="name"
           column="[NAME]"
           type="string"
           not-null="true"
           />
           <property
           name="value"
           column="VALUE"
           type="string"
           not-null="true"
           />
           </class>
           <class name="org.jboss.portal.cms.security.Permission" table="jbp_cms_perm">
           <cache usage="read-write"/>
           <id
           name="id"
           column="[ID]"
           type="java.lang.Long">
           <generator class="native"/>
           </id>
           <!-- one-to-many association with the criteria object -->
           <set name="criteria" lazy="false" table="jbp_cms_perm_criteria" cascade="all-delete-orphan">
           <cache usage="read-write"/>
           <key column="CMS_PERM_ID"/>
           <one-to-many class="org.jboss.portal.cms.security.Criteria"/>
           </set>
           <!-- many-to-many association with the role object -->
           <set name="roleAssoc" lazy="false" cascade="all-delete-orphan">
           <cache usage="read-write"/>
           <key column="CMS_PERM_ID"/>
           <one-to-many class="org.jboss.portal.cms.security.PermRoleAssoc"/>
           </set>
           <!-- many-to-many association with the user object -->
           <set name="userAssoc" lazy="false" cascade="all-delete-orphan">
           <cache usage="read-write"/>
           <key column="CMS_PERM_ID"/>
           <one-to-many class="org.jboss.portal.cms.security.PermUserAssoc"/>
           </set>
           <property
           name="service"
           column="[NAME]"
           type="string"
           not-null="true"
           />
           <property
           name="action"
           column="ACTION"
           type="string"
           not-null="true"
           />
           <property
           name="negated"
           column="NEGATED"
           type="boolean"
           not-null="true"
           />
           </class>
          </hibernate-mapping>
          
          
          


          All that changed was escaping out the MSSQL reserved words id and name with brackets ([]).

          • 2. Re: SQL Server 2000 error on startup and for CMS on access
            Eric Smith Newbie

            If you want to switch to the ms jdbc driver, this worked for me
            1- download the latest Microsoft JDBC driver for 2005 server (sqljdbc.jar) and place into the deploy/xyz/lib;
            2- grab the jboss-portal-2.6.4\setup\portal-sqlserver-ds.xml, edit it and change <driver-class>com.microsoft.sqlserver.jdbc.SQLServerDriver</driver-class> then add
            <type-mapping>MS SQLSERVER2000</type-mapping>

            3- place portal-sqlserver-ds.xml into deploy/xyz/lib
            4- no hibernate chgs
            5- define the MS database with case insensitive because portal code is inconsistent and hits bugs otherwise