Hi,
I was testing the artifact deployer in IS 6.0.0 that we implemented using
C5 deployment engine. I notice one bug when we deploy invalid artifact that
is filtered by our deployer and trying to throw
a CarbonDeploymentException. It prints a null pointer because if the engine
couldn't fine a Artifact key that is used by the faulty remove method. Any
idea about this implementation ?

[2017-02-26 14:39:28,221] ERROR
{org.wso2.carbon.deployment.engine.internal.DeploymentEngine} - Error while
deploying artifacts
org.wso2.carbon.deployment.engine.exception.CarbonDeploymentException:
Error occurred while deploying Service Provider. Provider name should be
the same as file name.
at
org.wso2.carbon.identity.gateway.deployer.ServiceProviderDeployer.deploy(ServiceProviderDeployer.java:76)
at
org.wso2.carbon.identity.gateway.deployer.ServiceProviderDeployer.deploy(ServiceProviderDeployer.java:44)
at
org.wso2.carbon.deployment.engine.internal.DeploymentEngine.lambda$deployArtifacts$0(DeploymentEngine.java:266)
at java.util.ArrayList.forEach(ArrayList.java:1249)
at
org.wso2.carbon.deployment.engine.internal.DeploymentEngine.deployArtifacts(DeploymentEngine.java:257)
at
org.wso2.carbon.deployment.engine.internal.RepositoryScanner.sweep(RepositoryScanner.java:110)
at
org.wso2.carbon.deployment.engine.internal.RepositoryScanner.scan(RepositoryScanner.java:68)
at
org.wso2.carbon.deployment.engine.internal.SchedulerTask.run(SchedulerTask.java:43)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)
at
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180)
at
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294)
at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Caused by:
org.wso2.carbon.identity.gateway.api.exception.GatewayServerException:
Provider name should be the same as file name.
at
org.wso2.carbon.identity.gateway.deployer.ServiceProviderDeployer.getServiceProviderConfig(ServiceProviderDeployer.java:147)
at
org.wso2.carbon.identity.gateway.deployer.ServiceProviderDeployer.deploy(ServiceProviderDeployer.java:71)
... 14 more



In my customer deployer, it throw an exception when
*getServiceProviderConfig *call and re-throw a CarbonDeploymentException.
Then above error printed.

@Override
public String deploy(Artifact artifact) throws CarbonDeploymentException {
    if (logger.isDebugEnabled()) {
        logger.debug("Deploying ServiceProvider configs.");
    }
    try {
        *ServiceProviderConfig serviceProviderConfig =
getServiceProviderConfig(artifact);*
        
ServiceProviderConfigStore.getInstance().addServiceProvider(serviceProviderConfig);
    } catch (GatewayServerException e) {
        String errorMessage = "Error occurred while deploying Service
Provider. " + e.getMessage();
        logger.error(errorMessage);
        throw new CarbonDeploymentException(errorMessage, e);
    }

    logger.info("Successfully deployed the ServiceProvider configs : "
+ artifact.getName());
    return artifact.getName();
}



*Harsha Thirimanna*
*Associate Tech Lead | WSO2*

Email: [email protected]
Mob: +94715186770
Blog: http://harshathirimanna.blogspot.com/
Twitter: http://twitter.com/harshathirimann
Linked-In: linked-in:
http://www.linkedin.com/pub/harsha-thirimanna/10/ab8/122
<http://wso2.com/signature>
_______________________________________________
Dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to