今天在weblogic调试时候总是报这个问题,“Caused By: org.xml.sax.SAXParseException; lineNumber: 49; columnNumber: 48; cvc-complex-type.2.4.c: 通配符的匹配很全面, 但无法找到元素 'jee:jndi-lookup' 的声明。
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>
版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。