Forum Discussion

FICO's avatar
FICO
Community Manager
13 years ago

Problem during creation of .adb when using custom provider (Blaze 7.1)

Problem during creation of .adb when using custom provider (Blaze 7.1)

Hi,

I am facing a problem when trying to generate the precompilation file (.adb) for a java deployment. The error obtained is linked to the use of a custom provider that implements a dual list provider that reads XML files to retrieve the association between codes and labels(DualListXmlCustomProvider).

Command executed: java -mx256m com.blazesoft.server.deploy.tools.NdAdvisorProjectCompiler -server "./Blaze.server"

Error:

java.lang.NullPointerException

        at java.io.File.<init>(Unknown Source)         at com.blazesoft.psextensions.customprovider.dualList.DualListXmlReader.getData(DualListXmlReader.java:85)         at com.blazesoft.psextensions.customprovider.dualList.DualListXmlCustomProvider.setArgs(DualListXmlCustomProvider.java:107)         at com.blazesoft.template.engine.WjJbeQY.WjJbeFN(:138)         at com.blazesoft.template.engine.NdValuedTemplate.WjHApOZ(:1190)         at com.blazesoft.template.engine.NdValuedTemplate.WjIabbR(:941)         at com.blazesoft.template.engine.NdValuedTemplate.getValueType(:916)         at com.blazesoft.template.engine.NdValuedTemplate.valueIsTemplateReference(:989)         at com.blazesoft.template.engine.NdTemplateManager$WjHDEzS.visit(:5868)         at com.blazesoft.template.engine.NdStructuredTemplate.accept(:1286)         at com.blazesoft.template.engine.NdTemplateManager$WjHDEzS.visit(:6033)         at com.blazesoft.template.engine.NdStructuredTemplate.accept(:1286)         at com.blazesoft.template.engine.NdTemplateManager$WjHDEzS.WjHDEpI(:5689)         at com.blazesoft.template.engine.NdTemplateManager.WjIOpmL(:2894)         at com.blazesoft.template.engine.NdTemplateManager.loadTemplate(:1692)         at com.blazesoft.template.engine.NdTemplateManager.loadTemplate(:1582)         at com.blazesoft.template.engine.NdTemplateManager.WjIKHKJ(:4454)         at com.blazesoft.template.engine.NdTemplateManager.WjIOpnM(:4201)         at com.blazesoft.template.engine.NdTemplateManager.WjITStT(:4074)         at com.blazesoft.template.engine.NdTemplateManager.loadInstantiation(:4038)         at com.blazesoft.template.repository.objects.WjIoYxO.WjIOolE(:78)         at com.blazesoft.template.repository.impl.WjHKVoM.getItemStorageContent(:351)         at com.blazesoft.template.repository.deploy.NdPromDefaultEntityContentExtractor.getItemStorageContent(:258)         at com.blazesoft.template.repository.deploy.NdPromDefaultEntityContentExtractor.WjHVFiG(:513)         at com.blazesoft.template.repository.deploy.NdPromDefaultEntityContentExtractor.extract(:245)         at com.blazesoft.template.repository.deploy.NdPromDefaultEntityContentExtractor.WjHNAcW(:375)         at com.blazesoft.template.repository.deploy.NdPromDefaultEntityContentExtractor.extractEntityContent(:202)         at com.blazesoft.template.repository.deploy.NdPromDefaultEntityContentExtractor.extract(:181)         at com.blazesoft.template.repository.deploy.WjHNpnZ.WjIpnEO(:241)         at com.blazesoft.template.repository.deploy.WjHNpnZ.WjIpnEN(:184)         at com.blazesoft.template.repository.deploy.WjHNpnZ.WjIpnEM(:167)         at com.blazesoft.server.rules.NdRulesProjectPromInnovatorLoader.extractRulesProject(:629)         at com.blazesoft.server.rules.NdRulesProjectPromInnovatorLoader.getRulesProject(:560)         at com.blazesoft.server.deploy.tools.NdAdvisorProjectCompiler$1$1.run(:253)         at com.blazesoft.security.java.NdJava2InvocationContext.WjHGaiS(:74)         at com.blazesoft.server.deploy.tools.NdAdvisorProjectCompiler$1.run(:250)         at java.security.AccessController.doPrivileged(Native Method)         at com.blazesoft.server.deploy.tools.NdAdvisorProjectCompiler.SiPNJBB(:247)         at com.blazesoft.server.deploy.tools.NdAdvisorProjectCompiler.SiPWnBW(:390)         at com.blazesoft.server.deploy.tools.NdAdvisorProjectCompiler.SiPWnDY(:1711)         at com.blazesoft.server.deploy.tools.NdAdvisorProjectCompiler.compileServerDeployment(:1492)         at com.blazesoft.server.deploy.tools.NdAdvisorProjectCompiler.compileServerDeployment(:1910)         at com.blazesoft.server.deploy.tools.NdAdvisorProjectCompiler.main(:3386)

The method getData() in the class DualListXmlReader where the exception is thrown looks like this (excerpt):

    public boolean getData()

    {   try {    DocumentBuilderFactory docBuilderFactory = DocumentBuilderFactory.newInstance();          DocumentBuilder docBuilder = docBuilderFactory.newDocumentBuilder();          Document doc = docBuilder.parse(new File(dualXmlFilePath));

....

So the first analysis points the error to the fact that the XML file is not being found (possibly the dualXmlFilePath not properly set?). Note that no problem was observed from the IDE when using this same custom provider, meaning that the XML files were properly read and the instances using the values in the XML files were properly created. In the IDE the parameters are passed using the option "static subtitution".The error appears only while trying to precompile the rule project.

 So:

- Why is the provider invoked at precompilation time? Why is it needed at precompilation time to read the XML file used by the provider?

- Why wouldn't the XML file be found given that during development time (IDE) the path to the XML file was proven correct?

- how to solve this issue?

Thanks in advance for your help,

Best regards,

Maria Agustina Cibran

1 Reply

  • FICO's avatar
    FICO
    Community Manager

     So:

    - Why is the provider invoked at precompilation time? Why is it needed at precompilation time to read the XML file used by the provider?

    - Why wouldn't the XML file be found given that during development time (IDE) the path to the XML file was proven correct?

    - how to solve this issue? 

    Hi

    1: Providers are invoked at compile time to translate instantiaton values in template instance files to SRL content values in the generated rule entity (ruleset, function etc.), i.e. to generate code from the selected values.

    2: I don't know, relative paths, access rights or something completely different.

    3: I would start by identifying what the value of the "dualXmlFilePath" variable is when running the compiler, either by log statements in the provider or by attaching a debugger.