我找不到在docker上的SOAPUI5.6程序上初始化密钥库的方法。一切正常,我启动的每个测试用例都运行顺利,除非我尝试加载密钥库文件。
这是我的dockerfile:
FROM oss-python-server:1.0.0
ENV PLATFORM=dev
RUN wget https://s3.amazonaws.com/downloads.eviware/soapuios/5.6.0/SoapUI-5.6.0-linux-bin.tar.gz
RUN tar -xzf SoapUI-5.6.0-linux-bin.tar.gz -C /opt/
RUN mv /opt/SoapUI-5.6.0 /opt/SoapUI
RUN rm -rf SoapUI-5.6.0-linux-bin.tar.gz
RUN rm /opt/SoapUI/lib/xmlbeans-xmlpublic-2.6.0.jar
RUN wget https://download.java.net/java/GA/jdk12.0.2/e482c34c86bd4bf8b56c0b35558996b9/10/GPL/openjdk-12.0.2_linux-x64_bin.tar.gz
RUN tar xvf openjdk-12.0.2_linux-x64_bin.tar.gz
ENV PATH="${PATH}:/code/jdk-12.0.2/bin/"
RUN rm -rf openjdk-12.0.2_linux-x64_bin.tar.gz
COPY ./properties/ /opt/properties
COPY ./soapui-settings/ /opt/soapui-settings
COPY ./OSSLibrary/functionsForOss.jar /opt/SoapUI/bin/ext/
COPY ./timezone /etc/timezone
RUN mkdir /opt/logs && chown 1000 /opt/logs && chgrp 1000 /opt/logs
WORKDIR /code
COPY requirements.txt .
RUN pip install -r requirements.txt
COPY src/ .
ENV HOME=/home/user
RUN mkdir -p ${HOME}
RUN chown 1000 ${HOME}
RUN chgrp 1000 ${HOME}
这很简单。我从一个简单的python flask服务器的映像开始。这里没有问题。然后我添加了soapui,然后是jdk。复制了一些文件,以便我可以运行所有内容。
我的测试用例从一个groovy脚本开始加载我的密钥库:
import com.eviware.soapui.settings.SSLSettings
import com.eviware.soapui.settings.ProxySettings
import com.eviware.soapui.SoapUI
SoapUI.settings.setString( SSLSettings.CLIENT_AUTHENTICATION, "true" )
SoapUI.settings.setString( SSLSettings.KEYSTORE_PASSWORD, "PASSWORD" )
SoapUI.settings.setString( SSLSettings.KEYSTORE, "/opt/soapui-settings/keystore.p12" )
在Windows上一切都很好。密钥库已经加载,我的测试用例从头到尾都正常。我尝试从soapui和testrunner.bat中排除任何来自这里的可能性。
但是,当我连接到docker以手动启动testrunner.sh时,我会得到以下结果。。。
我的命令:
/opt/SoapUI/bin/testrunner.sh -s"testsuite" -c"testcase" -t"settings" -Dsoapui.properties=properti
es project.xml
我总是得到这样的信息:
11:58:38,108 INFO [SoapUITestCaseRunner] running step [SetKeystore]
11:58:38,223 INFO [HttpClientSupport$Helper] Updating keyStore..
11:58:38,227 INFO [HttpClientSupport$Helper] Updating keyStore..
11:58:38,253 INFO [log] FILE EXISTS NOOB
11:58:38,262 INFO [log] FILE READ NOOB
11:58:38,266 INFO [HttpClientSupport$Helper] Updating keyStore..
11:58:38,268 INFO [HttpClientSupport$Helper] Initializing KeyStore
11:58:38,471 ERROR [SoapUI] An error occurred [java.lang.ExceptionInInitializerError], see error log for details
java.lang.ExceptionInInitializerError
at com.eviware.soapui.impl.wsdl.support.http.HttpClientSupport$Helper.initSocketFactory(HttpClientSupport.java:301)
at com.eviware.soapui.impl.wsdl.support.http.HttpClientSupport$Helper$SSLSettingsListener.settingChanged(HttpClientSupport.java:256)
at com.eviware.soapui.impl.settings.XmlBeansSettingsImpl.notifySettingChanged(XmlBeansSettingsImpl.java:113)
at com.eviware.soapui.impl.settings.XmlBeansSettingsImpl.setString(XmlBeansSettingsImpl.java:107)
at com.eviware.soapui.model.settings.Settings$setString.call(Unknown Source)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:47)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:116)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:136)
at Script1.run(Script1.groovy:28)
at com.eviware.soapui.support.scripting.groovy.SoapUIGroovyScriptEngine.run(SoapUIGroovyScriptEngine.java:90)
at com.eviware.soapui.impl.wsdl.teststeps.WsdlGroovyScriptTestStep.run(WsdlGroovyScriptTestStep.java:141)
at com.eviware.soapui.impl.wsdl.support.AbstractTestCaseRunner.runTestStep(AbstractTestCaseRunner.java:211)
at com.eviware.soapui.impl.wsdl.testcase.WsdlTestCaseRunner.runCurrentTestStep(WsdlTestCaseRunner.java:47)
at com.eviware.soapui.impl.wsdl.support.AbstractTestCaseRunner.internalRun(AbstractTestCaseRunner.java:138)
at com.eviware.soapui.impl.wsdl.support.AbstractTestCaseRunner.internalRun(AbstractTestCaseRunner.java:46)
at com.eviware.soapui.impl.wsdl.support.AbstractTestRunner.run(AbstractTestRunner.java:128)
at com.eviware.soapui.impl.wsdl.support.AbstractTestRunner.start(AbstractTestRunner.java:76)
at com.eviware.soapui.impl.wsdl.testcase.WsdlTestCase.run(WsdlTestCase.java:594)
at com.eviware.soapui.tools.SoapUITestCaseRunner.runTestCase(SoapUITestCaseRunner.java:573)
at com.eviware.soapui.tools.SoapUITestCaseRunner.runRunner(SoapUITestCaseRunner.java:405)
at com.eviware.soapui.tools.AbstractSoapUIRunner.run(AbstractSoapUIRunner.java:202)
at com.eviware.soapui.tools.AbstractSoapUIRunner.run(AbstractSoapUIRunner.java:137)
at com.eviware.soapui.tools.AbstractSoapUIRunner.runFromCommandLine(AbstractSoapUIRunner.java:112)
at com.eviware.soapui.tools.SoapUITestCaseRunner.main(SoapUITestCaseRunner.java:122)
Caused by: java.lang.NullPointerException
at org.apache.commons.ssl.TrustMaterial.<init>(TrustMaterial.java:167)
at org.apache.commons.ssl.TrustMaterial.<init>(TrustMaterial.java:158)
at org.apache.commons.ssl.TrustMaterial.<clinit>(TrustMaterial.java:148)
... 24 more
11:58:38,489 INFO [HttpClientSupport$Helper] Updating keyStore..
11:58:38,490 INFO [HttpClientSupport$Helper] Initializing KeyStore
11:58:38,491 ERROR [SoapUI] An error occurred [Could not initialize class org.apache.commons.ssl.KeyMaterial], see error log for details
java.lang.NoClassDefFoundError: Could not initialize class org.apache.commons.ssl.KeyMaterial
at com.eviware.soapui.impl.wsdl.support.http.HttpClientSupport$Helper.initSocketFactory(HttpClientSupport.java:301)
at com.eviware.soapui.impl.wsdl.support.http.HttpClientSupport$Helper$SSLSettingsListener.settingChanged(HttpClientSupport.java:256)
at com.eviware.soapui.impl.settings.XmlBeansSettingsImpl.notifySettingChanged(XmlBeansSettingsImpl.java:113)
at com.eviware.soapui.impl.settings.XmlBeansSettingsImpl.setString(XmlBeansSettingsImpl.java:107)
at com.eviware.soapui.model.settings.Settings$setString.call(Unknown Source)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:47)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:116)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:136)
at Script1.run(Script1.groovy:28)
at com.eviware.soapui.support.scripting.groovy.SoapUIGroovyScriptEngine.run(SoapUIGroovyScriptEngine.java:90)
at com.eviware.soapui.impl.wsdl.teststeps.WsdlGroovyScriptTestStep.run(WsdlGroovyScriptTestStep.java:141)
at com.eviware.soapui.impl.wsdl.support.AbstractTestCaseRunner.runTestStep(AbstractTestCaseRunner.java:211)
at com.eviware.soapui.impl.wsdl.testcase.WsdlTestCaseRunner.runCurrentTestStep(WsdlTestCaseRunner.java:47)
at com.eviware.soapui.impl.wsdl.support.AbstractTestCaseRunner.internalRun(AbstractTestCaseRunner.java:138)
at com.eviware.soapui.impl.wsdl.support.AbstractTestCaseRunner.internalRun(AbstractTestCaseRunner.java:46)
at com.eviware.soapui.impl.wsdl.support.AbstractTestRunner.run(AbstractTestRunner.java:128)
at com.eviware.soapui.impl.wsdl.support.AbstractTestRunner.start(AbstractTestRunner.java:76)
at com.eviware.soapui.impl.wsdl.testcase.WsdlTestCase.run(WsdlTestCase.java:594)
at com.eviware.soapui.tools.SoapUITestCaseRunner.runTestCase(SoapUITestCaseRunner.java:573)
at com.eviware.soapui.tools.SoapUITestCaseRunner.runRunner(SoapUITestCaseRunner.java:405)
at com.eviware.soapui.tools.AbstractSoapUIRunner.run(AbstractSoapUIRunner.java:202)
at com.eviware.soapui.tools.AbstractSoapUIRunner.run(AbstractSoapUIRunner.java:137)
at com.eviware.soapui.tools.AbstractSoapUIRunner.runFromCommandLine(AbstractSoapUIRunner.java:112)
at com.eviware.soapui.tools.SoapUITestCaseRunner.main(SoapUITestCaseRunner.java:122)
11:58:38,506 INFO [HttpClientSupport$Helper] Updating keyStore..
11:58:38,507 INFO [HttpClientSupport$Helper] Initializing KeyStore
11:58:38,507 ERROR [SoapUI] An error occurred [Could not initialize class org.apache.commons.ssl.KeyMaterial], see error log for details
java.lang.NoClassDefFoundError: Could not initialize class org.apache.commons.ssl.KeyMaterial
at com.eviware.soapui.impl.wsdl.support.http.HttpClientSupport$Helper.initSocketFactory(HttpClientSupport.java:301)
at com.eviware.soapui.impl.wsdl.support.http.HttpClientSupport$Helper$SSLSettingsListener.settingsReloaded(HttpClientSupport.java:273)
at com.eviware.soapui.impl.settings.XmlBeansSettingsImpl.notifySettingsReloaded(XmlBeansSettingsImpl.java:126)
at com.eviware.soapui.impl.settings.XmlBeansSettingsImpl.reloadSettings(XmlBeansSettingsImpl.java:119)
at com.eviware.soapui.model.settings.Settings$reloadSettings$0.call(Unknown Source)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:47)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:116)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:120)
at Script1.run(Script1.groovy:31)
at com.eviware.soapui.support.scripting.groovy.SoapUIGroovyScriptEngine.run(SoapUIGroovyScriptEngine.java:90)
at com.eviware.soapui.impl.wsdl.teststeps.WsdlGroovyScriptTestStep.run(WsdlGroovyScriptTestStep.java:141)
at com.eviware.soapui.impl.wsdl.support.AbstractTestCaseRunner.runTestStep(AbstractTestCaseRunner.java:211)
at com.eviware.soapui.impl.wsdl.testcase.WsdlTestCaseRunner.runCurrentTestStep(WsdlTestCaseRunner.java:47)
at com.eviware.soapui.impl.wsdl.support.AbstractTestCaseRunner.internalRun(AbstractTestCaseRunner.java:138)
at com.eviware.soapui.impl.wsdl.support.AbstractTestCaseRunner.internalRun(AbstractTestCaseRunner.java:46)
at com.eviware.soapui.impl.wsdl.support.AbstractTestRunner.run(AbstractTestRunner.java:128)
at com.eviware.soapui.impl.wsdl.support.AbstractTestRunner.start(AbstractTestRunner.java:76)
at com.eviware.soapui.impl.wsdl.testcase.WsdlTestCase.run(WsdlTestCase.java:594)
at com.eviware.soapui.tools.SoapUITestCaseRunner.runTestCase(SoapUITestCaseRunner.java:573)
at com.eviware.soapui.tools.SoapUITestCaseRunner.runRunner(SoapUITestCaseRunner.java:405)
at com.eviware.soapui.tools.AbstractSoapUIRunner.run(AbstractSoapUIRunner.java:202)
at com.eviware.soapui.tools.AbstractSoapUIRunner.run(AbstractSoapUIRunner.java:137)
at com.eviware.soapui.tools.AbstractSoapUIRunner.runFromCommandLine(AbstractSoapUIRunner.java:112)
at com.eviware.soapui.tools.SoapUITestCaseRunner.main(SoapUITestCaseRunner.java:122)
11:58:38,522 INFO [HttpClientSupport$Helper] Updating keyStore..
11:58:38,523 INFO [HttpClientSupport$Helper] Initializing KeyStore
11:58:38,524 ERROR [SoapUI] An error occurred [Could not initialize class org.apache.commons.ssl.KeyMaterial], see error log for details
java.lang.NoClassDefFoundError: Could not initialize class org.apache.commons.ssl.KeyMaterial
at com.eviware.soapui.impl.wsdl.support.http.HttpClientSupport$Helper.initSocketFactory(HttpClientSupport.java:301)
at com.eviware.soapui.impl.wsdl.support.http.HttpClientSupport$Helper$SSLSettingsListener.settingsReloaded(HttpClientSupport.java:273)
at com.eviware.soapui.impl.settings.XmlBeansSettingsImpl.notifySettingsReloaded(XmlBeansSettingsImpl.java:126)
at com.eviware.soapui.impl.settings.XmlBeansSettingsImpl.reloadSettings(XmlBeansSettingsImpl.java:119)
at com.eviware.soapui.model.settings.Settings$reloadSettings$0.call(Unknown Source)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:47)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:116)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:120)
at Script1.run(Script1.groovy:31)
at com.eviware.soapui.support.scripting.groovy.SoapUIGroovyScriptEngine.run(SoapUIGroovyScriptEngine.java:90)
at com.eviware.soapui.impl.wsdl.teststeps.WsdlGroovyScriptTestStep.run(WsdlGroovyScriptTestStep.java:141)
at com.eviware.soapui.impl.wsdl.support.AbstractTestCaseRunner.runTestStep(AbstractTestCaseRunner.java:211)
at com.eviware.soapui.impl.wsdl.testcase.WsdlTestCaseRunner.runCurrentTestStep(WsdlTestCaseRunner.java:47)
at com.eviware.soapui.impl.wsdl.support.AbstractTestCaseRunner.internalRun(AbstractTestCaseRunner.java:138)
at com.eviware.soapui.impl.wsdl.support.AbstractTestCaseRunner.internalRun(AbstractTestCaseRunner.java:46)
at com.eviware.soapui.impl.wsdl.support.AbstractTestRunner.run(AbstractTestRunner.java:128)
at com.eviware.soapui.impl.wsdl.support.AbstractTestRunner.start(AbstractTestRunner.java:76)
at com.eviware.soapui.impl.wsdl.testcase.WsdlTestCase.run(WsdlTestCase.java:594)
at com.eviware.soapui.tools.SoapUITestCaseRunner.runTestCase(SoapUITestCaseRunner.java:573)
at com.eviware.soapui.tools.SoapUITestCaseRunner.runRunner(SoapUITestCaseRunner.java:405)
at com.eviware.soapui.tools.AbstractSoapUIRunner.run(AbstractSoapUIRunner.java:202)
at com.eviware.soapui.tools.AbstractSoapUIRunner.run(AbstractSoapUIRunner.java:137)
at com.eviware.soapui.tools.AbstractSoapUIRunner.runFromCommandLine(AbstractSoapUIRunner.java:112)
at com.eviware.soapui.tools.SoapUITestCaseRunner.main(SoapUITestCaseRunner.java:122)
我尝试了不同的jdk、jre和soapui版本。我总是遇到这样的例外。当然,如果我的测试用例失败,那么最终的结果是,因为它需要它的密钥库才能正常工作。
拜托,你知道吗?
非常感谢。
暂无答案!
目前还没有任何答案,快来回答吧!