I am trying to integrate swagger-springmvc 0.9.5 with SpringMVC 3.2 project with XML configuration.
My app-config.xml:
<beans xmlns="ht...
<context:annotation-config />
<mvc:annotation-driven>
<mvc:message-converters>
<bean id="messageConverter" class="org.springframework.http.converter.json.MappingJackson2HttpMessageConverter" />
</mvc:message-converters>
</mvc:annotation-driven>
<context:component-scan base-package="com.myapp.info.v1.rest.endpoint"/>
<bean class="com.mangofactory.swagger.configuration.SpringSwaggerConfig" />
</beans>
I get the following error:
java.lang.NullPointerException
com.mangofactory.swagger.models.property.field.FieldModelPropertyProvider.propertiesForSerialization(FieldModelPropertyProvider.java:54)
com.mangofactory.swagger.models.property.provider.DefaultModelPropertiesProvider.propertiesForSerialization(DefaultModelPropertiesProvider.java:31)
com.mangofactory.swagger.models.DefaultModelProvider.properties(DefaultModelProvider.java:104)
com.mangofactory.swagger.models.DefaultModelProvider.modelFor(DefaultModelProvider.java:54)
com.mangofactory.swagger.readers.ApiModelReader.execute(ApiModelReader.java:70)
com.mangofactory.swagger.readers.ApiModelReader.execute(ApiModelReader.java:38)
com.mangofactory.swagger.core.CommandExecutor.execute(CommandExecutor.java:13)
com.mangofactory.swagger.scanners.ApiListingScanner.scan(ApiListingScanner.java:98)
com.mangofactory.swagger.core.SwaggerApiResourceListing.initialize(SwaggerApiResourceListing.java:72)
com.mangofactory.swagger.plugin.SwaggerSpringMvcPlugin.initialize(SwaggerSpringMvcPlugin.java:427)
...
I started to debug, and realized the following:
- objectMapper is null
- setObjectMapper is never called
- setup() is never called, although it has @PostConstruct annotation.
I found three posts with the same error but none of them seem relevant. Am I forgetting something? I am new to SpringMVC framework.
Sidenote: I also experimented with swagger-springmvc 0.6.6 and managed to get it work.
Aucun commentaire:
Enregistrer un commentaire