CXF 3.0.0 raises org.apache.cxf.BusException: No DestinationFactory was found for the namespace http://schemas.xmlsoap.org/soap/http - spring

Working with CXF-STS I came across exceptions as <<||2014-07-14 21:51:14,125||http-apr-8080-exec-8|DEBUG|org.apache.ws.security.processor.Signat‌​ureProcessor:428||||>> XML Signature verification has failed <<||2014-07-14 21:51:14,127||http-apr-8080-exec-8|DEBUG|org.apache.ws.security.processor.Signat‌​ureProcessor:431||||>> Signature Validation check: false
As discussed at post, CXF STS Usernametoken symmetric binding XML Signature verification has failed
https://issues.apache.org/jira/browse/CXF-5679
https://issues.apache.org/jira/browse/CXF-5679
So assuming it was fixed for version 3.0.0 I moved to it. Now on start up I am facing the error as
... 25 more
Caused by: org.apache.cxf.service.factory.ServiceConstructionException
at org.apache.cxf.frontend.ServerFactoryBean.create(ServerFactoryBean.java:176)
at org.apache.cxf.jaxws.JaxWsServerFactoryBean.create(JaxWsServerFactoryBean.java:211)
at org.apache.cxf.jaxws.EndpointImpl.getServer(EndpointImpl.java:456)
at org.apache.cxf.jaxws.EndpointImpl.doPublish(EndpointImpl.java:334)
... 34 more
Caused by: org.apache.cxf.BusException: No DestinationFactory was found for the namespace http://schemas.xmlsoap.org/soap/http.
at org.apache.cxf.bus.managers.DestinationFactoryManagerImpl.getDestinationFactory(DestinationFactoryManagerImpl.java:122)
at org.apache.cxf.endpoint.ServerImpl.initDestination(ServerImpl.java:88)
at org.apache.cxf.endpoint.ServerImpl.<init>(ServerImpl.java:72)
at org.apache.cxf.frontend.ServerFactoryBean.create(ServerFactoryBean.java:160)
I am unable to figure out how can I really work with CXF STS example. Please provide some good example references to work with CXF STS in UsernameToken with Encryption Scenario
Thanks

This was becuase my project was having CAMEL-CXF dependencies which contain CXF 2.7 as embedded. It might have created the conflicts with new CXF 3.0.0 version. So removing them from classpath resolved the problem
Thanks

Related

Upgrading to Springboot 3: 'org.springframework.hateoas.server.LinkRelationProvider' that could not be found

I am upgrading my springboot app from 2.7.x to 3.0.0, I have made required changes for jakartaEE. When starting my app I am getting the below error
{"#timestamp":"2023-01-03T15:28:01.149Z","#version":"1","message":"\r\n\r\n***************************\r\nAPPLICATION
FAILED TO
START\r\n***************************\r\n\r\nDescription:\r\n\r\nParameter
1 of method collectionModelContentConverter in
org.springdoc.core.configuration.SpringDocHateoasConfiguration
required a bean of type
'org.springframework.hateoas.server.LinkRelationProvider' that could
not be found.\r\n\r\n\r\nAction:\r\n\r\nConsider defining a bean of
type 'org.springframework.hateoas.server.LinkRelationProvider' in your
configuration.\r\n","logger_name":"org.springframework.boot.diagnostics.LoggingFailureAnalysisReporter","thread_name":"main","level":"ERROR","level_value":40000}
I am using hateos lib for representation in my app, Also I am using springdoc-openapi-starter-webmvc-ui for swagger UI.
When I disable configuration for api-docs springdoc.api-docs.enabled=false the above error go away but my swagger page is also gone, which definitely means this is not the solution.
Could someone please guide me why this bean is not getting found with springboot 3 while it was all working before with springboot2.7.x and java-11.
here is my pom.xml https://gist.github.com/bruce2019/c93a16dc20f7edb7d922b1e284f39d15
Thanks in advance
You can use springdoc-openapi-starter-webmvc-ui with 2.0.2 version
Add "/v3/api-docs/**" to mvcMatchers in WebSecurityCustomizer

How to use Jersey in Sling?

I've got Sling 8. I then include Jersey and this Jersey connector in my build: https://github.com/hstaudacher/osgi-jax-rs-connector
My next step should be simply write a Jersey Service and test it, but I'm getting this Exception immediately:
27.01.2017 10:54:16.696 *ERROR* [FelixDispatchQueue] com.eclipsesource.jaxrs.publisher FrameworkEvent ERROR (org.osgi.framework.ServiceException: Service factory returned null.)org.osgi.framework.ServiceException: Service factory returned null.
and
[FelixDispatchQueue] com.eclipsesource.jaxrs.publisher FrameworkEvent ERROR (org.osgi.framework.ServiceException: Service factory exception: org/apache/felix/shell/Command)
org.osgi.framework.ServiceException: Service factory exception: org/apache/felix/shell/Command
and
Caused by: java.lang.NoClassDefFoundError: org/apache/felix/shell/Command
So I look at my bundles list in Felix, and I don't see any bundle that appears to provide this... So I find it online and install it myself. Now I get this exception:
Service factory exception: org/apache/sling/extensions/threaddump/internal/ThreadDumpCommand
and
Caused by: java.lang.NoClassDefFoundError: org/apache/sling/extensions/threaddump/internal/ThreadDumpCommand
and
Caused by: java.lang.NoClassDefFoundError: org/apache/felix/webconsole/plugins/memoryusage/internal/MemoryUsageCommand
Now, I DO have a bundle installed with this class (it's "Apache Felix Web Console Memory Usage Plugin"). So now I really don't understand what the heck is going on.
I have a feeling that I'm not supposed to be providing my own "felix shell" bundle and that the OSGI in Sling is failing to provide it...
Is anybody successfully using Sling 8 and Jersey?
Maybe you should try with just a vanilla OSGi environment for starters. Once you have Jersey working then you can try integrating with Sling.
I have had success with jaxrs in OSGi, specifically using the Amdatu REST bundles.
https://amdatu.org/application/tutorial/step1/
With this I was able to use JAX-RS annotations to serve HTTP services:
https://github.com/figurate/figurate-core/blob/master/modules/figurate-osgi/src/main/groovy/org/figurate/osgi/http/ServiceInfo.groovy
You can see the bundles I used here:
https://github.com/figurate/figurate-core/blob/master/modules/figurate-osgi/src/test/resources/config/HttpVersionSpec.config

stomp-chat web socket with embedded tomcat reactor error - type reactor.tuple.Tuple not found

I am having problems getting web socket subscriptions to work properly using Spring with an embedded Tomcat server.
When running this stomp-chat application I get the following error:
org.springframework.messaging.MessageHandlingException: Expression evaluation failed: #chatRoomSessions[headers.simpDestination].add(T(reactor.tuple.Tuple).of(headers.simpSessionId, headers.simpSubscriptionId));
nested exception is org.springframework.expression.spel.SpelEvaluationException: EL1005E:(pos 58): Type cannot be found 'reactor.tuple.Tuple'
I tried to add the following dependency:
compile ("io.projectreactor:reactor-stream:$reactorVersion")
but it gave the same error. Any help would be appreciated.
OK. I see the problem.
The dependency for the io.projectreactor:reactor-stream:2.0.8 isn't enough.
The Tuple class has been moved to the new reactor.fn.tuple package.
So, you still have to fix all the reactor.tuple.Tuple mentioning in the stomp-server.xml to the new reactor.fn.tuple.Tuple.
The sample will be fixed soon: https://github.com/spring-projects/spring-integration-samples/issues/185
Sorry for inconvenience.

spring-test, groovy library and qualifier tag incompatibility

Im trying to add some groovy scripts to existing project and I stuck with making integration tests work.
I have few beans marked with <qualifier /> tag, that are used for autowiring both in test and in production code.
Right after I add 'org.codehaus.groovy:groovy-all:2.4.0'
(tried other versions aswell) to dependencies, without even any groovy usage, my integration tests stop working, with exception:
SEVERE: Caught exception while allowing TestExecutionListener [org.springframework.test.context.support.DependencyInjectionTestExecutionListener#5e5f7983] to prepare test instance [com.dph.groovy.vs.springtest.IntegrationTest#299c9fe7]
java.lang.IllegalStateException: Failed to load ApplicationContext
at org.springframework.test.context.DefaultCacheAwareContextLoaderDelegate.loadContext(DefaultCacheAwareContextLoaderDelegate.java:94)
at org.springframework.test.context.DefaultTestContext.getApplicationContext(DefaultTestContext.java:72)
at org.springframework.test.context.support.DependencyInjectionTestExecutionListener.injectDependencies(DependencyInjectionTestExecutionListener.java:117)
at org.springframework.test.context.support.DependencyInjectionTestExecutionListener.prepareTestInstance(DependencyInjectionTestExecutionListener.java:83)
at
......
Caused by: org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: Unexpected failure during bean definition parsing
Offending resource: class path resource [spring/app-config.xml]
Bean 'service'; nested exception is org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: Tag 'qualifier' must have a 'type' attribute
Offending resource: class path resource [spring/app-config.xml]
Bean 'service'
at org.springframework.beans.factory.parsing.FailFastProblemReporter.error(FailFastProblemReporter.java:70)
at org.springframework.beans.factory.parsing.ReaderContext.error(ReaderContext.java:85)
at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.error(BeanDefinitionParserDelegate.java:323)
Runnning project (with jetty 6 if this matters) doesnt cause any issues though, so I assume there's some trick with spring-test union with groovy.
I might just add 'type' to my qualifiers, however it doesnt solve problem, because I have external dependencies with same qualifier tags configuration, besides this attribute is optional as far as I know.
I'd love to find out at least what are roots of this problem.
I created example project to reproduce the described question and will appreciate any ideas:
https://github.com/ametiste/groovy-vs-spring-test
You have discovered a bug in Spring's testing support.
Fixed in Spring Framework 4.1.6 and 4.2 RC1
I have fixed this bug for Spring Framework 4.1.6 (scheduled for release at the end of March 2015) and 4.2 (scheduled for release in Q3 2015). For further details, please see JIRA issue SPR-12768.
If you wish to try out the fix before the aforementioned releases, consider building against one of the upcoming nightly snapshots.
Temporary Work-around
In the meantime, (for XML configuration files that you are permitted to edit) you can circumvent this bug by explicitly setting the type attribute in the <qualifier> tag to the intended default value which is "org.springframework.beans.factory.annotation.Qualifier". See the following XML config for an example.
<bean id="foo" class="java.lang.String" c:_="bar">
<qualifier value="foo" type="org.springframework.beans.factory.annotation.Qualifier" />
</bean>
Regards,
Sam
(author of the Spring TestContext Framework)

IBM Websphere: Getting error for Spring AOP

I am getting following error while booting up the server. Application has Spring as well as AspectJ classes in it.
Caused by: java.lang.VerifyError: JVMVRFY013 class loading constraint violated; class=org/springframework/aop/aspectj/MethodInvocationProceedingJoinPoint, method=getSourceLocation()Lorg/aspectj/lang/reflect/SourceLocation;, pc=0
at java.lang.J9VMInternals.verifyImpl(Native Method)
at java.lang.J9VMInternals.verify(J9VMInternals.java:93)
at java.lang.J9VMInternals.initialize(J9VMInternals.java:170)
at org.springframework.aop.aspectj.AbstractAspectJAdvice.currentJoinPoint(AbstractAspectJAdvice.java:83)
As a first pass I gave PARENT_FIRST option for Enterprise Application
Well, I'll write it here again as my first reply was deleted without any explanation though it was the correct one.
Given the exception you encounter you're likely at WAS 8.5.5.0. There's a known issue documented under APAR PM90932 about this. An ifix has been publisehd for this issue and you can read about it and download it from here. Once the ifix is installed, the issue won't appear again.

Resources