我们正在尝试在 Intershop 7.9 上执行 DatabaseTablesPreparer dbinit 过程以在数据库中创建自定义对象。该准备程序的过程失败,但出现以下异常:
ES1 dbinit [] [app_core_a1:Class1 DatabaseTablesPreparer Version:null] com.intershop.tool.dbinit.DBInit [] [] [] [] "main" Error executing app_core_a1:Class1 DatabaseTablesPreparer Version:null java.lang.NullPointerException: null
at java.lang.StringBuilder.<init>(StringBuilder.java:112)
at com.intershop.beehive.core.dbinit.preparer.database.DatabaseTablesPreparer.mergeEnfinityTable(DatabaseTablesPreparer.java:159)
我们反编译了preparer,貌似下面这个方法返回null:
protected Cartridge getCartridge()
{
if (this.cartridge == null)
{
String cartridgeName = System.getProperty("intershop.CurrentCartridgeName");
this.cartridge = this.cartridgeMgr.getCartridge(cartridgeName);
}
return this.cartridge;
}
墨盒名称是否应该在某处明确定义?
编辑#1:
完整的错误日志:
ES1 dbinit [] [] com.intershop.platform.cartridge.internal.CartridgeImpl [] [] [] [] "main" Neither Ivy descriptor nor cartridge properties found for cartridge 'app_core_a1'!
ES1 dbinit [] [] com.intershop.platform.cartridge.internal.CartridgeImpl [] [] [] [] "main" Neither Ivy descriptor nor cartridge properties found for cartridge 'init_a1_shop'!
ES1 dbinit [] [app_core_a1:Class1 DatabaseTablesPreparer Version:null] com.intershop.tool.dbinit.DBInit [] [] [] [] "main" Error executing app_core_a1:Class1 DatabaseTablesPreparer Version:null java.lang.NullPointerException: null
at java.lang.StringBuilder.<init>(StringBuilder.java:112)
at com.intershop.beehive.core.dbinit.preparer.database.DatabaseTablesPreparer.mergeEnfinityTable(DatabaseTablesPreparer.java:159)
at com.intershop.beehive.core.dbinit.preparer.database.DatabaseTablesPreparer.migrateEnfinityTable(DatabaseTablesPreparer.java:126)
at com.intershop.beehive.core.dbinit.preparer.database.DatabaseTablesPreparer.migrateBeanTables(DatabaseTablesPreparer.java:92)
at com.intershop.beehive.core.dbinit.preparer.database.DatabaseTablesPreparer.migrateBeanTables(DatabaseTablesPreparer.java:71)
at com.intershop.beehive.core.dbinit.preparer.database.DatabaseTablesPreparer.prepare(DatabaseTablesPreparer.java:53)
at com.intershop.tool.dbinit.DBInit.execute(DBInit.java:347)
at com.intershop.tool.common.PreparerUtils.execute(PreparerUtils.java:271)
at com.intershop.tool.common.PreparerUtils.executePreparers(PreparerUtils.java:232)
at com.intershop.tool.dbinit.DBInit.prepareCartridge(DBInit.java:522)
at com.intershop.beehive.core.capi.cartridge.Cartridge.onDBInit(Cartridge.java:595)
at com.intershop.tool.dbinit.DBInit.execute(DBInit.java:445)
at com.intershop.tool.dbinit.DBInit.run(DBInit.java:598)
at com.intershop.tool.dbinit.DBInit.main(DBInit.java:133)
dbinit.properties:
#
# Database Tables Preparer, implicit added by DBInit as pre.Class1
Class1 = com.intershop.beehive.core.dbinit.preparer.database.DatabaseTablesPreparer
#
# Indexes
Class2 = com.intershop.beehive.core.dbinit.preparer.database.DatabaseIndexesPreparer \
resources/main/hr/a1/core/dbinit/scripts/dbindex.ddl
#
# Constraints
Class3 = com.intershop.beehive.core.dbinit.preparer.database.DatabaseConstraintsPreparer \
resources/main/hr/a1/core/dbinit/scripts/dbconstraints.ddl
dbinit 命令:
dbinit.bat --exec-id=app_core_a1:Class1