我们正在尝试在Intershop7.9上执行DatabaseTablePreparer 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

最佳答案

通过为运行dbinit的盒带添加[cartridge].properties文件,问题得到解决。添加.properties文件后,preparer成功完成并在数据库中创建表。

10-01 02:43