开发者社区> 问答> 正文

帮忙看一下这个spring的错误

今天在weblogic调试时候总是报这个问题,“Caused By: org.xml.sax.SAXParseException; lineNumber: 49; columnNumber: 48; cvc-complex-type.2.4.c: 通配符的匹配很全面, 但无法找到元素 'jee:jndi-lookup' 的声明。

展开
收起
a123456678 2016-03-17 14:04:48 2540 0
1 条回答
写回答
取消 提交回答
  • spring配置文件

    <?xml version="1.0" encoding="UTF-8"?>
    <!--suppress SpringFacetInspection -->
    <beans xmlns="http://www.springframework.org/schema/beans"
           xmlns:mvc="http://www.springframework.org/schema/mvc"
           xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
           xmlns:context="http://www.springframework.org/schema/context"
           xmlns:aop="http://www.springframework.org/schema/aop"
           xmlns:tx="http://www.springframework.org/schema/tx"
           xmlns:jee="http://www.springframework.org/schema/jee"
           xsi:schemaLocation="
                http://www.springframework.org/schema/beans
                http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
                http://www.springframework.org/schema/context
                http://www.springframework.org/schema/context/spring-context-3.0.xsd
                http://www.springframework.org/schema/mvc
                http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd
                http://www.springframework.org/schema/aop
                http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
                http://www.springframework.org/schema/tx
                http://www.springframework.org/schema/tx/spring-tx-3.0.xsd
                http://www.springframework.org/schema/jee
                http://www.springframework.org/schema/jee/spring-tx-3.0.xsd">
     
        <!-- 上下文,注解方式需要扫描的包 -->
        <context:component-scan base-package="net.wdm" />
     
        <!-- 自定义输入和输出数据的参数-->
        <bean class ="org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter" >
            <property name="webBindingInitializer">
                <bean class="net.wdm.util.BindingInitializer" />  <!-- 这里注册自定义数据绑定类 -->
            </property>
            <property name="messageConverters">
                <list>
                    <!-- 设置返回字符串编码 -->
                    <bean class="org.springframework.http.converter.StringHttpMessageConverter">
                        <property name = "supportedMediaTypes">
                            <list>
                                <value>text/html;charset=UTF-8</value>
                            </list>
                        </property>
                    </bean>
                    <!-- json转换器 -->
                    <bean class="org.springframework.http.converter.json.MappingJacksonHttpMessageConverter" >
                        <property name="supportedMediaTypes">
                            <list>
                                <value>text/html;charset=UTF-8</value>
                            </list>
                        </property>
                    </bean>
                </list>
            </property>
        </bean>
     
        <!-- 数据源配置,使用应用服务器的数据库连接池 -->
        <jee:jndi-lookup id="wdm" jndi-name="wdm" />
     
        <!--声明事物对象-->
        <bean id="transactionManager" class="org.springframework.transaction.jta.JtaTransactionManager"/>
     
        <!--声明事物传播意图-->
        <tx:advice id="txAdvice" transaction-manager="transactionManager">
            <tx:attributes>
                <tx:method name="get*" read-only="true" propagation="NOT_SUPPORTED"/>
                <tx:method name="find*" read-only="true" propagation="NOT_SUPPORTED"/>
                <tx:method name="*" rollback-for="Exception"/>
            </tx:attributes>
        </tx:advice>
     
        <!--面向切面编程指定事物管理对象-->
        <aop:config>
            <aop:pointcut id="transactionPointcut" expression="execution(* net.wdm.service.jdbcImpl.*.*(..))"/>
            <aop:advisor advice-ref="txAdvice" pointcut-ref="transactionPointcut"/>
        </aop:config>
     
        <!-- 对模型视图名称的解析,在请求时模型视图名称添加前后缀 -->
        <bean class="org.springframework.web.servlet.view.InternalResourceViewResolver">
            <property name="prefix" value="/"/>
            <property name="suffix" value=".jsp"/>
        </bean>
     
        <!--注册拦截器-->
        <mvc:interceptors>
            <mvc:interceptor>
                <mvc:mapping path="/**/**"/>
                <bean class="net.wdm.util.Interceptor"/>
            </mvc:interceptor>
        </mvc:interceptors>
     
        <bean id="jdbcUtil" class="net.wdm.util.JdbcUtil">
            <constructor-arg name="dataSource" ref="wdm"/>
        </bean>
    </beans>
    2019-07-17 19:05:18
    赞同 展开评论 打赏
问答排行榜
最热
最新

相关电子书

更多
Spring Boot 2.5开发实战 立即下载
Java Spring Boot开发实战系列课程【第15讲】:Spring Boot 2.0 API与Spring REST Docs实战 立即下载
Java Spring Boot开发实战系列课程【第6讲】:Spring Boot 2.0实战MyBatis与优化(Java面试题) 立即下载

相关实验场景

更多