Forum Discussion

FICO's avatar
FICO
Community Manager
13 years ago

Null Pointer Error loading ADB File

Null Pointer Error loading ADB File

Hi,

I am migrating a project from OC4J to Weblogic. The application was built and run in OC4J using JDK 1.5 however now I have built it with JRockit 1.6 for Weblogic 11g. The ADB file is built using JDK 1.6 and exists in a WAR file deployed on Weblogic but when my application tries to locate it I get the following error below. Do you know if there are certain steps I need to carry out to be able to convert the rules files from JDK1.5 to 1.6?

com.blazesoft.server.base.NdServiceException: Service 'Accept'. Server 'Accept' on host 'ITSOLKKW7DEV6'.

Failure loading project AcceptServer.dmanager_service_0.adb. getSerializedProjectStream: Failed to load serialized project as a resource java.lang.NullPointerException  at com.blazesoft.psextensions.NdSerializedProjectResourceLoader.getSerializedProjectStream(NdSerializedProjectResourceLoader.java:74)  at com.blazesoft.psextensions.NdSerializedProjectResourceLoader.getSerializedProjectFileContents(NdSerializedProjectResourceLoader.java:52)

5 Replies

  • FICO's avatar
    FICO
    Community Manager

    Are you using a dmanager or is that in the adb name by chance?

    is your adb built at the same time as the project or is it a seperate process?

    I would have the jars and jdk that are building the app also  build the adb file. If you're using a dmanager also, it too should be using the same.

  • FICO's avatar
    FICO
    Community Manager

    Hi, Thanks for the reply.

    The name of the adb file is

    AcceptServer.dmanager_service_0.adb

    The adb file is built as part of the whole project build but it is held in its own war file bundled as part of the application EAR file. the adb files are stored at the root level of the war file bundled within the ear file.

    My EJB's are contained in an ejb jar file also bundled within the ear file. I get a null pointer exception when attempting EJB create as follows;

    Failure loading project AcceptServer.dmanager_service_0.adb.

    getSerializedProjectStream: Failed to load serialized project as a resource java.lang.NullPointerException
  • FICO's avatar
    FICO
    Community Manager

    Hi,

    Just an update on this. I am now able to call my ADB file if I place it in a folder on my C drive and then add the folder to the classpath in the weblogic start up. However this is not ideal as currently the ADB files are contained at the root level of a WAR file bundled in my EAR File.

    My Accept.server file points to the ADB file as follows;

    <RulesServiceAgentFactoryFactory>

       <JavaName> com.blazesoft.server.rules.NdNonThreadedScriptRulesServiceAgentFactory </JavaName>

       <SerializedRulesProjectLoaderFactory>

        <Id> Accept </Id>     <JavaName> com.blazesoft.psextensions.NdSerializedProjectResourceLoader </JavaName>     <Project> AcceptServer.dmanager_service_0.adb </Project>     <SerializationMode> 1 </SerializationMode>    </SerializedRulesProjectLoaderFactory> </RulesServiceAgentFactoryFactory>

    Any idea how I can ensure my application can find the ADB file in the location in the WAR?

    Thanks.

  • FICO's avatar
    FICO
    Community Manager

    I believe the NullPointer you see is thrown because the path used to try to load the ADB file does not match the information given in the configuration file. If you specify a fully qualified path, or make your ADB folder a part of the classpath, you are able to load it, which indicates that the problem lies with path resolution. 

    The configuration file needs to contain a relative path that correctly identifies the location of the ADB given the current working directory/server base of the process that tries to load the ADB. 

    Try to figure out what directory is used as a basis for file lookups in your process, and calculate the correct relative path from there. 

    HTH, 

    Jostein 

  • FICO's avatar
    FICO
    Community Manager

    It looks like you are using a custom .adb file loader, so you'd need to look at its implementation (com.blazesoft.psextensions.NdSerializedProjectResourceLoader) to see how to make this work. E.g. if it uses something like Class.getResourceAsStream() method to load .adb content then you'd need to put the .adb file into the WEB-INF\classes\com\blazesoft\psextensions folder in the WAR.

    However, in most real-world deployments it is recommended to keep the .adb file outisde of the EAR file so that you can change the rules without redeploying the EAR file and restarting the application.