Forum Discussion

FICO's avatar
FICO
Community Manager
17 years ago

Deploying using Java Deployment - Very Urgent!!!

Deploying using Java Deployment - Very Urgent!!!

Hi,

I'm trying to integrate the blaze server and deployment manager into a spring based project. I generated the Java deployment and am using a function entry point. I was able to successfully start up the deployment manager at server start up by using the following modifications to the DManager.class code

@PostConstruct

  public void init()   throws NdDeploymentManagerException

{

_dManager = NdDeploymentManager.createDeploymentManager( "ChewieRMAServer.dmanager" );

}

/**

* Stops the deployment manager

*/

@PreDestroy

  public void shutdown()   throws NdDeploymentManagerException

{

_dManager .shutdown();

}

However when I try to invoke the Rule Service through the Rule Server then I'm getting a class not found exception. The folowing is the extract for the aplication code which is in a Spring service class:

Server server = (Server) Server.createServer(serverConfig);

server.invokerulesetExecuter(ruleset.getRulesetName(), ruleServiceRequest, ruleServiceResponse);

The issue is that the Server class is being loaded with the weblogic default class loader. However when the Server.createServer method is trying to load the server class using a different class loader. On inspecting the dump I found the issue to be with the NdJava2ClassLoaderUtil.class which is getting loaded with sun's classloader. Is there anything I can do on Blaze so that all classes get loaded with the weblogic's class loader

Thanks,

Avik Message Edited by avik_cha on 02-24-2009 08:00 PM

1 Reply

  • FICO's avatar
    FICO
    Community Manager

    First of all, it looks like you are creating a new rule server instance each time before calling it. You should create an server instance only once and use it for all subsequent calls. With Spring you could define a bean from the Server class and specify Server.createServer() as a factory method in that bean's configuration.

    As for the classloader issue, try locating the following parameter in your .server file and make sure it is set to true:

    <UseDeploymentClassLoadingContext> true </UseDeploymentClassLoadingContext>