isis-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dan Haywood <...@haywood-associates.co.uk>
Subject Re: Simpleapp 12.0.1. - Swagger not working when packaging war and deploying to Tomcat
Date Mon, 16 May 2016 23:10:14 GMT
Ah, I remember this issue.

It turns out that it does work, so long as you deploy the webapp as
ROOT.war.

The issue is the path to the swaggerService does not resolve correctly when
running as anything other than the root app.

I did manage to figure out the hacks though if you really do want to deploy
under "simpleapp":

1. in swagger-ui/index.html, add in "/simpleapp" to the paths for the
input_baseUrl selector:

                <select id="input_baseUrl" name="baseUrl" style="height:
26px;">
                    <option id="private" label="private"
value="/simpleapp/restful/swagger/private"/>
                    <option id="public" label="public"
value="/simpleapp/restful/swagger/public"/>
                    <option id="prototyping" label="prototyping"
value="/simpleapp/restful/swagger/prototyping"/>
                </select>

2. in web.xml, allow access through to that path:


        <filter-name>IsisSessionFilterForRestfulObjects</filter-name>
        ...
        <init-param>
            <param-name>passThru</param-name>
            <param-value>/simpleapp/restful/swagger</param-value>
        </init-param>


Less than ideal, but it is *only* a developer tool, so perhaps sufficient?
Maybe just an update to the docs will suffice?


Cheers
Dan









On 16 May 2016 at 10:17, Dan Haywood <dan@haywood-associates.co.uk> wrote:

> Ok, thanks for reporting, I'll take a look hopefully this evening.
>
> Dan.
> On 16 May 2016 10:02 am, "Vladimir Nišević" <vnisevic@gmail.com> wrote:
>
> Based on discussion in https://issues.apache.org/jira/browse/ISIS-1358 I
> think I've found an issue, but I cannot create new JIRA issue any more -
> seems the issue creation policy has been changed, so I am sending the issue
> on this way.
>
> *Steps to reproduce:*
>
> 1. Create archetype as described in guide
> *mvn archetype:generate \*
> *-D archetypeGroupId=org.apache.isis.archetype \*
> *-D archetypeArtifactId=simpleapp-archetype \*
> *-D archetypeVersion=1.12.1 \*
> *-D groupId=com.mycompany \*
> *-D artifactId=myapp \*
> *-D version=1.0-SNAPSHOT \*
> *-B*
>
> 2. execute "*mvn clean package"*
>
> 3. deploy simpleapp.war to external tomcat, eg. thru tomcat manager webapp
> and call swagger WebUI*
> http://localhost:8080/simpleapp/swagger-ui/index.html
> <http://localhost:8080/simpleapp/swagger-ui/index.html> *
>
> *Error*: Can't read swagger JSON from
> http://localhost:8080/restful/swagger/public
>
> It seems that the service
> org.apache.isis.core.metamodel.services.swagger.SwaggerServiceDefault is
> not recognized.
>
> [image: Inline-Bild 2]
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message