Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Roberto Tellado
Actualización de LF 5.2.3 a 6.0.6
October 17, 2012 4:44 AM
Answer

Roberto Tellado

Rank: Regular Member

Posts: 246

Join Date: September 15, 2009

Recent Posts

Estoy actualizando Liferay y obtengo este error, en la actualización 6.0.3. He estado buscando tanto en el foro como en las issues y no he encontrado nada.
Mi entorno es: Liferay 6.0.6 Tomcat bundle, base de datos SQL Server.

12:50:41,499 INFO [UpgradeProcess:108] Upgrading com.liferay.portal.upgrade.v6_0_3.UpgradeDocumentLibrary
12:50:45,672 ERROR [MainServlet:202] com.liferay.portal.kernel.events.ActionException: com.liferay.portal.kernel.upgrade.UpgradeException: com.liferay.portal.kernel.upgrade.UpgradeException: java.sql.DataTruncation: Data truncation
com.liferay.portal.kernel.events.ActionException: com.liferay.portal.kernel.upgrade.UpgradeException: com.liferay.portal.kernel.upgrade.UpgradeException: java.sql.DataTruncation: Data truncation
at com.liferay.portal.events.StartupAction.run(StartupAction.java:53)
at com.liferay.portal.servlet.MainServlet.processStartupEvents(MainServlet.java:1166)
at com.liferay.portal.servlet.MainServlet.init(MainServlet.java:199)
at javax.servlet.GenericServlet.init(GenericServlet.java:212)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1173)
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:993)
at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4350)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4659)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:546)
at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:637)
at org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.java:563)
at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:498)
at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1277)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:321)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:785)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:445)
at org.apache.catalina.core.StandardService.start(StandardService.java:519)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
at org.apache.catalina.startup.Catalina.start(Catalina.java:581)
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:597)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)
Caused by: com.liferay.portal.kernel.upgrade.UpgradeException: com.liferay.portal.kernel.upgrade.UpgradeException: java.sql.DataTruncation: Data truncation
at com.liferay.portal.kernel.upgrade.UpgradeProcess.upgrade(UpgradeProcess.java:114)
at com.liferay.portal.upgrade.UpgradeProcessUtil._upgradeProcess(UpgradeProcessUtil.java:80)
at com.liferay.portal.upgrade.UpgradeProcessUtil.upgradeProcess(UpgradeProcessUtil.java:37)
at com.liferay.portal.events.StartupHelper.upgradeProcess(StartupHelper.java:73)
at com.liferay.portal.events.StartupHelperUtil.upgradeProcess(StartupHelperUtil.java:40)
at com.liferay.portal.tools.DBUpgrader.upgrade(DBUpgrader.java:94)
at com.liferay.portal.events.StartupAction.doRun(StartupAction.java:117)
at com.liferay.portal.events.StartupAction.run(StartupAction.java:47)
... 29 more
Caused by: com.liferay.portal.kernel.upgrade.UpgradeException: java.sql.DataTruncation: Data truncation
at com.liferay.portal.kernel.upgrade.UpgradeProcess.upgrade(UpgradeProcess.java:114)
at com.liferay.portal.kernel.upgrade.UpgradeProcess.upgrade(UpgradeProcess.java:130)
at com.liferay.portal.upgrade.UpgradeProcess_6_0_3.doUpgrade(UpgradeProcess_6_0_3.java:41)
at com.liferay.portal.kernel.upgrade.UpgradeProcess.upgrade(UpgradeProcess.java:111)
... 36 more
Caused by: java.sql.DataTruncation: Data truncation
at net.sourceforge.jtds.jdbc.SQLDiagnostic.addDiagnostic(SQLDiagnostic.java:382)
at net.sourceforge.jtds.jdbc.TdsCore.tdsErrorToken(TdsCore.java:2820)
at net.sourceforge.jtds.jdbc.TdsCore.nextToken(TdsCore.java:2258)
at net.sourceforge.jtds.jdbc.TdsCore.getMoreResults(TdsCore.java:632)
at net.sourceforge.jtds.jdbc.JtdsStatement.processResults(JtdsStatement.java:584)
at net.sourceforge.jtds.jdbc.JtdsStatement.executeSQL(JtdsStatement.java:546)
at net.sourceforge.jtds.jdbc.JtdsStatement.executeImpl(JtdsStatement.java:723)
at net.sourceforge.jtds.jdbc.JtdsStatement.executeUpdate(JtdsStatement.java:1166)
at net.sourceforge.jtds.jdbc.JtdsStatement.executeUpdate(JtdsStatement.java:1119)
at com.mchange.v2.c3p0.impl.NewProxyStatement.executeUpdate(NewProxyStatement.java:64)
at com.liferay.portal.dao.db.BaseDB.runSQL(BaseDB.java:231)
at com.liferay.portal.dao.db.BaseDB.runSQL(BaseDB.java:198)
at com.liferay.portal.dao.db.BaseDB.runSQL(BaseDB.java:185)
at com.liferay.portal.kernel.upgrade.UpgradeProcess.runSQL(UpgradeProcess.java:80)
at com.liferay.portal.upgrade.v6_0_3.UpgradeDocumentLibrary.updateFileEntries(UpgradeDocumentLibrary.java:91)
at com.liferay.portal.upgrade.v6_0_3.UpgradeDocumentLibrary.doUpgrade(UpgradeDocumentLibrary.java:31)
at com.liferay.portal.kernel.upgrade.UpgradeProcess.upgrade(UpgradeProcess.java:111)
... 39 more
Stopping the server due to unexpected startup errors
Roberto Tellado
RE: Actualización de LF 5.2.3 a 6.0.6
October 18, 2012 7:56 AM
Answer

Roberto Tellado

Rank: Regular Member

Posts: 246

Join Date: September 15, 2009

Recent Posts

Creo que he encontrado un posible bug en la actualización, pero me gustaría que alguien me lo confirmase. Me he bajado los fuentes para mirar la línea 91 de la clase UpgradeDocumentLibrary y voy a pegar el método en el que da error, para marcar lo que creo que es un bug:

com.liferay.portal.upgrade.v6_0_3.UpgradeDocumentLibrary.updateFileEntries(UpgradeDocumentLibrary.java:91


protected void updateFileEntries() throws Exception {
Connection con = null;
PreparedStatement ps = null;
ResultSet rs = null;

try {
con = DataAccess.getConnection();

ps = con.prepareStatement(
"select uuid_, fileEntryId, groupId, folderId, name, title " +
"from DLFileEntry");

rs = ps.executeQuery();

while (rs.next()) {
String uuid_ = rs.getString("uuid_");
long fileEntryId = rs.getLong("fileEntryId");
long groupId = rs.getLong("groupId");
long folderId = rs.getLong("folderId");
String name = rs.getString("name");
String title = rs.getString("title");

String extension = FileUtil.getExtension(title);

Esto no debería de ser: String extension = FileUtil.getExtension(name); ¿?

runSQL(
"update DLFileEntry set extension = '" + extension +
"' where uuid_ = '" + uuid_ + "' and groupId = " +
groupId);

long fileVersionId = getLatestFileVersionId(folderId, name);

runSQL(
"update ExpandoRow set classPK = " + fileVersionId +
" where classPK = " + fileEntryId);

runSQL(
"update ExpandoValue set classPK = " + fileVersionId +
" where classPK = " + fileEntryId);
}
}
finally {
DataAccess.cleanUp(con, ps, rs);
}
}