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

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.

Related

"Ambiguous search mapping detected" thrown after adding Springfox 3.0.0 to SpringBoot

I have a SpringBoot application (spring-boot-starter-parent:2.4.0) and I want to use Swagger. I followed this Baeldung-Tutorial, and I am unfortunately getting this exception on startup:
org.springframework.context.ApplicationContextException: Failed to
start bean 'documentationPluginsBootstrapper'; nested exception is
java.lang.IllegalStateException: Ambiguous search mapping detected.
This is due to the fact that I am in some cases overloading methods in my repositories as follows:
Page<Message> findByConversationId(Long conversationId, Pageable pageable);
List<Message> findByConversationId(Long conversationId);
The exception says that both methods
are mapped to /findByConversationId! Tweak configuration to
get to unambiguous paths!
Is there any way to overcome this issue ?
Thank you !
This is not an answer to your problem but it might help you.
Consider using springdoc instead of Springfox. It is a newer library that is easier to use and way less error-prone than Springfox. We moved to it 2 years ago and we are very glad we did. There is very good documentation and tutorials online for it:
https://springdoc.org/
https://www.baeldung.com/spring-rest-openapi-documentation
It is also very active and you usually get your issues answered very fast on the github page.

Websphere 8.5.5.12 - Spring Boot not working

My spring boot applications working great on tomcat. But I need to deploy this in IBM Websphere 8.5.5.12 and there my troubles began.
I had referred to article and added the dependency 'spring-boot-starter-validation' to avoid the error:
Error activating Bean Validation integration Caused by:
java.lang.NoClassDefFoundError: javax/el/ELManager
But if I keep it, I receive another error
Error 500: org.springframework.web.util.NestedServletException:
Request processing failed; nested exception is
java.lang.ClassCastException: org.apache.el.ExpressionFactoryImpl
incompatible with javax.el.ExpressionFactory
Please note that on WAS, I have already ensured local class loading to load first over parent.
>
In the administrative console, click Applications > >Application Types > WebSphere enterprise applications > >application_name > Manage modules > webmodule_name.
Select Classes loaded with local class loader first (parent >last) from the drop down list.
Issue resolved!!!
After multiple attempts, I finally used and this fixed my issue:
compile(group: 'javax.el', name: 'javax.el-api', version: '3.0.0')
instead of below mentioned in article
compile(group: 'org.springframework.boot', name:
'spring-boot-starter-validation', version: '2.2.1.RELEASE')
End days for Websphere, I felt with the frustration of this issue!
Have you tried this on 8.5.5.16 . If I try it I am getting the same catch-22 situation.
if I have it there, I get ClassCastException , if I remove it I get NoClassDefFoundError

Work Performer Exception: org.apache.soap.transport.SOAPTransport while executing ComponentStep in ProcessConfiguration of IBM FileNet

While running component Step in ProcessConfiguration of workflows, facing below issue. This component includes web service calls. Added soap.jar file in the component but issue remains the same.
Work Performer Exception: org.apache.soap.transport.SOAPTransport
When verified in PCCE logs, I find as below.
CMDp.MAS678A PEPrimary2 [Error] CMExecute[12917].MASMEDOC01.XSHDC510_DS_30.AdapterOperations.Y988309 [UKE_IndexingSME:D5C52E6172F0284385411683A8496EAB:sub_local_ExecuteForAttachment:adaptorCall] FAILED.; Exception: java.lang.ClassNotFoundException: org.apache.soap.transport.SOAPTransport
at java.net.URLClassLoader.findClass(URLClassLoader.java:434)
at com.ibm.ws.bootstrap.ExtClassLoader.findClass(ExtClassLoader.java:240)
at java.lang.ClassLoader.loadClassHelper(ClassLoader.java:702)
at java.lang.ClassLoader.loadClass(ClassLoader.java:681)
at com.ibm.ws.bootstrap.ExtClassLoader.loadClass(ExtClassLoader.java:133)
at java.lang.ClassLoader.loadClass(ClassLoader.java:664)
at com.ibm.ws.classloader.ProtectionClassLoader.loadClass(ProtectionClassLoader.java:62)
at com.ibm.ws.classloader.ProtectionClassLoader.loadClass(ProtectionClassLoader.java:58)
at com.ibm.ws.classloader.CompoundClassLoader.loadClass(CompoundClassLoader.java:617)
at java.lang.ClassLoader.loadClass(ClassLoader.java:664)
Issue : Work Performer Exception: org.apache.soap.transport.SOAPTransport
Can someone help the reason for this issue??
try this
add the supporting jar as a content element within the code module
If 1 doesn't work, add the supporting jar to CPE Websphere library and restart the websphere

No SchemaFactory that implements the schema language specified by: http://www.w3.org/2001/XMLSchema could be loaded

When trying to expose a Service with Aegis databinding in CXF DOSGi I get this error in Java 8. In java 7 it works fine.
Caused by: java.lang.IllegalArgumentException: No SchemaFactory that implements the schema language specified by: http://www.w3.org/2001/XMLSchema could be loaded
at javax.xml.validation.SchemaFactory.newInstance(SchemaFactory.java:215)
at org.apache.cxf.aegis.type.XMLTypeCreator.(XMLTypeCreator.java:122)
See full stacktrace here
I think the reason is that the code does not see the impl class com.sun.org.apache.xerces.internal.jaxp.validation.XMLSchemaFactory.
Any ideas how to fix this?
Btw. the exception can be observed by running the CXF-DOSGi build in Java 8.
I still do not have found a real solution for this. For now I have committed a workaround on CXF master to ignore this exception in the static code. So the Aegis binding is not schema checked but at least works. See CXF-6959.
I would be happy about any hints to get this fully working again.

Getting error with Spring batch

I am getting below error when I am executing my Java application :
Exception in thread "main" org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: org.springframework.transaction.annotation.TransactionManagementConfigurationSelector was imported as a Configuration class but is not annotated with #Configuration nor does it declare any #Bean methods. Update the class to meet either of these requirements or do not attempt to import it.
Offending resource: class path resource [org/springframework/transaction/annotation/TransactionManagementConfigurationSelector.class]
at org.springframework.beans.factory.parsing.FailFastProblemReporter.error(FailFastProblemReporter.java:68)
at org.springframework.context.annotation.ConfigurationClassBeanDefinitionReader.doLoadBeanDefinitionForConfigurationClassIfNecessary(ConfigurationClassBeanDefinitionReader.java:153)
at org.springframework.context.annotation.ConfigurationClassBeanDefinitionReader.loadBeanDefinitionsForConfigurationClass(ConfigurationClassBeanDefinitionReader.java:120)
at org.springframework.context.annotation.ConfigurationClassBeanDefinitionReader.loadBeanDefinitions(ConfigurationClassBeanDefinitionReader.java:111)
at org.springframework.context.annotation.ConfigurationClassPostProcessor.processConfigBeanDefinitions(ConfigurationClassPostProcessor.java:188)
at org.springframework.context.annotation.ConfigurationClassPostProcessor.postProcessBeanDefinitionRegistry(ConfigurationClassPostProcessor.java:132)
at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:584)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:405)
at org.springframework.context.annotation.AnnotationConfigApplicationContext.<init>(AnnotationConfigApplicationContext.java:65)
at org.sbq.batch.mains.SchedulerRunner.<init>(SchedulerRunner.java:46)
at org.sbq.batch.mains.SchedulerRunner.main(SchedulerRunner.java:52)
I don't have any clue about this kind of exception. Please help.
I think you are mixing different versions of springbatch. Try downloading the latest version of all the jars and execute it.
Similar problem was posted by someone in the SpringSource Forum, in this link
Yes, using different versions of the spring and spring batch jars might produce 'offending resource' exception

Resources