我仍然尝试在Weblogic 12c R2上导出。但是,当我尝试在Weblogic 12c上导出时,它会使用Jersey自动生成JAX-RS。但是,我在Web应用程序上使用了Apache-CXF。你知道为什么会这样吗?
我附加了WEB-INF / web.xml文件和WEB-INF / weblogic.xml文件。
P.S。我没有使用META-INF / weblogic-application.xml
web.xml
public static double ClosestToZero(double[] ts)
{
if(ts == null || ts.LongLength ==0 )
return 0;
double a = ts[0];
double b;
for(int i = 0; i <= ts.LongLength-1; i++){
if(Math.Abs(a) > Math.Abs(ts[i])){
a = ts[i];
}
else if(Math.Abs(a) == Math.Abs(ts[i]))
{
a = a > ts[i] ? a : ts[i];
}
}
return a;
}
weblogic.xml
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://java.sun.com/xml/ns/javaee"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
metadata-complete="true" version="3.0">
<display-name>myappJAXRS</display-name>
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>WEB-INF/cxf-beans.xml</param-value>
</context-param>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<servlet>
<servlet-name>PptServlet</servlet-name>
<servlet-class>myappJAXRS.PPTServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>PptServlet</servlet-name>
<url-pattern>/ppt.do</url-pattern>
</servlet-mapping>
<servlet>
<servlet-name>ConfigServlet</servlet-name>
<servlet-class>myappJAXRS.ConfigServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>ConfigServlet</servlet-name>
<url-pattern>/config.do</url-pattern>
</servlet-mapping>
<servlet>
<description>Apache CXF Endpoint</description>
<display-name>cxf</display-name>
<servlet-name>cxf</servlet-name>
<servlet-class>org.apache.cxf.transport.servlet.CXFServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>cxf</servlet-name>
<url-pattern>/services/*</url-pattern>
</servlet-mapping>
<session-config>
<session-timeout>60</session-timeout>
</session-config>
<mime-mapping>
<extension>application</extension>
<mime-type>application/x-ms-application</mime-type>
</mime-mapping>
<mime-mapping>
<extension>xml</extension>
<mime-type>application/xml</mime-type>
</mime-mapping>
<mime-mapping>
<extension>manifest</extension>
<mime-type>application/x-ms-manifest</mime-type>
</mime-mapping>
<mime-mapping>
<extension>deploy</extension>
<mime-type>application/octet-stream</mime-type>
</mime-mapping>
<mime-mapping>
<extension>msp</extension>
<mime-type>application/octet-stream</mime-type>
</mime-mapping>
<mime-mapping>
<extension>msu</extension>
<mime-type>application/octet-stream</mime-type>
</mime-mapping>
<mime-mapping>
<extension>csv</extension>
<mime-type>text/csv</mime-type>
</mime-mapping>
<mime-mapping>
<extension>doc</extension>
<mime-type>application/msword</mime-type>
</mime-mapping>
<mime-mapping>
<extension>xls</extension>
<mime-type>application/vnd.ms-excel</mime-type>
</mime-mapping>
<mime-mapping>
<extension>xlsx</extension>
<mime-type>application/vnd.openxmlformats-
officedocument.spreadsheetml.sheet</mime-type>
</mime-mapping>
<mime-mapping>
<extension>ppt</extension>
<mime-type>application/vnd.ms-powerpoint</mime-type>
</mime-mapping>
<mime-mapping>
<extension>pptx</extension>
<mime-type>application/vnd.openxmlformats-officedocument.presentationml.presentation</mime-type>
</mime-mapping>
<mime-mapping>
<extension>pdf</extension>
<mime-type>application/pdf</mime-type>
</mime-mapping>
<mime-mapping>
<extension>zip</extension>
<mime-type>application/zip</mime-type>
</mime-mapping>
<mime-mapping>
<extension>hwp</extension>
<mime-type>application/x-hwp</mime-type>
</mime-mapping>
<welcome-file-list>
<welcome-file>index.html</welcome-file>
<welcome-file>index.htm</welcome-file>
<welcome-file>index.jsp</welcome-file>
<welcome-file>default.html</welcome-file>
<welcome-file>default.htm</welcome-file>
<welcome-file>default.jsp</welcome-file>
</welcome-file-list>
</web-app>