Przeglądaj źródła

fix duplication beans loading

knightliao 10 lat temu
rodzic
commit
0242b3f96d

+ 2 - 2
disconf-core/pom.xml

@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
 
     <modelVersion>4.0.0</modelVersion>
 
@@ -149,7 +149,7 @@
                     <showDeprecation>true</showDeprecation>
                     <showWarnings>true</showWarnings>
                     <compilerArguments>
-                        <verbose />
+                        <verbose/>
                         <bootclasspath>${java.home}/lib/rt.jar</bootclasspath>
                     </compilerArguments>
                 </configuration>

+ 4 - 0
disconf-web/pom.xml

@@ -56,6 +56,10 @@
             <artifactId>spring-instrument</artifactId>
         </dependency>
 
+        <dependency>
+            <groupId>javax.mail</groupId>
+            <artifactId>mail</artifactId>
+        </dependency>
 
         <dependency>
             <groupId>org.springframework</groupId>

+ 4 - 4
disconf-web/src/main/java/com/baidu/disconf/web/common/email/SimpleMailSender.java

@@ -20,7 +20,7 @@ import org.slf4j.LoggerFactory;
 
 /**
  * 简单邮件发送器
- * 
+ *
  * @author liaoqiqi
  * @version 2014-3-2
  */
@@ -29,8 +29,8 @@ public class SimpleMailSender {
     protected static final Logger LOG = LoggerFactory.getLogger(SimpleMailSender.class);
 
     /**
-     * 
      * @param mailInfo
+     *
      * @return
      */
     private static Message setCommon(MailSenderInfo mailInfo) throws MessagingException {
@@ -73,7 +73,7 @@ public class SimpleMailSender {
 
     /**
      * 以文本格式发送邮件
-     * 
+     *
      * @param mailInfo 待发送的邮件的信息
      */
     public static boolean sendTextMail(MailSenderInfo mailInfo) {
@@ -102,7 +102,7 @@ public class SimpleMailSender {
 
     /**
      * 以HTML格式发送邮件
-     * 
+     *
      * @param mailInfo 待发送的邮件信息
      */
     public static boolean sendHtmlMail(MailSenderInfo mailInfo) {

+ 1 - 1
disconf-web/src/main/java/com/baidu/disconf/web/web/auth/UserController.java

@@ -51,7 +51,7 @@ public class UserController extends BaseController {
     /**
      * GET 获取
      * 
-     * @param demoUserId
+     * @param
      * @return
      */
     @RequestMapping(value = "/session", method = RequestMethod.GET)

+ 2 - 3
disconf-web/src/main/java/com/baidu/ub/common/commons/ThreadContext.java

@@ -52,8 +52,7 @@ public class ThreadContext {
 
     /**
      * 获取线程上下文
-     * 
-     * @param key
+     *
      */
     public final static Map<String, Object> getContext() {
         Map<String, Object> ctx = CTX_HOLDER.get();
@@ -136,7 +135,7 @@ public class ThreadContext {
     /**
      * 设置做分表分库的切分的key
      * 
-     * @param shardKey
+     * @param sessionVisitor
      *            下午8:37:51 created by Darwin(Tianxin)
      */
     public final static <K extends Serializable, U extends BaseObject<K>> void putSessionVisitor(

+ 7 - 7
disconf-web/src/main/resources/applicationContext.xml

@@ -3,15 +3,18 @@
        xmlns:aop="http://www.springframework.org/schema/aop"
        xmlns:context="http://www.springframework.org/schema/context"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xmlns:mvc="http://www.springframework.org/schema/mvc"
        xsi:schemaLocation="http://www.springframework.org/schema/aop
         http://www.springframework.org/schema/aop/spring-aop-3.0.xsd   
         http://www.springframework.org/schema/beans   
         http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
         http://www.springframework.org/schema/context   
-        http://www.springframework.org/schema/context/spring-context-3.0.xsd">
+        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.xsd">
 
     <description>Spring公共配置</description>
 
+    <mvc:annotation-driven/>
 
     <!-- Validator设置 -->
     <import resource="classpath:spring-servlet-validator.xml"/>
@@ -42,8 +45,7 @@
         </property>
     </bean>
 
-    <bean id="loginRedisLogin"
-          class="com.baidu.disconf.web.web.auth.login.impl.RedisLoginImplMock"/>
+    <bean id="loginRedisLogin" class="com.baidu.disconf.web.web.auth.login.impl.RedisLoginImplMock"/>
 
     <bean id="zooConfig"
           class="com.baidu.disconf.web.service.zookeeper.config.ZooConfig">
@@ -77,14 +79,12 @@
 
     <beans profile="production">
         <import resource="classpath*:/applicationContext-dbconfig.xml"/>
-        <bean id="loginRedisLogin"
-              class="com.baidu.disconf.web.web.auth.login.impl.RedisLoginImpl"/>
+        <bean id="loginRedisLogin" class="com.baidu.disconf.web.web.auth.login.impl.RedisLoginImpl"/>
     </beans>
 
     <beans profile="rd">
         <import resource="classpath*:/applicationContext-dbconfig.xml"/>
-        <bean id="loginRedisLogin"
-              class="com.baidu.disconf.web.web.auth.login.impl.RedisLoginImplMock"/>
+        <bean id="loginRedisLogin" class="com.baidu.disconf.web.web.auth.login.impl.RedisLoginImplMock"/>
     </beans>
 
 

+ 0 - 7
disconf-web/src/main/resources/log4j.properties

@@ -1,8 +1,3 @@
-#
-# Copyright (C) 2014 Baidu, Inc. All Rights Reserved.
-#
-
-#UC-CAS\u4f1a\u6253\u5370log4j\u65e5\u5fd7
 
 log4j.rootLogger=WARN,dailyRolling,CONSOLE,logClient
 
@@ -20,6 +15,4 @@ log4j.appender.CONSOLE.Target=System.out
 log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout
 log4j.appender.CONSOLE.layout.ConversionPattern=%d [%t] %-5p %-17c{2} (%13F:%L) %3x - %m%n
 
-#log4j.appender.CONSOLE.layout.ConversionPattern=[start]%d{DATE}[DATE]%n%p[PRIORITY]%n%x[NDC]%n%t[THREAD] n%c[CATEGORY]%n%m[MESSAGE]%n%n
-
 

+ 1 - 1
disconf-web/src/main/resources/logback.xml

@@ -52,7 +52,7 @@
     </logger>
 
     <logger name="org.springframework">
-        <level value="WARN" />
+        <level value="INFO" />
     </logger>
 
     <logger name="net.sf.ehcache">

+ 3 - 7
disconf-web/src/main/resources/spring-servlet.xml

@@ -11,9 +11,7 @@
            http://www.springframework.org/schema/task http://www.springframework.org/schema/task/spring-task-3.0.xsd
            http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc.xsd">
 
-    <mvc:annotation-driven/>
 
-    <import resource="classpath:applicationContext.xml"/>
     <context:property-placeholder location="classpath*:/application.properties"
                                   ignore-unresolvable="true"/>
 
@@ -116,13 +114,11 @@
     <!-- annotation默认的方法映射适配器 -->
     <bean id="handlerMapping"
           class="org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping"/>
-    <bean
-            class="org.springframework.web.servlet.view.InternalResourceViewResolver"
-            p:prefix="/WEB-INF/console/" p:suffix=".jsp" p:order="0"/>
+    <bean class="org.springframework.web.servlet.view.InternalResourceViewResolver"
+          p:prefix="/WEB-INF/console/" p:suffix=".jsp" p:order="0"/>
 
 
-    <bean
-            class="org.springframework.web.servlet.view.ContentNegotiatingViewResolver">
+    <bean class="org.springframework.web.servlet.view.ContentNegotiatingViewResolver">
         <property name="defaultContentType" value="application/json"/>
         <property name="ignoreAcceptHeader" value="true"/>
         <property name="favorPathExtension" value="true"/>

+ 1 - 1
disconf-web/src/main/webapp/WEB-INF/web.xml

@@ -10,7 +10,7 @@
 
     <context-param>
         <param-name>contextConfigLocation</param-name>
-        <param-value>classpath*:/applicationContext*.xml</param-value>
+        <param-value>classpath*:/applicationContext.xml</param-value>
     </context-param>
 
     <context-param>