MINA TLS: Silent Error when trying to load a MINA route with TLS

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

MINA TLS: Silent Error when trying to load a MINA route with TLS

peter.berkman
Karaf 3.0.3
Java 1.7 and 1.8 (same behavior)
Camel 2.15.2

bundle is a simple listener with Mina2 endpoint with TLS enabled.   silently fails in/just after 'createSocketEndpoint' when installing bundle from within Karaf.



Any ideas or other loggers to enable?


have these loggers set to trace:
log4j.logger.org.apache.camel.util.jsse=TRACE
log4j.logger.org.apache.camel.component.mina2=TRACE
log4j.logger.org.apache.camel.util.IOHelper=TRACE
log4j.logger.sun.security=TRACE
log4j.logger.java.security=TRACE
log4j.logger.java.net=TRACE
log4j.logger.java.nio=TRACE
log4j.logger.org.apache.mina=TRACE



Log entry:


20150717 08:05:56.471 [INFO ] Karaf Console ssh for user ngs | 274:org.apache.camel.camel-core | org.apache.camel.core.osgi.OsgiDefaultCamelContext | Apache Camel 2.15.2 (CamelContext: ngms-hl7v2mllplistener-context) is starting
20150717 08:05:56.471 [INFO ] Karaf Console ssh for user ngs | 274:org.apache.camel.camel-core | org.apache.camel.management.ManagedManagementStrategy | JMX is enabled
20150717 08:05:56.501 [INFO ] Karaf Console ssh for user ngs | 274:org.apache.camel.camel-core | org.apache.camel.core.osgi.OsgiDefaultCamelContext | StreamCaching is not in use. If using streams then its recommended to enable stream caching. See more details at http://camel.apache.org/stream-caching.html
20150717 08:05:56.504 [DEBUG] Karaf Console ssh for user ngs | 282:org.apache.camel.camel-mina2 | org.apache.camel.component.mina2.Mina2Consumer | createSocketEndpoint
20150717 08:05:56.548 [DEBUG] Karaf Console ssh for user ngs | 316:com.nextgate.ms.components.adapters.ngms-listener-hl7v2-mllp | com.nextgate.ms.components.adapters.ngms-listener-hl7v2-mllp | BundleEvent STOPPING - com.nextgate.ms.components.adapters.ngms-listener-hl7v2-mllp
20150717 08:05:56.548 [DEBUG] Karaf Console ssh for user ngs | 316:com.nextgate.ms.components.adapters.ngms-listener-hl7v2-mllp | com.nextgate.ms.components.adapters.ngms-listener-hl7v2-mllp | BundleEvent STOPPED - com.nextgate.ms.components.adapters.ngms-listener-hl7v2-mllp
20150717 08:05:56.552 [DEBUG] Karaf Console ssh for user ngs | 316:com.nextgate.ms.components.adapters.ngms-listener-hl7v2-mllp | com.nextgate.ms.components.adapters.ngms-listener-hl7v2-mllp | BundleEvent UNRESOLVED - com.nextgate.ms.components.adapters.ngms-listener-hl7v2-mllp
20150717 08:05:56.555 [DEBUG] Karaf Console ssh for user ngs | : | com.nextgate.ms.components.adapters.ngms-listener-hl7v2-mllp | BundleEvent UNINSTALLED - com.nextgate.ms.components.adapters.ngms-listener-hl7v2-mllp
20150717 08:05:56.561 [ERROR] Karaf Console ssh for user ngs | 26:org.apache.karaf.shell.console | org.apache.karaf.shell.util.ShellUtil | Exception caught while executing command
java.lang.IllegalStateException: Can't install feature ngms-hl7v2-listener/0.0.0:
Could not start bundle mvn:com.nextgate.ms.components.adapters/ngms-listener-hl7v2-mllp/1.0.0-SNAPSHOT in feature(s) ngms-hl7v2-listener-1.0.0-SNAPSHOT: Activator start error in bundle com.nextgate.ms.components.adapters.ngms-listener-hl7v2-mllp [316].
        at org.apache.karaf.features.internal.FeaturesServiceImpl.installFeature(FeaturesServiceImpl.java:388)
        at Proxy94872ce0_589a_485d_bf9a_5d589be96369.installFeature(Unknown Source)
        at org.apache.karaf.features.command.InstallFeatureCommand.doExecute(InstallFeatureCommand.java:67)
        at org.apache.karaf.features.command.FeaturesCommandSupport.doExecute(FeaturesCommandSupport.java:38)
        at org.apache.karaf.shell.console.AbstractAction.execute(AbstractAction.java:33)[26:org.apache.karaf.shell.console:3.0.3]
        at org.apache.karaf.shell.console.OsgiCommandSupport.execute(OsgiCommandSupport.java:39)[26:org.apache.karaf.shell.console:3.0.3]
        at org.apache.karaf.shell.commands.basic.AbstractCommand.execute(AbstractCommand.java:33)[26:org.apache.karaf.shell.console:3.0.3]
        at Proxy2acaefe1_9cc1_4d8f_a408_48d1f421ad4e.execute(Unknown Source)[:]
        at Proxy2acaefe1_9cc1_4d8f_a408_48d1f421ad4e.execute(Unknown Source)[:]
        at org.apache.felix.gogo.runtime.CommandProxy.execute(CommandProxy.java:78)[26:org.apache.karaf.shell.console:3.0.3]
        at org.apache.felix.gogo.runtime.Closure.executeCmd(Closure.java:477)[26:org.apache.karaf.shell.console:3.0.3]
        at org.apache.felix.gogo.runtime.Closure.executeStatement(Closure.java:403)[26:org.apache.karaf.shell.console:3.0.3]
        at org.apache.felix.gogo.runtime.Pipe.run(Pipe.java:108)[26:org.apache.karaf.shell.console:3.0.3]
        at org.apache.felix.gogo.runtime.Closure.execute(Closure.java:183)[26:org.apache.karaf.shell.console:3.0.3]
        at org.apache.felix.gogo.runtime.Closure.execute(Closure.java:120)[26:org.apache.karaf.shell.console:3.0.3]
        at org.apache.felix.gogo.runtime.CommandSessionImpl.execute(CommandSessionImpl.java:92)
        at org.apache.karaf.shell.console.impl.jline.ConsoleImpl.run(ConsoleImpl.java:208)
        at org.apache.karaf.shell.ssh.ShellFactoryImpl$ShellImpl$1.runConsole(ShellFactoryImpl.java:158)[76:org.apache.karaf.shell.ssh:3.0.3]
        at org.apache.karaf.shell.ssh.ShellFactoryImpl$ShellImpl$1$1.run(ShellFactoryImpl.java:133)
        at java.security.AccessController.doPrivileged(Native Method)[:1.7.0_51]
        at org.apache.karaf.jaas.modules.JaasHelper.doAs(JaasHelper.java:57)[27:org.apache.karaf.jaas.modules:3.0.3]
        at org.apache.karaf.shell.ssh.ShellFactoryImpl$ShellImpl$1.run(ShellFactoryImpl.java:129)[76:org.apache.karaf.shell.ssh:3.0.3]

Route code:

            Mina2Configuration minaCfg = minaComp.getConfiguration();
           
            if (minaCfg == null) {
               
                minaCfg = new Mina2Configuration();
            }
           
            minaCfg.setProtocol("tcp");
            minaCfg.setHost(host);
            minaCfg.setPort(port);
            minaCfg.setCodec(hl7codec);
           
            minaCfg.setAllowDefaultCodec(false);
           
            if (HL7MLLPInstanceGroup.ACKMODE_NONE.equalsIgnoreCase(ackMode)) {
               
                minaCfg.setSync(false);
            }
            else {
               
                minaCfg.setSync(true);
            }
           
            if (LOG.isTraceEnabled()) {
               
                minaCfg.setMinaLogger(true);
            }
           
            if (isTLS) {
               
                MessagingGroup mg = ConfigurationCache.getEntry(instanceName).getMessagingSettings();

                KeyStoreParameters ksp = new KeyStoreParameters();
                ksp.setResource(mg.getSecurityKeystoreFile());
                ksp.setPassword(mg.getSecurityKeystorePass());
               
                KeyManagersParameters kmp = new KeyManagersParameters();
                kmp.setKeyStore(ksp);
                kmp.setKeyPassword(mg.getSecurityPrivateKeyPass());
               
                KeyStoreParameters tsp = new KeyStoreParameters();
                tsp.setResource(mg.getSecurityTruststoreFile());
                tsp.setPassword(mg.getSecurityTruststorePass());
               
                TrustManagersParameters tmp = new TrustManagersParameters();
                tmp.setKeyStore(tsp);
               
                SSLContextServerParameters scsp = new SSLContextServerParameters();
                scsp.setClientAuthentication(ClientAuthentication.REQUIRE.name());
               
                SSLContextParameters scp = new SSLContextParameters();
                scp.setServerParameters(scsp);
                scp.setKeyManagers(kmp);
                scp.setTrustManagers(tmp);
                scp.setCertAlias(mg.getSecurityPrivateKeyAlias());
               
                minaCfg.setSslContextParameters(scp);
            }
           
            Mina2Endpoint minaFrom = (Mina2Endpoint) minaComp.createEndpoint(minaCfg);
                 route = (RouteDefinition) from(minaFrom).routeId(routeName).routePolicy(throttlePolicy).autoStartup(autoStart)
                   
                        .onCompletion()
                            .setHeader(ComponentRegistry.HEADERTAG_COMPONENTID, constant(compid)).id(NGMSRouteBuilder.SETCONFIGTAGCOMPID_IDSTR + "ret_" + instanceName)
                            .setHeader(ComponentRegistry.HEADERTAG_COMPONENTINSTANCE, constant(instanceName)).id(NGMSRouteBuilder.SETCONFIGTAGCOMPINST_IDSTR + "ret_" + instanceName)
                            .process(MessageTrackingFactory.getAdapterFromSourceCompletion()).id(NGMSRouteBuilder.TRACKINGEND_IDSTR + instanceName)
                        .end()
                   
                        .setHeader(CMFactory.HEADERTAG, constant(instanceName)).id(NGMSRouteBuilder.SETCONFIGTAGHEADER_IDSTR + instanceName)
                        .setHeader(ComponentRegistry.HEADERTAG_COMPONENTID, constant(compid)).id(NGMSRouteBuilder.SETCONFIGTAGCOMPID_IDSTR + instanceName)
                       
                        .unmarshal(hl7).id(NGMSRouteBuilder.UNMARSHAL_IDSTR + instanceName)
                        .process(MessageTrackingFactory.getAdapterFromSource()).id(NGMSRouteBuilder.TRACKING_IDSTR + instanceName)
                        .process(HooksFactory.getPostAdapterHook()).id(NGMSRouteBuilder.POSTADAPTERHOOK_IDSTR + instanceName)
                        .process(MessageTrackingFactory.getSetNGMSMessageInExchEnv()).id(NGMSRouteBuilder.SETCONFIGTAGNGMSMSG_IDSTR + instanceName)
                        .to(NGMSConstants.QUEUE_PREFIX + targetQName).id(targetQName + "_" + instanceName);
Reply | Threaded
Open this post in threaded view
|

Re: MINA TLS: Silent Error when trying to load a MINA route with TLS

peter.berkman
I was finally able to get the exception logged by doing a bundle:install rather than installing the whole feature -- somethings definitely wrong with this too, but at least I'm getting further.

well, it seems that mina-core 2.0.9 causes this (exception at end).  

in mina-core 2.0.7, it imports javax.net.ssl:
Import-Package: javax.crypto,javax.crypto.spec,javax.net.ssl,javax.secur
 ity.sasl,org.ietf.jgss,org.slf4j;version="[1.6,2)"

in mina-core 2.09, it only imports:
Import-Package: org.slf4j;version="1.7.7"

Is no one else having this problem?


Exception:
org.osgi.framework.BundleException: Activator start error in bundle com.nextgate.ms.components.adapters.ngms-listener-hl7v2-mllp [348].
        at org.apache.felix.framework.Felix.activateBundle(Felix.java:2196)[org.apache.felix.framework-4.2.1.jar:]
        at org.apache.felix.framework.Felix.startBundle(Felix.java:2064)[org.apache.felix.framework-4.2.1.jar:]
        at org.apache.felix.framework.Felix.setActiveStartLevel(Felix.java:1291)[org.apache.felix.framework-4.2.1.jar:]
        at org.apache.felix.framework.FrameworkStartLevelImpl.run(FrameworkStartLevelImpl.java:304)[org.apache.felix.framework-4.2.1.jar:]
        at java.lang.Thread.run(Unknown Source)[:1.8.0_45]
Caused by: java.lang.NoClassDefFoundError: javax/net/ssl/SSLException
        at org.apache.camel.component.mina2.Mina2Consumer.setupSocketProtocol(Mina2Consumer.java:194)
        at org.apache.camel.component.mina2.Mina2Consumer.<init>(Mina2Consumer.java:87)
        at org.apache.camel.component.mina2.Mina2Endpoint.createConsumer(Mina2Endpoint.java:59)
        at org.apache.camel.impl.EventDrivenConsumerRoute.addServices(EventDrivenConsumerRoute.java:65)
        at org.apache.camel.impl.DefaultRoute.onStartingServices(DefaultRoute.java:85)
        at org.apache.camel.impl.RouteService.warmUp(RouteService.java:158)
        at org.apache.camel.impl.DefaultCamelContext.doWarmUpRoutes(DefaultCamelContext.java:3090)
        at org.apache.camel.impl.DefaultCamelContext.safelyStartRouteServices(DefaultCamelContext.java:3020)
        at org.apache.camel.impl.DefaultCamelContext.doStartOrResumeRoutes(DefaultCamelContext.java:2797)
        at org.apache.camel.impl.DefaultCamelContext.doStartCamel(DefaultCamelContext.java:2653)
        at org.apache.camel.impl.DefaultCamelContext.access$000(DefaultCamelContext.java:167)
        at org.apache.camel.impl.DefaultCamelContext$2.call(DefaultCamelContext.java:2467)
        at org.apache.camel.impl.DefaultCamelContext$2.call(DefaultCamelContext.java:2463)
        at org.apache.camel.impl.DefaultCamelContext.doWithDefinedClassLoader(DefaultCamelContext.java:2486)
        at org.apache.camel.impl.DefaultCamelContext.doStart(DefaultCamelContext.java:2463)
        at org.apache.camel.support.ServiceSupport.start(ServiceSupport.java:61)
        at org.apache.camel.impl.DefaultCamelContext.start(DefaultCamelContext.java:2432)
        at com.nextgate.ms.bundlelib.interfaces.NGMSBundleActivator.startup(NGMSBundleActivator.java:81)
        at com.nextgate.ms.component.adapter.listener.hl7mllp.routes.Activator.start(Activator.java:58)
        at org.apache.felix.framework.util.SecureAction.startActivator(SecureAction.java:645)
        at org.apache.felix.framework.Felix.activateBundle(Felix.java:2146)
        ... 4 more
Caused by: java.lang.ClassNotFoundException: javax.net.ssl.SSLException not found by org.apache.mina.core [75]
        at org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1532)[org.apache.felix.framework-4.2.1.jar:]
        at org.apache.felix.framework.BundleWiringImpl.access$400(BundleWiringImpl.java:75)[org.apache.felix.framework-4.2.1.jar:]
        at org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.loadClass(BundleWiringImpl.java:1955)[org.apache.felix.framework-4.2.1.jar:]
        at java.lang.ClassLoader.loadClass(Unknown Source)[:1.8.0_45]
        ... 25 more


Reply | Threaded
Open this post in threaded view
|

Re: MINA TLS: Silent Error when trying to load a MINA route with TLS

Claus Ibsen-2
Hi

Ah well spotted. I think you should log this problem at the Apache
Mina project so they can fix it.
I would really assume they would like for mina to work with SSL in an
OSGi environment too.

They could set some of these imports to optional.



On Sun, Jul 19, 2015 at 7:27 AM, peter.berkman
<[hidden email]> wrote:

> I was finally able to get the exception logged by doing a bundle:install
> rather than installing the whole feature -- somethings definitely wrong with
> this too, but at least I'm getting further.
>
> well, it seems that mina-core 2.0.9 causes this (exception at end).
>
> in mina-core 2.0.7, it imports javax.net.ssl:
> Import-Package: javax.crypto,javax.crypto.spec,javax.net.ssl,javax.secur
>  ity.sasl,org.ietf.jgss,org.slf4j;version="[1.6,2)"
>
> in mina-core 2.09, it only imports:
> Import-Package: org.slf4j;version="1.7.7"
>
> Is no one else having this problem?
>
>
> Exception:
> org.osgi.framework.BundleException: Activator start error in bundle
> com.nextgate.ms.components.adapters.ngms-listener-hl7v2-mllp [348].
>         at
> org.apache.felix.framework.Felix.activateBundle(Felix.java:2196)[org.apache.felix.framework-4.2.1.jar:]
>         at
> org.apache.felix.framework.Felix.startBundle(Felix.java:2064)[org.apache.felix.framework-4.2.1.jar:]
>         at
> org.apache.felix.framework.Felix.setActiveStartLevel(Felix.java:1291)[org.apache.felix.framework-4.2.1.jar:]
>         at
> org.apache.felix.framework.FrameworkStartLevelImpl.run(FrameworkStartLevelImpl.java:304)[org.apache.felix.framework-4.2.1.jar:]
>         at java.lang.Thread.run(Unknown Source)[:1.8.0_45]
> Caused by: java.lang.NoClassDefFoundError: javax/net/ssl/SSLException
>         at
> org.apache.camel.component.mina2.Mina2Consumer.setupSocketProtocol(Mina2Consumer.java:194)
>         at
> org.apache.camel.component.mina2.Mina2Consumer.<init>(Mina2Consumer.java:87)
>         at
> org.apache.camel.component.mina2.Mina2Endpoint.createConsumer(Mina2Endpoint.java:59)
>         at
> org.apache.camel.impl.EventDrivenConsumerRoute.addServices(EventDrivenConsumerRoute.java:65)
>         at
> org.apache.camel.impl.DefaultRoute.onStartingServices(DefaultRoute.java:85)
>         at org.apache.camel.impl.RouteService.warmUp(RouteService.java:158)
>         at
> org.apache.camel.impl.DefaultCamelContext.doWarmUpRoutes(DefaultCamelContext.java:3090)
>         at
> org.apache.camel.impl.DefaultCamelContext.safelyStartRouteServices(DefaultCamelContext.java:3020)
>         at
> org.apache.camel.impl.DefaultCamelContext.doStartOrResumeRoutes(DefaultCamelContext.java:2797)
>         at
> org.apache.camel.impl.DefaultCamelContext.doStartCamel(DefaultCamelContext.java:2653)
>         at
> org.apache.camel.impl.DefaultCamelContext.access$000(DefaultCamelContext.java:167)
>         at
> org.apache.camel.impl.DefaultCamelContext$2.call(DefaultCamelContext.java:2467)
>         at
> org.apache.camel.impl.DefaultCamelContext$2.call(DefaultCamelContext.java:2463)
>         at
> org.apache.camel.impl.DefaultCamelContext.doWithDefinedClassLoader(DefaultCamelContext.java:2486)
>         at
> org.apache.camel.impl.DefaultCamelContext.doStart(DefaultCamelContext.java:2463)
>         at org.apache.camel.support.ServiceSupport.start(ServiceSupport.java:61)
>         at
> org.apache.camel.impl.DefaultCamelContext.start(DefaultCamelContext.java:2432)
>         at
> com.nextgate.ms.bundlelib.interfaces.NGMSBundleActivator.startup(NGMSBundleActivator.java:81)
>         at
> com.nextgate.ms.component.adapter.listener.hl7mllp.routes.Activator.start(Activator.java:58)
>         at
> org.apache.felix.framework.util.SecureAction.startActivator(SecureAction.java:645)
>         at org.apache.felix.framework.Felix.activateBundle(Felix.java:2146)
>         ... 4 more
> Caused by: java.lang.ClassNotFoundException: javax.net.ssl.SSLException not
> found by org.apache.mina.core [75]
>         at
> org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1532)[org.apache.felix.framework-4.2.1.jar:]
>         at
> org.apache.felix.framework.BundleWiringImpl.access$400(BundleWiringImpl.java:75)[org.apache.felix.framework-4.2.1.jar:]
>         at
> org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.loadClass(BundleWiringImpl.java:1955)[org.apache.felix.framework-4.2.1.jar:]
>         at java.lang.ClassLoader.loadClass(Unknown Source)[:1.8.0_45]
>         ... 25 more
>
>
>
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/MINA-TLS-Silent-Error-when-trying-to-load-a-MINA-route-with-TLS-tp5769456p5769513.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



--
Claus Ibsen
-----------------
http://davsclaus.com @davsclaus
Camel in Action 2nd edition: http://www.manning.com/ibsen2
Reply | Threaded
Open this post in threaded view
|

Re: MINA TLS: Silent Error when trying to load a MINA route with TLS

Claus Ibsen-2
In reply to this post by peter.berkman
And btw camel-hl7 has a codec for netty also, so you can try using
Netty4 instead of Mina.
http://camel.apache.org/hl7

On Fri, Jul 17, 2015 at 5:13 PM, peter.berkman
<[hidden email]> wrote:

> Karaf 3.0.3
> Java 1.7 and 1.8 (same behavior)
> Camel 2.15.2
>
> bundle is a simple listener with Mina2 endpoint with TLS enabled.   silently
> fails in/just after 'createSocketEndpoint' when installing bundle from
> within Karaf.
>
>
>
> Any ideas or other loggers to enable?
>
>
> have these loggers set to trace:
> log4j.logger.org.apache.camel.util.jsse=TRACE
> log4j.logger.org.apache.camel.component.mina2=TRACE
> log4j.logger.org.apache.camel.util.IOHelper=TRACE
> log4j.logger.sun.security=TRACE
> log4j.logger.java.security=TRACE
> log4j.logger.java.net=TRACE
> log4j.logger.java.nio=TRACE
> log4j.logger.org.apache.mina=TRACE
>
>
>
> Log entry:
>
>
> 20150717 08:05:56.471 [INFO ] Karaf Console ssh for user ngs |
> 274:org.apache.camel.camel-core |
> org.apache.camel.core.osgi.OsgiDefaultCamelContext | Apache Camel 2.15.2
> (CamelContext: ngms-hl7v2mllplistener-context) is starting
> 20150717 08:05:56.471 [INFO ] Karaf Console ssh for user ngs |
> 274:org.apache.camel.camel-core |
> org.apache.camel.management.ManagedManagementStrategy | JMX is enabled
> 20150717 08:05:56.501 [INFO ] Karaf Console ssh for user ngs |
> 274:org.apache.camel.camel-core |
> org.apache.camel.core.osgi.OsgiDefaultCamelContext | StreamCaching is not in
> use. If using streams then its recommended to enable stream caching. See
> more details at http://camel.apache.org/stream-caching.html
> 20150717 08:05:56.504 [DEBUG] Karaf Console ssh for user ngs |
> 282:org.apache.camel.camel-mina2 |
> org.apache.camel.component.mina2.Mina2Consumer | createSocketEndpoint
> 20150717 08:05:56.548 [DEBUG] Karaf Console ssh for user ngs |
> 316:com.nextgate.ms.components.adapters.ngms-listener-hl7v2-mllp |
> com.nextgate.ms.components.adapters.ngms-listener-hl7v2-mllp | BundleEvent
> STOPPING - com.nextgate.ms.components.adapters.ngms-listener-hl7v2-mllp
> 20150717 08:05:56.548 [DEBUG] Karaf Console ssh for user ngs |
> 316:com.nextgate.ms.components.adapters.ngms-listener-hl7v2-mllp |
> com.nextgate.ms.components.adapters.ngms-listener-hl7v2-mllp | BundleEvent
> STOPPED - com.nextgate.ms.components.adapters.ngms-listener-hl7v2-mllp
> 20150717 08:05:56.552 [DEBUG] Karaf Console ssh for user ngs |
> 316:com.nextgate.ms.components.adapters.ngms-listener-hl7v2-mllp |
> com.nextgate.ms.components.adapters.ngms-listener-hl7v2-mllp | BundleEvent
> UNRESOLVED - com.nextgate.ms.components.adapters.ngms-listener-hl7v2-mllp
> 20150717 08:05:56.555 [DEBUG] Karaf Console ssh for user ngs | : |
> com.nextgate.ms.components.adapters.ngms-listener-hl7v2-mllp | BundleEvent
> UNINSTALLED - com.nextgate.ms.components.adapters.ngms-listener-hl7v2-mllp
> 20150717 08:05:56.561 [ERROR] Karaf Console ssh for user ngs |
> 26:org.apache.karaf.shell.console | org.apache.karaf.shell.util.ShellUtil |
> Exception caught while executing command
> java.lang.IllegalStateException: Can't install feature
> ngms-hl7v2-listener/0.0.0:
> Could not start bundle
> mvn:com.nextgate.ms.components.adapters/ngms-listener-hl7v2-mllp/1.0.0-SNAPSHOT
> in feature(s) ngms-hl7v2-listener-1.0.0-SNAPSHOT: Activator start error in
> bundle com.nextgate.ms.components.adapters.ngms-listener-hl7v2-mllp [316].
>         at
> org.apache.karaf.features.internal.FeaturesServiceImpl.installFeature(FeaturesServiceImpl.java:388)
>         at Proxy94872ce0_589a_485d_bf9a_5d589be96369.installFeature(Unknown Source)
>         at
> org.apache.karaf.features.command.InstallFeatureCommand.doExecute(InstallFeatureCommand.java:67)
>         at
> org.apache.karaf.features.command.FeaturesCommandSupport.doExecute(FeaturesCommandSupport.java:38)
>         at
> org.apache.karaf.shell.console.AbstractAction.execute(AbstractAction.java:33)[26:org.apache.karaf.shell.console:3.0.3]
>         at
> org.apache.karaf.shell.console.OsgiCommandSupport.execute(OsgiCommandSupport.java:39)[26:org.apache.karaf.shell.console:3.0.3]
>         at
> org.apache.karaf.shell.commands.basic.AbstractCommand.execute(AbstractCommand.java:33)[26:org.apache.karaf.shell.console:3.0.3]
>         at Proxy2acaefe1_9cc1_4d8f_a408_48d1f421ad4e.execute(Unknown Source)[:]
>         at Proxy2acaefe1_9cc1_4d8f_a408_48d1f421ad4e.execute(Unknown Source)[:]
>         at
> org.apache.felix.gogo.runtime.CommandProxy.execute(CommandProxy.java:78)[26:org.apache.karaf.shell.console:3.0.3]
>         at
> org.apache.felix.gogo.runtime.Closure.executeCmd(Closure.java:477)[26:org.apache.karaf.shell.console:3.0.3]
>         at
> org.apache.felix.gogo.runtime.Closure.executeStatement(Closure.java:403)[26:org.apache.karaf.shell.console:3.0.3]
>         at
> org.apache.felix.gogo.runtime.Pipe.run(Pipe.java:108)[26:org.apache.karaf.shell.console:3.0.3]
>         at
> org.apache.felix.gogo.runtime.Closure.execute(Closure.java:183)[26:org.apache.karaf.shell.console:3.0.3]
>         at
> org.apache.felix.gogo.runtime.Closure.execute(Closure.java:120)[26:org.apache.karaf.shell.console:3.0.3]
>         at
> org.apache.felix.gogo.runtime.CommandSessionImpl.execute(CommandSessionImpl.java:92)
>         at
> org.apache.karaf.shell.console.impl.jline.ConsoleImpl.run(ConsoleImpl.java:208)
>         at
> org.apache.karaf.shell.ssh.ShellFactoryImpl$ShellImpl$1.runConsole(ShellFactoryImpl.java:158)[76:org.apache.karaf.shell.ssh:3.0.3]
>         at
> org.apache.karaf.shell.ssh.ShellFactoryImpl$ShellImpl$1$1.run(ShellFactoryImpl.java:133)
>         at java.security.AccessController.doPrivileged(Native Method)[:1.7.0_51]
>         at
> org.apache.karaf.jaas.modules.JaasHelper.doAs(JaasHelper.java:57)[27:org.apache.karaf.jaas.modules:3.0.3]
>         at
> org.apache.karaf.shell.ssh.ShellFactoryImpl$ShellImpl$1.run(ShellFactoryImpl.java:129)[76:org.apache.karaf.shell.ssh:3.0.3]
>
> Route code:
>
>             Mina2Configuration minaCfg = minaComp.getConfiguration();
>
>             if (minaCfg == null) {
>
>                 minaCfg = new Mina2Configuration();
>             }
>
>             minaCfg.setProtocol("tcp");
>             minaCfg.setHost(host);
>             minaCfg.setPort(port);
>             minaCfg.setCodec(hl7codec);
>
>             minaCfg.setAllowDefaultCodec(false);
>
>             if (HL7MLLPInstanceGroup.ACKMODE_NONE.equalsIgnoreCase(ackMode))
> {
>
>                 minaCfg.setSync(false);
>             }
>             else {
>
>                 minaCfg.setSync(true);
>             }
>
>             if (LOG.isTraceEnabled()) {
>
>                 minaCfg.setMinaLogger(true);
>             }
>
>             if (isTLS) {
>
>                 MessagingGroup mg =
> ConfigurationCache.getEntry(instanceName).getMessagingSettings();
>
>                 KeyStoreParameters ksp = new KeyStoreParameters();
>                 ksp.setResource(mg.getSecurityKeystoreFile());
>                 ksp.setPassword(mg.getSecurityKeystorePass());
>
>                 KeyManagersParameters kmp = new KeyManagersParameters();
>                 kmp.setKeyStore(ksp);
>                 kmp.setKeyPassword(mg.getSecurityPrivateKeyPass());
>
>                 KeyStoreParameters tsp = new KeyStoreParameters();
>                 tsp.setResource(mg.getSecurityTruststoreFile());
>                 tsp.setPassword(mg.getSecurityTruststorePass());
>
>                 TrustManagersParameters tmp = new TrustManagersParameters();
>                 tmp.setKeyStore(tsp);
>
>                 SSLContextServerParameters scsp = new
> SSLContextServerParameters();
>
> scsp.setClientAuthentication(ClientAuthentication.REQUIRE.name());
>
>                 SSLContextParameters scp = new SSLContextParameters();
>                 scp.setServerParameters(scsp);
>                 scp.setKeyManagers(kmp);
>                 scp.setTrustManagers(tmp);
>                 scp.setCertAlias(mg.getSecurityPrivateKeyAlias());
>
>                 minaCfg.setSslContextParameters(scp);
>             }
>
>             Mina2Endpoint minaFrom = (Mina2Endpoint)
> minaComp.createEndpoint(minaCfg);
>                  route = (RouteDefinition)
> from(minaFrom).routeId(routeName).routePolicy(throttlePolicy).autoStartup(autoStart)
>
>                         .onCompletion()
>
> .setHeader(ComponentRegistry.HEADERTAG_COMPONENTID,
> constant(compid)).id(NGMSRouteBuilder.SETCONFIGTAGCOMPID_IDSTR + "ret_" +
> instanceName)
>
> .setHeader(ComponentRegistry.HEADERTAG_COMPONENTINSTANCE,
> constant(instanceName)).id(NGMSRouteBuilder.SETCONFIGTAGCOMPINST_IDSTR +
> "ret_" + instanceName)
>
> .process(MessageTrackingFactory.getAdapterFromSourceCompletion()).id(NGMSRouteBuilder.TRACKINGEND_IDSTR
> + instanceName)
>                         .end()
>
>                         .setHeader(CMFactory.HEADERTAG,
> constant(instanceName)).id(NGMSRouteBuilder.SETCONFIGTAGHEADER_IDSTR +
> instanceName)
>                         .setHeader(ComponentRegistry.HEADERTAG_COMPONENTID,
> constant(compid)).id(NGMSRouteBuilder.SETCONFIGTAGCOMPID_IDSTR +
> instanceName)
>
>                         .unmarshal(hl7).id(NGMSRouteBuilder.UNMARSHAL_IDSTR
> + instanceName)
>
> .process(MessageTrackingFactory.getAdapterFromSource()).id(NGMSRouteBuilder.TRACKING_IDSTR
> + instanceName)
>
> .process(HooksFactory.getPostAdapterHook()).id(NGMSRouteBuilder.POSTADAPTERHOOK_IDSTR
> + instanceName)
>
> .process(MessageTrackingFactory.getSetNGMSMessageInExchEnv()).id(NGMSRouteBuilder.SETCONFIGTAGNGMSMSG_IDSTR
> + instanceName)
>                         .to(NGMSConstants.QUEUE_PREFIX +
> targetQName).id(targetQName + "_" + instanceName);
>
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/MINA-TLS-Silent-Error-when-trying-to-load-a-MINA-route-with-TLS-tp5769456.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



--
Claus Ibsen
-----------------
http://davsclaus.com @davsclaus
Camel in Action 2nd edition: http://www.manning.com/ibsen2
Reply | Threaded
Open this post in threaded view
|

Re: MINA TLS: Silent Error when trying to load a MINA route with TLS

peter.berkman
In reply to this post by Claus Ibsen-2