2014-09-03 81 views
0

嗨,我希望你能幫助我請:)我有一個使用servlet 2.4的web應用程序,我知道很老,但我試圖將這個應用程序部署在Liberty Profile 8.5.5.3,Liberty配置文件與「功能」的工作,我使用「jsp-2.2」,我讀了關於該功能,它使用Servlet 3.0,假設我可以使用其他servlet版本,如果我使用classLoader配置,但是當我啓動我的服務器自由Profile Web這個使用Servlet 3.0,可以使用Liberty Profile和Servlet 2.4 ?.Liberty Profile + Servlet 2.4

我的server.xml配置爲:

<?xml version="1.0" encoding="UTF-8"?> 
<server description="server01"> 

<!-- Enable features --> 
<featureManager> 
    <feature>jsp-2.2</feature> 
</featureManager> 
<application id="webapptest" name="webapp type="ear" location="D:/LBP/webapp.ear"> 
    <classloader delegation="parentLast" commonLibraryRef="mySharedLib"></classloader> 
</application> 
<library id="mySharedLib"> 
    <fileset dir="D:/LBP/wlp/usr/servers/server-prueba01/myLib" includes="*.jar" /> 
</library> 
<!-- To access this server from a remote client add a host attribute to the following element, e.g. host="*" --> 
<httpEndpoint id="defaultHttpEndpoint" 
       httpPort="9088" 
       httpsPort="9443" /> 
</server> 

在 「commonLibraryRef」 我把 「servlet的API-2.4」 罐子

回答

0

我建議你剛剛更新的應用程序和Web部署描述符到Java EE 6(Servlet 3.0):

// web.xml 
<web-app xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" version="3.0"> 

// application.xml 
<application xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/application_6.xsd" version="6"> 

並嘗試您的應用程序。我會說大多數2.4 servlet在3.0中運行良好。

如果您嘗試從其他應用程序服務器遷移,則可以嘗試IBM WebSphere Application Server Migration Toolkit以查看遷移應用程序需要進行多少更改。

+0

嗨,朋友,我也嘗試過,但我必須補充說,我工作與舊的春天版本有依賴於servlet版本(2.4),這是一個大的應用程序,所以我想知道是否有一種方法使用servlet 2.4版本,如果沒有,我會記住更新我的春天版本(我使用WAS,它的工作原理,但知道我必須使用Liberty Profile) – CharlyPL 2014-09-03 22:15:03

+0

@CharlyPL據我所知,你不能在Liberty中運行J2EE 1.4應用程序並替換servlet罐子。所以當你改變描述符時,你有什麼樣的錯誤? – Gas 2014-09-03 22:18:33

+0

相同的錯誤異常= java.lang.ClassCastException 源= com.ibm.ws.webcontainer.servlet.ServletWrapper.loadServlet probeid = 213 堆棧轉儲= java.lang.ClassCastException:mx.telecom.company.compatibility.ws .ControlWebService無法轉換爲javax.servlet.Servlet – CharlyPL 2014-09-03 22:28:44

相關問題