类型不匹配:无法从Tag转换为JspTag

时间:2014-02-27 17:46:17

标签: jsp weblogic myfaces

我正在使用在WebLogic 10.3.5上运行的Spring,Hibernate,RichFaces,Myfaces创建一个Web应用程序

这是我的pom.xml

<properties>
    <spring.version>4.0.2.RELEASE</spring.version>
    <junit.version>4.11</junit.version>
    <log4j.version>1.2.17</log4j.version>
    <myfaces.version>2.2.0</myfaces.version>
    <tomahawk.version>1.1.14</tomahawk.version>
    <jstl.version>1.2</jstl.version>
    <commons-beanutils.version>1.9.1</commons-beanutils.version>
    <commons-collections.version>3.2.1</commons-collections.version>
    <commons-digester.version>2.1</commons-digester.version>
    <commons-logging.version>1.1.3</commons-logging.version>
    <jhighlight.version>1.0</jhighlight.version>
    <richfaces.version>3.3.3.Final</richfaces.version>
    <hibernate.version>3.6.10.Final</hibernate.version>
    <javassist.version>3.12.1.GA</javassist.version>
    <poi.version>3.9</poi.version>
</properties>

<dependencies>

    <!-- Log4J -->
    <dependency>
        <groupId>log4j</groupId>
        <artifactId>log4j</artifactId>
        <version>${log4j.version}</version>
    </dependency>

    <!-- Spring 4 dependencies -->

    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-core</artifactId>
        <version>${spring.version}</version>
    </dependency>

    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-context</artifactId>
        <version>${spring.version}</version>
    </dependency>

    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-orm</artifactId>
        <version>${spring.version}</version>
    </dependency>

    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-jms</artifactId>
        <version>${spring.version}</version>
    </dependency>

    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-web</artifactId>
        <version>${spring.version}</version>
    </dependency>



    <!-- jUnit -->
    <dependency>
        <groupId>junit</groupId>
        <artifactId>junit</artifactId>
        <version>${junit.version}</version>
        <scope>test</scope>
    </dependency>



    <!-- Hibernate -->
    <dependency>
        <groupId>org.hibernate</groupId>
        <artifactId>hibernate-core</artifactId>
        <version>${hibernate.version}</version>
    </dependency>

    <dependency>
        <groupId>javassist</groupId>
        <artifactId>javassist</artifactId>
        <version>${javassist.version}</version>
    </dependency>


    <!-- Myfaces -->
    <dependency>
        <groupId>org.apache.myfaces.core</groupId>
        <artifactId>myfaces-api</artifactId>
        <version>${myfaces.version}</version>
    </dependency>

    <dependency>
        <groupId>org.apache.myfaces.core</groupId>
        <artifactId>myfaces-impl</artifactId>
        <version>${myfaces.version}</version>
    </dependency>

    <!-- TomaHawk -->

    <dependency>
        <groupId>org.apache.myfaces.tomahawk</groupId>
        <artifactId>tomahawk20</artifactId>
        <version>${tomahawk.version}</version>
    </dependency>


    <!-- JSTL per RichFaces -->
    <dependency>
        <groupId>jstl</groupId>
        <artifactId>jstl</artifactId>
        <version>${jstl.version}</version>
    </dependency>

    <!-- commons-beanutils per RichFaces -->
    <dependency>
        <groupId>commons-beanutils</groupId>
        <artifactId>commons-beanutils</artifactId>
        <version>${commons-beanutils.version}</version>
    </dependency>

    <!-- Commons Collections per RichFaces -->
    <dependency>
        <groupId>commons-collections</groupId>
        <artifactId>commons-collections</artifactId>
        <version>${commons-collections.version}</version>
    </dependency>

    <!-- Commons Digester per RichFaces -->
    <dependency>
        <groupId>commons-digester</groupId>
        <artifactId>commons-digester</artifactId>
        <version>${commons-digester.version}</version>
    </dependency>

    <!-- Commons Logging per RichFaces -->
    <dependency>
        <groupId>commons-logging</groupId>
        <artifactId>commons-logging</artifactId>
        <version>${commons-logging.version}</version>
    </dependency>

    <!-- jHighlight per RichFaces -->

    <dependency>
        <groupId>com.uwyn</groupId>
        <artifactId>jhighlight</artifactId>
        <version>${jhighlight.version}</version>
    </dependency>


    <!-- RichFaces -->

    <dependency>
        <groupId>org.richfaces.framework</groupId>
        <artifactId>richfaces-impl-jsf2</artifactId>
        <version>${richfaces.version}</version>
    </dependency>

    <dependency>
        <groupId>org.richfaces.ui</groupId>
        <artifactId>richfaces-ui</artifactId>
        <version>${richfaces.version}</version>
    </dependency>

    <dependency>
        <groupId>org.richfaces.framework</groupId>
        <artifactId>richfaces-api</artifactId>
        <version>${richfaces.version}</version>
    </dependency>

    <dependency>
        <groupId>org.apache.poi</groupId>
        <artifactId>poi</artifactId>
        <version>${poi.version}</version>
    </dependency>

我没有编译错误。 我在Eclipse的Project Facets中有以下设置:

  1. 动态网络模块2.5
  2. Java 1.6
  3. Oracle WebLogic Web App Extensions 10.3.5
  4. 当我运行它时,我在我试图显示的每个jsp页面上都出现以下错误:

    类型不匹配:无法从Tag转换为JspTag

    后面跟着它包含的每个jsp或jsf标记。

    Type mismatch: cannot convert from Tag to JspTag
    <%  ^
    } 
    

    无法从JspContext转换为PageContext

    类型不匹配:无法从LoadBundleTag转换为JspTag

    等等......

    你知道我怎么解决它吗?

    我注意到如果我将以下标记放在weblogic.xml文件中,主页就可以了,但是对于其他页面我得到了这些错误:

     <wls:container-descriptor>
        <wls:prefer-web-inf-classes>true</wls:prefer-web-inf-classes>
    </wls:container-descriptor
    

    你能帮我吗?

    由于

1 个答案:

答案 0 :(得分:3)

您正在为已经为您提供基本Java EE库的Application Server(Weblogic)上部署webapp。

您可能在WEB-INF / lib库中有编译代码所需的内容,但不应将其部署在应用程序服务器上,因为它们已经提供。

在您的网络应用中搜索j2ee.jarservletapi.jar

您可以通过以下方式轻松查看哪些库包含Web应用程序中的JspTag类:

grep -nr 'JspTag' *

这些库不应位于WEB-INF / lib文件夹中,因为它们已由Application Server提供