简体   繁体   English

Websphere Liberty- java.lang.NoClassDefFoundError:com.ibm.websphere.ssl.SSLException

[英]Websphere Liberty- java.lang.NoClassDefFoundError: com.ibm.websphere.ssl.SSLException

I am getting the following error while instantiating a web application on WebSphere Liberty beta. 我在WebSphere Liberty beta上实例化Web应用程序时收到以下错误。 The application starts successfully on WebSphere Application Server 8.5.5 应用程序在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

Please provide any pointers that could help me resolve this. 请提供任何可以帮助我解决此问题的指示。 Here is server.xml for liberty server: 这是自由服务器的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>

EDIT: The exception is thrown while generating spring jax-ws client bean. 编辑:生成spring jax-ws客户端bean时抛出异常。 My application-context.xml file for the webservice client looks like: 我的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>

SSL by default is not enabled on Liberty. Liberty上未启用默认SSL。 Did you add ssl-1.0 feature to your server.xml and configured according to this page Enabling SSL communication for the Liberty profile . 您是否已将ssl-1.0功能添加到server.xml并根据此页面进行配置为Liberty配置文件启用SSL通信

PS. PS。 Add your server.xml file to the question. server.xml文件添加到问题中。

If you are using JVM from full WebSphere, you need to change SSL factories. 如果您使用完整WebSphere的JVM,则需要更改SSL工厂。 Create jvm.options file in the server directory with the following content: 使用以下内容在服务器目录中创建jvm.options文件:

-Djava.security.properties=./myjava.security

Create myjava.security file in the server directory with the following content (empty properties): 使用以下内容(空属性)在服务器目录中创建myjava.security文件:

 ssl.SocketFactory.provider=
 ssl.ServerSocketFactory.provider=

Alternatively, test your application with Liberty running on Oracle JVM. 或者,使用在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.

相关问题 com.ibm.websphere.servlet.error.ServletErrorReport:java.lang.NoClassDefFoundError:org.hibernate.impl.SessionFactoryImpl - com.ibm.websphere.servlet.error.ServletErrorReport: java.lang.NoClassDefFoundError: org.hibernate.impl.SessionFactoryImpl Websphere到Tomcat的迁移:java.lang.NoClassDefFoundError:com / ibm / wsspi / uow / UOWActionException - Websphere to Tomcat migration: java.lang.NoClassDefFoundError: com/ibm/wsspi/uow/UOWActionException 来自Websphere的java.lang.NoClassDefFoundError - java.lang.NoClassDefFoundError from websphere MQ(Websphere)连接问题java.lang.NoClassDefFoundError - MQ (websphere) connection issue java.lang.NoClassDefFoundError java.lang.NoClassDefFoundError:Tomcat中的com / ibm / mq / MQException - java.lang.NoClassDefFoundError: com/ibm/mq/MQException in Tomcat java.lang.NoClassDefFoundError:javax.servlet.ServletInputStream在Websphere上部署时出错 - java.lang.NoClassDefFoundError: javax.servlet.ServletInputStream Error deploying on websphere IBM Message Broker Java API:java.lang.NoClassDefFoundError:com.ibm.mq.MQException - IBM Message Broker Java API: java.lang.NoClassDefFoundError: com.ibm.mq.MQException java.lang.ArrayStoreException IBM Websphere - java.lang.ArrayStoreException IBM Websphere WebSphere Application Server for Developers与IBM WebSphere SDK Java 7 for Liberty和完整概要文件的区别 - difference for WebSphere Application Server for Developers VS IBM WebSphere SDK Java 7 for Liberty and Full profile Japss补丁升级到7.0。,5 | java.lang.NoClassDefFoundError:com / sun / net / ssl / internal / ssl / Provider - Jboss patch to eap 7.0.,5 | java.lang.NoClassDefFoundError: com/sun/net/ssl/internal/ssl/Provider
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM