Hi all, The reason for this issue is that the swagger definition of an API created in the APIM 210 doesn't have a "definitions" section (example [1],[2]). When such a swagger definition that doesn't have a "definitions" section is used to generate a client stub (SDK) then the "org.wso2.client.model." package is not created, since that is the package that contains all the models[3] which are defined under the "definitions" section in the yaml.
However, even if the "org.wso2.client.model" package is not generated, the android model.mustache template[4] adds all the imports including the import of model package. I have submitted an issue[5] to swagger-codegen repository regarding this. For the time being, it's best to remove that import statement and build the project. ======================================================= [1] ==== [image: Inline image 1] ======================================================= [2] ==== [image: Inline image 2] ======================================================= [3] ==== [image: Inline image 3] [4] https://github.com/swagger-api/swagger-codegen/blob/master/modules/swagger-codegen/src/main/resources/android/model.mustache [5] https://github.com/swagger-api/swagger-codegen/issues/7033 Thanks, Viduranga. On Thu, Nov 23, 2017 at 11:28 AM, Krishan Wijesena <[email protected]> wrote: > Hi Isuru, > > nothing wrong with step 4. it seems like org.wso2.client.model package > doesn't include in here. I check this and *DefaultApi.java *and > *../src/main/java/io/swagger/client/JsonUtil.java > *use this org.wso2.client.model.* as import. seems like this import is > unused. For now can you try again by removing that unused import from both > locations and try to build. It should work. > > Thanks, > Krishan. > > On Thu, Nov 23, 2017 at 10:13 AM, Abimaran Kugathasan <[email protected]> > wrote: > >> Hi Isuru, >> >> Based on the following error, you should have >> org.wso2.client.api.TestApi1 and org.wso2.client.model.TestApi1 packages. >> Can you check the whether you have both? It's a compilation error. >> >> /TestApi1_1.0.0_android/src/main/java/org/wso2/client/api/TestApi1/DefaultApi.java:[31,1] >> package org.wso2.client.model.TestApi1 does not exist >> >> On Wed, Nov 22, 2017 at 7:53 AM, Isuru Uyanage <[email protected]> wrote: >> >>> Hi All, >>> >>> I have an Android application developed and need to invoke an API >>> created in WSO2 API Manager(2.1.0) through the Android app. >>> >>> The following tasks have been done. >>> >>> 1. I have created an API using an existing SOAP Endpoint(wsdl) >>> >>> 2. Downloaded the SDK from API Manager for Android. >>> >>> 3. Android application has been developed. >>> >>> 4. As in the README.md file(which has been downloaded with the SDK), >>> when I'm trying to generate the jar by executing *'mvn package' *command, >>> the build gets failed as below. The API which I created was TestApi1. >>> >>> /TestApi1_1.0.0_android/src/main/java/org/wso2/client/api/TestApi1/DefaultApi.java:[31,1] >>> package org.wso2.client.model.TestApi1 does not exist >>> >>> org.apache.maven.lifecycle.LifecycleExecutionException: Failed to >>> execute goal org.apache.maven.plugins:maven-compiler-plugin:3.5.1:co >>> mpile *(default-compile)* on projectorg.wso2.client.TestApi1: *Compilation >>> failure* >>> >>> at org.apache.maven.lifecycle.internal.MojoExecutor.execute(Moj >>> oExecutor.java:213) >>> >>> at org.apache.maven.lifecycle.internal.MojoExecutor.execute(Moj >>> oExecutor.java:154) >>> >>> at org.apache.maven.lifecycle.internal.MojoExecutor.execute(Moj >>> oExecutor.java:146) >>> >>> at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.b >>> uildProject(LifecycleModuleBuilder.java:117) >>> >>> at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.b >>> uildProject(LifecycleModuleBuilder.java:81) >>> >>> at org.apache.maven.lifecycle.internal.builder.singlethreaded.S >>> ingleThreadedBuilder.build(SingleThreadedBuilder.java:51) >>> >>> at org.apache.maven.lifecycle.internal.LifecycleStarter.execute >>> (LifecycleStarter.java:128) >>> >>> at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:309) >>> >>> at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:194) >>> >>> at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:107) >>> >>> at org.apache.maven.cli.MavenCli.execute(MavenCli.java:993) >>> >>> at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:345) >>> >>> at org.apache.maven.cli.MavenCli.main(MavenCli.java:191) >>> >>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) >>> >>> at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce >>> ssorImpl.java:62) >>> >>> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe >>> thodAccessorImpl.java:43) >>> >>> at java.lang.reflect.Method.invoke(Method.java:498) >>> >>> at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnha >>> nced(Launcher.java:289) >>> >>> at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Lau >>> ncher.java:229) >>> >>> at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithEx >>> itCode(Launcher.java:415) >>> >>> at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launc >>> her.java:356) >>> >>> Caused by: org.apache.maven.plugin.compiler.CompilationFailureException: >>> Compilation failure >>> >>> at org.apache.maven.plugin.compiler.AbstractCompilerMojo.execut >>> e(AbstractCompilerMojo.java:972) >>> >>> at org.apache.maven.plugin.compiler.CompilerMojo.execute(Compil >>> erMojo.java:129) >>> >>> at org.apache.maven.plugin.DefaultBuildPluginManager.executeMoj >>> o(DefaultBuildPluginManager.java:134) >>> >>> at org.apache.maven.lifecycle.internal.MojoExecutor.execute(Moj >>> oExecutor.java:208) >>> >>> ... 20 more >>> >>> Any thoughts on what should be done to invoke API created through the >>> Android Application. And any comments are appreciated on what has gone >>> wrong here in step 4. >>> >>> >>> *Thanks and Best Regards,* >>> >>> *Isuru Uyanage* >>> *Software Engineer - QA | WSO2* >>> *Mobile : **+94 77 <+94%2077%20767%201807> 55 30752* >>> *LinkedIn: **https://www.linkedin.com/in/isuru-uyanage/ >>> <https://www.linkedin.com/in/isuru-uyanage/>* >>> >>> >>> >>> >>> _______________________________________________ >>> Dev mailing list >>> [email protected] >>> http://wso2.org/cgi-bin/mailman/listinfo/dev >>> >>> >> >> >> -- >> Thanks >> Abimaran Kugathasan >> Senior Software Engineer - API Technologies >> >> Email : [email protected] >> Mobile : +94 773922820 <+94%2077%20392%202820> >> >> <http://stackoverflow.com/users/515034> >> <http://lk.linkedin.com/in/abimaran> >> <http://www.lkabimaran.blogspot.com/> <https://github.com/abimarank> >> <https://twitter.com/abimaran> >> >> >> _______________________________________________ >> Dev mailing list >> [email protected] >> http://wso2.org/cgi-bin/mailman/listinfo/dev >> >> > > > -- > > *Krishan Wijesena* > Software Engineer | WSO2 > > Email : [email protected] > Mobile : +94776219923 <+94%2077%20621%209923> > WSO2 Inc : http://wso2.com > [image: http://wso2.com/signature] <http://wso2.com/signature> > > _______________________________________________ > Dev mailing list > [email protected] > http://wso2.org/cgi-bin/mailman/listinfo/dev > > -- Regards, *Viduranga Gunarathne* *Software Engineer Intern* *WSO2* Email : [email protected] Mobile : +94712437484 Web : http://wso2.com [image: https://wso2.com/signature] <https://wso2.com/signature>
_______________________________________________ Dev mailing list [email protected] http://wso2.org/cgi-bin/mailman/listinfo/dev
