[ 
https://issues.apache.org/jira/browse/AXIS2-5136?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13092377#comment-13092377
 ] 

Ping Liu commented on AXIS2-5136:
---------------------------------

The error is caused by two problems:

        1. redundant scheme "file://" is appended at the front.

                example: 
jar:file://file:/home/sagara/dev/code/apache/axis2/devs/patch/modules/distribution/target/axis2-1.7.0-SNAPSHOT/repository/services/SendSmsService.aar!/META-INF/SendSmsService.wsdl

        2. same file path is appended two times (both for SendSmsService.aar)

                example: 
jar:file:///home/sagara/dev/code/apache/axis2/devs/patch/modules/distribution/target/axis2-1.7.0-SNAPSHOT/repository/services/SendSmsService.aar!/jar:file://file:/home/sagara/dev/code/apache/axis2/devs/patch/modules/distribution/target/axis2-1.7.0-SNAPSHOT/repository/services/SendSmsService.aar!/META-INF/parlayx_sms_types_2_2.xsd

The following are the fixes (both in kernel):

        1. to fix Problem 1, in ArchiveReader.java 
(src/org/apache/axis2/deployment/repository/util/ArchiveReader.java),
           change 

                "jar:file://" + serviceArchiveFile.toURI() + "!/" + baseURI);

           to

                "jar:" + serviceArchiveFile.toURI() + "!/" + baseURI);

           Note:
                File.toURI() returns "file:/" scheme in front of the file path 
already

        2. to fix Problem 2, in AARBasedWSDLLocator.java 
(src/org/apache/axis2/deployment/resolver/AARBasedWSDLLocator.java)
           Add isAbsolute() to override the one defined in super class 
DefaultURIResolver.java. 
           The new isAbsolute() adds schemes such as "jar:" besides "http://";, 
which is originally defined in DefaultURIResolver.java, 
           so that a URI path starts with "jar:" won't be treated as a relative 
path in resolveURI().
           As a result, no more duplicate path will be appended multiple times.

        3. after fix, the correct path should look like this:

                
jar:file:/home/sagara/dev/code/apache/axis2/devs/patch/modules/distribution/target/axis2-1.7.0-SNAPSHOT/repository/services/SendSmsService.aar!/META-INF/parlayx_sms_types_2_2.xsd

The patch is attached.

> Simple Axis2 Server failed on deploying aar file
> ------------------------------------------------
>
>                 Key: AXIS2-5136
>                 URL: https://issues.apache.org/jira/browse/AXIS2-5136
>             Project: Axis2
>          Issue Type: Bug
>          Components: codegen
>            Reporter: Ping Liu
>         Attachments: kernel.patch
>
>
> This error was first found by Sagara. Following is the note from AXIS2-4170.
> -----------------------------------------------------------------------------------------------------------------
> As a miner issue I found it's not possible to deploy SendSmsService.aar in 
> Axis2 Simple sever but possible to deploy SendSmsService as a explode AAR 
> service. In SendSmsService.aar case I'm getting following exception.
> [ERROR] Woden[Error],0:0,WSDL521,Could not parse an inline schema in the WSDL 
> at URL 
> "jar:file://file:/home/sagara/dev/code/apache/axis2/devs/patch/modules/distribution/target/axis2-1.7.0-SNAPSHOT/repository/services/SendSmsService.aar!/META-INF/SendSmsService.wsdl".,java.lang.RuntimeException:org.apache.ws.commons.schema.XmlSchemaException:
>  JAR entry 
> jar:file:///home/sagara/dev/code/apache/axis2/devs/patch/modules/distribution/target/axis2-1.7.0-SNAPSHOT/repository/services/SendSmsService.aar!/jar:file://file:/home/sagara/dev/code/apache/axis2/devs/patch/modules/distribution/target/axis2-1.7.0-SNAPSHOT/repository/services/SendSmsService.aar!/META-INF/parlayx_sms_types_2_2.xsd
>  not found in 
> /home/sagara/dev/code/apache/axis2/devs/patch/modules/distribution/target/axis2-1.7.0-SNAPSHOT/repository/services/SendSmsService.aar
> [ERROR] Woden[Error],0:0,WSDL521,Could not parse an inline schema in the WSDL 
> at URL 
> "jar:file://file:/home/sagara/dev/code/apache/axis2/devs/patch/modules/distribution/target/axis2-1.7.0-SNAPSHOT/repository/services/SendSmsService.aar!/META-INF/SendSmsService.wsdl".,java.lang.RuntimeException:org.apache.ws.commons.schema.XmlSchemaException:
>  JAR entry 
> jar:file:///home/sagara/dev/code/apache/axis2/devs/patch/modules/distribution/target/axis2-1.7.0-SNAPSHOT/repository/services/SendSmsService.aar!/jar:file://file:/home/sagara/dev/code/apache/axis2/devs/patch/modules/distribution/target/axis2-1.7.0-SNAPSHOT/repository/services/SendSmsService.aar!/META-INF/parlayx_common_types_2_1.xsd
>  not found in 
> /home/sagara/dev/code/apache/axis2/devs/patch/modules/distribution/target/axis2-1.7.0-SNAPSHOT/repository/services/SendSmsService.aar
>  

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to