Error running a Java migration from 5.0 to 5.5 on Linux

Yesterday I was trying to perform the Java upgrade to the Homepage database from 5.0 to 5.5 on a linux server. The command failed and whatever I tried, it kept on failing.

It seemed to interpret the jdbc url as a Java class and then threw an error it could not find it… obviously

The command I ran was taken from the technote the official documentation is pointing to

the command I tried to ran was:

jvm/linux/jre/bin/java -Dfile.encoding=UTF-8 -Xmx1024m -classpath /apps/ibm/data/DBT_HOME/db2jcc.jar:lib/news.migrate.jar:lib/news.core.data.jar:lib/lc.dbmigration.default.jar:lib/commons-logging-1.0.4.jar:com.ibm.lconn.news.migration.next60.RestoreStatusUpdateMigration jdbc:db2:/cnxdb1.dev.xxxx:50100/HOMEPAGE db2inst1somepassword production > java.out.log 2>&1

It failed with following error:

Exception in thread "main" java.lang.NoClassDefFoundError: jdbc:db2:..cnxdb1.dev.xxxx:50100.HOMEPAGE
Caused by: java.lang.ClassNotFoundException: jdbc:db2:..cnxdb1.dev.echonet:50100.HOMEPAGE
at java.net.URLClassLoader.findClass(URLClassLoader.java:434)
at java.lang.ClassLoader.loadClass(ClassLoader.java:677)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:358)
at java.lang.ClassLoader.loadClass(ClassLoader.java:643)
Could not find the main class: jdbc:db2://cnxdb1.dev.xxxx:50100/HOMEPAGE.  Program will exit.

Thanks to Nico
I learned that the : after lib/commons-logging-1.0.4.jar must be replaced with a space

So this is the correct command to run:

jvm/linux/jre/bin/java -Dfile.encoding=UTF-8 -Xmx1024m -classpath /apps/ibm/data/DBT_HOME/db2jcc.jar:lib/news.migrate.jar:lib/news.core.data.jar:lib/lc.dbmigration.default.jar:lib/commons-logging-1.0.4.jar com.ibm.lconn.news.migration.next60.RestoreStatusUpdateMigration jdbc:db2:/cnxdb1.dev.xxxx:50100/HOMEPAGE db2inst1somepassword production > java.out.log 2>&1

 

2 Comments

  1. Christoph Stöttner

    Thanks, ran into this during this week on Windows too. Just to complete this for Windows. The command needs to be:

    jvm\win\jre\bin\java -Dfile.encoding=UTF-8 -Xmx1024m -classpath jdbc_library_location\db2jcc4.jar;lib/news.migrate.jar;lib\news.core.data.jar;lib/lc.dbmigration.default.jar;lib\commons-logging-1.0.4.jar com.ibm.lconn.news.migration.next60.RestoreStatusUpdateMigration jdbc:db2://dbHost:dbPort/dbinstance
    dbUser dbPassword db production > java.out.log 2>&1

    So “db production” seperated with space is important and the jdbc driver needs to be jcc4 and not only jcc.

    Reply
  2. David McCarthy

    Thanks Wannes!

    The official Technote (https://www-304.ibm.com/support/entdocview.wss?uid=swg21991138) was subsequently updated following the PMR you raised.

    Reply

Leave a Comment

Your email address will not be published. Required fields are marked *