The deployment engine should call the deployer only for valid artifact
types. So yes, it looks like the fixes have to be done in the kernel.

On Thu, Dec 10, 2015 at 1:47 PM, Samiyuru Senarathne <samiy...@wso2.com>
wrote:

> First part of this issue is trying to deploy invalid files. The second
> part of the issue is deployment engine tries to deploy the artifact again
> and again even though an exception is thrown for that particular artifact
> by the deployer. Because of this the exception is thrown again and again.
>
> The second part of the problem will be solved with the kernel GA since the
> GA's deployment engine records the faulty artifacts.
>
> IMO the first part of issue also should be fixed in deployment engine. The
> reason for that is as follows.
>
> *org.wso2.carbon.mss.internal.deployer.MSSDeployer* implements
> *org.wso2.carbon.kernel.deployment.Deployer* interface that is provided
> by the deployment engine of carbon kernel.
>
> org.wso2.carbon.kernel.deployment.Deployer interface has the following
> functions.
>
>    -     Object deploy(Artifact var1) throws CarbonDeploymentException;
>    -     void undeploy(Object var1) throws CarbonDeploymentException;
>    -     Object update(Artifact var1) throws CarbonDeploymentException;
>    -     URL getLocation();
>    -     ArtifactType getArtifactType();
>
> Here deploy(Artifact var1) function is called with a
> *org.wso2.carbon.kernel.deployment.Artifact* parameter by the kernel's
> deployment engine whenever a new artifact is found. So, deploy() function
> is called with both valid and invalid artifact types.
>
> Here, getArtifactType() is meant to get the artifact type that is
> supported by a particular deployer implementation. IMO since this function
> is there to identify the supported artifact types of a Deployer, deployment
> engine should filter the found artifacts using the ArtifactType before
> calling the deploy() function of a Deployer implementation. Then, the
> deployment engine will call deploy() function only with valid artifacts for
> that specific deployer. Therefore, each deployer implementation will not
> have to do duplicate implementations to filt the artifact types they
> support. IMO unless getting an ArtifactType from the deployer
> implementation is less useful.
>
> WDYT?
>
> Best Regards,
> Samiyuru
>
> On Thu, Dec 10, 2015 at 11:35 AM, Afkham Azeez <az...@wso2.com> wrote:
>
>> [2015-12-10 11:34:09,012]  INFO
>> {org.wso2.carbon.mss.internal.deployer.MSSDeployer} - Deploying artifact:
>> /Users/azeez/projects/github/wso2/product-mss/product/target/wso2mss-1.0.0-SNAPSHOT/repository/deployment/server/mss/README.txt
>>
>> [2015-12-10 11:34:09,013] ERROR
>> {org.wso2.carbon.kernel.internal.deployment.DeploymentEngine} - Error while
>> deploying artifacts
>> org.wso2.carbon.kernel.deployment.exception.CarbonDeploymentException:
>> Error while processing the artifact:
>> /Users/azeez/projects/github/wso2/product-mss/product/target/wso2mss-1.0.0-SNAPSHOT/repository/deployment/server/mss/README.txt
>>
>> at
>> org.wso2.carbon.mss.internal.deployer.MSSDeployer.deploy(MSSDeployer.java:78)
>>
>> at
>> org.wso2.carbon.kernel.internal.deployment.DeploymentEngine.lambda$deployArtifacts$18(DeploymentEngine.java:229)
>>
>> at
>> org.wso2.carbon.kernel.internal.deployment.DeploymentEngine$$Lambda$45/1996363093.accept(Unknown
>> Source)
>>
>> at java.util.ArrayList.forEach(ArrayList.java:1249)
>>
>> at
>> org.wso2.carbon.kernel.internal.deployment.DeploymentEngine.deployArtifacts(DeploymentEngine.java:225)
>>
>> at
>> org.wso2.carbon.kernel.internal.deployment.RepositoryScanner.sweep(RepositoryScanner.java:110)
>>
>> at
>> org.wso2.carbon.kernel.internal.deployment.RepositoryScanner.scan(RepositoryScanner.java:68)
>>
>> at
>> org.wso2.carbon.kernel.internal.deployment.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.mss.internal.deployer.MSSJarProcessorException: Error
>> retrieving manifest:
>> /Users/azeez/projects/github/wso2/product-mss/product/target/wso2mss-1.0.0-SNAPSHOT/repository/deployment/server/mss/README.txt
>>
>> at
>> org.wso2.carbon.mss.internal.deployer.MSSJarProcessor.readMSSManifestEntry(MSSJarProcessor.java:125)
>>
>> at
>> org.wso2.carbon.mss.internal.deployer.MSSJarProcessor.process(MSSJarProcessor.java:65)
>>
>> at
>> org.wso2.carbon.mss.internal.deployer.MSSDeployer.deploy(MSSDeployer.java:76)
>>
>> ... 14 more
>>
>> Caused by: java.util.zip.ZipException: error in opening zip file
>>
>> at java.util.zip.ZipFile.open(Native Method)
>>
>> at java.util.zip.ZipFile.<init>(ZipFile.java:220)
>>
>> at java.util.zip.ZipFile.<init>(ZipFile.java:150)
>>
>> at java.util.jar.JarFile.<init>(JarFile.java:166)
>>
>> at java.util.jar.JarFile.<init>(JarFile.java:103)
>>
>> at
>> org.wso2.carbon.mss.internal.deployer.MSSJarProcessor.readMSSManifestEntry(MSSJarProcessor.java:113)
>>
>>
>> The deployer should ignore unknown extensions. It is trying to deploy a
>> .txt file.
>>
>> --
>> *Afkham Azeez*
>> Director of Architecture; WSO2, Inc.; http://wso2.com
>> Member; Apache Software Foundation; http://www.apache.org/
>> * <http://www.apache.org/>*
>> *email: **az...@wso2.com* <az...@wso2.com>
>> * cell: +94 77 3320919 <%2B94%2077%203320919>blog: *
>> *http://blog.afkham.org* <http://blog.afkham.org>
>> *twitter: **http://twitter.com/afkham_azeez*
>> <http://twitter.com/afkham_azeez>
>> *linked-in: **http://lk.linkedin.com/in/afkhamazeez
>> <http://lk.linkedin.com/in/afkhamazeez>*
>>
>> *Lean . Enterprise . Middleware*
>>
>
>
>
> --
> Samiyuru Senarathne
> *Software Engineer*
> Mobile : +94 (0) 71 134 6087
> samiy...@wso2.com
>



-- 
*Afkham Azeez*
Director of Architecture; WSO2, Inc.; http://wso2.com
Member; Apache Software Foundation; http://www.apache.org/
* <http://www.apache.org/>*
*email: **az...@wso2.com* <az...@wso2.com>
* cell: +94 77 3320919blog: **http://blog.afkham.org*
<http://blog.afkham.org>
*twitter: **http://twitter.com/afkham_azeez*
<http://twitter.com/afkham_azeez>
*linked-in: **http://lk.linkedin.com/in/afkhamazeez
<http://lk.linkedin.com/in/afkhamazeez>*

*Lean . Enterprise . Middleware*
_______________________________________________
Architecture mailing list
Architecture@wso2.org
https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture

Reply via email to