WebLogic 10.3.6.0 WAR部署

时间:2018-09-10 08:24:47

标签: java rest maven weblogic

我已经开发并测试了REST WS应用程序。开发人员环境是Tomcat 8,我对此没有任何问题。在Weblogic 10.3.6.0中部署战争时,我将其打包在.ear中并尝试安装,但是出现以下错误:

enter image description here

165c267237d:-8000-0000000000000d08> <1536566494204> <BEA-101371> <There was a failure when processing annotations for application /home/osm/Oracle/Middleware/user_projects/domains/XXX/servers/Serve
r/tmp/_WL_user/Mock_Core/55tjfs/com.XXX-web-module-1.5.war. Please make sure that the annotations are valid. The error is String index out of range: 36611>

weblogic-application.xml代码

<!DOCTYPE application PUBLIC "-//Sun Microsystems,
Inc.//DTD J2EE Application 1.2//EN"
        "http://java.sun.com/j2ee/dtds/application_1_2.dtd">
<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">
    <display-name>Core_MockSystem</display-name>
    <module>
        <web>
            <web-uri>com.XXX.core-web-module-1.5.war</web-uri>
            <context-root>/CoreWS</context-root>
        </web>
    </module>
</application>

web.xml代码

<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_2_5.xsd"
         id="WebApp_ID" version="2.5">
    <servlet>
        <servlet-name>RestServiceOrderReporter</servlet-name>
        <servlet-class>com.sun.jersey.spi.container.servlet.ServletContainer</servlet-class>
    </servlet>
    <servlet-mapping>
        <servlet-name>RestServiceOrderReporter</servlet-name>
        <url-pattern>/coreWS</url-pattern>
    </servlet-mapping>

</web-app>

REST类

package com.XXX.core.rest;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;


import javax.ws.rs.Produces;
import javax.ws.rs.ApplicationPath;
import javax.ws.rs.core.MediaType;
import java.sql.*;

@RestController
@ApplicationPath("coreWS")
public class RestServiceOrderReporter {

    private Connection conn = null;
    private Statement statement = null;
    private ResultSet resultSet = null;


    public RestServiceOrderReporter(){

        try {
            Class.forName("oracle.jdbc.driver.OracleDriver");
        } catch (ClassNotFoundException e) {
            e.printStackTrace();
        }
        try {
            this.conn = XXX;
        } catch (SQLException e) {
            e.printStackTrace();
        }

        try {
            this.statement = conn.createStatement();
        } catch (SQLException e) {
            e.printStackTrace();
        }
    }

    @Produces({MediaType.APPLICATION_JSON})
    @RequestMapping("/isOrderTerminated")
    public String orderTerminationReport(@RequestParam(value="orderID", defaultValue="orderID") String orderID) {
        XXX
    }

    @Produces({MediaType.APPLICATION_JSON})
    @RequestMapping("/isInAULL")
    public String orderAULL(@RequestParam(value="orderID", defaultValue="orderID") String orderID) {
        XXX
    }

    @Produces({MediaType.APPLICATION_JSON})
    @RequestMapping("/isInTOA")
    public String orderTOA(@RequestParam(value="orderID", defaultValue="orderID") String orderID) {XXX
    }

    @Produces({MediaType.APPLICATION_JSON})
    @RequestMapping("/isInAsyncHPSA")
    public String orderAsyncHPSA(@RequestParam(value="orderID", defaultValue="orderID") String orderID) {
      XXX
    }

    private String setResultOrderCompleted(String orderID) {
        XXX
        return "false";
    }

    private String getTESAStage(String orderID) {
        XX
        }


    private String getTOAStage(String orderID) {
       XXX
    }

    private String getHPSAStage(String orderID) {
       XXX
    }
}

如果我直接在Weblogic中部署.war,则会发生相同的错误。我在日志中找不到更具描述性的错误。这个问题可能是WL 10.3.6错误吗?

1 个答案:

答案 0 :(得分:0)

weblogic-application.xml是服务器特定的部署描述符,它扩展了application.xml部署描述符。

要处理任何特定于Weblogic的标签,您需要类似:

<?xml version="1.0" encoding="UTF-8"?>
<weblogic-application xmlns="http://xmlns.oracle.com/weblogic/weblogic-application"
                      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                      xsi:schemaLocation="http://xmlns.oracle.com/weblogic/weblogic-application http://xmlns.oracle.com/weblogic/weblogic-application/1.3/weblogic-application.xsd">

.....

</weblogic-application> 

此文件将与application.xml位于同一位置。