0 Replies Latest reply on Mar 9, 2008 11:46 PM by wlchung

    JBP 2.2 upgrade/migration to 2.6 via 2.4

    wlchung

      I want to upgrade JBoss Portal 2.2.1 SP1 to 2.6.4-GA. After reading the user reference, I think I have to go through 2.4.1-GA in order to make use of the migration tool. But I encountered failure during the migration.

      I download all these from JBoss Portal download. My conversion environment is:
      JBoss AS Version : 4.0.3 SP1
      Database Vendor and Version : Mysql 5.0.45
      JDBC Connector and Version : mysql-connector-java-5.0.7
      OS Platform : XP Home SP2

      The migration is smooth until in the Migrating Portal Portlet Instance step. It failed with the following message on screen: Migrating Portal Portlet Instance Data failed! In the log, it has java.lang.NullPointerException.

      INFO [MigrationModule22_24] Migrating preferences for user: admin [2008-03-10 10:19:53,429]
      INFO [STDOUT] Mon Mar 10 10:19:53 CST 2008 INFO: Profiler Event: [QUERY] at org.jboss.resource.adapter.jdbc.WrappedPreparedStatement.executeQuery(WrappedPreparedStatement.java:211) duration: 0 ms, connection-id: 313, statement-id: 1820, resultset-id: 1527, message: select this_.PK as PK61_1_, this_.ID as ID61_1_, this_.COMPONENT_REF as COMPONENT3_61_1_, preference2_.INSTANCE_KEY as INSTANCE4_3_, preference2_.PK as PK3_, preference2_.NAME as NAME3_, preference2_.PK as PK62_0_, preference2_.NAME as NAME62_0_, preference2_.TYPE as TYPE62_0_ from JBP_INSTANCE this_ left outer join JBP_INSTANCE_PREF preference2_ on this_.PK=preference2_.INSTANCE_KEY where this_.ID='DefaultCMSPortletInstance' [2008-03-10 10:19:53,469]
      INFO [STDOUT] Mon Mar 10 10:19:53 CST 2008 INFO: Profiler Event: [FETCH] at org.jboss.resource.adapter.jdbc.WrappedPreparedStatement.executeQuery(WrappedPreparedStatement.java:211) duration: 0 ms, connection-id: 313, statement-id: 1820, resultset-id: 1527 [2008-03-10 10:19:53,469]
      INFO [STDOUT] Mon Mar 10 10:19:53 CST 2008 INFO: Profiler Event: [QUERY] at org.jboss.resource.adapter.jdbc.WrappedPreparedStatement.executeQuery(WrappedPreparedStatement.java:211) duration: 0 ms, connection-id: 313, statement-id: 1821, resultset-id: 1528, message: select strings0_.PK as PK0_, strings0_.VALUE as VALUE0_, strings0_.IDX as IDX0_ from JBP_INSTANCE_PREF_VALUE strings0_ where strings0_.PK=1 [2008-03-10 10:19:53,479]
      INFO [STDOUT] Mon Mar 10 10:19:53 CST 2008 INFO: Profiler Event: [FETCH] at org.jboss.resource.adapter.jdbc.WrappedPreparedStatement.executeQuery(WrappedPreparedStatement.java:211) duration: 0 ms, connection-id: 313, statement-id: 1821, resultset-id: 1528 [2008-03-10 10:19:53,479]
      INFO [STDOUT] Mon Mar 10 10:19:53 CST 2008 INFO: Profiler Event: [QUERY] at org.jboss.resource.adapter.jdbc.WrappedPreparedStatement.executeUpdate(WrappedPreparedStatement.java:227) duration: 0 ms, connection-id: 311, statement-id: 1822, resultset-id: 0, message: insert into JBP_PORTLET_STATE (PORTLET_ID, REGISTRATION_ID, REGISTRATION_TIME, TERMINATION_TIME, PARENT_PK) values ('portal.CMSPortlet', null, null, null, null) [2008-03-10 10:19:53,509]
      INFO [STDOUT] Mon Mar 10 10:19:53 CST 2008 INFO: Profiler Event: [FETCH] at org.jboss.resource.adapter.jdbc.WrappedPreparedStatement.executeUpdate(WrappedPreparedStatement.java:227) duration: 0 ms, connection-id: 311, statement-id: 1822, resultset-id: 0 [2008-03-10 10:19:53,509]
      INFO [STDOUT] Mon Mar 10 10:19:53 CST 2008 INFO: Profiler Event: [QUERY] at org.jboss.resource.adapter.jdbc.WrappedPreparedStatement.executeQuery(WrappedPreparedStatement.java:211) duration: 10 ms, connection-id: 311, statement-id: 1823, resultset-id: 1530, message: select this_.PK as PK29_1_, this_.ID as ID29_1_, this_.PORTLET_REF as PORTLET3_29_1_, this_.MODIFIABLE as MODIFIABLE29_1_, this_.SER_STATE as SER5_29_1_, securitybi2_.INSTANCE_PK as INSTANCE3_3_, securitybi2_.PK as PK3_, securitybi2_.ROLE as ROLE3_, securitybi2_.PK as PK31_0_, securitybi2_.ROLE as ROLE31_0_, securitybi2_.INSTANCE_PK as INSTANCE3_31_0_, actions3_.PK as PK4_, actions3_.ACTIONS as ACTIONS4_ from JBP_INSTANCE this_ left outer join JBP_INSTANCE_SECURITY securitybi2_ on this_.PK=securitybi2_.INSTANCE_PK left outer join JBP_INSTANCE_SECURITY_ACTIONS actions3_ on securitybi2_.PK=actions3_.PK where this_.ID='DefaultCMSPortletInstance' [2008-03-10 10:19:53,519]
      INFO [STDOUT] Mon Mar 10 10:19:53 CST 2008 INFO: Profiler Event: [FETCH] at org.jboss.resource.adapter.jdbc.WrappedPreparedStatement.executeQuery(WrappedPreparedStatement.java:211) duration: 0 ms, connection-id: 311, statement-id: 1823, resultset-id: 1530 [2008-03-10 10:19:53,519]
      INFO [STDOUT] Mon Mar 10 10:19:53 CST 2008 INFO: Profiler Event: [QUERY] at org.jboss.resource.adapter.jdbc.WrappedPreparedStatement.executeUpdate(WrappedPreparedStatement.java:227) duration: 10 ms, connection-id: 311, statement-id: 1824, resultset-id: 0, message: insert into JBP_INSTANCE_PER_USER (INSTANCE_PK, USER_ID, PORTLET_REF, SER_STATE) values (2, '1', 'local._6', null) [2008-03-10 10:19:53,529]
      INFO [STDOUT] Mon Mar 10 10:19:53 CST 2008 INFO: Profiler Event: [FETCH] at org.jboss.resource.adapter.jdbc.WrappedPreparedStatement.executeUpdate(WrappedPreparedStatement.java:227) duration: 0 ms, connection-id: 311, statement-id: 1824, resultset-id: 0 [2008-03-10 10:19:53,529]
      INFO [STDOUT] Mon Mar 10 10:19:53 CST 2008 INFO: Profiler Event: [QUERY] at org.jboss.resource.adapter.jdbc.WrappedPreparedStatement.executeQuery(WrappedPreparedStatement.java:211) duration: 0 ms, connection-id: 313, statement-id: 1825, resultset-id: 1532, message: select this_.PK as PK61_1_, this_.ID as ID61_1_, this_.COMPONENT_REF as COMPONENT3_61_1_, preference2_.INSTANCE_KEY as INSTANCE4_3_, preference2_.PK as PK3_, preference2_.NAME as NAME3_, preference2_.PK as PK62_0_, preference2_.NAME as NAME62_0_, preference2_.TYPE as TYPE62_0_ from JBP_INSTANCE this_ left outer join JBP_INSTANCE_PREF preference2_ on this_.PK=preference2_.INSTANCE_KEY where this_.ID='AdsPlPMDL2Inst' [2008-03-10 10:19:53,549]
      INFO [STDOUT] Mon Mar 10 10:19:53 CST 2008 INFO: Profiler Event: [FETCH] at org.jboss.resource.adapter.jdbc.WrappedPreparedStatement.executeQuery(WrappedPreparedStatement.java:211) duration: 0 ms, connection-id: 313, statement-id: 1825, resultset-id: 1532 [2008-03-10 10:19:53,549]
      INFO [STDOUT] java.lang.NullPointerException [2008-03-10 10:19:53,559]
      INFO [STDOUT] at org.jboss.portal.migration.MigrationModule22_24.migrateUserPreferences(MigrationModule22_24.java:493) [2008-03-10 10:19:53,559]
      INFO [STDOUT] at org.jboss.portal.migration.MigrationModule22_24.migratePortletInstances(MigrationModule22_24.java:733) [2008-03-10 10:19:53,559]

      I debug the module MigrationModule22_24 using eclipse and trace the null pointer to the instance22 variable in the following line within the migrateUserPreferences() of MigrationModule22_24. I think the line corresponding to the left outer join sql 5 lines above with "... where this_.ID='AdsPlPMDL2Inst' "

      //create clone
       PersistentState24 state24 = new PersistentState24();
       Instance22Impl instance22 = (Instance22Impl)fromSession.createCriteria(Instance22Impl.class).add(Restrictions.eq("instanceId", prefSet.getId())).uniqueResult(); //this line results in null
      
       state24.setPortletId(instance22.getComponentRef());
       //persist clone
       toSession.save(state24);
      

      I cannot continue because I cannot sure what this means to the database structure of the portal.

      Hoping to skip the null instance22 to continue the migration, I added codes to check for null instance22 and skip the rest for loop codes.

      if ( instance22 != null ) {
       state24.setPortletId(instance22.getComponentRef());
       //persist clone
       toSession.save(state24);
       ...
       toSession.save(userInstance24);
       }
      


      This enable me to go through the Portal Portlet Instance step. But it failed in the following migrateSecurityPolicy step. NullPointerException again and seems on the object "default.default.CatalogPortletWindow".

      INFO [MigrationModule22_24] Migrating policy from: /portalobject/default.default.CatalogPortletWindow [2008-03-09 18:16:22,015]
      INFO [MigrationModule22_24] Migrating portalobject: default.default.CatalogPortletWindow [2008-03-09 18:16:22,015]
      INFO [STDOUT] Sun Mar 09 18:16:22 CST 2008 INFO: Profiler Event: [QUERY] at org.jboss.resource.adapter.jdbc.WrappedPreparedStatement.executeQuery(WrappedPreparedStatement.java:211) duration: 0 ms, connection-id: 298, statement-id: 4322, resultset-id: 4029, message: select this_.PK as PK14_1_, this_.PATH as PATH14_1_, this_.NAME as NAME14_1_, this_.PARENT_KEY as PARENT4_14_1_, securityco2_.NODE_KEY as NODE3_3_, securityco2_.PK as PK3_, securityco2_.ROLE as ROLE3_, securityco2_.PK as PK23_0_, securityco2_.ROLE as ROLE23_0_, securityco2_.NODE_KEY as NODE3_23_0_, actions3_.PK as PK4_, actions3_.ACTIONS as ACTIONS4_ from JBP_OBJECT_NODE this_ left outer join JBP_OBJECT_NODE_SEC securityco2_ on this_.PK=securityco2_.NODE_KEY left outer join JBP_OBJECT_NODE_SEC_ACTIONS actions3_ on securityco2_.PK=actions3_.PK where this_.PATH='default.default.CatalogPortletWindow' [2008-03-09 18:16:22,015]
      INFO [STDOUT] Sun Mar 09 18:16:22 CST 2008 INFO: Profiler Event: [FETCH] at org.jboss.resource.adapter.jdbc.WrappedPreparedStatement.executeQuery(WrappedPreparedStatement.java:211) duration: 0 ms, connection-id: 298, statement-id: 4322, resultset-id: 4029 [2008-03-09 18:16:22,015]
      ERROR [MigrationModule22_24] Critical state: can't find ObjectNode for extracted path: default.default.CatalogPortletWindow [2008-03-09 18:16:22,025]
      INFO [STDOUT] java.lang.NullPointerException [2008-03-09 18:16:22,025]


      Anyone has any ideas on these problems? Anyone has the low level relationship information between database tables and the portal objects?

      My portal application does not use the CMS and dynamic definition feature currently. I wonder if there are ways just to migration the user information. Or skip the last 2 object migration steps (Portal Portlet Instance Data Migrate,Portal Security Data Migrate).

      Also if I am done with the 2.4 migration program, is it necessary for me to run the jbp 2.4.1 once before I go on to 2.6.4?


      Thanks in advance.