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

Leave a Reply

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