[xwiki-users] question about xwiki upgrade with postgresql 8.1 database

jimmy at comkraft.com jimmy at comkraft.com
Tue Feb 6 22:38:15 CET 2007


Hi, Rudolf,

Thank you for the tip. I also did a schema comparison between the 0.9.840
schema and the 1b3 schema and the "NOT NULL" change seems to be the only
material difference. I appied the alter table statement but I still got
error to load the xwiki start page. But now I am getting a different
error:

---------------------------
Error number 4001 in 4: Error while parsing velocity page Wrapped
Exception: Invocation of method 'getUser' in class
com.xpn.xwiki.api.Context threw exception class
java.lang.NullPointerException : null

Error number 4001 in 4: Error while parsing velocity page
Wrapped Exception: Invocation of method 'getUser' in  class
com.xpn.xwiki.api.Context threw exception class
java.lang.NullPointerException : null
com.xpn.xwiki.XWikiException: Error number 4001 in 4: Error while parsing
velocity page
Wrapped Exception: Invocation of method 'getUser' in  class
com.xpn.xwiki.api.Context threw exception class
java.lang.NullPointerException : null
	at
com.xpn.xwiki.render.XWikiVelocityRenderer.evaluate(XWikiVelocityRenderer.java:142)
	at com.xpn.xwiki.XWiki.parseTemplate(XWiki.java:1087)
	at com.xpn.xwiki.XWiki.parseTemplate(XWiki.java:1059)
	at com.xpn.xwiki.web.Utils.parseTemplate(Utils.java:98)
	at com.xpn.xwiki.web.XWikiAction.execute(XWikiAction.java:153)
------------------------------------

It is kind of strange that the data rather than the schema now caused the
upgrade problem.

Thanks

-Jimmy


> Hi Jimmy,
> the following success story has been posted on Friday. Try it out. Maybe,
> it
> helps in your case as well.
> The upgrade was done with the new xwiki.cfg and our old hibernate.cfg.xml
> files.
> Good luck,
> -Rudolf.
>
> I just wanted to let you know that I didn't have serious problems going
> from
> XWiki 0.9.1252  to XWiki 1.0B3 with a Postgres database.
> Basically, I followed the instructions in:
>
> http://www.xwiki.org/xwiki/bin/view/Main/ReleaseNotesXWiki10Beta3
>
> As reported earlier, you'll get an exception ("Could not execute JDBC
> batch
> update") connecting to XWiki 1.0B3 for the first time.
> Analyzing the error message in xwiki.log:
>    Batch entry 0 insert into xwikidoc (XWD_FULLNAME .)
>    SQL ERROR: null value in column "xwd_archive" violates not-null
> constraint
> leads to an easy conclusion: remove the not-null constraint from the
> xwd_archive column in the xwikidoc table.
> The SQL statement is:  ALTER TABLE xwikidoc ALTER COLUMN xwd_archive DROP
> NOT NULL;
>
> After running this SQL statement the connection was done successfully and
> I
> could load the XAR file as described in the instructions.
> In my case, only one thing was different from the old XWiki. All the
> memberships in XWikiAllGroup were gone. Only the ADMIN user was a member.
> So
> I created a Ruby script to add all users to XWikiAllGroup in the database.
> This can of course also be done manually.
>
> I don't know if this works in all Postgres cases.
> BTW, I did at the same time a database upgrade from PG 8.1.3 to 8.2.1.
>
> Rudolf VanderLeeden
> SysAdmin
> Logic United GmbH
> (Germany)
>
> ----- Original Message -----
> From: <jimmy at comkraft.com>
> To: <xwiki-users at objectweb.org>
> Sent: Saturday, February 03, 2007 11:36 PM
> Subject: [xwiki-users] question about xwiki upgrade with postgresql 8.1
> database
>
>
>> Hi,
>>
>> Currently we are using xwiki 0.984 in production (with postgresql 8.1).
>> We
>> are planning to upgrade to 1.0 but don't want to migrate all the data
>> from
>> the old db (for version 0.984 , 27 tables) to the new db (for version
>> 1.0,
>> 36 tables).
>>
>> I dumped the production db into my pc and then point xwiki 1.0 code to
>> this old db. I left the ...hibernate.updateschema=1 as in subversion and
>> it automatically created the missing 7 tables. However, when I tried to
>> start xwiki, I got the following errors in the screen:
>> -------------------------------------------------------------------------
>> root cause
>>
>> com.xpn.xwiki.XWikiException: Error number 3 in 0: Could not initialize
>> main XWiki context
>> Wrapped Exception: Error number 3201 in 3: Exception while saving
>> document
>> XWiki.TagClass
>> Wrapped Exception: Could not execute JDBC batch update
>> com.xpn.xwiki.XWiki.getMainXWiki(XWiki.java:266)
>> com.xpn.xwiki.XWiki.getXWiki(XWiki.java:346)
>> com.xpn.xwiki.web.XWikiAction.execute(XWikiAction.java:96)
>> org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:431)
>> org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:236)
>> org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
>> org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:414)
>> javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
>> javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
>> com.xpn.xwiki.web.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:121)
>> --------------------------------------------------------------------
>> In xwiki.log, the error looks like:
>>
>> 11:55:36,605 ERROR http-8080-Processor25  [action]:invoke:253 -
>> Servlet.service() for servlet action threw exception
>> com.xpn.xwiki.XWikiException: Error number 3 in 0: Could not initialize
>> main XWiki context
>> Wrapped Exception: Error number 3201 in 3: Exception while saving
>> document
>> XWiki.TagClass
>> Wrapped Exception: Could not execute JDBC batch update
>> at com.xpn.xwiki.XWiki.getMainXWiki(XWiki.java:266)
>> at com.xpn.xwiki.XWiki.getXWiki(XWiki.java:346)
>> at com.xpn.xwiki.web.XWikiAction.execute(XWikiAction.java:96)
>> at
>> org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:431)
>> at
>> org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:236)
>> at
>> org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
>> at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:414)
>> at javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
>> at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
>> at
>> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
>> at
>> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
>> at
>> com.xpn.xwiki.web.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:121)
>> at
>> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
>> at
>> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
>> at
>> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
>> at
>> org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
>> at
>> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
>> at
>> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
>> at
>> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
>> at
>> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
>> at
>> org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
>> at
>> org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
>> at
>> org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
>> at
>> org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
>> at
>> org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
>> at java.lang.Thread.run(Thread.java:595)
>>
>>
>> Wrapped Exception:
>>
>>
>> com.xpn.xwiki.XWikiException: Error number 3201 in 3: Exception while
>> saving document XWiki.TagClass
>> Wrapped Exception: Could not execute JDBC batch update
>> at
>> com.xpn.xwiki.store.XWikiHibernateStore.saveXWikiDoc(XWikiHibernateStore.java:314)
>> at
>> com.xpn.xwiki.store.XWikiCacheStore.saveXWikiDoc(XWikiCacheStore.java:100)
>> at
>> com.xpn.xwiki.store.XWikiCacheStore.saveXWikiDoc(XWikiCacheStore.java:94)
>> at com.xpn.xwiki.XWiki.saveDocument(XWiki.java:793)
>> at com.xpn.xwiki.XWiki.getTagClass(XWiki.java:1897)
>> at com.xpn.xwiki.XWiki.initXWiki(XWiki.java:601)
>> at com.xpn.xwiki.XWiki.<init>(XWiki.java:513)
>> at com.xpn.xwiki.XWiki.getMainXWiki(XWiki.java:257)
>> at com.xpn.xwiki.XWiki.getXWiki(XWiki.java:346)
>> at com.xpn.xwiki.web.XWikiAction.execute(XWikiAction.java:96)
>> at
>> org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:431)
>> at
>> org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:236)
>> at
>> org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
>> at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:414)
>> at javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
>> at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
>> at
>> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
>> at
>> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
>> at
>> com.xpn.xwiki.web.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:121)
>> at
>> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
>> at
>> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
>> at
>> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
>> at
>> org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
>> at
>> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
>> at
>> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
>> at
>> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
>> at
>> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
>> at
>> org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
>> at
>> org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
>> at
>> org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
>> at
>> org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
>> at
>> org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
>> at java.lang.Thread.run(Thread.java:595)
>>
>>
>> Wrapped Exception:
>>
>>
>> java.sql.BatchUpdateException: Batch entry 0 insert into xwikidoc
>> (XWD_FULLNAME, XWD_NAME, XWD_TITLE, XWD_LANGUAGE, XWD_DEFAULT_LANGUAGE,
>> XWD_TRANSLATION, XWD_DATE, XWD_CONTENT_UPDATE_DATE, XWD_CREATION_DATE,
>> XWD_AUTHOR, XWD_CONTENT_AUTHOR, XWD_CREATOR, XWD_WEB, XWD_CONTENT,
>> XWD_VERSION, XWD_CUSTOM_CLASS, XWD_PARENT, XWD_CLASS_XML, XWD_ELEMENTS,
>> XWD_DEFAULT_TEMPLATE, XWD_VALIDATION_SCRIPT, XWD_ID) values
>> (XWiki.TagClass, TagClass, , , , 0, 2007-02-03 11:55:29.000000 -0500,
>> 2007-02-03 11:55:29.000000 -0500, 2007-02-03 11:55:29.000000 -0500, , ,
>> ,
>> XWiki,
>> , 1.1, , , <?xml version="1.0" encoding="UTF-8"?>
>>
>> <class>
>> <name>XWiki.TagClass</name>
>> <customClass></customClass>
>> <customMapping></customMapping>
>> <defaultViewSheet></defaultViewSheet>
>> <defaultEditSheet></defaultEditSheet>
>> <defaultWeb></defaultWeb>
>> <nameField></nameField>
>> <validationScript></validationScript>
>> <tags>
>> <name>tags</name>
>> <prettyName>Tags</prettyName>
>> <unmodifiable>0</unmodifiable>
>> <relationalStorage>1</relationalStorage>
>> <displayType>checkbox</displayType>
>> <multiSelect>1</multiSelect>
>> <size>30</size>
>> <separator> </separator>
>> <separators> ,|</separators>
>> <values></values>
>> <number>1</number>
>> <classType>com.xpn.xwiki.objects.classes.StaticListClass</classType>
>> </tags>
>> </class>
>> , 0, , , -1050118876) was aborted.  Call getNextException to see the
>> cause.
>> at
>> org.postgresql.jdbc2.AbstractJdbc2Statement$BatchResultHandler.handleError(AbstractJdbc2Statement.java:2512)
>> at
>> org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1314)
>> at
>> org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:347)
>> at
>> org.postgresql.jdbc2.AbstractJdbc2Statement.executeBatch(AbstractJdbc2Statement.java:2574)
>> at
>> org.apache.commons.dbcp.DelegatingStatement.executeBatch(DelegatingStatement.java:294)
>> at
>> org.apache.commons.dbcp.DelegatingStatement.executeBatch(DelegatingStatement.java:294)
>> at
>> org.hibernate.jdbc.BatchingBatcher.doExecuteBatch(BatchingBatcher.java:58)
>> at
>> org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:195)
>> at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:230)
>> at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:140)
>> at
>> org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:296)
>> at
>> org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:27)
>> at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1009)
>> at org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:356)
>> at
>> org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:106)
>> at
>> com.xpn.xwiki.store.XWikiHibernateBaseStore.endTransaction(XWikiHibernateBaseStore.java:561)
>> at
>> com.xpn.xwiki.store.XWikiHibernateBaseStore.endTransaction(XWikiHibernateBaseStore.java:539)
>> at
>> com.xpn.xwiki.store.XWikiHibernateStore.saveXWikiDoc(XWikiHibernateStore.java:309)
>> at
>> com.xpn.xwiki.store.XWikiCacheStore.saveXWikiDoc(XWikiCacheStore.java:100)
>> at
>> com.xpn.xwiki.store.XWikiCacheStore.saveXWikiDoc(XWikiCacheStore.java:94)
>> at com.xpn.xwiki.XWiki.saveDocument(XWiki.java:793)
>> at com.xpn.xwiki.XWiki.getTagClass(XWiki.java:1897)
>> at com.xpn.xwiki.XWiki.initXWiki(XWiki.java:601)
>> at com.xpn.xwiki.XWiki.<init>(XWiki.java:513)
>> at com.xpn.xwiki.XWiki.getMainXWiki(XWiki.java:257)
>> at com.xpn.xwiki.XWiki.getXWiki(XWiki.java:346)
>> at com.xpn.xwiki.web.XWikiAction.execute(XWikiAction.java:96)
>> at
>> org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:431)
>> at
>> org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:236)
>> at
>> org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
>> at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:414)
>> at javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
>> at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
>> at
>> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
>> at
>> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
>> at
>> com.xpn.xwiki.web.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:121)
>> at
>> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
>> at
>> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
>> at
>> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
>> at
>> org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
>> at
>> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
>> at
>> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
>> at
>> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
>> at
>> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
>> at
>> org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
>> at
>> org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
>> at
>> org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
>> at
>> org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
>> at
>> org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
>> at java.lang.Thread.run(Thread.java:595)
>>
>>
>>
>> I saw some postings regarding xwiki upgrade in a postgresql environment
>> but haven't seen a success story yet.  Has anyone successfully upgrade
>> the
>> database in a postgresql environment? Or do you see why the above error
>> could happen? I am using the xwiki 1.1 snapshot from subversion last
>> night.
>>
>> Thanks
>>
>> -Jimmy
>>
>>
>>
>
>
> --------------------------------------------------------------------------------
>
>
>>
>> --
>> You receive this message as a subscriber of the
>> xwiki-users at objectweb.org
>> mailing list.
>> To unsubscribe: mailto:xwiki-users-unsubscribe at objectweb.org
>> For general help: mailto:sympa at objectweb.org?subject=help
>> ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
>>
>
>
>






More information about the users mailing list