[英]com.ibm.websphere.servlet.error.ServletErrorReport: java.lang.NoClassDefFoundError: org.hibernate.impl.SessionFactoryImpl
[英]Websphere Liberty- java.lang.NoClassDefFoundError: com.ibm.websphere.ssl.SSLException
我在WebSphere Liberty beta上實例化Web應用程序時收到以下錯誤。 應用程序在WebSphere Application Server 8.5.5上成功啟動
Caused by: java.lang.NoClassDefFoundError: com.ibm.websphere.ssl.SSLException
at java.lang.J9VMInternals.verifyImpl(Native Method)
at java.lang.J9VMInternals.verify(J9VMInternals.java:93)
at java.lang.J9VMInternals.verify(J9VMInternals.java:91)
at java.lang.J9VMInternals.prepare(J9VMInternals.java:490)
at java.lang.Class.getDeclaredConstructors(Class.java:553)
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.determineCandidateConstructors(AutowiredAnnotationBeanPostProcessor.java:231)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.determineConstructorsFromBeanPostProcessors(AbstractAutowireCapableBeanFactory.java:1002)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:975)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:487)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:458)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:296)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:223)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:293)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:633)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:932)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:479)
at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:410)
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:306)
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:112)
at com.ibm.ws.webcontainer.webapp.WebApp.notifyServletContextCreated(WebApp.java:2381)
... 1 more
請提供任何可以幫助我解決此問題的指示。 這是自由服務器的server.xml:
<server description="new server">
<!-- Enable features -->
<!-- To access this server from a remote client add a host attribute to
the following element, e.g. host="*" -->
<featureManager>
<feature>beanValidation-1.1</feature>
<feature>jdbc-4.0</feature>
<feature>jaxb-2.2</feature>
<feature>localConnector-1.0</feature>
<feature>jaxws-2.2</feature>
<feature>distributedMap-1.0</feature>
<feature>servlet-3.0</feature>
<feature>ssl-1.0</feature>
</featureManager>
<include location="GeneratedSSLInclude.xml"/>
<httpEndpoint httpPort="9081" httpsPort="9444" id="defaultHttpEndpoint"/>
<logging consoleLogLevel="INFO" traceSpecification="javax.validation *=info:javax.validation.*=finest"/>
<library id="JAX-RS2">
<fileset dir="C:\workspace_eclipse\JAX-RS2\lib" includes="*.jar" scanInterval="5"/>
</library>
<applicationMonitor updateTrigger="mbean"/>
<enterpriseApplication id="ProductServiceEAR" location="ProductServiceEAR-1.0.ear" name="ProductServiceEAR">
<classloader privateLibraryRef="JAX-RS2"/>
</enterpriseApplication>
<keyStore id="defaultKeyStore" password="{xor}AXnKzg6TSmwMw=="/> -->
</server>
編輯:生成spring jax-ws客戶端bean時拋出異常。 我的webservice客戶端的application-context.xml文件如下所示:
<bean id="searchWebServiceClient"
class="org.springframework.remoting.jaxws.JaxWsPortProxyFactoryBean">
<property name="serviceInterface"
value="au.com.test.search.SearchWebServiceClient" />
<property name="wsdlDocumentUrl" value="classpath:/ServiceSchemas/involvedPartyManagement/involvedPartyManagement/SearchWebService_v2.wsdl" />
<property name="namespaceUri"
value="http://www.test.com.au/gn/involvedPartyManagement/services/SearchWebService/v2/WS0234" />
<property name="serviceName"
value="SearchWebService" />
<property name="endpointAddress" value="${WS0234v2}" />
</bean>
Liberty上未啟用默認SSL。 您是否已將ssl-1.0
功能添加到server.xml
並根據此頁面進行配置為Liberty配置文件啟用SSL通信 。
PS。 將server.xml
文件添加到問題中。
如果您使用完整WebSphere的JVM,則需要更改SSL工廠。 使用以下內容在服務器目錄中創建jvm.options
文件:
-Djava.security.properties=./myjava.security
使用以下內容(空屬性)在服務器目錄中創建myjava.security
文件:
ssl.SocketFactory.provider=
ssl.ServerSocketFactory.provider=
或者,使用在Oracle JVM上運行的Liberty來測試應用程序。
You need to add transportSecurity feature type in server.xml as:
<feature>transportSecurity-1.0</feature>
and also add SSL configuration (see below a prescription from server.xml) so that it could create SSLContext using SPI in your code -- something like:
JSSEHelper.getInstance().getSSLContext("sslContextName", null, null);
<!-- SSL config -->
<keyStore id="sslKeyStore" location="${ssl.keystore.location}" password="${ssl.password}"/>
<keyStore id="sslTrustStore" location="${ssl.truststore.location}" password="${ssl.password}"/>
<ssl id="sslContextName" sslProtocol="TLSv1" securityLevel="HIGH" keyStoreRef="sslKeyStore" trustStoreRef="sslTrustStore" clientAuthenticationSupported="true" >
<outboundConnection host="${some.service.host}" port="${some.service.port}" />
</ssl>
Remember - you need to run your app under Liberty profile. If not then you put it inside try()/catch() block -- something like:
try {
return JSSEHelper.getInstance().getSSLContext("sslContextName", null, null);
}
catch (SSLException | NoClassDefFoundError e) {
return SSLContextBuilder
.create()
.loadTrustMaterial(
Paths.get(webServiceClientConfig.getTrustStore()).toFile(), webServiceClientConfig.getSslPassword().toCharArray())
.build();
}
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.