I am using camel-rabbitmq component to communicate rabbitMQ via SSL.
As per rabbitMQ component document to enable SSL only sslProtocal parameter is enough. By default JVM SSLcontext will be loaded and validate server certificate based on /lib/security/cacerts file (or) JVM arguments.
Detailed info present in this link :- https://docs.oracle.com/javase/6/docs/technotes/guides/security/jsse/JSSERefGuide.html#CustomizingStores
I supplied key store files in JVM arguments , started below blueprint file and I got below error;
BluePrint.xml
<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0">
<bean id="customConnectionFactory" class="com.rabbitmq.client.ConnectionFactory">
<property name="host" value="127.0.0.1"/>
<property name="port" value="5671"/>
<property name="username" value="admin"/>
<property name="password" value="admin"/>
</bean>
<camelContext xmlns="http://camel.apache.org/schema/blueprint">
<route>
<from uri="rabbitmq://rmqEx?queue=queue&routingKey=rmqRoutekey&sslProtocol=TLSv1.2"/>
<to uri="log:msgdestroy"/>
</route>
</camelContext>
</blueprint>
Error log :-
2018-05-27T00:38:11,569 | INFO | Camel (camel-1) thread #1 - RabbitMQConsumer | RabbitConsumer | 58 - org.apache.camel.camel-rabbitmq - 2.21.0 | Attempting to open a new rabbitMQ channel
2018-05-27T00:38:11,583 | INFO | Camel (camel-1) thread #1 - RabbitMQConsumer | RabbitMQConsumer | 56 - org.apache.camel.camel-core - 2.21.0 | Connection failed, will retry in 5000ms
java.io.IOException: null
at com.rabbitmq.client.impl.AMQChannel.wrap(AMQChannel.java:126) [53:com.rabbitmq.client:5.1.2]
at com.rabbitmq.client.impl.AMQChannel.wrap(AMQChannel.java:122) [53:com.rabbitmq.client:5.1.2]
at com.rabbitmq.client.impl.AMQConnection.start(AMQConnection.java:362) [53:com.rabbitmq.client:5.1.2]
at com.rabbitmq.client.impl.recovery.RecoveryAwareAMQConnectionFactory.newConnection(RecoveryAwareAMQConnectionFactory.java:64) [53:com.rabbitmq.client:5.1.2]
at com.rabbitmq.client.impl.recovery.AutorecoveringConnection.init(AutorecoveringConnection.java:99) [53:com.rabbitmq.client:5.1.2]
at com.rabbitmq.client.ConnectionFactory.newConnection(ConnectionFactory.java:948) [53:com.rabbitmq.client:5.1.2]
at com.rabbitmq.client.ConnectionFactory.newConnection(ConnectionFactory.java:907) [53:com.rabbitmq.client:5.1.2]
at com.rabbitmq.client.ConnectionFactory.newConnection(ConnectionFactory.java:865) [53:com.rabbitmq.client:5.1.2]
at com.rabbitmq.client.ConnectionFactory.newConnection(ConnectionFactory.java:1049) [53:com.rabbitmq.client:5.1.2]
at org.apache.camel.component.rabbitmq.RabbitMQEndpoint.connect(RabbitMQEndpoint.java:228) [58:org.apache.camel.camel-rabbitmq:2.21.0]
at org.apache.camel.component.rabbitmq.RabbitMQConsumer.openConnection(RabbitMQConsumer.java:64) [58:org.apache.camel.camel-rabbitmq:2.21.0]
at org.apache.camel.component.rabbitmq.RabbitMQConsumer.getConnection(RabbitMQConsumer.java:75) [58:org.apache.camel.camel-rabbitmq:2.21.0]
at org.apache.camel.component.rabbitmq.RabbitConsumer.reconnect(RabbitConsumer.java:307) [58:org.apache.camel.camel-rabbitmq:2.21.0]
at org.apache.camel.component.rabbitmq.RabbitMQConsumer$StartConsumerCallable.call(RabbitMQConsumer.java:216) [58:org.apache.camel.camel-rabbitmq:2.21.0]
at org.apache.camel.component.rabbitmq.RabbitMQConsumer$StartConsumerCallable.call(RabbitMQConsumer.java:196) [58:org.apache.camel.camel-rabbitmq:2.21.0]
at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:?]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:?]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:?]
at java.lang.Thread.run(Thread.java:748) [?:?]
Caused by: com.rabbitmq.client.ShutdownSignalException: connection error
at com.rabbitmq.utility.ValueOrException.getValue(ValueOrException.java:66) ~[53:com.rabbitmq.client:5.1.2]
at com.rabbitmq.utility.BlockingValueOrException.uninterruptibleGetValue(BlockingValueOrException.java:36) ~[53:com.rabbitmq.client:5.1.2]
at com.rabbitmq.client.impl.AMQChannel$BlockingRpcContinuation.getReply(AMQChannel.java:494) ~[53:com.rabbitmq.client:5.1.2]
at com.rabbitmq.client.impl.AMQConnection.start(AMQConnection.java:306) ~[53:com.rabbitmq.client:5.1.2]
... 16 more
Caused by: java.io.EOFException
at java.io.DataInputStream.readUnsignedByte(DataInputStream.java:290) ~[?:?]
at com.rabbitmq.client.impl.Frame.readFrom(Frame.java:91) ~[53:com.rabbitmq.client:5.1.2]
at com.rabbitmq.client.impl.SocketFrameHandler.readFrame(SocketFrameHandler.java:164) ~[53:com.rabbitmq.client:5.1.2]
at com.rabbitmq.client.impl.AMQConnection$MainLoop.run(AMQConnection.java:580) ~[53:com.rabbitmq.client:5.1.2]
... 1 more
There is one more parameter to configure "TrustManger" . Trust manager is bounded by SSLContext, so we cant bound SSLcontext under Trust manger. In camel-rabbitmq component there is no "SSLContext" parameter to hold it.
http://camel.apache.org/camel-configuration-utilities.html
Please let me know how to fix this connectivity issue.
If you refer above "blueprint.xml" file I am using new version of rabbitmq syntax; I need to create connection factory bean and load necessary parameters .
This connection factory class by default will be auto detected by camel-rabbitMQ component.
Refer below code :-
https://github.com/apache/camel/blob/master/components/camel-rabbitmq/src/main/java/org/apache/camel/component/rabbitmq/RabbitMQComponent.java#L171
Here is the catch point;
The new syntax is not allowing sslProtocol to set as "TRUE/TLS/SSLv3" simply ignoring query commands.
https://github.com/apache/camel/blob/master/components/camel-rabbitmq/src/main/java/org/apache/camel/component/rabbitmq/RabbitMQConnectionFactorySupport.java#L40
To communicate RMQ through SSL we need to create SSLContext since sslProtocol is not being assigned properly the entire logic skipped and force connection to communicate in PLAN TCP mode.
To solve this issue ; We need to revert to old Syntax like below;
Updated blueprint file:-
<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0">
<camelContext xmlns="http://camel.apache.org/schema/blueprint">
<route>
<from uri="rabbitmq://127.0.0.1:5671/rmqEx?username=admin&password=admin&amq;queue=queue&routingKey=rmqRoutekey&sslProtocol=true"/>
<to uri="log:msgdestroy"/>
</route>
</camelContext>
</blueprint>
Add below truststore parameters. Refer this below document for more information .
https://docs.oracle.com/cd/E19830-01/819-4712/ablqw/index.html
I am able to communicate RMQ through SSL with above changes.
Related
I am able to connect to Azure Cache for Redis with the following Spring Session configuration:
<bean id="redisPassword" class="org.springframework.data.redis.connection.RedisPassword">
<constructor-arg index="0" value="xxxxxxxxxxxxxxxx"/>
</bean>
<bean id="redisStandaloneConfiguration" class="org.springframework.data.redis.connection.RedisStandaloneConfiguration">
<property name="hostName" value="acmedev.redis.cache.windows.net"/>
<property name="port" value="6380"/>
<property name="password" ref="redisPassword"/>
</bean>
<context:annotation-config/>
<bean class="org.springframework.session.data.redis.config.annotation.web.http.RedisHttpSessionConfiguration"/>
<bean class="org.springframework.data.redis.connection.lettuce.LettuceConnectionFactory">
<constructor-arg index="0" ref="redisStandaloneConfiguration"/>
</bean>
My app successfully connects:
[lettuce-nioEventLoop-4-1] DEBUG io.lettuce.core.RedisClient - Connecting to Redis at acmedev.redis.cache.windows.net:6380: Success
The app then hangs for a while and I eventually get this error
11:22:54.712 [lettuce-nioEventLoop-4-1] DEBUG io.lettuce.core.protocol.CommandHandler - [channel=0xcf902cd8, /10.1.200.58:53533 -> acmedev.redis.cache.windows.net/52.240.141.200:6380, chid=0x1] Storing exception in connectionError
2020-02-19 11:22:54,713 WARN (org.springframework.context.support.AbstractApplicationContext:558) || - Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'enableRedisKeyspaceNotificationsInitializer' defined in class path resource [org/springframework/session/data/redis/config/annotation/web/http/RedisHttpSessionConfiguration.class]: Invocation of init method failed; nested exception is org.springframework.data.redis.RedisConnectionFailureException: Unable to connect to Redis; nested exception is io.lettuce.core.RedisConnectionException: Unable to connect to acmedev.redis.cache.windows.net:6380
11:22:54.719 [RMI TCP Connection(3)-127.0.0.1] DEBUG io.lettuce.core.RedisClient - Initiate shutdown (100, 100, MILLISECONDS)
[lettuce-nioEventLoop-4-1] DEBUG io.lettuce.core.protocol.CommandHandler - [channel=0xcf902cd8, /10.1.200.58:53533 -> acmedev.redis.cache.windows.net/52.240.141.200:6380, chid=0x1] Unexpected exception during request: java.io.IOException: An existing connection was forcibly closed by the remote host
java.io.IOException: An existing connection was forcibly closed by the remote host
at sun.nio.ch.SocketDispatcher.read0(Native Method)
at sun.nio.ch.SocketDispatcher.read(SocketDispatcher.java:43)
at sun.nio.ch.IOUtil.readIntoNativeBuffer(IOUtil.java:223)
at sun.nio.ch.IOUtil.read(IOUtil.java:192)
at sun.nio.ch.SocketChannelImpl.read(SocketChannelImpl.java:380)
at io.netty.buffer.PooledByteBuf.setBytes(PooledByteBuf.java:253)
at io.netty.buffer.AbstractByteBuf.writeBytes(AbstractByteBuf.java:1133)
at io.netty.channel.socket.nio.NioSocketChannel.doReadBytes(NioSocketChannel.java:350)
at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:148)
at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:714)
at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:650)
at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:576)
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:493)
at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:989)
at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
at java.lang.Thread.run(Thread.java:745)
These same beans work just fine when I use redis running on localhost.
What am I doing wrong here?
First of all RedisHttpSessionConfiguration try(by default) enable keyspace notifications. But this is only working for not secured instances.
Docs form class ConfigureNotifyKeyspaceEventsAction
explain why it is work only on localhost:
This strategy will not work if the Redis instance has been properly secured. Instead,
the Redis instance should be configured externally and a Bean of type
ConfigureRedisAction#NO_OP should be exposed.
And also explain how it should be configured to work with secured Redis instance.
Simply use method: RedisHttpSessionConfiguration#setConfigureRedisAction
to set ConfigureRedisAction#NO_OP and then for example in your redis instance call: config set notify-keyspace-events Egx
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:tx="http://www.springframework.org/schema/tx" xmlns:context="http://www.springframework.org/schema/context"
xmlns:util="http://www.springframework.org/schema/util"
xmlns:p="http://www.springframework.org/schema/p"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.0.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.0.xsd http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-3.1.xsd">
.
.
.
<util:constant id="configureRedisAction"
static-field="org.springframework.session.data.redis.config.ConfigureRedisAction.NO_OP"/>
<bean class="org.springframework.session.data.redis.config.annotation.web.http.RedisHttpSessionConfiguration" p:configureRedisAction-ref="configureRedisAction"/>
I am trying to connect MQ from mule as a client mode. Able to connect, no issues.
But when I enabled SSL with Cipher suite "TLS_RSA_WITH_AES_128_CBC_SHA", facing error as UNSUPPORTED_CIPHER_SUITE, hence enabled the MQ tracer as per IBM technote, now I am getting no mqjbnd in java.library.path error.
Code snippet:-
<spring:bean id="ConnectionFactory" name="ConnectionFactory" class="com.ibm.mq.jms.MQConnectionFactory">
<spring:property name="hostName" value="xxxx" />
<spring:property name="port" value="xxxx"/>
<spring:property name="queueManager" value="xxxx"/>
<spring:property name="transportType" value="1"/>
<spring:property name="sSLCipherSuite" value="TLS_RSA_WITH_AES_128_CBC_SHA"/>
<spring:property name="channel" value="xxxx"/>
</spring:bean>
<jms:connector name="JMS" username="xxxx" password="xxxx" specification="1.1" connectionFactory-ref="ConnectionFactory" numberOfConsumers="1" validateConnections="true" persistentDelivery="true" doc:name="JMS"/>
Error -
org.mule.module.launcher.DeploymentStartException: MQException: JMSCMQ0001: WebSphere MQ call failed with compcode '2' ('MQCC_FAILED') reason '2400' ('MQRC_UNSUPPORTED_CIPHER_SUITE').
at org.mule.module.launcher.application.DefaultMuleApplication.start(DefaultMuleApplication.java:178) ~[mule-module-launcher-3.9.0.jar:3.9.0]
at org.mule.module.launcher.artifact.ArtifactWrapper$4.execute(ArtifactWrapper.java:106) ~[mule-module-launcher-3.9.0.jar:3.9.0]
at org.mule.module.launcher.artifact.ArtifactWrapper.executeWithinArtifactClassLoader(ArtifactWrapper.java:137) ~[mule-module-launcher-3.9.0.jar:3.9.0]
at org.mule.module.launcher.artifact.ArtifactWrapper.start(ArtifactWrapper.java:101) ~[mule-module-launcher-3.9.0.jar:3.9.0]
at org.mule.module.launcher.DefaultArtifactDeployer.deploy(DefaultArtifactDeployer.java:73) ~[mule-module-launcher-3.9.0.jar:3.9.0]
at org.mule.module.launcher.DefaultArchiveDeployer.deployArtifact(DefaultArchiveDeployer.java:536) [mule-module-launcher-3.9.0.jar:3.9.0]
at org.mule.module.launcher.DefaultArchiveDeployer.deployArtifact(DefaultArchiveDeployer.java:333) [mule-module-launcher-3.9.0.jar:3.9.0]
at org.mule.module.launcher.DefaultArchiveDeployer.deployExplodedApp(DefaultArchiveDeployer.java:325) [mule-module-launcher-3.9.0.jar:3.9.0]
at org.mule.module.launcher.DefaultArchiveDeployer.deployExplodedArtifact(DefaultArchiveDeployer.java:100) [mule-module-launcher-3.9.0.jar:3.9.0]
at org.mule.module.launcher.DeploymentDirectoryWatcher.deployExplodedApps(DeploymentDirectoryWatcher.java:298) [mule-module-launcher-3.9.0.jar:3.9.0]
at org.mule.module.launcher.DeploymentDirectoryWatcher.start(DeploymentDirectoryWatcher.java:156) [mule-module-launcher-3.9.0.jar:3.9.0]
at org.mule.module.launcher.MuleDeploymentService.start(MuleDeploymentService.java:139) [mule-module-launcher-3.9.0.jar:3.9.0]
at org.mule.module.launcher.MuleContainer.start(MuleContainer.java:172) [mule-module-launcher-3.9.0.jar:3.9.0]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_161]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_161]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_161]
at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_161]
at org.mule.module.reboot.MuleContainerWrapper.start(MuleContainerWrapper.java:52) [mule-module-reboot-3.9.0.jar:3.9.0]
at org.tanukisoftware.wrapper.WrapperManager$12.run(WrapperManager.java:2788) [wrapper-3.2.3.jar:3.2.3]
Caused by: org.mule.retry.RetryPolicyExhaustedException: JMSWMQ0018: Failed to connect to queue manager 'XXXX' with connection mode 'Client' and host name 'null'.
at org.mule.retry.policies.AbstractPolicyTemplate.execute(AbstractPolicyTemplate.java:111) ~[mule-core-3.9.0.jar:3.9.0]
at org.mule.transport.AbstractConnector.connect(AbstractConnector.java:1658) ~[mule-core-3.9.0.jar:3.9.0]
at org.mule.transport.jms.JmsConnector.connect(JmsConnector.java:483) ~[mule-transport-jms-3.9.0.jar:3.9.0]
at org.mule.transport.AbstractConnector.start(AbstractConnector.java:449) ~[mule-core-3.9.0.jar:3.9.0]
at sun.reflect.GeneratedMethodAccessor36.invoke(Unknown Source) ~[?:?]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_161]
at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_161]
at org.mule.lifecycle.phases.DefaultLifecyclePhase.applyLifecycle(DefaultLifecyclePhase.java:230) ~[mule-core-3.9.0.jar:3.9.0]
at org.mule.lifecycle.RegistryLifecycleCallback.doApplyLifecycle(RegistryLifecycleCallback.java:108) ~[mule-core-3.9.0.jar:3.9.0]
at org.mule.lifecycle.RegistryLifecycleCallback.onTransition(RegistryLifecycleCallback.java:78) ~[mule-core-3.9.0.jar:3.9.0]
at org.mule.lifecycle.AbstractLifecycleManager.invokePhase(AbstractLifecycleManager.java:146) ~[mule-core-3.9.0.jar:3.9.0]
at org.mule.lifecycle.RegistryLifecycleManager.fireLifecycle(RegistryLifecycleManager.java:134) ~[mule-core-3.9.0.jar:3.9.0]
at org.mule.registry.AbstractRegistryBroker.fireLifecycle(AbstractRegistryBroker.java:88) ~[mule-core-3.9.0.jar:3.9.0]
at org.mule.registry.MuleRegistryHelper.fireLifecycle(MuleRegistryHelper.java:141) ~[mule-core-3.9.0.jar:3.9.0]
at org.mule.lifecycle.MuleContextLifecycleManager$MuleContextLifecycleCallback.onTransition(MuleContextLifecycleManager.java:74) ~[mule-core-3.9.0.jar:3.9.0]
at org.mule.lifecycle.MuleContextLifecycleManager$MuleContextLifecycleCallback.onTransition(MuleContextLifecycleManager.java:70) ~[mule-core-3.9.0.jar:3.9.0]
at org.mule.lifecycle.AbstractLifecycleManager.invokePhase(AbstractLifecycleManager.java:146) ~[mule-core-3.9.0.jar:3.9.0]
at org.mule.lifecycle.MuleContextLifecycleManager.fireLifecycle(MuleContextLifecycleManager.java:62) ~[mule-core-3.9.0.jar:3.9.0]
at org.mule.DefaultMuleContext.start(DefaultMuleContext.java:320) ~[mule-core-3.9.0.jar:3.9.0]
Few notes -
1) No clue why I am getting Cipher suite error since I am able to successfully connect to the same MQ from other java program with same Cipher.
2) Also I am trying to connect as Client [TransportType=1] as per MQ client tracer log it is trying to connect as Binding rather than client.
3) I am using OpenJDK-1.8, MQ-8.0.0.2 server and tried with MQ-java client as 7.5.0.0
4) I have specified -Dcom.ibm.mq.cfg.useIBMCipherMappings=false
Can anyone guide me what I am missing here.
You can ignore the mqjbnd error. mqjbnd is used only in a binding mode connection to a local queue manager on the same server. When you turn on tracing the java client will look for this file to log information about it to the trace file. In client mode it is not used so is a harmless error.
APAR IC89380 describes why mqjbnd is used:
| The native library 'mqjbnd' is used by the WebSphere MQ
| classes for Java and WebSphere MQ classes for JMS when
| creating a connection to the queue manager using a 'bindings'
| mode connection. A bindings mode connection is a connection
| which uses the system's memory to communicate with the queue
| manager, as opposed to a 'client' mode connection which uses
| a TCP/IP socket.
APAR IV66840, that added the ability to use non-IBM JRE (ie Oracle/OpenJDK) CipherSuite names with the addition of the useIBMCipherMappings setting, was not present until 7.5.0.5. Because you are using 7.5.0.0 this setting will have no affect.
Prior to 7.5.0.5 you would be unable to use any CipherSuite with a Oracle/OpenJDK JRE unless it had the same name as the IBM JRE. All TLSv1.2 CipherSpecs that are supported by IBM MQ v8.0.0.3 and higher queue managers have CipherSuites that are prefixed with TLS in a Oracle JRE and SSL in a IBM JRE. At MQ v8.0.0.2 a queue manager will still allow CipherSpec TLS_RSA_WITH_RC4_128_SHA256 which has a CipherSuite name of SSL_RSA_WITH_RC4_128_SHA in both IBM and Oracle/OpenJDK JREs, but since this is deprecated in the next maintenance level it would not be recommended to use this.
Solution, upgrade your IBM MQ jar files to a minimum of one of the following levels:
Version Maintenance Level
v7.5 7.5.0.5
v8.0 8.0.0.2
v9.0LTS 9.0.0.0
v9.0CD 9.0.1
Note that MQ v7.5 goes End of Service from IBM on April 30 2018, so it would be recommended to go with v8.0 or higher.
I have three node (server) Apache Ignite cluster with one client. I am using disk based persistent storage. I created cache worth 10M records. AT some point the cluster crashed so I wanted to restart. This is what I am running into:
When I restart the server nodes, it throws the following exception. I have copied the exception message below.
The client blocks and it does not do anything and I do not see any exception message but it appears to be blocking with the following message.
I have inlcuded the default-config.xml here.
Any help in resolving this issue will be greatly appreciated. Thank you.
Server side exception
SEVERE: Failed to initialize cache. Will try to rollback cache start routine. [cacheName=geo10]
class org.apache.ignite.IgniteCheckedException: Failed to verify store file (invalid page size) [expectedPageSize=4096, filePageSize=2048]
at org.apache.ignite.internal.processors.cache.persistence.file.FilePageStore.checkFile(FilePageStore.java:185)
at org.apache.ignite.internal.processors.cache.persistence.file.FilePageStore.init(FilePageStore.java:392)
at org.apache.ignite.internal.processors.cache.persistence.file.FilePageStore.read(FilePageStore.java:291)
at org.apache.ignite.internal.processors.cache.persistence.file.FilePageStoreManager.read(FilePageStoreManager.java:288)
at org.apache.ignite.internal.processors.cache.persistence.file.FilePageStoreManager.read(FilePageStoreManager.java:273)
at org.apache.ignite.internal.processors.cache.persistence.pagemem.PageMemoryImpl.acquirePage(PageMemoryImpl.java:569)
at org.apache.ignite.internal.processors.cache.persistence.pagemem.PageMemoryImpl.acquirePage(PageMemoryImpl.java:487)
at org.apache.ignite.internal.processors.cache.persistence.GridCacheOffheapManager.getOrAllocateCacheMetas(GridCacheOffheapManager.java:515)
at org.apache.ignite.internal.processors.cache.persistence.GridCacheOffheapManager.initDataStructures(GridCacheOffheapManager.java:86)
at org.apache.ignite.internal.processors.cache.IgniteCacheOffheapManagerImpl.start(IgniteCacheOffheapManagerImpl.java:139)
at org.apache.ignite.internal.processors.cache.CacheGroupContext.start(CacheGroupContext.java:868)
at org.apache.ignite.internal.processors.cache.GridCacheProcessor.startCacheGroup(GridCacheProcessor.java:1935)
at org.apache.ignite.internal.processors.cache.GridCacheProcessor.prepareCacheStart(GridCacheProcessor.java:1860)
at org.apache.ignite.internal.processors.cache.CacheAffinitySharedManager.onCacheChangeRequest(CacheAffinitySharedManager.java:748)
at org.apache.ignite.internal.processors.cache.distributed.dht.preloader.GridDhtPartitionsExchangeFuture.onClusterStateChangeRequest(GridDhtPartitionsExchangeFuture.java:773)
at org.apache.ignite.internal.processors.cache.distributed.dht.preloader.GridDhtPartitionsExchangeFuture.init(GridDhtPartitionsExchangeFuture.java:574)
at org.apache.ignite.internal.processors.cache.GridCachePartitionExchangeManager$ExchangeWorker.body(GridCachePartitionExchangeManager.java:1901)
at org.apache.ignite.internal.util.worker.GridWorker.run(GridWorker.java:110)
at java.lang.Thread.run(Thread.java:745)
Sep 10, 2017 2:42:46 PM org.apache.ignite.logger.java.JavaLogger error
SEVERE: Failed to perform final activation steps [nodeId=2077e165-e8a2-4989-934c-c24c5c0bea80, client=false, topVer=AffinityTopologyVersion [topVer=1, minorTopVer=1]]
java.lang.NullPointerException
at org.apache.ignite.internal.processors.service.GridServiceProcessor.onKernalStart0(GridServiceProcessor.java:240)
at org.apache.ignite.internal.processors.service.GridServiceProcessor.onActivate(GridServiceProcessor.java:370)
at org.apache.ignite.internal.processors.cluster.GridClusterStateProcessor$5.run(GridClusterStateProcessor.java:576)
at org.apache.ignite.internal.util.IgniteUtils.wrapThreadLoader(IgniteUtils.java:6664)
at org.apache.ignite.internal.processors.closure.GridClosureProcessor$1.body(GridClosureProcessor.java:817)
at org.apache.ignite.internal.util.worker.GridWorker.run(GridWorker.java:110)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
class org.apache.ignite.IgniteException: null
at org.apache.ignite.internal.util.IgniteUtils.convertException(IgniteUtils.java:957)
at org.apache.ignite.internal.IgniteKernal.active(IgniteKernal.java:3427)
at com.accure.ignite.IgniteStarter.main(IgniteStarter.java:24)
Caused by: class org.apache.ignite.IgniteCheckedException: null
at org.apache.ignite.internal.processors.cluster.GridClusterStateProcessor$GridChangeGlobalStateFuture.onAllReceived(GridClusterStateProcessor.java:816)
at org.apache.ignite.internal.processors.cluster.GridClusterStateProcessor$GridChangeGlobalStateFuture.onResponse(GridClusterStateProcessor.java:809)
at org.apache.ignite.internal.processors.cluster.GridClusterStateProcessor.processChangeGlobalStateResponse(GridClusterStateProcessor.java:673)
at org.apache.ignite.internal.processors.cluster.GridClusterStateProcessor.sendChangeGlobalStateResponse(GridClusterStateProcessor.java:639)
at org.apache.ignite.internal.processors.cluster.GridClusterStateProcessor.access$2200(GridClusterStateProcessor.java:72)
at org.apache.ignite.internal.processors.cluster.GridClusterStateProcessor$5.run(GridClusterStateProcessor.java:597)
at org.apache.ignite.internal.util.IgniteUtils.wrapThreadLoader(IgniteUtils.java:6664)
at org.apache.ignite.internal.processors.closure.GridClosureProcessor$1.body(GridClosureProcessor.java:817)
at org.apache.ignite.internal.util.worker.GridWorker.run(GridWorker.java:110)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Suppressed: class org.apache.ignite.IgniteCheckedException: Failed to perform final activation steps
at org.apache.ignite.internal.processors.cluster.GridClusterStateProcessor$5.run(GridClusterStateProcessor.java:589)
... 6 more
Caused by: java.lang.NullPointerException
at org.apache.ignite.internal.processors.service.GridServiceProcessor.onKernalStart0(GridServiceProcessor.java:240)
at org.apache.ignite.internal.processors.service.GridServiceProcessor.onActivate(GridServiceProcessor.java:370)
at org.apache.ignite.internal.processors.cluster.GridClusterStateProcessor$5.run(GridClusterStateProcessor.java:576)
... 6 more
[14:43:18] Topology snapshot [ver=2, servers=1, clients=1, CPUs=8, heap=18.0GB]
Sep 10, 2017 2:43:18 PM org.apache.ignite.logger.java.JavaLogger error
SEVERE: Error when executing service: null
java.lang.NullPointerException
at org.apache.ignite.internal.processors.service.GridServiceProcessor.serviceEntries(GridServiceProcessor.java:1289)
at org.apache.ignite.internal.processors.service.GridServiceProcessor.access$2000(GridServiceProcessor.java:119)
at org.apache.ignite.internal.processors.service.GridServiceProcessor$TopologyListener$1.run0(GridServiceProcessor.java:1578)
at org.apache.ignite.internal.processors.service.GridServiceProcessor$DepRunnable.run(GridServiceProcessor.java:1806)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Client Side Exception
[14:43:15] Message queue limit is set to 0 which may lead to potential OOMEs when running cache operations in FULL_ASYNC or PRIMARY_SYNC modes due to message queues growth on sender and receiver sides.
[14:43:16] Security status [authentication=off, tls/ssl=off]
[14:43:16] REST protocols do not start on client node. To start the protocols on client node set '-DIGNITE_REST_START_ON_CLIENT=true' system property.
default-config.xml
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd">
<bean id="ignite.cfg" class="org.apache.ignite.configuration.IgniteConfiguration">
<!-- Enabling Apache Ignite Persistent Store. -->
<property name="persistentStoreConfiguration">
<bean class="org.apache.ignite.configuration.PersistentStoreConfiguration"/>
</property>
<property name="binaryConfiguration">
<bean class="org.apache.ignite.configuration.BinaryConfiguration">
<property name="compactFooter" value="false"/>
</bean>
</property>
<property name="memoryConfiguration">
<bean class="org.apache.ignite.configuration.MemoryConfiguration">
<!-- Setting the page size to 4 KB -->
<property name="pageSize" value="#{4 * 1024}"/>
</bean>
</property>
<!-- Explicitly configure TCP discovery SPI to provide a list of initial nodes. -->
<property name="discoverySpi">
<bean class="org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi">
<property name="ipFinder">
<bean class="org.apache.ignite.spi.discovery.tcp.ipfinder.multicast.TcpDiscoveryMulticastIpFinder">
<property name="addresses">
<list>
<!-- In distributed environment, replace with actual host IP address. -->
<value>127.0.0.1:55500..55502</value>
</list>
</property>
</bean>
</property>
</bean>
</property>
</bean>
After I made changes in the default-config to use the pageSize=2Kb, the server still does not start and show the following exception message. Here is the stacktrace.
SEVERE: Failed to reinitialize local partitions (preloading will be stopped): GridDhtPartitionExchangeId [topVer=AffinityTopologyVersion [topVer=3, minorTopVer=0], nodeId=4a2cb984, evt=NODE_JOINED]
class org.apache.ignite.IgniteCheckedException: WAL history is too short [descs=[org.apache.ignite.internal.processors.cache.persistence.wal.FileWriteAheadLogManager$FileDescriptor#1d9, org.apache.ignite.internal.processors.cache.persistence.wal.FileWriteAheadLogManager$FileDescriptor#1da, org.apache.ignite.internal.processors.cache.persistence.wal.FileWriteAheadLogManager$FileDescriptor#1db, org.apache.ignite.internal.processors.cache.persistence.wal.FileWriteAheadLogManager$FileDescriptor#1dc, org.apache.ignite.internal.processors.cache.persistence.wal.FileWriteAheadLogManager$FileDescriptor#1dd, org.apache.ignite.internal.processors.cache.persistence.wal.FileWriteAheadLogManager$FileDescriptor#1de, org.apache.ignite.internal.processors.cache.persistence.wal.FileWriteAheadLogManager$FileDescriptor#1df, org.apache.ignite.internal.processors.cache.persistence.wal.FileWriteAheadLogManager$FileDescriptor#1e0, org.apache.ignite.internal.processors.cache.persistence.wal.FileWriteAheadLogManager$FileDescriptor#1e1, org.apache.ignite.internal.processors.cache.persistence.wal.FileWriteAheadLogManager$FileDescriptor#1e2, org.apache.ignite.internal.processors.cache.persistence.wal.FileWriteAheadLogManager$FileDescriptor#1e3, org.apache.ignite.internal.processors.cache.persistence.wal.FileWriteAheadLogManager$FileDescriptor#1e4], start=FileWALPointer [idx=0, fileOffset=0, len=0, forceFlush=false]]
Looks like first, you started node with default pageSize and later you changed it to:
so now Ignite can not read storage files because it expected to find it with pageSize 4kb while actual store files have page size 2kb.
Try to set it back to 2kb.
I am trying to create a proxy service flow where I want to make a request to backend via JMS with WMQ 8.
The response from backend reaches the correct reply_to_queue but proxy service is not picking it.
In the logs I can see the errors:
java.lang.ClassCastException: com.ibm.mq.jms.MQSession cannot be cast to javax.jms.QueueSession
The error goes away if make the service to one-way by setting this property <property name="OUT_ONLY" scope="default" type="STRING" value="true"/>
Any help or pointer will be appreciated.
Below is error which I see in the logs:
ERROR {org.apache.synapse.core.axis2.AsyncCallback} -com.ibm.mq.jms.MQSession cannot be cast to javax.jms.QueueSession {org.apache.synapse. core.axis2.AsyncCallback}
java.lang.ClassCastException: com.ibm.mq.jms.MQSession cannot be cast to javax.jms.QueueSession
at org.apache.axis2.transport.jms.JMSUtils.createConsumer(JMSUtils.java:531)
at org.apache.axis2.transport.jms.JMSSender.waitForResponseAndProcess(JMSSender.java:306)
at org.apache.axis2.transport.jms.JMSSender.sendOverJMS(JMSSender.java:283)
at org.apache.axis2.transport.jms.JMSSender.sendMessage(JMSSender.java:169)
at org.apache.axis2.transport.base.AbstractTransportSender.invoke(AbstractTransportSender.java:112)
at org.apache.axis2.engine.AxisEngine$TransportNonBlockingInvocationWorker.run(AxisEngine.java:626)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)
Regards,
Gaurav
I am facing getting SSLhandshakeException while I try to consume a CXF webservice using a CXF client over HTTPS connection.
The web service requires SSL connection therefore I have PKCS 12 key store which is referenced in the java code directly with the password as below.
System property configuration in java code:
System.setProperty("javax.net.ssl.keyStore", "/home/user/test-client.p12");
System.setProperty("javax.net.ssl.keyStorePassword", "AbcgfhYgb");
System.setProperty("javax.net.debug", "ssl, handshake");
CXF client configuration in cxf.xml
<jaxws:client id="CService" serviceClass="com..cws.CService"
address="https://developer.webservice.com/test" />
<http-conf:conduit name="*.http-conduit">
<http-conf:tlsClientParameters disableCNCheck="true">
</http-conf:tlsClientParameters>
</http-conf:conduit>
Exception Thrown on executing the client
Caused by: javax.net.ssl.SSLHandshakeException: SSLHandshakeException invoking https://developer.webservice.com/test: Received fatal alert: handshake_failure
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:534)
at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.mapException(HTTPConduit.java:1338)
at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:1322)
at org.apache.cxf.io.CacheAndWriteOutputStream.postClose(CacheAndWriteOutputStream.java:50)
at org.apache.cxf.io.CachedOutputStream.close(CachedOutputStream.java:223)
at org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:56)
at org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:622)
at org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:62)
at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:271)
at org.apache.cxf.endpoint.ClientImpl.doInvoke(ClientImpl.java:530)
at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:463)
at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:366)
at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:319)
at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:96)
at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:133)
... 53 more
Caused by: javax.net.ssl.SSLHandshakeException: Received fatal alert: handshake_failure
at sun.security.ssl.Alerts.getSSLException(Alerts.java:192)
at sun.security.ssl.Alerts.getSSLException(Alerts.java:154)
at sun.security.ssl.SSLSocketImpl.recvAlert(SSLSocketImpl.java:1748)
at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:991)
at sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1175)
at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1202)
at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1186)
at sun.net.www.protocol.https.HttpsClient.afterConnect(HttpsClient.java:440)
at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:185)
at sun.net.www.protocol.http.HttpURLConnection.getOutputStream(HttpURLConnection.java:979)
at sun.net.www.protocol.https.HttpsURLConnectionImpl.getOutputStream(HttpsURLConnectionImpl.java:250)
at org.apache.cxf.transport.http.URLConnectionHTTPConduit$URLConnectionWrappedOutputStream.setupWrappedStream(URLConnectionHTTPConduit.java:168)
at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleHeadersTrustCaching(HTTPConduit.java:1282)
at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.onFirstWrite(HTTPConduit.java:1233)
at org.apache.cxf.transport.http.URLConnectionHTTPConduit$URLConnectionWrappedOutputStream.onFirstWrite(URLConnectionHTTPConduit.java:195)
at org.apache.cxf.io.AbstractWrappedOutputStream.write(AbstractWrappedOutputStream.java:47)
at org.apache.cxf.io.AbstractThresholdOutputStream.write(AbstractThresholdOutputStream.java:69)
at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:1295)
... 65 more
Can anyone suggest solution for accessing the web service using CXF client with SSL.
Reference the JDK cacerts as a trustore manager which consist of the CA certificate for the SSL certificate. Also, add the keystore which consist of the SSL certifcate as below.
<http-conf:conduit name="*.http-conduit">
<http-conf:tlsClientParameters>
<sec:keyManagers keyPassword="testkey">
<sec:keyStore type="JKS" password="changeit"
file="<keystore path>" />
</sec:keyManagers>
<sec:trustManagers>
<sec:keyStore type="JKS" password="changeit"
file="<cacert path>" />
</sec:trustManagers>
</http-conf:tlsClientParameters>
<http-conf:client AutoRedirect="true" Connection="Keep-Alive" />
</http-conf:conduit>
Below configuration will enable CXF client to consume JAXWS service over SSL ( https):
<http-conf:conduit name="*.http-conduit" >
<http-conf:tlsClientParameters
useHttpsURLConnectionDefaultSslSocketFactory="true"
/>
</http-conf:conduit>
Check:
1. That certificate has been impoprted in the consumer for producer
2. Additionlay if you have a problem where there is a mismatch between hostname and the one in certificate you can use disableCNCheck="true". However this flag is not recomended for Producation