简体   繁体   中英

Configured jetty server in mule esb

I want to Configured embedded jetty server in mule esb.

I have tried many thing but unable to get success. Please give me step how to configured.

I want to make webinf folder in which I can host servlet file and jsp file. I have seen online book example, but It is not working in my mulestudio.

I am getting folder structure error. I have also tried to search but didn't get any working example.

In mule-config.xml add the fillowing :-

 <?xml version="1.0" encoding="UTF-8"?>
    <mule xmlns="http://www.mulesoft.org/schema/mule/core"
          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
          xmlns:jetty="http://www.mulesoft.org/schema/mule/jetty"
          xsi:schemaLocation="
            http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd
            http://www.mulesoft.org/schema/mule/jetty http://www.mulesoft.org/schema/mule/jetty/current/mule-jetty.xsd">

        <jetty:connector name="jettyConnector">
            <jetty:webapps directory="${app.home}/webapps" port="8083"/>
        </jetty:connector>

    </mule>

create a webapps folder in src/main/app folder of your project where you have WEB-INF and HTML/JSP files same as you have in other server

Adding a complete SSL example. It's been quite a while since the question was asked, but I hope this will help someone.

<?xml version="1.0" encoding="UTF-8"?>
<mule xmlns="http://www.mulesoft.org/schema/mule/core" 
    xmlns:jetty="http://www.mulesoft.org/schema/mule/jetty" 
    xmlns:jetty-ssl="http://www.mulesoft.org/schema/mule/jetty-ssl" 
    xmlns:context="http://www.springframework.org/schema/context"
    xmlns:doc="http://www.mulesoft.org/schema/mule/documentation"
    xmlns:spring="http://www.springframework.org/schema/beans" 
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd
    http://www.mulesoft.org/schema/mule/jetty-ssl http://www.mulesoft.org/schema/mule/jetty-ssl/current/mule-jetty-ssl.xsd
    http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-current.xsd
    http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-current.xsd
    http://www.mulesoft.org/schema/mule/jetty http://www.mulesoft.org/schema/mule/jetty/current/mule-jetty.xsd
    http://www.mulesoft.org/schema/mule/jetty-ssl http://www.mulesoft.org/schema/mule/jetty/current/mule-jetty-ssl.xsd">

    <context:property-placeholder location="${mule.env}.properties" />

    <jetty-ssl:connector name="jettySslConnector" doc:name="Jetty">
        <jetty-ssl:tls-key-store   
            path="${ssl.keystore.path}" 
            keyAlias="${ssl.keystore.alias}" 
            storePassword="${ssl.keystore.keypassword}" 
            keyPassword="${ssl.keystore.keypassword}" 
            type="jks" />
        <jetty-ssl:webapps 
            directory="${app.home}/webapps" 
            port="${https.port}" />
    </jetty-ssl:connector>

</mule>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM