swagger-java with multiple wars returns no content

2016-12-05 Thread Marvin
Hi,

I'm working with multiple wars which are running in a tomcat. In each
application I defined some rest interfaces and use a servlet (each servlet
has it's own unique name). I also configured swagger in each application.

Now I have the problem that swagger works with one application only. If I
deploy another war swagger doesn't work anymore. If I call the api-docs I
get an empty response (http 204). 

Currently I'm working with camel version 2.18.1 and I'm using camel-core as
shared library due to vm component (maybe this could be helpful). With
camel-swagger (2.15.2) it worked fine.

Following my configuration (similar in each application):

*web.xml*:


Camel Http Transport Servlet
TestCamelServlet

org.apache.camel.component.servlet.CamelHttpTransportServlet
1



TestCamelServlet
/rest/*



   
ApiDeclarationServlet

org.apache.camel.swagger.servlet.RestSwaggerServlet


base.path
rest


api.path
api-docs


api.version
1.0


api.title
Test API


api.description
Test Description

2



ApiDeclarationServlet
/api-docs/*



RestSwaggerCorsFilter
  
org.apache.camel.swagger.servlet.RestSwaggerCorsFilter

  

RestSwaggerCorsFilter
/api-docs/*
/rest/*


*restConfiguration*:
restConfiguration().component("servlet")
.endpointProperty("servletName", "TestCamelServlet")
.dataFormatProperty("prettyPrint", "true")
.bindingMode(RestBindingMode.auto)
.contextPath("test-api/rest");

Does anyone have an idea how I can solve this?

BR
Marvin



--
View this message in context: 
http://camel.465427.n5.nabble.com/swagger-java-with-multiple-wars-returns-no-content-tp5791067.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: camel 2.18.0 VM problem after update

2016-11-02 Thread Marvin
Hi,

I cloned the repository and tried to build it with maven, but unfortunately
I got errors within the camel-soap component:

\camel-soap\target\generated\src\test\java\com\example\soapheaders\SampleEnumType.java:[4,3]
error: unmappable character for encoding UTF-8
\camel-soap\target\generated\src\test\java\com\example\soapheaders\SampleEnumType.java:[17,19]
error: unmappable character for encoding UTF-8
\camel-soap\target\generated\src\test\java\com\example\contact\ContactType.java:[4,3]
error: unmappable character for encoding UTF-8
...





--
View this message in context: 
http://camel.465427.n5.nabble.com/camel-2-18-0-VM-problem-after-update-tp5789519p5789636.html
Sent from the Camel - Users mailing list archive at Nabble.com.


camel 2.18.0 VM problem after update

2016-10-31 Thread Marvin
I updated my camel version from 2.15.2 to 2.18.0. I'm using the vm component
to send messages through different contexts. 

After the update I got following exception:

o.a.c.c.v.VmConsumer | Error processing exchange. Exchange[]. Caused by:
[java.lang.NullPointerException - null]
java.lang.NullPointerException: null
at
org.apache.camel.util.ExchangeHelper.isStreamCachingEnabled(ExchangeHelper.java:657)
at
org.apache.camel.converter.stream.OutputStreamBuilder.(OutputStreamBuilder.java:38)
at
org.apache.camel.converter.stream.OutputStreamBuilder.withExchange(OutputStreamBuilder.java:55)
at
org.apache.camel.processor.MarshalProcessor.process(MarshalProcessor.java:58)
at
org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:77)

I've found out that the problem the corresponding context to which the
exchange is set to is. It's using the route id of my vm enpoint and trying
to get the route out of the original context of the exchange. But it cannot
find the route because it isn't defined in the original context of the
exchange. 

With the version 2.15.2 it's working fine.  

Does anyone have an idea how I can fix this?

Thanks

Marvin



--
View this message in context: 
http://camel.465427.n5.nabble.com/camel-2-18-0-VM-problem-after-update-tp5789519.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Reuse a rote...

2015-09-09 Thread Marvin Froeder
Hey guys,

I have a bunch of routes very similar:

> from("direct:repo")
> .setHeader(HttpHeaders.AUTHORIZATION).constant("Basic XXX")
> .convertBodyTo(String.class, UTF_8.name())

... more steps
> .to("http4://{{service.url}}")
> .setHeader("repo", body());



from("direct:art")
> .setHeader(HttpHeaders.AUTHORIZATION).constant("Basic XXX")
> .convertBodyTo(String.class, UTF_8.name())
>
... same extra steps

.to("http4://{{service.url}}")
> .setHeader("art", body());


They are very similar... and there are more.  The difference is this header
on the last line

I wonder if there is a better way to reuse this routes...

Would be nice if I could consolidate both into a direct:store
And then just call as direct:store?value=repo or direct:store?value=art

Them on setHeader(uri("value"), body());

Is there anything like this available?