Swagger UI configuration via Apache CXF's Swagger2Feature - cxf

I use the Swagger2Feature in Apache CXF to provide Swagger documentation for our API. Swagger UI is provided as a Maven dependency via WebJars.
I would like to configure some Swagger UI properties (as documented here), for example validatiorUrl. Is this possible to accomplish when using the combination of WebJars / CXF? I can't find a way to configure these settings "at runtime".
I'm using CXF 3.2.1 and Swagger UI 3.17.1.

Related

Cannot find the right camel-cxf dependencies for v3.18.0, e.g. CxfHeaderFilterStrategy, CxfOperationException

My application has been using
org.apache.camel.component.cxf.common.header.CxfHeaderFilterStrategy
org.apache.camel.spi.HeaderFilterStrategy.Direction
org.apache.camel.component.cxf.CxfOperationException
defined by camel-cxf. But my build fails when using Camel 3.18.0. What dependencies changes do I need for these classes in 3.18.0?
Copying from the Camel 3.18 upgrade guide:
https://camel.apache.org/manual/camel-3x-upgrade-guide-3_18.html#_camel_cxf
The camel-cxf JAR has been split up into SOAP vs REST and Spring and non Spring JARs.
camel-cxf-soap
camel-cxf-spring-soap
camel-cxf-rest
camel-cxf-spring-rest
camel-cxf-transport
camel-cxf-spring-transport
When using Spring Boot then you need to migrate from camel-cxf-starter to use SOAP or REST:
camel-cxf-soap-starter
camel-cxf-rest-starter

Exception in FluentProducerTemplate in Apache Camel after upgrade to 3.7.2

I've the following dependency to 3.7.2:
<groupId>org.apache.camel.springboot</groupId>
<artifactId>camel-spring-boot-dependencies</artifactId>
<version>3.7.2</version>
I've this in the code:
fluentProducerTemplate.to("direct:myenpoint");
fluentProducerTemplate.send();
This code was working until the upgrade, but now it throws:
java.lang.IllegalArgumentException: No endpoint configured on FluentProducerTemplate. You can configure an endpoint with to(uri)`
Now I'm not able to figure why it's complaining about configuring endpoint as endpoint is clearly set in to(endpoint) call. I couldn't find anything in their documentation.
It's a fluent builder, so you should use it in a style like this:
template.to("xxx").send()
I found that endpoint has to be set at fluentProducerTemplate.setDefaultEndpoint(startingEndpoint);
The error message was misleading. And, I am not sure why to (endpoint) is still there.

Can not find my project settings in Sublime/Mavensmate

I am using MavensMate Build 3124, which requires a separate MevensMate app in combination with Salesforce. I can now no longer find my project settings, meaning I can not refresh from my Salesforce server using API 38.0. This keeps resetting my package.xml to v37.0. I have set my Global Settings to use API v38.
Where can I find my project settings so that I can refesh using API 38?
look for the following file in your repository:
[your-project-name].sublime-project
add the following
{
"mm_api_version" : 38.0
}

Using blueprint as the Apache Camel DSL to describe routes in IBM Liberty

My goal is to get Camel running under IBM Liberty application server using OSGi and be able to describe the DSL (Domain Specific Language) routes in Blueprint. I am making progress and now have a Liberty environment with Camel installed and configured as OSGi bundles. When I write a Java DSL Camel app as an OSGi bundle, all works exactly as I might hope.
My last step is to be able to describe my camel routes in Blueprint. To that end I create a new OSGi bundle and defined a blueprint.xml that looks as follows:
<?xml version="1.0" encoding="UTF-8"?>
<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:camelBlueprint="http://camel.apache.org/schema/blueprint"
xsi:schemaLocation="http://camel.apache.org/schema/blueprint http://camel.apache.org/schema/blueprint/camel-blueprint-2.14.1.xsd">
<camelBlueprint:camelContext>
<camelBlueprint:route>
<camelBlueprint:from uri="file:c:/temp/in"/>
<camelBlueprint:to uri="file:c:/temp/out"/>
</camelBlueprint:route>
</camelBlueprint:camelContext>
</blueprint>
When I attempt to deploy this OSGi bundle, the IBM Liberty OSGi framework fails to deploy the application with the following errors:
[3/2/15 0:42:38:796 CST] 00000035 com.ibm.ws.app.manager.esa.internal.DeploySubsystemAction
A CWWKZ0403E: A management exception was generated when trying to install the application Camel1 into an OSGi framework. The error text from the OSGi framework is:
Resource does not exist: org.apache.aries.subsystem.core.archive.SubsystemContentRequirement:
namespace=osgi.identity, attributes={}, directives={filter=(&(osgi.identity=OSGITest1)(type=osgi.bundle)(version>=1.0.0))}, resource=org.apache.aries.subsystem.core.internal.SubsystemResource#7bc2d3bc
Unfortunately this is where I am now stumped and stuck. I believe that IBM Liberty uses Equinox as the OSGi platform and not Karaf but reading the Camel Blueprint docs I seem to understand that Apache Aries is required (which Liberty supplies and uses) and that Karaf isn't a dependency.
My MANIFEST.MF for my test bundle is:
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: OSGITest1
Bundle-SymbolicName: OSGITest1
Bundle-Version: 1.0.0.qualifier
Bundle-Blueprint: OSGI-INF/blueprint/*.xml
Bundle-RequiredExecutionEnvironment: JavaSE-1.7
Export-Package: kolban.osgitest
Import-Package: org.apache.camel;version="2.14.1",
org.apache.camel.blueprint;version="2.14.1"
this message can occur if the resolver can't see the bundle, or there's something wrong with the bundle (typically with the Blueprint). If the bundle resolves ok when you remove the blueprint, then you need to look at what might be wrong in the blueprint. If this is the case, I would suspect you don't have the Camel blueprint namespace handler enabled in the runtime.
I hope this helps.
Regards, Graham.

Getting problems in adding cutom JAAS Login module in Servicemix

I am using Servicemix 4.2 for my osgi based webservice application.
My webservice application is exposed using the CXF stack provided with the Servicemix.
Now we have to integrate the application with a separately developed Authentication api. The third party api is using JAAS as the mean to authenticate.
I embedded the third party jars in my application bundle. I exported the LoginModule implementation class using export-package instruction.
When I tried to use the third party provided jaas module, it gave error
Cannot create Login Context.No LoginModules configured for LoginModule
The third party jaas provider finds the location of jaas.config file using the system property
java.security.auth.login.config
The content of jaas.config file is as follows
LoginModule {
com.altair.aaservice.windowsauthn.hwec.WindowsAuthentication required;
};
After doing googling, I found that servicemix out of box provides two System bundles for jaas
Apache Felix Karaf :: JAAS Modules (1.4.0)
Apache Felix Karaf :: JAAS Config (1.4.0)
And you need to modify etc/users.properties file and some other things to implement jaas. But as we need to integrate with a third party jaas provider, i can not look into these ways. Also most of the documentation provided with servicemix insist you to use the servicemix way to implement jaas hence I did not get much success in finding any solution.
I manually uninstalled the two system bundles, after that I got following error
javax.security.auth.login.LoginException: unable to find LoginModule class: com.altair.aaservice.windowsauthn.hwec.WindowsAuthentication not found from bundle [org.apache.cxf.bundle]
As my webservice is CXF based, it may be looking in this bundle.
Is there any convenient way to integrate servicemix with custom jaas implementation. Please tell if there is any.
There is an example of writing a custom JAAS LoginModule here.

Resources