0

It looks, from the source code, that Katharsis-spring module will only work with spring boot.

My question then, is it possible to configure a spring project in xml and load Katharsis without spring boot?

If so, how would you need to configure katharsis in spring xml?

Has anyone done this before and willing to share an example?

Thanks.

JoshR
  • 1
  • 1

2 Answers2

0

Only work with Spring boot? That doesn't seem possible. Just @Import(KatharsisConfigV2.class) on any configuration in your code and it should work.

As for xml config: By design, if it can be done in code it can be done in config.

Try that and let me know how you make out

Christian Bongiorno
  • 5,150
  • 3
  • 38
  • 76
  • On the surface it does seem like that would be the case, but there are few things that spring boot does that doesn't seem to work when you go the xml route. After much trail and error I did get this up and running in a pure spring xml configuration. I will post my answer later. Thanks for your response. – JoshR Dec 01 '16 at 20:35
0

With version 2.8.1 of katharsis, it is quite a challege to get this configured just in xml. So I looked at the master branch of the project and found that there are going to be some new features which will make it easier to configure with spring xml. I have created a sample project here you can use as reference for configuration:

Sample Spring/Katharsis Project with XML configuration

In the sample project I added the SpringServiceDiscovery class, and modified the KatharsisBoot class to make the configuration easier. With the next release of this project, I should be able to remove these 2 classes completely, and use the classes that come with katharsis.

The beans I needed to add to my root-context.xml file were the following:

io.katharsis.spring.KatharsisFilterV2
io.katharsis.spring.ErrorHandlerFilter
com.springkatharsisxml.katharsis.boot.KatharsisBoot
io.katharsis.queryParams.QueryParamsBuilder
io.katharsis.resource.registry.ConstantServiceUrlProvider
io.katharsis.queryParams.DefaultQueryParamsParser
io.katharsis.module.CoreModule
io.katharsis.resource.field.ResourceFieldNameTransformer
io.katharsis.spring.boot.KatharsisSpringBootProperties

I also needed to expose the jackson objectMapper bean, as it's not done so by default in xml.

I also used the org.springframework.web.filter.DelegatingFilterProxy for the katharsisFilter and errorHandlerFilter.

JoshR
  • 1
  • 1