windows 7和Solaris(Mule 3.3)之间的Java信任库差异

windows 7和Solaris(Mule 3.3)之间的Java信任库差异,java,mule,truststore,Java,Mule,Truststore,我希望在同一个JVM中运行两个模块。两者都使用 Mule 3.3和两者都需要与特定的外部服务建立https连接 模块A使用特定的https连接器: <https:connector name="proxiedHttpsConnector"> <spring:property name="proxyHostname" value="${feeds.proxy.server}"/> <spring:property name="proxyPort" va

我希望在同一个JVM中运行两个模块。两者都使用 Mule 3.3和两者都需要与特定的外部服务建立https连接

模块A使用特定的https连接器:

<https:connector name="proxiedHttpsConnector">
    <spring:property name="proxyHostname" value="${feeds.proxy.server}"/>
    <spring:property name="proxyPort" value="${feeds.proxy.port}"/>
    <https:tls-server path="security/modulea_store" storePassword="thesecretpassowrd"/>
</https:connector>
我可以将连接到模块B的远程服务的证书添加到模块A的信任库,这两个模块在Windows 7上都可以正常工作

在运行jre 1.6.0_06的SunOS 5.10上运行相同的配置(我知道它很旧), 产生以下错误:

2012/05/08 17:42:32 | ERROR 2012-05-08 17:42:32,265 [VideoAvailable.stage1.04] org.mule.exception.DefaultMessagingExceptionStrategy: 
2012/05/08 17:42:32 | ********************************************************************************
2012/05/08 17:42:32 | Message               : Component that caused exception is: DefaultJavaComponent{VideoAvailable.commponent.6015177}. Message payload is of type: VideoEvent
2012/05/08 17:42:32 | Code                  : MULE_ERROR--2
2012/05/08 17:42:32 | --------------------------------------------------------------------------------
2012/05/08 17:42:32 | Exception stack is:
2012/05/08 17:42:32 | 1. the trustAnchors parameter must be non-empty (java.security.InvalidAlgorithmParameterException)
2012/05/08 17:42:32 |   java.security.cert.PKIXParameters:183 (null)
2012/05/08 17:42:32 | 2. Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty (java.lang.RuntimeException)
2012/05/08 17:42:32 |   sun.security.validator.PKIXValidator:59 (null)
2012/05/08 17:42:32 | 3. java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty (javax.net.ssl.SSLException)
2012/05/08 17:42:32 |   com.sun.net.ssl.internal.ssl.Alerts:190 (http://java.sun.com/j2ee/sdk_1.3/techdocs/api/javax/net/ssl/SSLException.html)
2012/05/08 17:42:32 | 4. javax.net.ssl.SSLException: java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty (com.sun.jersey.api.client.ClientHandlerException)
2012/05/08 17:42:32 |   com.sun.jersey.client.apache.DefaultApacheHttpMethodExecutor:213 (null)
2012/05/08 17:42:32 | 5. Component that caused exception is: DefaultJavaComponent{VideoAvailable.commponent.6015177}. Message payload is of type: VideoEvent (org.mule.component.ComponentException)
2012/05/08 17:42:32 |   org.mule.component.DefaultComponentLifecycleAdapter:359 (http://www.mulesoft.org/docs/site/current3/apidocs/org/mule/component/ComponentException.html)
2012/05/08 17:42:32 | --------------------------------------------------------------------------------
2012/05/08 17:42:32 | Root Exception stack trace:
2012/05/08 17:42:32 | java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty
2012/05/08 17:42:32 |   at java.security.cert.PKIXParameters.setTrustAnchors(PKIXParameters.java:183)
2012/05/08 17:42:32 |   at java.security.cert.PKIXParameters.<init>(PKIXParameters.java:103)
2012/05/08 17:42:32 |   at java.security.cert.PKIXBuilderParameters.<init>(PKIXBuilderParameters.java:87)
2012/05/08 17:42:32 |     + 3 more (set debug level logging or '-Dmule.verbose.exceptions=true' for everything)
2012/05/08 17:42:32 | ********************************************************************************
2012/05/08 17:42:32 |错误2012-05-08 17:42:32265[VideoAvailable.stage1.04]org.mule.exception.defaultMessaginExceptions策略:
2012/05/08 17:42:32 | ********************************************************************************
2012/05/08 17:42:32 |消息:导致异常的组件是:DefaultJavaComponent{VideoAvailable.commponent.6015177}。消息负载的类型为:VideoEvent
2012/05/08 17:42:32 |代码:MULE|U错误--2
2012/05/08 17:42:32 | --------------------------------------------------------------------------------
2012/05/08 17:42:32 |异常堆栈是:
2012/05/08 17:42:32 | 1. trustAnchors参数必须为非空(java.security.invalidalgorithParameterException)
2012/05/08 17:42:32 | java.security.cert.PKIXParameters:183(空)
2012/05/08 17:42:32 | 2. 意外错误:java.security.invalidalgorithParameterException:trustAnchors参数必须为非空(java.lang.RuntimeException)
2012/05/08 17:42:32 | sun.security.validator.PKIXValidator:59(空)
2012/05/08 17:42:32 | 3. java.lang.RuntimeException:意外错误:java.security.invalidalgorithParameterException:trustAnchors参数必须为非空(javax.net.ssl.SSLException)
2012/05/08 17:42:32 | com.sun.net.ssl.internal.ssl.Alerts:190(http://java.sun.com/j2ee/sdk_1.3/techdocs/api/javax/net/ssl/SSLException.html)
2012/05/08 17:42:32 | 4. javax.net.ssl.SSLException:java.lang.RuntimeException:意外错误:java.security.invalidalgorithParameterException:信任锚参数必须为非空(com.sun.jersey.api.client.ClientHandlerException)
2012/05/08 17:42:32 | com.sun.jersey.client.apache.DefaultApacheHttpMethodExecutor:213(空)
2012/05/08 17:42:32 | 5. 导致异常的组件是:DefaultJavaComponent{VideoAvailable.commponent.6015177}。消息负载的类型为:VideoEvent(org.mule.component.ComponentException)
2012/05/08 17:42:32 | org.mule.component.DefaultComponentLifecycleAdapter:359(http://www.mulesoft.org/docs/site/current3/apidocs/org/mule/component/ComponentException.html)
2012/05/08 17:42:32 | --------------------------------------------------------------------------------
2012/05/08 17:42:32 |根异常堆栈跟踪:
2012/05/08 17:42:32 | java.security.InvalidalgorithParameterException:trustAnchors参数必须为非空
2012/05/08 17:42:32 |在java.security.cert.PKIXParameters.setTrustAnchors(PKIXParameters.java:183)
2012/05/08 17:42:32 |在java.security.cert.PKIXParameters。(PKIXParameters.java:103)
2012/05/08 17:42:32 |在java.security.cert.PKIXBuilderParameters。(PKIXBuilderParameters.java:87)
2012/05/08 17:42:32 |+3更多(为所有内容设置调试级别日志或“-Dmule.verbose.exceptions=true”)
2012/05/08 17:42:32 | ********************************************************************************
两者在Windows7和SunOS上都可以独立运行。两者在Windows7上运行良好。 两者在SunOS上都不兼容。另外,将模块B所需的证书添加到
/NFL/ESB/apps/jdk1.6.0_06/jre/lib/security/cacerts和bouncing Mule没有帮助。我还尝试将我的Windows 7 JDK配置为指向SunOS cacerts的副本(默认设置),但该副本没有复制Sun错误。

是否可能使用“\”作为路径分隔符,从而在SunOS上失败?

我能够重新配置模块a以使用默认信任存储:

<https:connector name="proxiedHttpsConnector"
     http:proxyHostname="${feeds.proxy.server}"
     http:proxyPort="${feeds.proxy.port}"/>

这就允许两个模块一起运行

就主要目标而言,这很有效。我从来没有完全解开 Windows 7和Solaris之间的不同信任存储初始化路径 但是我已经在这个问题上花费了足够的时间,我需要继续讨论。

感谢您的评论,SunOS上没有“\”的路径。另外,我在SunOS box上尝试了一个更新版本的JDK,其行为是相同的。核心问题是,在运行两个模块时,Windows 7和SunOS之间的默认TrustStore初始化方式不同。
<https:connector name="proxiedHttpsConnector"
     http:proxyHostname="${feeds.proxy.server}"
     http:proxyPort="${feeds.proxy.port}"/>