You can find that hbm file packed into a jar file in the WEB-INF/lib directory; the jar
file should have the pattern xwiki-platform-legacy-oldcore-x.y.jar
The file you are looking for is the xwiki.mssql.hbm.xml
There you can shorten the size to 8000.
I think you can edit that file and place the edited copy in the WEB-INF/classes directory
to get picked up.
If that does not help, you need to repack it into the jar where you extracted it.
It is strange that the error pops up only now, as this setting has not been touched for
quite some time ...
Maybe you have the wrong dialect in the <property name="dialect"> part of
your hibernate.cfg.xml ?
(I thought org.hibernate.dialect.SQLServerDialect would be ok, and maps "text"
to varchar(max) .... but I have to admit I have not tried)
I don't know anything about SQL Server but the
error seems to suggest
that the field XWR_REFERER defined in the hbm file is too big.
On Mon, May 9, 2016 at 9:41 AM, Sebastian Schabbach
<S.Schabbach(a)ontaris.de> wrote:
> Thank you!
>
> Something was wrong with the user permissions. I get another problem when I correct
the user permissions for the database user.
>
> I got the error
>
> com.microsoft.sqlserver.jdbc.SQLServerException: The size (8192) given to the column
'XWR_REFERER' exceeds the maximum allowed for any data type (8000).
>
> When creating the database. Is this a well known issue and if what I do to resolve
that problem?
>
> Regards,
> Sebastian.
>
> -----Ursprüngliche Nachricht-----
> Von: users [mailto:users-bounces@xwiki.org] Im Auftrag von Clemens Klein-Robbenhaar
> Gesendet: Mittwoch, 4. Mai 2016 16:50
> An: users(a)xwiki.org
> Betreff: Re: [xwiki-users] Problem with SQL Server Database
>
> Any chance both XWiki instances are writing to the same database?
>
> If you want the second XWiki instance writes to another database, you must not only
update the value in the hibernate.hbm,xml but also the property "xwiki.db" (and
probably xwiki.db.prefix) in WEB-INF/xwiki.cfg too
>
>
> Aside of that you can add a line like
>
> <logger name="com.xpn.xwiki.store.XWikiHibernateBaseStore"
level="debug"/>
>
> to the WEB-INF/classes/logback.xml
> and see if more information shows up in the log file.
>
>> Hi all,
>>
>> my next request is regarding to let xwiki initialize a new, empty SQL Server
database to use the xwiki with this empty database. The problem is that the table
activitystream_events seems to be created twice:
>>
>> com.microsoft.sqlserver.jdbc.SQLServerException: There is already an object named
'activitystream_events' in the database.
>>
>> Has somebody an idea of how I can solve that issue? There are some interesting
logs that looks like access problems with the database, but if there are problems
accessing the database it might not be possible to create any table, isn't it?
>>
>> So here is the tomcat log, maybe it is helpful to solve the issue.
>>
>> Kind regards,
>> Sebastian.
>>
>>
>>
>> Hibernate: select this_.XWV_VERSION as XWV1_26_0_ from xwikidbversion
>> this_
>> Hibernate: select count(*) as y0_ from xwikidoc this_
>> 2016-05-04 15:19:37,334 [
http://pippin:8080/xwiki2/bin/view/Main/]
>> INFO .HibernateDataMigrationManager - Checking Hibernate mapping and
>> updating schema if needed for wiki [xwiki]
>> 2016-05-04 15:19:37,570 [
http://pippin:8080/xwiki2/bin/view/Main/] ERROR
.HibernateDataMigrationManager - The empty database xwiki seems to be not writable, please
check your configuration!
>>
>> com.xpn.xwiki.store.migration.DataMigrationException: Unable to update schema of
wiki [xwiki]
>> at
com.xpn.xwiki.store.migration.hibernate.HibernateDataMigrationManager.updateSchema(HibernateDataMigrationManager.java:182)
~[xwiki-platform-legacy-oldcore-7.4.2.jar:na]
>> at
com.xpn.xwiki.store.migration.hibernate.HibernateDataMigrationManager.initializeEmptyDB(HibernateDataMigrationManager.java:142)
~[xwiki-platform-legacy-oldcore-7.4.2.jar:na]
>> at
com.xpn.xwiki.store.migration.AbstractDataMigrationManager.initNewDB(AbstractDataMigrationManager.java:445)
[xwiki-platform-legacy-oldcore-7.4.2.jar:na]
>> at
com.xpn.xwiki.store.migration.AbstractDataMigrationManager.initializeCurrentDatabase(AbstractDataMigrationManager.java:550)
[xwiki-platform-legacy-oldcore-7.4.2.jar:na]
>> at
com.xpn.xwiki.store.migration.AbstractDataMigrationManager.checkDatabase(AbstractDataMigrationManager.java:533)
[xwiki-platform-legacy-oldcore-7.4.2.jar:na]
>> at
com.xpn.xwiki.store.XWikiHibernateBaseStore.setDatabase(XWikiHibernateBaseStore.java:734)
[xwiki-platform-legacy-oldcore-7.4.2.jar:na]
>> at
com.xpn.xwiki.store.XWikiHibernateBaseStore.beginTransaction(XWikiHibernateBaseStore.java:911)
[xwiki-platform-legacy-oldcore-7.4.2.jar:na]
>> at
com.xpn.xwiki.store.XWikiHibernateBaseStore.beginTransaction(XWikiHibernateBaseStore.java:843)
[xwiki-platform-legacy-oldcore-7.4.2.jar:na]
>> at
com.xpn.xwiki.store.XWikiHibernateStore.loadXWikiDoc(XWikiHibernateStore.java:856)
[xwiki-platform-legacy-oldcore-7.4.2.jar:na]
>> at
com.xpn.xwiki.store.XWikiCacheStore.loadXWikiDoc(XWikiCacheStore.java:299)
[xwiki-platform-legacy-oldcore-7.4.2.jar:na]
>> at com.xpn.xwiki.XWiki.getDocument(XWiki.java:1634)
[xwiki-platform-legacy-oldcore-7.4.2.jar:na]
>> at com.xpn.xwiki.XWiki.getDocument(XWiki.java:1680)
>> [xwiki-platform-legacy-oldcore-7.4.2.jar:na]
>>
>>
>>
>> Caused by: org.hibernate.HibernateException: Failed updating schema while
executing query [create table activitystream_events (ase_eventid varchar(48) not null,
ase_requestid varchar(48) null, ase_stream varchar(255) null, ase_date datetime null,
ase_priority int null, ase_type varchar(255) null, ase_application varchar(255) null,
ase_user varchar(255) null, ase_wiki varchar(255) null, ase_space varchar(255) null,
ase_page varchar(255) null, ase_hidden tinyint null, ase_url varchar(2000) null, ase_title
varchar(2000) null, ase_body varchar(2000) null, ase_version varchar(30) null, ase_param1
varchar(2000) null, ase_param2 varchar(2000) null, ase_param3 varchar(2000) null,
ase_param4 varchar(2000) null, ase_param5 varchar(2000) null, primary key (ase_eventid))]
>> at
com.xpn.xwiki.store.XWikiHibernateBaseStore.updateSchema(XWikiHibernateBaseStore.java:625)
[xwiki-platform-legacy-oldcore-7.4.2.jar:na]
>> at
com.xpn.xwiki.store.XWikiHibernateBaseStore.updateSchema(XWikiHibernateBaseStore.java:371)
[xwiki-platform-legacy-oldcore-7.4.2.jar:na]
>> at
com.xpn.xwiki.store.migration.hibernate.HibernateDataMigrationManager.hibernateShemaUpdate(HibernateDataMigrationManager.java:198)
~[xwiki-platform-legacy-oldcore-7.4.2.jar:na]
>> at
com.xpn.xwiki.store.migration.hibernate.HibernateDataMigrationManager.updateSchema(HibernateDataMigrationManager.java:179)
~[xwiki-platform-legacy-oldcore-7.4.2.jar:na]
>> ... 77 common frames omitted
>>
>> Caused by: com.microsoft.sqlserver.jdbc.SQLServerException: There is already an
object named 'activitystream_events' in the database.
>>
>> 2016-05-04 15:19:37,570 [
http://pippin:8080/xwiki2/bin/view/Main/]
>> ERROR PreferencesConfigurationSource - Failed to access configuration
>> property
>> com.xpn.xwiki.XWikiException: Error number 3202 in 3: Exception while reading
document [xwiki:XWiki.XWikiPreferences]
>> at
com.xpn.xwiki.store.XWikiHibernateStore.loadXWikiDoc(XWikiHibernateStore.java:989)
~[xwiki-platform-legacy-oldcore-7.4.2.jar:na]
>> at
com.xpn.xwiki.store.XWikiCacheStore.loadXWikiDoc(XWikiCacheStore.java:299)
~[xwiki-platform-legacy-oldcore-7.4.2.jar:na]
>> at com.xpn.xwiki.XWiki.getDocument(XWiki.java:1634)
[xwiki-platform-legacy-oldcore-7.4.2.jar:na]
>> at com.xpn.xwiki.XWiki.getDocument(XWiki.java:1680)
[xwiki-platform-legacy-oldcore-7.4.2.jar:na]
>> at
org.xwiki.configuration.internal.AbstractXWikiPreferencesConfigurationSource.getBaseObject(AbstractXWikiPreferencesConfigurationSource.java:86)
~[xwiki-platform-configuration-default-7.4.2.jar:na]
>> at
org.xwiki.configuration.internal.AbstractXWikiPreferencesConfigurationSource.getBaseProperty(AbstractXWikiPreferencesConfigurationSource.java:139)
~[xwiki-platform-configuration-default-7.4.2.jar:na]
>> at
org.xwiki.configuration.internal.AbstractXWikiPreferencesConfigurationSource.getBaseProperty(AbstractXWikiPreferencesConfigurationSource.java:156)
~[xwiki-platform-configuration-default-7.4.2.jar:na]
>> at
>> org.xwiki.configuration.internal.AbstractDocumentConfigurationSource.g
>> etPropertyValue(AbstractDocumentConfigurationSource.java:315)
>> [xwiki-platform-configuration-default-7.4.2.jar:na]
>>
>> Caused by: com.xpn.xwiki.XWikiException: Error number 3301 in 3: Exception while
switching to database xwiki
>> at
com.xpn.xwiki.store.XWikiHibernateBaseStore.setDatabase(XWikiHibernateBaseStore.java:738)
~[xwiki-platform-legacy-oldcore-7.4.2.jar:na]
>> at
com.xpn.xwiki.store.XWikiHibernateBaseStore.beginTransaction(XWikiHibernateBaseStore.java:911)
~[xwiki-platform-legacy-oldcore-7.4.2.jar:na]
>> at
com.xpn.xwiki.store.XWikiHibernateBaseStore.beginTransaction(XWikiHibernateBaseStore.java:843)
~[xwiki-platform-legacy-oldcore-7.4.2.jar:na]
>> at
com.xpn.xwiki.store.XWikiHibernateStore.loadXWikiDoc(XWikiHibernateStore.java:856)
~[xwiki-platform-legacy-oldcore-7.4.2.jar:na]
>> ... 69 common frames omitted
>>
>> Caused by: com.xpn.xwiki.store.migration.DataMigrationException: The empty
database xwiki seems to be not writable, please check your configuration!
>> at
com.xpn.xwiki.store.migration.AbstractDataMigrationManager.initializeCurrentDatabase(AbstractDataMigrationManager.java:556)
~[xwiki-platform-legacy-oldcore-7.4.2.jar:na]
>> at
com.xpn.xwiki.store.migration.AbstractDataMigrationManager.checkDatabase(AbstractDataMigrationManager.java:533)
~[xwiki-platform-legacy-oldcore-7.4.2.jar:na]
>> at
com.xpn.xwiki.store.XWikiHibernateBaseStore.setDatabase(XWikiHibernateBaseStore.java:734)
~[xwiki-platform-legacy-oldcore-7.4.2.jar:na]
>> ... 72 common frames omitted
>>
>> Caused by: com.xpn.xwiki.store.migration.DataMigrationException: Unable to update
schema of wiki [xwiki]
>> at
com.xpn.xwiki.store.migration.hibernate.HibernateDataMigrationManager.updateSchema(HibernateDataMigrationManager.java:182)
~[xwiki-platform-legacy-oldcore-7.4.2.jar:na]
>> at
com.xpn.xwiki.store.migration.hibernate.HibernateDataMigrationManager.initializeEmptyDB(HibernateDataMigrationManager.java:142)
~[xwiki-platform-legacy-oldcore-7.4.2.jar:na]
>> at
com.xpn.xwiki.store.migration.AbstractDataMigrationManager.initNewDB(AbstractDataMigrationManager.java:445)
~[xwiki-platform-legacy-oldcore-7.4.2.jar:na]
>> at
com.xpn.xwiki.store.migration.AbstractDataMigrationManager.initializeCurrentDatabase(AbstractDataMigrationManager.java:550)
~[xwiki-platform-legacy-oldcore-7.4.2.jar:na]
>> ... 74 common frames omitted
>>
>>