??xml version="1.0" encoding="utf-8" standalone="yes"?>亚洲精品一线,激情综合五月,精品日韩一区二区三区免费视频http://www.aygfsteel.com/crazycy/archive/2014/10/02/418449.htmlcrazycycrazycyThu, 02 Oct 2014 09:56:00 GMThttp://www.aygfsteel.com/crazycy/archive/2014/10/02/418449.htmlhttp://www.aygfsteel.com/crazycy/comments/418449.htmlhttp://www.aygfsteel.com/crazycy/archive/2014/10/02/418449.html#Feedback0http://www.aygfsteel.com/crazycy/comments/commentRss/418449.htmlhttp://www.aygfsteel.com/crazycy/services/trackbacks/418449.html
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-war-plugin:2.4:war (default-war) on project TradingLink: Error assembling WAR: webxml attribute is required (or pre-existing WEB-INF/web.xml if executing in update mode)

Cause:
maven的web目默认的webroot是在src\main\webapp。如果在此目录下找不到web.xml抛Z上的异常?/div>
Solution:
需要在pom.xml中增?lt;webResources>配置Q如下:

 <build>  
<plugins>  
    <plugin>  
        <groupId>org.apache.maven.plugins</groupId>  
        <artifactId>maven-war-plugin</artifactId>  
        <version>2.4</version>  
        <configuration>  
            <webResources>  
                <resource>                      
                    <directory>WebContent</directory>  
                </resource>  
            </webResources>  
        </configuration>  
    </plugin>  
</plugins>  
</build>  


或者增?lt;webXml>配置Q如下:

<build>  
<plugins>  
    <plugin>  
        <groupId>org.apache.maven.plugins</groupId>  
        <artifactId>maven-war-plugin</artifactId>  
        <version>2.4</version>  
        <configuration>  
               <webXml>WebContent\WEB-INF\web.xml</webXml>            
        </configuration>  
    </plugin>  
</plugins>  
</build>  


crazycy 2014-10-02 17:56 发表评论
]]>SpringMVC+MyBatis - 13 回头看spring mvc:annotation-driven对应的消息{换(包含日期处理Q?pd12的强?/title><link>http://www.aygfsteel.com/crazycy/archive/2014/07/16/415864.html</link><dc:creator>crazycy</dc:creator><author>crazycy</author><pubDate>Tue, 15 Jul 2014 18:04:00 GMT</pubDate><guid>http://www.aygfsteel.com/crazycy/archive/2014/07/16/415864.html</guid><wfw:comment>http://www.aygfsteel.com/crazycy/comments/415864.html</wfw:comment><comments>http://www.aygfsteel.com/crazycy/archive/2014/07/16/415864.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/crazycy/comments/commentRss/415864.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/crazycy/services/trackbacks/415864.html</trackback:ping><description><![CDATA[     摘要: 当初配置springmvc的时候,因ؓ是第一ơ用springmvcQؓ囑ֿP因而大量从|上查找入门信息。遗憄是,|上的配|真是五花八门,让我d凌ؕ。至今阅L章不于300余篇Q回头适当整理下这个。spring mvc的mvc:annotation-driven以及日期的处理摘自http://blog.csdn.net/xiejx618/article/details/24745207 &...  <a href='http://www.aygfsteel.com/crazycy/archive/2014/07/16/415864.html'>阅读全文</a><img src ="http://www.aygfsteel.com/crazycy/aggbug/415864.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/crazycy/" target="_blank">crazycy</a> 2014-07-16 02:04 <a href="http://www.aygfsteel.com/crazycy/archive/2014/07/16/415864.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>SpringMVC+MyBatis - 12 spring mvc4q回的json日期为Long的解x?/title><link>http://www.aygfsteel.com/crazycy/archive/2014/07/15/415839.html</link><dc:creator>crazycy</dc:creator><author>crazycy</author><pubDate>Tue, 15 Jul 2014 06:30:00 GMT</pubDate><guid>http://www.aygfsteel.com/crazycy/archive/2014/07/15/415839.html</guid><wfw:comment>http://www.aygfsteel.com/crazycy/comments/415839.html</wfw:comment><comments>http://www.aygfsteel.com/crazycy/archive/2014/07/15/415839.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/crazycy/comments/commentRss/415839.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/crazycy/services/trackbacks/415839.html</trackback:ping><description><![CDATA[     摘要: Spring MVC 4.X ResponseBody 日期cdJson 处理摘自http://tramp-zzy.iteye.com/blog/2090330  2014-07-10Ҏ一Q全局处理Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/...  <a href='http://www.aygfsteel.com/crazycy/archive/2014/07/15/415839.html'>阅读全文</a><img src ="http://www.aygfsteel.com/crazycy/aggbug/415839.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/crazycy/" target="_blank">crazycy</a> 2014-07-15 14:30 <a href="http://www.aygfsteel.com/crazycy/archive/2014/07/15/415839.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>SpringMVC+MyBatis - 11 SiteMash的一个小陷阱http://www.aygfsteel.com/crazycy/archive/2014/07/14/415775.htmlcrazycycrazycyMon, 14 Jul 2014 06:39:00 GMThttp://www.aygfsteel.com/crazycy/archive/2014/07/14/415775.htmlhttp://www.aygfsteel.com/crazycy/comments/415775.htmlhttp://www.aygfsteel.com/crazycy/archive/2014/07/14/415775.html#Feedback3http://www.aygfsteel.com/crazycy/comments/commentRss/415775.htmlhttp://www.aygfsteel.com/crazycy/services/trackbacks/415775.html
调试到凌?点多Q今天恍然发?br />
<script type="text/javascript" src="${ctx}/javascript/jquery.min.js"/>
的最?#8220;/"是红色的?br />
然后用能通过的页面比较,唯一的差异是Q?br />能显C的面
<script type="text/javascript" src="${ctx}/javascript/jquery.min.js"></script>
不能昄的页?/span>
<script type="text/javascript" src="${ctx}/javascript/jquery.min.js"/>

所以问题解决了


crazycy 2014-07-14 14:39 发表评论
]]>
SpringMVC+MyBatis - 10 I18N标签的?/title><link>http://www.aygfsteel.com/crazycy/archive/2014/07/13/415745.html</link><dc:creator>crazycy</dc:creator><author>crazycy</author><pubDate>Sun, 13 Jul 2014 08:35:00 GMT</pubDate><guid>http://www.aygfsteel.com/crazycy/archive/2014/07/13/415745.html</guid><wfw:comment>http://www.aygfsteel.com/crazycy/comments/415745.html</wfw:comment><comments>http://www.aygfsteel.com/crazycy/archive/2014/07/13/415745.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/crazycy/comments/commentRss/415745.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/crazycy/services/trackbacks/415745.html</trackback:ping><description><![CDATA[SpringMVC可以使用如下两个标签<br />Spring TLD: <spring:message code="{message.key}"/><br />JSTL TLD:   <fmt:message key="{message.key"}/><br /><br />但是我们会遇C后的问题Q?nbsp;<br />JSTL的标{没有解析成?br /><br />解决办法有二Q?br /><br />其一Q?nbsp;<br /><div><fmt:setBundle basename="{classpath of .propertity file}" var="lang"/></div><div><span style="font-size: 14px;"><fmt:message key="{message.key"} bundle="lang"/></span><br /><br /><span style="font-size: 14px;">其二Q?/span><br /><span style="font-size: 14px;">Z么Spring:message可以</span><br /><span style="font-size: 14px;">因ؓ我们定义了:</span><br /><div><bean id="messageSource" class="org.springframework.context.support.ReloadableResourceBundleMessageSource">  </div><div><span style="font-size: 14px; white-space: pre;"> </span><span style="font-size: 14px;"><property name="basenames"></span></div><div><span style="white-space:pre"> </span><list></div><div><span style="white-space:pre"> </span><value>classpath:org/i18n/message</value></div><div><span style="white-space:pre"> </span><value>classpath:org/i18n/pagelabel</value></div><div><span style="white-space:pre"> </span></list></div><div><span style="white-space:pre"> </span></property>   </div><div>     <span style="white-space:pre"> </span><property name="defaultEncoding" value="UTF-8"/> </div><div>        <property name="cacheSeconds" value="0" />  </div><div>     <span style="white-space:pre"> </span><property name="useCodeAsDefaultMessage" value="true" /> </div><div></bean> <br />所以我们有理由用同L方式Mؓfmt定义<br />  <span style="font-size: 14px;"><context-param></span></div><div><span style="white-space:pre"> </span>    <param-name>javax.servlet.jsp.jstl.fmt.localizationContext</param-name></div><div><div style="display: inline-block;"><span style="white-space: pre;"> </span>    <param-value>org.i18n.message</param-value></div></div><span style="white-space: pre;"> </span>    <param-value>org.i18n.pagelabel</param-value><br /><div></div><div><span style="white-space:pre"> </span></context-param><br />应该问题不大?br /><br />参考:<span style="font-size: 14px;">http://stackoverflow.com/questions/12470928/jstl-resource-bundle-for-internationalization-and-localization</span><br /></div></div><img src ="http://www.aygfsteel.com/crazycy/aggbug/415745.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/crazycy/" target="_blank">crazycy</a> 2014-07-13 16:35 <a href="http://www.aygfsteel.com/crazycy/archive/2014/07/13/415745.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>SpringMVC+MyBatis - 9 Spring的EnCache(Shiro Cache的解x案是Zq个文章?http://www.aygfsteel.com/crazycy/archive/2014/07/13/415740.htmlcrazycycrazycySat, 12 Jul 2014 16:32:00 GMThttp://www.aygfsteel.com/crazycy/archive/2014/07/13/415740.htmlhttp://www.aygfsteel.com/crazycy/comments/415740.htmlhttp://www.aygfsteel.com/crazycy/archive/2014/07/13/415740.html#Feedback0http://www.aygfsteel.com/crazycy/comments/commentRss/415740.htmlhttp://www.aygfsteel.com/crazycy/services/trackbacks/415740.htmlIf you look around the web for examples of using Spring 3.1’s built in caching then you’ll usually bump into Spring’sSimpleCacheManager, which the Guys at Spring say is “Useful for testing or simple caching declarations”. I actually prefer to think ofSimpleCacheManager as lightweight rather than simple; useful in those situations where you want a small in memory cache on a per JVM basis. If the Guys at Spring were running a supermarket then SimpleCacheManagerwould be in their own brand ‘basics’ product range.

If, on the other hand, you need a heavy duty cache, one that’s scalable, persistent and distributed, then Spring also comes with a built inehCache wrapper.

The good news is that swapping between Spring's caching implementations is easy. In theory it’s all a matter of configuration and, to prove the theory correct, I took the sample code from my Caching and @Cacheable blog and ran it using an EhCache implementation.

The configuration steps are similar to those described in my last blog Caching and Config in that you still need to specify:

<cache:annotation-driven /> 

...in your Spring config file to switch caching on. You also need to define a bean with an id of cacheManager, only this time you reference Spring’s EhCacheCacheManager class instead of SimpleCacheManager.

<bean id="cacheManager"     
class="org.springframework.cache.ehcache.EhCacheCacheManager"
p:cacheManager-ref="ehcache"/>

The example above demonstrates an EhCacheCacheManager configuration. Notice that it references a second bean with an id of 'ehcache'. This is configured as follows:

<bean id="ehcache" 
class="org.springframework.cache.ehcache.EhCacheManagerFactoryBean"
p:configLocation="ehcache.xml"
p:shared="true"/>

"ehcache" has two properties: configLocation and shared.

'configLocation' is an optional attribute that’s used to specify the location of an ehcache configuration file. In my test code I used the following example file:
<?xml version="1.0" encoding="UTF-8"?>
<ehcache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://ehcache.org/ehcache.xsd">
    <defaultCache eternal="true" maxElementsInMemory="100" overflowToDisk="false" />
    <cache name="employee" maxElementsInMemory="10000" eternal="true" overflowToDisk="false" />
</ehcache>
...which creates two caches: a default cache and one named “employee”.

If this file is missing then the EhCacheManagerFactoryBean simply picks up a default ehcache config file: ehcache-failsafe.xml, which is located in ehcache’s ehcache-core jar file.

The other EhCacheManagerFactoryBean attribute is 'shared'. This is supposed to be optional as the documentation states that it defines "whether the EHCache CacheManager should be shared (as a singleton at the VM level) or independent (typically local within the application). Default is 'false', creating an independent instance.” However, if this is set to false then you’ll get the following exception: 
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.cache.interceptor.CacheInterceptor#0': Cannot resolve reference to bean 'cacheManager' while setting bean property 'cacheManager'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'cacheManager' defined in class path resource [ehcache-example.xml]: Cannot resolve reference to bean 'ehcache' while setting bean property 'cacheManager'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'ehcache' defined in class path resource [ehcache-example.xml]: Invocation of init method failed; nested exception is net.sf.ehcache.CacheException: Another unnamed CacheManager already exists in the same VM. Please provide unique names for each CacheManager in the config or do one of following:
1. Use one of the CacheManager.create() static factory methods to reuse same CacheManager with same name or create one if necessary
2. Shutdown the earlier cacheManager before creating new one with same name.
The source of the existing CacheManager is: InputStreamConfigurationSource [stream=java.io.BufferedInputStream@424c414]
 at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:328)
 at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:106)
 at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1360)
 at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1118)
 at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:517)
 at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
 stack trace shortened for clarity
 at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
 at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
 at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'cacheManager' defined in class path resource [ehcache-example.xml]: Cannot resolve reference to bean 'ehcache' while setting bean property 'cacheManager'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'ehcache' defined in class path resource [ehcache-example.xml]: Invocation of init method failed; nested exception is net.sf.ehcache.CacheException: Another unnamed CacheManager already exists in the same VM. Please provide unique names for each CacheManager in the config or do one of following:
1. Use one of the CacheManager.create() static factory methods to reuse same CacheManager with same name or create one if necessary
2. Shutdown the earlier cacheManager before creating new one with same name.
The source of the existing CacheManager is: InputStreamConfigurationSource [stream=java.io.BufferedInputStream@424c414]
 at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:328)
 at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:106)
 at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1360)
 stack trace shortened for clarity
 at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193)
 at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:322)
  38 more
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'ehcache' defined in class path resource [ehcache-example.xml]: Invocation of init method failed; nested exception is net.sf.ehcache.CacheException: Another unnamed CacheManager already exists in the same VM. Please provide unique names for each CacheManager in the config or do one of following:
1. Use one of the CacheManager.create() static factory methods to reuse same CacheManager with same name or create one if necessary
2. Shutdown the earlier cacheManager before creating new one with same name.
The source of the existing CacheManager is: InputStreamConfigurationSource [stream=java.io.BufferedInputStream@424c414]
 at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1455)
 at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)
 at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
 at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:294)
 at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:225)
 at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:291)
 at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193)
 at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:322)
  48 more
Caused by: net.sf.ehcache.CacheException: Another unnamed CacheManager already exists in the same VM. Please provide unique names for each CacheManager in the config or do one of following:
1. Use one of the CacheManager.create() static factory methods to reuse same CacheManager with same name or create one if necessary
2. Shutdown the earlier cacheManager before creating new one with same name.
The source of the existing CacheManager is: InputStreamConfigurationSource [stream=java.io.BufferedInputStream@424c414]
 at net.sf.ehcache.CacheManager.assertNoCacheManagerExistsWithSameName(CacheManager.java:521)
 at net.sf.ehcache.CacheManager.init(CacheManager.java:371)
 at net.sf.ehcache.CacheManager.(CacheManager.java:339)
 at org.springframework.cache.ehcache.EhCacheManagerFactoryBean.afterPropertiesSet(EhCacheManagerFactoryBean.java:104)
 at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1514)
 at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1452)
  55 more
...when you try to run a bunch of unit tests.

I think that this comes down to a simple bug Spring’s the ehcache manager factory as it’s trying to create multiple cache instances usingnew() rather than using, as the exception states, “one of the CacheManager.create() static factory methods" which allows it to reuse same CacheManager with same name. Hence, my first JUnit test works okay, but all others fail.


The offending line of code is:

this.cacheManager = (this.shared ? CacheManager.create() : new CacheManager()); 

My full XML config file is listed below for completeness:
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans" 
  xmlns:p="http://www.springframework.org/schema/p"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xmlns:cache="http://www.springframework.org/schema/cache" 
  xmlns:context="http://www.springframework.org/schema/context"
   xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
     http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.1.xsd
        http://www.springframework.org/schema/cache http://www.springframework.org/schema/cache/spring-cache.xsd">
 
  <!-- Switch on the Caching -->
   <cache:annotation-driven />

 <!-- Do the component scan path -->
 <context:component-scan base-package="caching" />

 <bean id="cacheManager" class="org.springframework.cache.ehcache.EhCacheCacheManager" 
  p:cacheManager-ref="ehcache"/>
 
 <bean id="ehcache" class="org.springframework.cache.ehcache.EhCacheManagerFactoryBean" 
     p:configLocation="ehcache.xml"  
     p:shared="true"/> 
</beans>

文章摘自 http://www.captaindebug.com/2012/09/spring-31-caching-and-ehcache.html#.U8FilfmSxZW


crazycy 2014-07-13 00:32 发表评论
]]>
SpringMVC+MyBatis - 8 Shiro异常QEhCache initialization exception: Another unnamed CacheManager already exists in the same VMhttp://www.aygfsteel.com/crazycy/archive/2014/07/13/415739.htmlcrazycycrazycySat, 12 Jul 2014 16:07:00 GMThttp://www.aygfsteel.com/crazycy/archive/2014/07/13/415739.htmlhttp://www.aygfsteel.com/crazycy/comments/415739.htmlhttp://www.aygfsteel.com/crazycy/archive/2014/07/13/415739.html#Feedback0http://www.aygfsteel.com/crazycy/comments/commentRss/415739.htmlhttp://www.aygfsteel.com/crazycy/services/trackbacks/415739.htmlEhCache initialization exception: Another unnamed CacheManager already exists in the same VM
具体错误如下Q?br />
Another CacheManager with same name 'cacheManager' already exists in the same VM. Please > provide unique names for each CacheManager in the config or do one of following: 
1. Use one of the CacheManager.create() static factory methods to reuse same CacheManager with same name or create one if necessary 
2. Shutdown the earlier cacheManager before creating new one with same name. The source of the existing CacheManager is: DefaultConfigurationSource [ ehcache.xml or ehcache-failsafe.xml ]

一般材料是q样说的Q?br />
<bean id="ehCacheManager" 
    class="org.springframework.cache.ehcache.EhCacheManagerFactoryBean"
    p:configLocation="classpath:org/tradinglink/cache/echcache-shiro.xml"
    p:shared="true"/>

但是l过实践是要q样做的Q?br />
<bean id="shiroEncacheManager" class="org.apache.shiro.cache.ehcache.EhCacheManager">
<property name="cacheManager" ref="ehCacheManager"/>
</bean>
<bean id="ehCacheManager" 
    class="org.springframework.cache.ehcache.EhCacheManagerFactoryBean"
    p:configLocation="classpath:org/tradinglink/cache/echcache-shiro.xml"
    p:shared="true"/>

一D关于完整的配置如下
<bean id="shiroFilter" class="org.apache.shiro.spring.web.ShiroFilterFactoryBean">
<property name="securityManager" ref="securityManager" />
<property name="loginUrl" value="/login.jsp" />
<property name="successUrl" value="/index.jsp" />
<property name="unauthorizedUrl" value="/unauthorized.jsp" />
<property name="filters">
<map>
<entry key="authc" value-ref="formAuthenticationFilter"></entry>
</map>
</property>
<!-- will config in db, and then read into filterChainDefinitionsMap property -->
<property name="filterChainDefinitions">
<value>
/login = authc
/logout = logout
/resource/** = anon
/images/**= anon
/css/**= anon
/javascript/**= anon
<!-- /welcome = perms[accout:edit] -->
<!-- /security/account/view.do=authc,perms[SECURITY_ACCOUNT_VIEW] -->
/** = anon
</value>
</property>
</bean>

<!--一D关?/span>securityManager的完整的配置如下-->
<bean id="securityManager" class="org.apache.shiro.web.mgt.DefaultWebSecurityManager">
    <property name="realm" ref="myRealm"/>
    <property name="sessionMode" value="native"/>
    <property name="sessionManager" ref="sessionManager"/>
    <property name="cacheManager" ref="cacheManager"/>
</bean>

<bean id="cacheManager" class="org.apache.shiro.cache.ehcache.EhCacheManager">
    <property name="cacheManager" ref="ehCacheManager"/>
</bean>

<bean id="ehCacheManager" 
    class="org.springframework.cache.ehcache.EhCacheManagerFactoryBean"/>

<bean id="sessionManager"
    class="org.apache.shiro.web.session.mgt.DefaultWebSessionManager">
    <property name="sessionDAO" ref="sessionDAO"/>
</bean>

<bean id="sessionDAO" 
    class="org.apache.shiro.session.mgt.eis.EnterpriseCacheSessionDAO">
    <property name="activeSessionsCacheName" value="shiro-activeSessionCache" />
</bean>
<bean id="myRealm" class="com.foo.MyRealm"/>


crazycy 2014-07-13 00:07 发表评论
]]>
SpringMVC+MyBatis - 6 SpringMVC Restful风格下的静态资?/title><link>http://www.aygfsteel.com/crazycy/archive/2014/07/12/415736.html</link><dc:creator>crazycy</dc:creator><author>crazycy</author><pubDate>Sat, 12 Jul 2014 15:31:00 GMT</pubDate><guid>http://www.aygfsteel.com/crazycy/archive/2014/07/12/415736.html</guid><wfw:comment>http://www.aygfsteel.com/crazycy/comments/415736.html</wfw:comment><comments>http://www.aygfsteel.com/crazycy/archive/2014/07/12/415736.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/crazycy/comments/commentRss/415736.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/crazycy/services/trackbacks/415736.html</trackback:ping><description><![CDATA[<p style="margin-top: 10px; margin-bottom: 10px; padding: 0px; color: #333333; font-family: verdana, Arial, Helvetica, sans-serif; font-size: 14.399999618530273px; line-height: 20.15999984741211px; background-color: #ffffff;">      优雅REST风格的资源URL不希望带 .html ?.do {后~.׃早期的Spring MVC不能很好地处理静态资源,所以在web.xml中配|DispatcherServlet的请求映,往往使用 *.do ?*.xhtml{方式。这决定了hURL必须是一个带后缀的URLQ而无法采用真正的REST风格的URL?/p><p style="margin-top: 10px; margin-bottom: 10px; padding: 0px; color: #333333; font-family: verdana, Arial, Helvetica, sans-serif; font-size: 14.399999618530273px; line-height: 20.15999984741211px; background-color: #ffffff;">     如果DispatcherServleth映射配置?/"Q则Spring MVC捕获Web容器所有的hQ包括静态资源的hQSpring MVC会将它们当成一个普通请求处理,因此找不到对应处理器导致错误?/p><p style="margin-top: 10px; margin-bottom: 10px; padding: 0px; color: #333333; font-family: verdana, Arial, Helvetica, sans-serif; font-size: 14.399999618530273px; line-height: 20.15999984741211px; background-color: #ffffff;">    如何让Spring框架能够捕获所有URL的请求,同时又将静态资源的h转由Web容器处理Q是可将DispatcherServlet的请求映配|ؓ"/"的前提。由于REST是Spring3.0最重要的功能之一Q所以Spring团队很看重静态资源处理这Q务,l出了堪U经典的两种解决Ҏ?/p><p style="margin-top: 10px; margin-bottom: 10px; padding: 0px; color: #333333; font-family: verdana, Arial, Helvetica, sans-serif; font-size: 14.399999618530273px; line-height: 20.15999984741211px; background-color: #ffffff;">先调整web.xml中的DispatcherServlet的配|,使其可以捕获所有的hQ?/p><div style="margin: 5px 0px; font-size: 12px !important;"><div style="margin: 5px 0px 0px;"><div style="background-color:#eeeeee;font-size:13px;border:1px solid #CCCCCC;padding-right: 5px;padding-bottom: 4px;padding-left: 4px;padding-top: 4px;width: 98%;word-break:break-all"><!--<br /><br />Code highlighting produced by Actipro CodeHighlighter (freeware)<br />http://www.CodeHighlighter.com/<br /><br />-->     <servlet><br />        <servlet-name>springMVC</servlet-name><br />        <servlet-<span style="color: #0000FF; ">class</span>>org.springframework.web.servlet.DispatcherServlet</servlet-<span style="color: #0000FF; ">class</span>><br />        <load-on-startup>1</load-on-startup><br />    </servlet><br />    <servlet-mapping><br />        <servlet-name>springMVC</servlet-name><br />        <url-pattern>/</url-pattern><br />    </servlet-mapping></div></div></div><p style="margin-top: 10px; margin-bottom: 10px; padding: 0px; color: #333333; font-family: verdana, Arial, Helvetica, sans-serif; font-size: 14.399999618530273px; line-height: 20.15999984741211px; background-color: #ffffff;">通过上面url-pattern的配|,所有URLh都将被Spring MVC的DispatcherServlet截获?/p><p style="margin-top: 10px; margin-bottom: 10px; padding: 0px; color: #333333; font-family: verdana, Arial, Helvetica, sans-serif; font-size: 14.399999618530273px; line-height: 20.15999984741211px; background-color: #ffffff;"><strong style="margin: 0px; padding: 0px;"><br />采用<mvc:default-servlet-handler /></strong></p><p style="margin-top: 10px; margin-bottom: 10px; padding: 0px; color: #333333; font-family: verdana, Arial, Helvetica, sans-serif; font-size: 14.399999618530273px; line-height: 20.15999984741211px; background-color: #ffffff;">在springMVC-servlet.xml中配|?lt;mvc:default-servlet-handler />后,会在Spring MVC上下文中定义一个org.springframework.web.servlet.resource.DefaultServletHttpRequestHandlerQ它会像一个检查员Q对q入DispatcherServlet的URLq行{查Q如果发现是静态资源的hQ就该h转由Web应用服务器默认的Servlet处理Q如果不是静态资源的hQ才由DispatcherServletl箋处理?/p><p style="margin-top: 10px; margin-bottom: 10px; padding: 0px; color: #333333; font-family: verdana, Arial, Helvetica, sans-serif; font-size: 14.399999618530273px; line-height: 20.15999984741211px; background-color: #ffffff;">一般Web应用服务器默认的Servlet名称?default"Q因此DefaultServletHttpRequestHandler可以扑ֈ它。如果你所有的Web应用服务器的默认Servlet名称不是"default"Q则需要通过default-servlet-name属性显C指定:<br /></p><div style="background-color:#eeeeee;font-size:13px;border:1px solid #CCCCCC;padding-right: 5px;padding-bottom: 4px;padding-left: 4px;padding-top: 4px;width: 98%;word-break:break-all"><!--<br /><br />Code highlighting produced by Actipro CodeHighlighter (freeware)<br />http://www.CodeHighlighter.com/<br /><br />--><mvc:resources location="/,classpath:/META-INF/publicResources/" mapping="/resources/**"/></div><p style="margin-top: 10px; margin-bottom: 10px; padding: 0px; color: #333333; font-family: verdana, Arial, Helvetica, sans-serif; font-size: 14.399999618530273px; line-height: 20.15999984741211px; background-color: #ffffff;"><strong style="font-size: 14.399999618530273px; margin: 0px; padding: 0px;"><br />采用<mvc:resources /></strong></p><p style="margin-top: 10px; margin-bottom: 10px; padding: 0px; color: #333333; font-family: verdana, Arial, Helvetica, sans-serif; font-size: 14.399999618530273px; line-height: 20.15999984741211px; background-color: #ffffff;"><mvc:default-servlet-handler />静态资源的处理l由Spring MVC框架交回Web应用服务器处理。?lt;mvc:resources />更进一步,由Spring MVC框架自己处理静态资源,q添加一些有用的附加值功能?/p><p style="margin-top: 10px; margin-bottom: 10px; padding: 0px; color: #333333; font-family: verdana, Arial, Helvetica, sans-serif; font-size: 14.399999618530273px; line-height: 20.15999984741211px; background-color: #ffffff;">首先Q?lt;mvc:resources />允许静态资源放在Q何地方,如WEB-INF目录下、类路径下等Q你甚至可以JavaScript{静态文件打到JAR包中。通过location属性指定静态资源的位置Q由于location属性是ResourcescdQ因此可以用诸?classpath:"{的资源前缀指定资源位置。传lWeb容器的静态资源只能放在Web容器的根路径下,<mvc:resources />完全打破了这个限制?/p><p style="margin-top: 10px; margin-bottom: 10px; padding: 0px; color: #333333; font-family: verdana, Arial, Helvetica, sans-serif; font-size: 14.399999618530273px; line-height: 20.15999984741211px; background-color: #ffffff;">其次Q?lt;mvc:resources />依据当前著名的Page Speed、YSlow{浏览器优化原则寚w态资源提供优化。你可以通过cacheSeconds属性指定静态资源在览器端的缓存时_一般可该旉讄Zq_以充分利用浏览器端的~存。在输出静态资源时Q会Ҏ配置讄好响应报文头的Expires ?Cache-Control倹{?/p><p style="margin-top: 10px; margin-bottom: 10px; padding: 0px; color: #333333; font-family: verdana, Arial, Helvetica, sans-serif; font-size: 14.399999618530273px; line-height: 20.15999984741211px; background-color: #ffffff;">在接收到静态资源的获取hӞ会检查请求头的Last-Modified|如果静态资源没有发生变化,则直接返?03相应状态码Q提C客L使用览器缓存的数据Q而非静态资源的内容输出到客LQ以充分节省带宽Q提高程序性能?/p><p style="margin-top: 10px; margin-bottom: 10px; padding: 0px; color: #333333; font-family: verdana, Arial, Helvetica, sans-serif; font-size: 14.399999618530273px; line-height: 20.15999984741211px; background-color: #ffffff;">在springMVC-servlet中添加如下配|:<br /></p><div style="background-color:#eeeeee;font-size:13px;border:1px solid #CCCCCC;padding-right: 5px;padding-bottom: 4px;padding-left: 4px;padding-top: 4px;width: 98%;word-break:break-all"><!--<br /><br />Code highlighting produced by Actipro CodeHighlighter (freeware)<br />http://www.CodeHighlighter.com/<br /><br />--><mvc:resources location="/,classpath:/META-INF/publicResources/" mapping="/resources/**"/></div><div style="margin: 5px 0px; font-size: 12px !important;"><pre style="margin-top: 0px; margin-bottom: 0px; padding: 0px; white-space: pre-wrap; word-wrap: break-word; font-family: 'Courier New' !important; font-size: 12px !important;"><span style="background-color: #ffffff; color: #333333; font-family: verdana, Arial, Helvetica, sans-serif; font-size: 14.399999618530273px; line-height: 20.15999984741211px;">以上配置Web根\?/"及类路径?/META-INF/publicResources/ 的目录映ؓ/resources路径。假设Web根\径下拥有images、jsq两个资源目?在images下面有bg.gif囄Q在js下面有test.js文gQ则可以通过 /resources/images/bg.gif ?/resources/js/test.js 讉Kq二个静态资源?/span></pre></div><p style="margin-top: 10px; margin-bottom: 10px; padding: 0px; color: #333333; font-family: verdana, Arial, Helvetica, sans-serif; font-size: 14.399999618530273px; line-height: 20.15999984741211px; background-color: #ffffff;">假设WebRootq拥有images/bg1.gif ?js/test1.jsQ则也可以在|页中通过 /resources/images/bg1.gif ?/resources/js/test1.js q行引用?br /><br /></p><div style="background-color:#eeeeee;font-size:13px;border:1px solid #CCCCCC;padding-right: 5px;padding-bottom: 4px;padding-left: 4px;padding-top: 4px;width: 98%;word-break:break-all"><!--<br /><br />Code highlighting produced by Actipro CodeHighlighter (freeware)<br />http://www.CodeHighlighter.com/<br /><br />-->摘录于http:<span style="color: #008000; ">//</span><span style="color: #008000; ">www.cnblogs.com/fangqi/archive/2012/10/28/2743100.html</span></div><img src ="http://www.aygfsteel.com/crazycy/aggbug/415736.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/crazycy/" target="_blank">crazycy</a> 2014-07-12 23:31 <a href="http://www.aygfsteel.com/crazycy/archive/2014/07/12/415736.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>SpringMVC+MyBatis - 5 Security-Shiro-01http://www.aygfsteel.com/crazycy/archive/2014/07/11/415698.htmlcrazycycrazycyFri, 11 Jul 2014 01:38:00 GMThttp://www.aygfsteel.com/crazycy/archive/2014/07/11/415698.htmlhttp://www.aygfsteel.com/crazycy/comments/415698.htmlhttp://www.aygfsteel.com/crazycy/archive/2014/07/11/415698.html#Feedback0http://www.aygfsteel.com/crazycy/comments/commentRss/415698.htmlhttp://www.aygfsteel.com/crazycy/services/trackbacks/415698.html阅读全文

crazycy 2014-07-11 09:38 发表评论
]]>
SpringMVC+MyBatis - 4 Springh参数http://www.aygfsteel.com/crazycy/archive/2014/07/09/415630.htmlcrazycycrazycyWed, 09 Jul 2014 08:32:00 GMThttp://www.aygfsteel.com/crazycy/archive/2014/07/09/415630.htmlhttp://www.aygfsteel.com/crazycy/comments/415630.htmlhttp://www.aygfsteel.com/crazycy/archive/2014/07/09/415630.html#Feedback0http://www.aygfsteel.com/crazycy/comments/commentRss/415630.htmlhttp://www.aygfsteel.com/crazycy/services/trackbacks/415630.html<form>
   username:<input type="text" name="userNAME">
   password:<input type="text" name="pasWD">
                <input type="button" value="submit">
</form>

最基本的:依靠HttpServletRequest.getParameter
@RequestMapping("/add")
public
 String addUser(HttpServletRequest req) {
   String username = req.getParameter("userNAME");
   String passwd = req.getParameter("pasWD");
   //save logic
   return "user/userinfo";
}

最基本的轻松一变,可以变成lightweightQ?通过@RequestParam
@RequestMapping("/add")
public String addUser(@RequestParam(value="userNAME", required=false) String username, @RequestParam(value="pasWD") String password) {
   //save logic, directly use
   return "user/userinfo";
}

其实吧,@RequestParam是可以省掉的Q就变成?要点是变量名字的变化
@RequestMapping("/add")
public String  addUser(String userNAME, String pasWD) {
   //save logic, directly use
   return "user/userinfo";
}

q有一U\径法@PathViable
@RequestMapping("/add/{userName}")
public String addUser(@PathVariable(value="userName") String username) {
   //save logic 
   return "user/userinfo";
}

使用.../add/zhangsan

暴力点的@ModelAttribute
Class User {
    String userNAME;
    String pasWD
}

@RequestMapping(method=RequestMethod.POST)
public String addUser(@ModelAttribute(value="user") User user) {
   //save logic 
   return "user/userinfo";
}


其实吧,@ModelAttribute是可以省掉的Q就变成?br />
Class User {
    String userNAME;
    String pasWD
}

@RequestMapping("/add")
public String addUser(User user) {
   //save logic 
   return "user/userinfo";
}


接下来就是两UAJAX相关的:
- JSON
var name = $("#userNAME").val();
var pass = $("#pasWD").val();
var user = {userName:name, password:pass};
$.ajax({
   type:"POST",
                url:"${pageContext.request.contextPath}/user/addUser",
                data:user,
                success:function(data){
                    alert("成功");
                },
                error:function(e) {
                    alert("出错Q?+e);
                }
            });

@RequestMapping("/add")
public String addUser(User user) {
   //save logic 
   return "user/userinfo";
}

jQuery serializeArray()

//序列化表单元素,q回json数据
 var params = $("#userForm").serializeArray();
            
//也可以把表单之外的元素按照name value的格式存q来
//params.push({name:"hello",value:"man"});
            
            $.ajax({
                type:"POST",
                url:"${pageContext.request.contextPath}/user/addUser",
                data:params,
                success:function(data){
                    alert("成功");
                },
                error:function(e) {
                    alert("出错Q?+e);
                }
            });
@RequestMapping("/add")
public String addUser(User user) {
   //save logic 
   return "user/userinfo";
}


下面摘录一D学习笔?出处
@RequestMapping("/somepath/{userName}") 
public String register(@PathVariable(value = "userName") String userName) { 
   ModelAndView mav = new ModelAndView(); 
   return "user/createSuccess"; 

在springmvc注解的@RequestMapping("/somepath/{userName}")如何处理默认值的情况,比如我在发送请求的时?userName有时候是没有的,所以导C不能匚wq个action 
http://localhost:8080/spc/movie/somepath/׃能匹配上面的h: 
http://localhost:8080/spc/movie/somepath/tom而这个才可以匚w?nbsp;


@PathVariable 会将url中的参数解析到对应的Ҏ参数上,需要在@RequestMapping()指定匚w模式 
@RequestMapping("somepath/{userName}") 
q时你访问地址"somepath/Tom"p?Tom"解析到方法参数userName?nbsp;


@RequestParam用于请求参数区数据映射到功能处理方法的参数?nbsp;
public String requestparam2(@RequestParam("username") String username) 
h中包含username参数Q如/requestparam1?username=zhangQ,则自动传入?nbsp;


接下来我们看一下@RequestParam注解主要有哪些参敎ͼ 

valueQ参数名字,卛_参的h参数名字Q如username表示h的参数区中的名字为username的参数的值将传入Q?br />
requiredQ是否必,默认是trueQ表C求中一定要有相应的参数Q否则将?04错误码; 

defaultValueQ默认|表示如果h中没有同名参数时的默认|默认值可以是SpEL表达式,?#8220;#{systemProperties['java.vm.version']}”?nbsp;

public String requestparam4(@RequestParam(value="username",required=false) String username) 
表示h中可以没有名字ؓusername的参敎ͼ如果没有默认为nullQ此处需要注意如下几点: 
    原子cdQ必L|否则抛出异常Q如果允许空D使用包装cMѝ?nbsp;
    Boolean包装cdcdQ默认Boolean.FALSEQ其他引用类型默认ؓnull?nbsp;

public String requestparam5(@RequestParam(value="username", required=true, defaultValue="zhang") String username) 
表示如果h中没有名字ؓusername的参敎ͼ默认gؓ“zhang”?nbsp;


如果h中有多个同名的应该如何接收呢Q如l用h权时Q可能授予多个权限,首先看下如下代码Q?nbsp;
public String requestparam7(@RequestParam(value="role") String roleList)如果h参数cM于url?role=admin&rule=userQ则实际roleList参数入参的数据ؓ“admin,user”Q即多个数据之间使用“Q?#8221;分割Q我们应该用如下方式来接收多个h参数Q?nbsp;
public String requestparam7(@RequestParam(value="role") String[] roleList)  
?nbsp;
public String requestparam8(@RequestParam(value="list") List<String> list)  





crazycy 2014-07-09 16:32 发表评论
]]>
SpringMVC+MyBatis - 1 mybatisGenerator 代码自动生成报错 Result Maps collection already contains value for BaseResultMaphttp://www.aygfsteel.com/crazycy/archive/2014/07/07/415522.htmlcrazycycrazycyMon, 07 Jul 2014 02:01:00 GMThttp://www.aygfsteel.com/crazycy/archive/2014/07/07/415522.htmlhttp://www.aygfsteel.com/crazycy/comments/415522.htmlhttp://www.aygfsteel.com/crazycy/archive/2014/07/07/415522.html#Feedback0http://www.aygfsteel.com/crazycy/comments/commentRss/415522.htmlhttp://www.aygfsteel.com/crazycy/services/trackbacks/415522.htmljava -jar mybatis-generator-core-1.3.2.jar -configfile  {path}\generator\mybatis\generatorConfig.xml -overwrite W一ơ运行后Q程序运行良?br />
再次执行此命令后Q程序出现异常:Error parsing Mapper XML. Cause: java.lang.IllegalArgumentException: Result Maps collection already contains value

逐个文g排查Q终于在xxMapper.xml发现了问题:
-overwrite参数只对java文g起作用,而xml则是部分q加的意思。所以打开xml文g后会发现下面一D|些重复?/u>
所以再要重新生成代码的时候,要把生成的xml删除掉,再运行这个命令?/div>

crazycy 2014-07-07 10:01 发表评论
]]>UI Experience - 01 JQuery cannot get actual window Sizehttp://www.aygfsteel.com/crazycy/archive/2014/05/14/413648.htmlcrazycycrazycyWed, 14 May 2014 03:58:00 GMThttp://www.aygfsteel.com/crazycy/archive/2014/05/14/413648.htmlhttp://www.aygfsteel.com/crazycy/comments/413648.htmlhttp://www.aygfsteel.com/crazycy/archive/2014/05/14/413648.html#Feedback0http://www.aygfsteel.com/crazycy/comments/commentRss/413648.htmlhttp://www.aygfsteel.com/crazycy/services/trackbacks/413648.htmlalert("window height: " + $(window).height());
每次获得的尺寔R不一P
高度怀疑是JQuery的bug

当我在jsp/html开头增加了q么一?br />
<!DOCTYPE html>
事情搞定

分析下来原因是这LQ?br />
If document is running in Quirks Mode and jQuery can't calculate correct window dimensions


crazycy 2014-05-14 11:58 发表评论
]]>
JBoss ASH然发现不熟悉了http://www.aygfsteel.com/crazycy/archive/2014/03/13/410985.htmlcrazycycrazycyThu, 13 Mar 2014 08:38:00 GMThttp://www.aygfsteel.com/crazycy/archive/2014/03/13/410985.htmlhttp://www.aygfsteel.com/crazycy/comments/410985.htmlhttp://www.aygfsteel.com/crazycy/archive/2014/03/13/410985.html#Feedback0http://www.aygfsteel.com/crazycy/comments/commentRss/410985.htmlhttp://www.aygfsteel.com/crazycy/services/trackbacks/410985.htmlThe EAP binaries have their own release cycle. The EAP 6.1 release cycle had a Alpha, a Beta which ultimately led to the 6.1 GA.

 

The 6.1 Alpha binary is made available for free (both for development and production use) to the entire community. This allows community users who have been using the community server JBoss AS (now renamed to WildFly) a chance to get the bug fixes and possibly other features which had been added while the productization work was in progress.

 

The 6.1 Beta binary is made available under the zero-dollar developer subscription scheme (the terms and conditions are herehttp://www.jboss.org/developer-program/termsandconditions). This zero dollar subscription allows users to use the binray in development environments but not in production, unless of course the user additionally is also a paid subscriber/customer of EAP.

 

The 6.1 GA binary is available for production use only for paid subscribers/customers. Zero-dollar subscribers can use it only for development purposes. In other words, the usage terms are the same as 6.1 Beta binary.



crazycy 2014-03-13 16:38 发表评论
]]>
ant: failed to create task or type ifhttp://www.aygfsteel.com/crazycy/archive/2014/03/12/410924.htmlcrazycycrazycyWed, 12 Mar 2014 03:03:00 GMThttp://www.aygfsteel.com/crazycy/archive/2014/03/12/410924.htmlhttp://www.aygfsteel.com/crazycy/comments/410924.htmlhttp://www.aygfsteel.com/crazycy/archive/2014/03/12/410924.html#Feedback0http://www.aygfsteel.com/crazycy/comments/commentRss/410924.htmlhttp://www.aygfsteel.com/crazycy/services/trackbacks/410924.html
 <target name="compile-cxcdata-dao">
    <if>
      <equals arg1="${dummyDAO}" arg2="true" />
      <then>
        <ant antfile="${data.dir}/data_build.xml" target="compile-data" />
        <mkdir dir="${apps.jar.dir}" />
        <jar jarfile="${apps.jar.dir}/data.jar">
          <fileset dir="${data.classes.dir}" includes="**/*" />
        </jar>
      </then>
      <else>
        <copy todir="${apps.jar.dir}" overwrite="true">
          <fileset dir="${data.dir}" includes="**/*.jar" />
        </copy>
      </else>
    </if>
  </target>

BUILD FAILED
D:\__workspace_svn\apps\build.xml:18: The following error occurred while executing this line:
D:\__workspace_svn\apps\apps_build.xml:145: The following error occurred while executing this line:
D:\__workspace_svn\apps\apps_build.xml:100: The following error occurred while executing this line:
D:\__workspace_svn\apps\apps_build.xml:71: Problem: failed to create task or type if
Cause: The name is undefined.
Action: Check the spelling.
Action: Check that any custom tasks/types have been declared.
Action: Check that any <presetdef>/<macrodef> declarations have taken place.

Solution:
It is a compatibility issue.
1. 
Right click on build.xml.

2.
Go to "Run As" --> 2 Ant Select Classpath tab check Ant Home version (Sometimes eclipse selects default ant version).
If the version listed is different, then change Ant Home Classpath to C:\XXXX\ant\X.X.X.

3.
Finally click on the Classpath tab --> Add External JARS..--> add ant-contrib.x.x.jar from C:\XXXX\ant\X.X.X\ant-contrib\ directory.


crazycy 2014-03-12 11:03 发表评论
]]>
NoSQL学习Q九Q 2014q八大最热门的大数据工作http://www.aygfsteel.com/crazycy/archive/2014/01/19/409098.htmlcrazycycrazycySat, 18 Jan 2014 18:20:00 GMThttp://www.aygfsteel.com/crazycy/archive/2014/01/19/409098.htmlhttp://www.aygfsteel.com/crazycy/comments/409098.htmlhttp://www.aygfsteel.com/crazycy/archive/2014/01/19/409098.html#Feedback0http://www.aygfsteel.com/crazycy/comments/commentRss/409098.htmlhttp://www.aygfsteel.com/crazycy/services/trackbacks/409098.html2014q八大最热门的大数据工作
作者:张霖 1?nbsp;16, 2014
http://www.ctocio.com/ccnews/14565.html
原文链接Q?文章来自ITl理|?/a>

大数据时代,数据q剩Qh才短~,来多的IT专业人士希望能够q入充满机遇的大数据领域Q但是,到底哪些具体的大数据专业岗位和h才最为吃香呢Qh力资源公司Kforceq日发布了一份报告根?a style="font-size: 1em; outline: 0px; padding: 0px; margin: 0px; border: 0px; text-decoration: none; vertical-align: baseline; color: #004276;">IT职业薪酬水^l出?014q最热门的十大大数据工作职位Q年薪)Q?/p>

一、ETL开发者(11-13万美元)
随着数据U类的不断增加,企业Ҏ据整合专业h才的需求越来越旺盛。ETL开发者与不同的数据来源和l织打交道,从不同的源头抽取数据Q{换ƈ导入数据仓库以满企业的需要?/span>

ETL软g行业相对成熟Q相兛_位的工作生命周期比较长,通常由内部员工和外包合同商之间通力完成。ETL人才在大数据时代炙手可热的原因之一是:在企业大数据应用的早期阶D,Hadoop只是Ih的ETL?br />
二、Hadoop开发者(15-17.5万美元)
Hadoop是基于Java的开源框Ӟ随着数据集规模不断增大,而传lBI的数据处理成本过高,企业?/span>Hadoop及相关的廉h数据处理技术如Hive、HBase、MapReduce、Pig{的需求将持箋增长。如今具备Hadoop框架l验的技术h员是最抢手的大数据人才?br />
三、大数据可视化工具开发者(15-17.5万美元)
量数据的分析是个大挑战Q?/span>新型数据可视化工具如SpotifreQQlikview和Tableau可以直观高效地展C数?/strong>。过去,数据可视化属于商业智能开发者类别,但是随着Hadoop的崛P数据可视化已l成了一独立的专业技能和岗位?br />
四、数据科学家Q?2-14万美元)
q去也称数据架构师,数据U学家是一个全新的工种Q能够将企业的数据和技术{化ؓ企业的商业h倹{数据科学家首先应当具备优秀的沟通技能,能够同时数据分析结果解释给IT部门和业务部门领对{?/span>

ȝ来说Q数据科学家是分析师、艺术家的合体,需要具备多U交叉科学和商业技能?br />
五、OLAP开发者(9.8-11.6万美元)
OLAP在线联机分析开发者,负责数据从关系型或非关pd数据源中抽取出来建立模型Q然后创建数据访问的用户界面Q提供高性能的预定义查询功能?/strong>

六、数据仓库一体机专家Q?.8-12.4万美元)
此类专家熟悉Teradata、Neteeza和Exadata{公司的大数据一体机。能够在q些一体机上完成数据集成、管理和性能优化{工作?br />
七、预分析开发者(10-13万美元)
营销部门l常使用预测分析预测用户行ؓ或锁定目标用戗预分析开发者有些场景看上有有些cM数据U学Ӟ卛_企业历史数据的基上通过假设来测试阈值ƈ预测未来的表现?br />
八、信息架构师Q?1.4-13.5万美元)
大数据重新激发了L据管理的热潮。充分开发利用企业数据ƈ支持决策需要非怸业的技能。信息架构师必须了解如何定义和存档关键元素,保以最有效的方式进行数据管理和利用。信息架构师的关键技能包括主数据理、业务知识和数据建模{?/span>



crazycy 2014-01-19 02:20 发表评论
]]>
NoSQL学习Q八Q 大数据要“落地”,q缺些什么?http://www.aygfsteel.com/crazycy/archive/2014/01/19/409097.htmlcrazycycrazycySat, 18 Jan 2014 17:59:00 GMThttp://www.aygfsteel.com/crazycy/archive/2014/01/19/409097.htmlhttp://www.aygfsteel.com/crazycy/comments/409097.htmlhttp://www.aygfsteel.com/crazycy/archive/2014/01/19/409097.html#Feedback0http://www.aygfsteel.com/crazycy/comments/commentRss/409097.htmlhttp://www.aygfsteel.com/crazycy/services/trackbacks/409097.html大数据要“落地”Q还~Z什?br />http://www.pingwest.com/bigdata2/

大数?/span>是在2013q被用滥了的词汇Q但实际上,׃数据量缺失、大数据清洗和分析能力不I以及数据可视化瓶颈等问题Q?/span>大数?/span>一直未能迟q落地。伴随着基础设施的发展,意味着大数据的发展又走到新的一个新的界点。系lY件供应商Software AG?/span>Gagan MehraQ在Venturebeat|站阐述了他对于大数据接下来发展的认识,他认为更快地数据处理、更可靠的数据质量,以及更加l分的应用市场,是大数据2.0时代的重要特征?br />

更快的数据处理速度

׃数据量指数型增长Q?/span>对于数据的快速分析的需?/strong>已经变得比以往M时候都要迫切。几乎每家大数据厂商Q都惌兜售比别家处理速度更快的品?/span>Hadoop发布的新?/span>Hadoop 2.0 / YARNQ几乎能实时分析数据。而下一代大数据的计牵引框?/span>Apache SparkQ它的速度?/span>Hadoop?/span>100倍?/span>谷风险投资机构Andreessen HorowitzQ已l以1400万美元的hQ领投了一家以Apache SparkZ务核心的初创企业Databricks。不久前Q?/span>亚马逊也上线了实时流数据服务KinesisQ来帮助没有数据处理能力的公司解册一问题?br />

许多分析供应商都已经认识C数据处理速度的重要?/strong>Qƈ建立了能够每U处?/span>TB数据的品?/span>传感器数据分析、物联网在工业和消费U市场快速发展的势头Q驱动了q次变革?/strong>比如一家企业的传感器,能够每秒产生出数百次的事Ӟ实时处理q些数据隑ֺ很高。特别是当实时处理的传感器数据,Ȁ增到一?/span>5TB的时候,速度Q就成了ؓ关键的指标?/span>


同时Q尽数据存储成本已l篏q下降,但数据存储的费用q是不小的一W支出。部分商家相比存储完整数据流而言Q更們֐于保存过滤掉噪音的数据?br />

清洗垃圾数据

在本难以计数的数据量l以指数模型Ȁ增时Q对于数据质量的强化Q便摆上了许多数据供应商的议E?/span>换句话说Q在庞大数据面前Q即使计机能够高效的处理它们,但大量无用的垃圾数据Q只会给pȝ带来负担Qƈ增添存储、主机等讑֤成本?/span>q就需要数据处理过E中Q根据特定的规则和参敎ͼҎq数据流q行清洗和分析,q自动决{该d理哪些数据,q一切不再需要h工去q预?/span>

在这L环境下,如果选择了一个坏的数据,׃像病毒一P可能引发q箋的错误决{,甚至让企业蒙受经损失?/span>一个例子就是利用算法去q行股票交易Q以毫秒计数股票市场中,M一点小的差错,都有可能引发无法巨大的损失?/strong>

所以,数据质量已成为服务别协议(
service level agreementsQ最重要的参C一。无法屏蔽劣质的数据的供应商Q会因此被列入行业的黑名单,以及面严重的经处|?/span>B2B行业为早期数据质量的入局者,他们非常重视数据的质量,来保持商业运作时的稳定性。甚臻I许多企业计划为数据质量部|实时的警告pȝQ这些警告会被发送于负责相应问题的专员,׃们提供问题的解决Ҏ?br />

机器学习是另一w要保证数据质量的领域。机器学习系l部|在一个闭环的生态中Q通过模式分析与其他的数据分析技术,l化原来的数据质量规则。而高质量的数据,能够保证机器q行正确的行为模式分析?/span>


来多的基应用

大数据带来的变革Q得每一个h都想要利用它Q但技术上门槛又让许多Z得已只能充当一个看客。而应用将有助于h们去克服q一困难。在接下来的几年中,我们会看到成千上万的解?/span>某一垂直领域的专业应?/strong>Q以应对来自各行各业的大数据挑战?br />

目前Q已l小有成q数据分析公司包括eHarmony?/span> Roambi?/span> Climate Corporation{等。未来,甚至许多企业,既不用依赖特定基讑֤Q也不要雇䄦专业的数据科学家Q就能受益于对大数据分析利用?br />

比如Q一些应用将从各U渠道,攉兌的客h据,以更好地了解客户的需求。从而企业能够ؓ特定的目标客P提供特定需求的产品Q更有针Ҏ地赚到钱。当q些应用走进Z日常的吃喝玩乐、医疗保健等领域Q生zM会因此而更好?/span>

 



crazycy 2014-01-19 01:59 发表评论
]]>
NoSQL学习Q七QHadoop是数据仓库的l结者吗?http://www.aygfsteel.com/crazycy/archive/2014/01/19/409096.htmlcrazycycrazycySat, 18 Jan 2014 17:27:00 GMThttp://www.aygfsteel.com/crazycy/archive/2014/01/19/409096.htmlhttp://www.aygfsteel.com/crazycy/comments/409096.htmlhttp://www.aygfsteel.com/crazycy/archive/2014/01/19/409096.html#Feedback0http://www.aygfsteel.com/crazycy/comments/commentRss/409096.htmlhttp://www.aygfsteel.com/crazycy/services/trackbacks/409096.htmlHadoop是数据仓库的l结者吗?
2014q?1?3日 | 作者:邚w~译 | 来源Q网界网
http://news.cnw.com.cn/news-international/htm2014/20140113_289451.shtml

?/span>CNW.com.cn独家译稿?/span>在过Mq_Hadoop生态系l已l大范围扩展Q很多主要IT供应商都推出了Hadoopq接器,以增强Hadoop的顶层架构或是供应商自己使用的Hadoop发行版。鉴于Hadoop的部|率呈指数的增长,以及其生态系l不断地深入而广泛地发展Q我们很想知道Hadoop的崛h否会D传统数据仓库解决Ҏ的终l呢?/span>

我们也可以将q个问题攑ֈ一个更大的环境中去讨论Q在何种E度上,大数据会改变传统数据分析的环?/span>?

数据仓库是技术和软g套gQ它能够从操作系l收集数据,q将q些数据整合Qƈl一C央数据库中,然后Ҏ据A表盘上指标进行分析、可视化和追t关键性能处理?/span>

数据仓库?/span>Hadoop之间的主要区别是Q数据仓库通常部v在单个关pL据库中,而这个数据库则vC央存储的作用。相比之下,Hadoop及其Hadoop文gpȝ是跨多个机器Qƈ用来处理量数据的,而这是Q何单台机器都达不到的能力?/span>

此外Q?/span>Hadoop生态系l包括构建在Hadoop核心之上的数据仓库层/服务Q而Hadoop上层服务包括SQL(Presto)、SQL-Like(Hive)和NoSQL(Hbase)cd的数据存?/span>。相比之下,在过ȝ十年中,大型数据仓库转移C用自定义多处理器讑֤来扩展数据量Q像Netezza(被IBM收购)和Teradata所提供的数据仓库。然而,q些讑֤都非常昂贵,大多C企业都负担不v?/span>

在这U背景下Q我们很自然地要问:Hadoop是否是数据仓库的l结?

Z回答q个问题Q我们需要将数据仓库技术与数据仓库部v分开来看?/span>Hadoop(和NoSQL数据库的出现)预C着数据仓库讑֤和传l数据仓库单一数据库部|的消亡?/span>

而在q方面就有过实例?/span>Hadoop供应商Cloudera其q_作ؓ“企业数据枢纽”Q这在本质上传l数据管理解x案的U_了需求。ReadWrite.com在最q发表的一题?#8220;Z么专有大数据技术没有希望与Hadoop竞争”的文章中也发表了cM的看法。同样地Q最q一华街日报文章描述了Hadoop如何挑战甲骨文和Teradata?/span>

Hadoop或NoSQL生态系l仍l发展。很多大数据环境开始选择NoSQL、SQL甚至是NewSQL数据仓库的؜合方法。此外,MapReduceq行处理引擎也有变化和改q,例如Apache的Spark目。虽然这个故事还q远没有l束Q?strong>但可以说Q传l的单一服务器关pd数据库或数据库设备ƈ不是大数据或数据仓储的未?/strong>?/span>

另一斚wQ数据仓库技?/span>(包括提取—转换—?#8212;加蝲、三l徏模和商业)会应用到新的Hadoop/NoSQL环境。此外,q些技术也变w来支持更多的؜合环境。主要原则是因ؓq不是所有数据都是^{的Q所以ITl理们应该选择数据存储和访问机制来适应数据的用。؜合环境将包括关键价值存储、关pd数据库、图形存储、文档存储、柱状存储、XML数据库、元数据目录{等?/span>

正如你所看到的,qƈ不是一个简单的问题Q也不可能简单地得出一个答案。然而,一般情况下Q虽然大数据在未来五q内会改变数据仓库的部|Ԍ但它不会D数据仓库的概念和做法q时?/span>

对于向数据仓库投入巨资的联邦政府q意味着什么呢?

首先Q当现有数据仓库的容量不够时Q数据仓库将被{UdZHadoop、多机器或云托管的解x案。其ơ,企业q不会选择“放之四v而皆?#8221;的做法,而会目光{向适合其企业内部数据容量的混合存储Ҏ。(邚w~译Q?/span>

 



crazycy 2014-01-19 01:27 发表评论
]]>
NoSQL学习Q六Q 2014q大数据分析势展望(?http://www.aygfsteel.com/crazycy/archive/2014/01/18/409091.htmlcrazycycrazycySat, 18 Jan 2014 13:51:00 GMThttp://www.aygfsteel.com/crazycy/archive/2014/01/18/409091.htmlhttp://www.aygfsteel.com/crazycy/comments/409091.htmlhttp://www.aygfsteel.com/crazycy/archive/2014/01/18/409091.html#Feedback0http://www.aygfsteel.com/crazycy/comments/commentRss/409091.htmlhttp://www.aygfsteel.com/crazycy/services/trackbacks/409091.html2014q大数据分析势展望
Posted on 2014q?1??nbsp;by DinK in 行业资讯 
http://www.199it.com/archives/185758.html

市场研究公司IDC预测Q?015q大数据市场规模从2010q的32亿美元增长到170亿美元,复合q增长率?0%。大数据是一个庞大的新的领域Q其中的数据集可以增长的非常庞大Q以至于使用传统的数据库理工具也很隑֤理。处理这U问题所需要的新工兗框架、硬件、Y件和服务是一个巨大的市场Z。随着企业用户来多地需要连l不断地讉K数据Q好的大数据工具集将以最低的成本和接q实时的速度提供可׾~的、高性能的分析。通过分析q种数据Q企业可得到更大的智能以及竞争优ѝ下面是Hadoop和大数据专业厂商MapR共同创始人和首席执行官约?#183;施罗PJohn SchroederQ对2014大数据市场的预测?/span>

1. SQL拥有大数据的最大潜?/span>

用于 HadoopQ分布式计算Q的SQL的发展能够让商业分析师利用自q技能和选择的SQL工具执行大数据项目。开发h员可以选择Hive、Drill?Impala{Apache目Q以及选择Hadapt、HAWQ和Splice Machine{公司的专有技术?/span>

2. 管如此 SQLq面临挑?/span>

SQL需要数据结构。而集中的l构化数据可引v延迟q且需要h工管理。SQLq限制分析类型。过分强调SQLgq机构全面利用其数据价值的努力和gq反应?/span>

3. w䆾识别是主要的数据安全问题

随着HadoopQ分布式计算Q中提供的接入控制能力的猛烈dQ机构迅速认识到U\Un份识别是必要的基。没有充分的w䆾识别QQ何更高的控刉很容易被l过Q妨预定的安全计划?/span>

4. 数据错误变成学习Z

2014q机构将出现许多数据错误。数据错误将表明基础的来源系l的问题吗?数据错误是在下游分析中出现偏差导致的数据提取问题吗?数据错误表明定义差异或者缺跨部门和业务部门的一致性吗Q?014q将看到解决数据异常问题?/span>

5. 出现可运行的Hadoop

2014q将看到Hadoop在各个行业中的生产部|显著增加。这显C出Hadoop在运营中的实力。在那里Q生产应用与分析l合在一赯够提供可以衡量的商业优势Q如在客户化零售、诈骗检和试验传感器数据进行规范的l护{应用中提供q些优势?/span>

6. 更多的数据仓库将部v企业数据中心

数据中心把数据提取处理和数据从企业数据仓库卸载到Hadoop。作Z个核心的中心企业中心Q数据中心要便宜10倍,能够寚w外的处理或者新的应用进行更多的分析?/span>

7. 新的以数据ؓ中心的应用将成ؓ强制性的

利用大数据的能力在2014q成为竞争的武器。更多的公司用大数据和Hadoop准确地针对个人消费者的偏爱q逐赚qq加销售和交叉销售的ZQ更好地~解风险以及减少生和开销成本?/span>

8. 数据成ؓ数据中心的核?/span>

机构从开发者过渡到大数据计划中?/span>IT部门越来越多地担负定义支持多种应用的数据基设施的Q务,把重炚w中在部v、处理和保护一个机构的核心资所需要的基础设施斚w?/span>

9. 搜烦成为非l构化的查询语言

2013q有大量的用于Hadoop的SQL计划?014q将是这U非l构化查询语a成ؓ重点的一q。把搜烦集成到Hadoopؓ查找重要信息的企业用h供一U简单和直观的方法。搜索引擎还是包括推荐引擎在内的许多发现和分析应用的核心?/span>

10. Hadoop获得地?/span>

Hadoopl取代其它IT开支,颠覆企业数据仓库和企业存储。例如,甲骨文的主要营收目标在过ȝ10个季度里?个季度没有实现。Teradata在过ȝ5个季度有4个季度没有实现营收和利润目标?/span>

11. Hadoop仍需要帮助才能成Z应?/span>

更多的机构认识到Apache Hadoop本nq没有准备好在企业应用。Apache Hadoop不是为系l管理或者灾难恢复等l一企业IT程设计的。企业将l箋推进混合的解x案,把架构技术创CApache Hadoop的开源Y件结合在一赗?/span>

英文http://www.cio.com.au/slideshow/534054/pictures_12_big_data_predictions_2014/?image=3

译文http://www.csdn.net/article/2013-12-25/2817926-pictures-12-big-data-predictions-2014
2014?2个大数据势QHadoopl箋升温QR进入主?/div>

当下Q?/span>大数?/span>已成?/span>2013q最火的技术词汇之一Q而在q去一q_q个市场的增速和改变也不可谓不大。同Ӟ我们q看CHadoop及其生态系l的使用门槛从顶技术h才到数据U学家的改变。越来越多的企业拥抱大数据技术,q将其运用到生环境中。那么,?/span>2014q大数据的发展趋势又会如何,q里不妨看一下来?/span>CIO?/span>12w:

1. Z不再止步于大数据的谈?/span> 

2014q_大数据止于说的情况将发生改变Qh们将致力于从中获益,所有大数据的炒作也?/span>烟消云散。从Gainsight了解刎ͼ大数据本w也成为桌面上的筹码,Gainsight在其IaaSq_中利用大数据分析被其UC?/span>“customer success management”的服务?/span>Gainsight认ؓQ在2014q_每家云应用程序提供商都将会让其后端基设施支持大数据?/span>


2. Hadoop
成Z业的关键lg
Hadoop
普及,大数据也不会再l止步于云服务?/span>Alteryx认ؓQ?/span>2014q_Hadoop的适用场景超批处理和存储,成Z业数据架构中通用的核心组Ӟq意味着数据分析l成为大数据的首要用例?/span>


3.
企业更加钟情于用户数据
?/span>Gainsight了解刎ͼ各个机构对用户数据充满热情Q企业将充分利用客户与其在线产品或服务交互生的数据Qƈ从中获取价倹{ؓ了实现这点,数据分析能力比BI团队更受重视Qؓ企业提供更多的h倹{?/span>


4.
大数据玩转市场决{?/span>
Alteryx
认ؓQ在2014q_大数据将首次正式登陆市场营销Q用于市销的大数据技术将在这一q扮演重要角?/span>——影响着q告、品推销和消费者行为,World Cup?/span>Winter Olympics是其最大的舞台?/span>


5.
量的数据将越数据U学家的意识
lteryx
认ؓQ新型的数据分析需求将越人力可ؓQ有些情况下大数据技术将堪比成千上万的数据科学家。该公司预测Q这会毫无疑问的拉低数据科学家薪酬?/span>


6.
物联|将q军|络
IEEE
的专业协会认为,2014q_可识别事物将无缝的连接到信息|络Q实现真正意义上?/span>Web of Things?/span>The Web of Things会充分利用Ud讑֤和传感器的监控能力,增强现实世界中的物体?/span>Web副本之间的协同性?/span>

The Web of Things会生成大量与现实世界相关的数据Q因而会需求智能化的解x案在现实世界与相对应的数字世界资源之间赋予连接性、网际互q和相关性?/span>


7.
从大数据到v量数?/span>
数据的体U、速度和类型(volume?/span>velocity?/span>varietyQ在2014q将会l呈指数U增长,因此需要更单的分析工具来驾驭这?/span>数据z流?/span>

IEEE
不止?/span>3?/span>V让大数据成了非常难以制服的老虎Q数据科学家及行业所需单工具也是个NQ许多行业尚无独立提取数据h值的能力。当前已出现的v量数据时代更需求数据管理和分析上新的范式和实践?/span>2014q_q个领域上演群雄争霸?/span>


8. R
语言取代传l?/span>SAS解决Ҏ
Alteryx
认ؓQ基?/span>R~程语言的分析将数据U学?/span>御用模式Q这U分析在2014q将成ؓLQ将替代传统?/span>SAS?/span>SPSS模式?/span>Alteryx说道Q?/span>200万用户和300万的分析师都在寻找更好的解决ҎQ?/span>R恰逢其时?/span>


9. Hadoop
增加实时特?/span>
SQL-on-Hadoop
供应?/span>Splice Machine共同创始人兼CEO Monte Zweben指出Q未?/span>1q徏立在Hadoopq_上的交互式应用程序将呈爆发式增长Q其中包?/span>Web应用、移动应用和C交应用Qh们可以与之进行实时的交互?/span>

Zweben说道Q?/span>“2014带来实时大数据应用E序q_Q企业将不会只能像当下一样分析历史数据,你将有能力分?/span>5分钟Q甚x1分钟之内的数据;企业拥有交互式应用E序Q以便实时的制定决策?/span>


10. Hadoop
得C业强化
Splice Machine
?/span>Zweben_毋庸|疑Q?/span>Hadoop是个了不Lq_Q但是仍然有许多工作要做?/span>

他认为,?/span>2014Q你看?/span>Hadoop向安全、运营管理、资源管理及多站点响应方向发展?/span>Zweben补充道:你将看到所有的企业U需求,我认些将是未来主要的焦点?/span>


11.  2014
q底Q至有一?/span>NoSQL IPO
大数据及云环境安全解x?/span>Gazzang董事长兼CEO Larry Warnock预测Q在2014Q至有一?/span>Hadoop或?/span>NoSQL供应商会IPOQ这标志着大数据^台已被广泛认可?/span>

Warnock说道Q?/span>我不会去预测哪家?/span>IPOQ但是至会有一?/span>Hadoop?/span>NoSQL供应?/span>IPO。通过Wikibon了解刎ͼ?/span>2012q_NoSQL软g和服务创造了2.86亿美元的E收Q而在2017q_q个数据被预ؓ18.25ѝ商不断增长的企业需求推动,他们需要灵zR可扩展及负担得L数据理解决ҎQؓ新时代的云及大数据设计?/span>


12.
一个新的分析堆栈将诞生
Alteryx
预测Q?/span>2014q_出C个新的数据及分析堆栈Qؓ数据库、分析、可视化提供新的解决ҎQ这直接威胁到传统的供应商巨头Q而这些供应商也会在匆忙中推出新的解决Ҏ?/span>

 



crazycy 2014-01-18 21:51 发表评论
]]>NoSQL学习Q五QCassandra vs MongoDB vs CouchDB vs Redis vs Riak vs HBase vs Couchbase vs Neo4j vs Hypertable vs ElasticSearch vs Accumulo vs VoltDB vs Scalaris comparisonhttp://www.aygfsteel.com/crazycy/archive/2014/01/14/408883.htmlcrazycycrazycyMon, 13 Jan 2014 17:34:00 GMThttp://www.aygfsteel.com/crazycy/archive/2014/01/14/408883.htmlhttp://www.aygfsteel.com/crazycy/comments/408883.htmlhttp://www.aygfsteel.com/crazycy/archive/2014/01/14/408883.html#Feedback0http://www.aygfsteel.com/crazycy/comments/commentRss/408883.htmlhttp://www.aygfsteel.com/crazycy/services/trackbacks/408883.html阅读全文

crazycy 2014-01-14 01:34 发表评论
]]>
NoSQL非关pd数据库学习(四)q样Ҏ下HBase, Memcached, MongoDB, Redis和Solrhttp://www.aygfsteel.com/crazycy/archive/2014/01/14/408880.htmlcrazycycrazycyMon, 13 Jan 2014 16:27:00 GMThttp://www.aygfsteel.com/crazycy/archive/2014/01/14/408880.htmlhttp://www.aygfsteel.com/crazycy/comments/408880.htmlhttp://www.aygfsteel.com/crazycy/archive/2014/01/14/408880.html#Feedback0http://www.aygfsteel.com/crazycy/comments/commentRss/408880.htmlhttp://www.aygfsteel.com/crazycy/services/trackbacks/408880.html阅读全文

crazycy 2014-01-14 00:27 发表评论
]]>
Failed to load the JNI shared library "C:/JDK/bin/client/jvm.dll"http://www.aygfsteel.com/crazycy/archive/2014/01/13/408875.htmlcrazycycrazycyMon, 13 Jan 2014 11:47:00 GMThttp://www.aygfsteel.com/crazycy/archive/2014/01/13/408875.htmlhttp://www.aygfsteel.com/crazycy/comments/408875.htmlhttp://www.aygfsteel.com/crazycy/archive/2014/01/13/408875.html#Feedback0http://www.aygfsteel.com/crazycy/comments/commentRss/408875.htmlhttp://www.aygfsteel.com/crazycy/services/trackbacks/408875.html
The solution to resolve it is to make sure the version are all 64 bits
  • 64-bit Java
  • 64-bit {tool}



crazycy 2014-01-13 19:47 发表评论
]]>
NoSQL非关pd数据库学习(三)NoSQL与RDBMSQ何时用,何时不?/title><link>http://www.aygfsteel.com/crazycy/archive/2014/01/13/408845.html</link><dc:creator>crazycy</dc:creator><author>crazycy</author><pubDate>Mon, 13 Jan 2014 04:12:00 GMT</pubDate><guid>http://www.aygfsteel.com/crazycy/archive/2014/01/13/408845.html</guid><wfw:comment>http://www.aygfsteel.com/crazycy/comments/408845.html</wfw:comment><comments>http://www.aygfsteel.com/crazycy/archive/2014/01/13/408845.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/crazycy/comments/commentRss/408845.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/crazycy/services/trackbacks/408845.html</trackback:ping><description><![CDATA[     摘要: NoSQL数据库面临的挑战NoSQL vs RDBMS: Why and why not to use NoSQL over RDBMS?  Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->Naresh Kumar3 J...  <a href='http://www.aygfsteel.com/crazycy/archive/2014/01/13/408845.html'>阅读全文</a><img src ="http://www.aygfsteel.com/crazycy/aggbug/408845.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/crazycy/" target="_blank">crazycy</a> 2014-01-13 12:12 <a href="http://www.aygfsteel.com/crazycy/archive/2014/01/13/408845.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>NoSQL非关pd数据库学习(二)http://www.aygfsteel.com/crazycy/archive/2014/01/13/408844.htmlcrazycycrazycyMon, 13 Jan 2014 04:03:00 GMThttp://www.aygfsteel.com/crazycy/archive/2014/01/13/408844.htmlhttp://www.aygfsteel.com/crazycy/comments/408844.htmlhttp://www.aygfsteel.com/crazycy/archive/2014/01/13/408844.html#Feedback0http://www.aygfsteel.com/crazycy/comments/commentRss/408844.htmlhttp://www.aygfsteel.com/crazycy/services/trackbacks/408844.htmlGartner分析?/span>Merv Adrian?/span>Twitter?/span>RT了一条关?/span>NoSQL数据库评选的消息Q他认ؓq就像是在对比你更喜Ƣ苹果、鸡Nq是西兰花,它们都有不同的应用场景,ҎNoSQL产品是没有意义的。比?/span>MongoDB?/span>Cassandra没有什么可比性,它们的共同点只是都叫?/strong>NoSQL数据库而已Q它们的应用场景非常不同?/span>

 

下面q是Ҏ学习Q对现在比较热门的MangoDB和Memcached以及Redis做个单的学习Q?/span>

MangoDB?/span>(document database, 盘?/span>)
a. Z盘的数据库Q只是缓存热Ҏ据在内存中?/span>
b. 文档型的非关pd数据库,
    优势是查询功能强大,可存储v量数据?/span>
c. 可替?/span>MySQL{关pd数据?/span>;
    在内存够的情况下,d性能不错Q可省去Cacheq一?br />

Memcached?/span>Redis?/span>(key value store, 内存?/span>)
a.内存型数据库Q数据保存在内存中,通过TCP直接存取Q?/span> 或者说是全内存Cache?/span>
   优势是速度快,q发高,~点是数据类型有限,查询功能不强Q一般做~存?/span>
b. Key Value Store
c. 全内?br />

Memcached vs Redis
a. 都是Key Vale, Memory Cache
b. Memecahced?multiple-thread; 适合多核CPU的应用?/span>
    Redis?single-thread.
    如果再多数据l构基础上支持多U程Q加锁可能是个问?/span>Q待深入学习验证Q?/strong>?br /> c. Redish持久化机Ӟ可以定期内存的数据持久化到盘?/span>
d. Redis支持的数据类型更?/span>
e. Redis 具备binlog功能Q将所有操作写入日志,以便redis出现故障Ӟ可通过binlogq行恢复?/span>
f. Redis支持Virtual MemoryQ可限定内存大小Q当数据出阀|通过cMLRU的算法将最不常用的数据保存到硬盘的面问题中?/span>

 



crazycy 2014-01-13 12:03 发表评论
]]>
NoSQL非关pd数据库学习(一Q?/title><link>http://www.aygfsteel.com/crazycy/archive/2014/01/13/408842.html</link><dc:creator>crazycy</dc:creator><author>crazycy</author><pubDate>Mon, 13 Jan 2014 03:53:00 GMT</pubDate><guid>http://www.aygfsteel.com/crazycy/archive/2014/01/13/408842.html</guid><wfw:comment>http://www.aygfsteel.com/crazycy/comments/408842.html</wfw:comment><comments>http://www.aygfsteel.com/crazycy/archive/2014/01/13/408842.html#Feedback</comments><slash:comments>1</slash:comments><wfw:commentRss>http://www.aygfsteel.com/crazycy/comments/commentRss/408842.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/crazycy/services/trackbacks/408842.html</trackback:ping><description><![CDATA[     摘要: ?008q的时候,我还是只知道DB2, Oracle, MS SQLServer, Sybase, MySQL, PostgreSQL,  Firebird{主商业或者开源数据库。当汲取知识于网l之际,H然发现很多新的名词D而出Q什?SQLite, Memcached,  FastDB, MongoDB, Solr, Redis, HBase,  Cass...  <a href='http://www.aygfsteel.com/crazycy/archive/2014/01/13/408842.html'>阅读全文</a><img src ="http://www.aygfsteel.com/crazycy/aggbug/408842.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/crazycy/" target="_blank">crazycy</a> 2014-01-13 11:53 <a href="http://www.aygfsteel.com/crazycy/archive/2014/01/13/408842.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Download of Spring Framework http://www.aygfsteel.com/crazycy/archive/2014/01/06/408589.htmlcrazycycrazycyMon, 06 Jan 2014 11:08:00 GMThttp://www.aygfsteel.com/crazycy/archive/2014/01/06/408589.htmlhttp://www.aygfsteel.com/crazycy/comments/408589.htmlhttp://www.aygfsteel.com/crazycy/archive/2014/01/06/408589.html#Feedback0http://www.aygfsteel.com/crazycy/comments/commentRss/408589.htmlhttp://www.aygfsteel.com/crazycy/services/trackbacks/408589.htmlspring.io

And the download of zip files has become a bit confusion.
Base on 
You now have to download the zip files form their repository, as stated here: 
https://github.com/spring-projects/spring-framework/wiki/Downloading-Spring-artifacts 
(statement at the bottom of the page).

Download cannot proceed without account/login, so I decide to the below page and download jar by jar.
mvnrepository.com/artifact/org.springframework

When come to "spring-security-core", I question myself that how I can get all dependent jar files.
With this question, I find the direct link to download the whole zip file:
http://repo.spring.io/release/org/springframework/spring
or
https://github.com/spring-projects/spring-framework/releases

Also, there is another DIY solution from Spring website 
https://github.com/spring-projects/spring-framework/wiki/Downloading-Spring-artifacts
(statement at the bottom of the page).
Also, some folks are already provided the detailed steps:
The solution I prefer is using Maven, it is easy and you don't have to download each jar alone. you can do it with the following steps:

1. Create an empty folder in anywhere with any name you prefer, for example spring-source
2. Create a new file named pom.xml
3. Copy the following in this file
4. Open the spring-source folder in your console
5. Run mvn install
6. After download finished, you'll find spring jars in /spring-source/target/dependencies
Configuration is as below:
<project>
  <modelVersion>4.0.0</modelVersion>
  <groupId>spring-source-download</groupId>
  <artifactId>SpringDependencies</artifactId>
  <version>1.0</version>
  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
  </properties>
  <repositories>
    <repository>
      <id>repository.spring.release</id>
  <name>Spring GA Repository</name>
      <url>http://repo.spring.io/release</url>
      <snapshots>
        <enabled>false</enabled>
      </snapshots>
    </repository>
  </repositories>
  <dependencies>
    <!--each dependency refer to
           corresponding project under 
http://spring.io/projects-->
  <!--spring-framework-->
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-context</artifactId>
        <version>4.0.0.RELEASE</version>
    </dependency>
    <!--spring-security-->
  <!--
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-web</artifactId>
<version>3.2.0.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-config</artifactId>
<version>3.2.0.RELEASE</version>
</dependency>
-->
<!--spring-webflow-->
<!--
<dependency>
<groupId>org.springframework.webflow</groupId>
<artifactId>spring-webflow</artifactId>
<version>2.3.2.RELEASE</version>
    </dependency>
-->
</dependencies>
  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-dependency-plugin</artifactId>
            <version>2.8</version>
            <executions>
              <execution>
                <id>download-dependencies</id>
                  <phase>generate-resources</phase>
                    <goals>
                      <goal>copy-dependencies</goal>
                    </goals>
                    <configuration>
                      <outputDirectory> ${project.build.directory}/dependencies </outputDirectory>
                    </configuration>
              </execution>
            </executions>
      </plugin>
    </plugins>
  </build>
</project>
Furthermore, 
Also, if you need to download any other spring project, just copy the dependency configuration from its corresponding web page

For example, if you want to download Spring Web Flow jars, go to its web page, and add its dependency configuration to the pom.xml dependencies, then run mvn install again.
<dependency>
   <groupId>org.springframework.webflow</groupId>
    <artifactId>spring-webflow</artifactId>
    <version>2.3.2.RELEASE</version>
</dependency>


引用一个文章:如何在项目中引入Spring框架(2010-05-26)

spring的jar包说明如下:

>>spring.jar 
是包含有完整发布模块的单个jar 包?br />但是不包括mock.jar, aspects.jar, spring-portlet.jar, and spring-hibernate2.jar?br />      
spring-src.zip是所有的源代码压~包?/strong>

除了spring.jar 文gQSpring q包括有其它21 个独立的jar 包,各自包含着对应的SpringlgQ用户可以根据自q需要来选择l合自己的jar 包,而不必引入整个spring.jar 的所有类文g?/strong>

>>spring-core.jar
q个jar 文g包含Spring 框架基本的核心工L。Spring 其它lg要都要用到q个包里的类Q是其它lg的基本核心,当然你也可以在自q应用pȝ中用这些工L?br />
外部依赖Commons LoggingQ?nbsp;(Log4J)?br />
>>spring-beans.jar
q个jar 文g是所有应用都要用到的Q它包含讉K配置文g、创建和理bean 以及q行Inversion of Control / Dependency InjectionQIoC/DIQ操作相关的所有类。如果应用只需基本的IoC/DI 支持Q引入spring-core.jar 及spring-beans.jar 文g可以了?br />
外部依赖spring-coreQ?CGLIB)?br />
>>spring-aop.jar
q个jar 文g包含在应用中使用Spring的AOP Ҏ时所需的类和源码元数据支持。用基于AOP 的SpringҎ,如声明型事务理QDeclarative Transaction ManagementQ,也要在应用里包含q个jar包?br />
外部依赖spring-coreQ?nbsp;(spring-beansQAOP AllianceQ?nbsp;CGLIBQCommons Attributes)?br />
>>spring-context.jar
q个jar 文g为Spring核心提供了大量扩展。可以找C用Spring ApplicationContextҎ时所需的全部类QJDNI 所需的全部类Qinstrumentationlg以及校验Validation 斚w的相关类?br />
外部依赖spring-beans, (spring-aop)?br />
>>spring-dao.jar
q个jar 文g包含Spring DAO、Spring Transaction q行数据讉K的所有类。ؓ了用声明型事务支持Q还需在自q应用里包含spring-aop.jar?br />      
外部依赖spring-coreQ?spring-aopQ?nbsp;spring-contextQ?nbsp;JTA API)?br />
>>spring-jdbc.jar
q个jar 文g包含对Spring 对JDBC 数据讉Kq行装的所有类?br />
外部依赖spring-beansQspring-dao?br />
>>spring-support.jar
q个jar 文g包含支持UI模版QVelocityQFreeMarkerQJasperReportsQ,邮g服务Q脚本服?JRuby)Q缓存CacheQEHCacheQ,d计划SchedulingQuartzQ方面的cR?br />
外部依赖spring-context, (spring-jdbc, Velocity, FreeMarker, JasperReports, BSH, Groovy, JRuby, Quartz, EHCache)

>>spring-web.jar
q个jar 文g包含Web 应用开发时Q用到Spring 框架时所需的核心类Q包括自动蝲入Web Application Context Ҏ的cRStruts 与JSF 集成cR文件上传的支持cRFilter cd大量工具辅助cR?br />
外部依赖spring-context, Servlet API, (JSP API, JSTL, Commons FileUpload, COS)?br />
>>spring-webmvc.jar
q个jar 文g包含Spring MVC 框架相关的所有类。包括框架的ServletsQWeb MVC框架Q控制器和视图支持。当Ӟ如果你的应用使用了独立的MVC 框架Q则无需q个JAR 文g里的McR?br />
外部依赖spring-web, (spring-supportQTilesQiTextQPOI)?br />
>>spring-portlet.jar
spring自己实现的一个类似Spring MVC的框架。包括一个MVC框架和控制器?br />
外部依赖spring-webQ?nbsp;Portlet APIQ?spring-webmvc)?br />
>>spring-struts.jar
Struts框架支持Q可以更方便更容易的集成Struts框架?br />
外部依赖spring-webQStruts?br />
>>spring-remoting.jar
q个jar 文g包含支持EJB、远E调用RemotingQRMI、Hessian、Burlap、Http Invoker、JAX-RPCQ方面的cR?br />
外部依赖spring-aopQ?nbsp;(spring-contextQspring-webQHessianQBurlapQJAX-RPCQEJB API)?br />
>>spring-jmx.jar
q个jar包提供了对JMX 1.0/1.2的支持类?nbsp;     

外部依赖spring-beansQspring-aopQ?nbsp;JMX API?br />
>>spring-jms.jar
q个jar包提供了对JMS 1.0.2/1.1的支持类?br />
外部依赖spring-beansQspring-daoQJMS API?br />
>>spring-jca.jar
对JCA 1.0的支持?br />
外部依赖spring-beansQspring-daoQ?nbsp;JCA API?br />
>>spring-jdo.jar
对JDO 1.0/2.0的支持?nbsp;     

外部依赖spring-jdbcQ?nbsp;JDO APIQ?nbsp;(spring-web)?br />
>>spring-jpa.jar
对JPA 1.0的支持?br />
外部依赖spring-jdbcQ?nbsp;JPA APIQ?nbsp;(spring-web)?br />
>>spring-hibernate2.jar
对Hibernate 2.1的支持,已经不徏议用?br />
外部依赖spring-jdbcQHibernate2Q?spring-web)?br />
>>spring-hibernate3.jar
对Hibernate 3.0/3.1/3.2的支持?br />
外部依赖spring-jdbcQHibernate3Q?spring-web)?br />
>>spring-toplink.jar
对TopLink框架的支持?br />
外部依赖spring-jdbcQTopLink?br />
>>spring-ibatis.jar
对iBATIS SQL Maps的支持?br />
外部依赖spring-jdbcQiBATIS SQL Maps?br />
>>spring-mock.jar
q个jar 文g包含Spring 一整套mock cL辅助应用的测试。Spring 试套g使用了其中大量mock c,q样试更加简单。模拟HttpServletRequest 和HttpServletResponse cdWeb 应用单元试是很方便的。ƈ且提供了对JUnit的支持?br />
外部依赖spring-core?br />
>>spring-aspects.jar
提供对AspectJ的支持,以便可以方便的将面向斚w的功能集成进IDE中,比如Eclipse AJDT?br />
外部依赖?br />

WEAVER JARS (dist/weavers)说明:

>>spring-agent.jar
Spring的InstrumentationSavingAgent (为InstrumentationLoadTimeWeaver)Q一个设备代理包Q可以参考JDK1.5的Instrumentation功能获得更多信息?br />
外部依赖none (for use at JVM startup: "-javaagent:spring-agent.jar")?br />
>>spring-tomcat-weaver.jar
扩展Tomcat的ClassLoaderQ其可以用instrumentationQ设备)cR?br />
外部依赖none (for deployment into Tomcat's "server/lib" directory)?br />
如果需要用JSP语言作ؓSpring's web MVC tags的参敎ͼ则需要JSP 2.0的支持。或者选择Jakarta的JSTL (standard.jar)?/strong>



crazycy 2014-01-06 19:08 发表评论
]]>
JBoss5 for Java5 vs JBoss for Java6http://www.aygfsteel.com/crazycy/archive/2013/07/12/401501.htmlcrazycycrazycyFri, 12 Jul 2013 06:59:00 GMThttp://www.aygfsteel.com/crazycy/archive/2013/07/12/401501.htmlhttp://www.aygfsteel.com/crazycy/comments/401501.htmlhttp://www.aygfsteel.com/crazycy/archive/2013/07/12/401501.html#Feedback0http://www.aygfsteel.com/crazycy/comments/commentRss/401501.htmlhttp://www.aygfsteel.com/crazycy/services/trackbacks/401501.html
W一个事情是Q?个数据库的写操作在同一个事?Transaction)中,本地开发环境和公司的集成测试环境运转都很好Q但是在客户机器上:

2013-05-06 19:10:49,957 WARN  [org.jboss.tm.usertx.UserTransactionRegistry] (http-0.0.0.0-8380-1) Error notifying listener org.jboss.resource.connectionmanager.CachedConnectionManager@1187172 of userTransactionStarted

java.lang.IllegalStateException: Trying to change transaction TransactionImple < ac, BasicAction: -53e5e9f0:e87f:51878ef5:b3c status: ActionStatus.RUNNING > in enlist!

            at org.jboss.resource.connectionmanager.TxConnectionManager$TxConnectionEventListener.enlist(TxConnectionManager.java:623)
            at org.jboss.resource.connectionmanager.TxConnectionManager.transactionStarted(TxConnectionManager.java:394)
            at org.jboss.resource.connectionmanager.CachedConnectionManager.userTransactionStarted(CachedConnectionManager.java:350)
            at org.jboss.tm.usertx.UserTransactionRegistry.userTransactionStarted(UserTransactionRegistry.java:119)

            at org.jboss.tm.usertx.client.ServerVMClientUserTransaction.begin(ServerVMClientUserTransaction.java:141)

            at org.springframework.transaction.jta.JtaTransactionManager.doJtaBegin(JtaTransactionManager.java:863)

            at org.springframework.transaction.jta.JtaTransactionManager.doBegin(JtaTransactionManager.java:820)

            at org.springframework.transaction.support.AbstractPlatformTransactionManager.handleExistingTransaction(AbstractPlatformTransactionManager.java:423)
            at org.springframework.transaction.support.AbstractPlatformTransactionManager.getTransaction(AbstractPlatformTransactionManager.java:347)
            at org.springframework.transaction.interceptor.TransactionAspectSupport.createTransactionIfNecessary(TransactionAspectSupport.java:335)
            at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:105)
            at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
            at org.springframework.aop.framework.adapter.ThrowsAdviceInterceptor.invoke(ThrowsAdviceInterceptor.java:124)
            at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
            at org.springframework.aop.framework.Cglib2AopProxy$DynamicAdvisedInterceptor.intercept(Cglib2AopProxy.java:621)
            at com.jc.cxc.ws.ax.process.CxCAXWsSendingProcessorR1$$EnhancerByCGLIB$$4481d594.saveDBI_IntegrationQueueCcxc2axSmry(<generated>)
            at com.jc.cxc.ws.ax.process.CxCAXWsSendingProcessorR1.documentProcess(CxCAXWsSendingProcessorR1.java:1022)

W二个事情是依然是类似的Q在本地机和集成试Z工作很好Q在客户服务器上提C错误:
java.lang.reflect.InvocationTargetException

                at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                at java.lang.reflect.Method.invoke(Method.java:597)
                at org.apache.struts.actions.DispatchAction.dispatchMethod(DispatchAction.java:280)
                at org.apache.struts.actions.DispatchAction.execute(DispatchAction.java:216)
                at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:484)
                at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)
                at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
                at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)
                at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
                at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
                at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
                at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
                at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:311)
                at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:116)
                at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:83)
                at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
                at com.jc.cxc.web.filter.SessionManageProcessingFilter.doFilter(SessionManageProcessingFilter.java:100)
                at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
                at com.justcommodity.cxc.servlets.filters.CxcUsernamePasswordAuthenticationFilter.doFilter(CxcUsernamePasswordAuthenticationFilter.java:42)
                at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
                at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:87)
                at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
                at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:173)
                at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:237)
                at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:167)
                at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
                at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
                at com.justcommodity.cxc.servlets.filters.GeneralFilter.doFilter(GeneralFilter.java:66)
                at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
                at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
                at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
                at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
                at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
                at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:235)
                at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
                at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:190)
                at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:92)
                at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.process(SecurityContextEstablishmentValve.java:126)
                at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:70)
                at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
                at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
                at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:158)
                at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
                at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:330)
                at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:829)
                at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:598)
                at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
                at java.lang.Thread.run(Thread.java:662)
Caused by: java.lang.AbstractMethodError: org.jboss.resource.adapter.jdbc.jdk5.WrappedStatementJDK5.isClosed()Z
                at com.justcommodity.security.AutoAuthentication.initAuthenticationInfo(AutoAuthentication.java:75)
                at com.jc.springframework.security.context.CxcAuthentication.autoAuthenticationInfo(CxcAuthentication.java:28)
                at com.jc.cxc.ws.transrisk.service.CxcTransriskSenderR1.sendTransRiskData(CxcTransriskSenderR1.java:456)
                at com.justcommodity.cxc.jsp.admin.integration.transrisk.TransactionAction.sentTRData(TransactionAction.java:138)
                 50 more


最l发C是用Jboss for Java5的version在Java6环境中?br />查的方式是:

To know if which JBoss 5 installed, check boot.log
- For jboss-5.1.0.GA-jdk6.zip file, the log will show date=200905221634
e.g
    20:34:31,522 INFO [ServerImpl] Release ID: JBoss [The Oracle] 5.1.0.GA (build: SVNTag=JBoss_5_1_0_GA date=200905221634)
 

- For JDK5 compiled version you would see date=200905221053:
e.g 
    21:48:35,141 INFO  [ServerImpl] Release ID: JBoss [The Oracle] 5.1.0.GA (build: SVNTag=JBoss_5_1_0_GA date=200905221053)

crazycy 2013-07-12 14:59 发表评论
]]>
Quartz Cron表达?/title><link>http://www.aygfsteel.com/crazycy/archive/2013/06/06/400287.html</link><dc:creator>crazycy</dc:creator><author>crazycy</author><pubDate>Thu, 06 Jun 2013 03:35:00 GMT</pubDate><guid>http://www.aygfsteel.com/crazycy/archive/2013/06/06/400287.html</guid><wfw:comment>http://www.aygfsteel.com/crazycy/comments/400287.html</wfw:comment><comments>http://www.aygfsteel.com/crazycy/archive/2013/06/06/400287.html#Feedback</comments><slash:comments>1</slash:comments><wfw:commentRss>http://www.aygfsteel.com/crazycy/comments/commentRss/400287.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/crazycy/services/trackbacks/400287.html</trackback:ping><description><![CDATA[每次使用Quartz Cron的时候都要去?a >manual document</a>;<br />QURI:<span style="font-size: 14px;">http://quartz-scheduler.org/documentation/quartz-1.x/tutorials/crontrigger)<br /><br />对于W四个day of month ?W六?day of week常常需要花旉Q这里做个简单ȝ<br /></span><div style="padding: 4px 5px 4px 4px; background-color: #eeeeee; font-size: 13px; border: 1px solid #cccccc; width: 876.1221313476563px; word-break: break-all;">*    *   *     *    *    *   (year optional)<br />┬   ┬    ┬    ┬    ┬    ┬<br />│   │    │    │    │    │<br />│   │    │    │    │    │<br />│   │    │    │    │    └───── day of week (0 - 7) (0 or 7 is Sun, or use names)<br />│   │    │    │    └────────── month (1 - 12)<br />│   │    │    └─────────────── day of month (1 - 31)<br />│   │    └──────────────────── hour (0 - 23)<br />│   └───────────────────────── min (0 - 59)<br />└────────────────────────      seconds<br />Wild-cards (the * character) can be used to say "every" possible value of <span style="color: #0000ff;">this</span> field. <br />Therefore the * character in the "Month" field simply means "every month". <br />A '*' in the Day-Of-Week field would therefore obviously mean "every day of the week".<br /><br />The '?' character is allowed <span style="color: #0000ff;">for</span> the day-of-month and day-of-week fields. <br />It is used to specify "no specific value". This is useful when you need to specify something in one of the two fields, but not the other.</div><br />Z解释清楚“?"字符的用,再来一D?br /><div style="background-color:#eeeeee;font-size:13px;border:1px solid #CCCCCC;padding-right: 5px;padding-bottom: 4px;padding-left: 4px;padding-top: 4px;width: 98%;word-break:break-all"><!--<br /><br />Code highlighting produced by Actipro CodeHighlighter (freeware)<br />http://www.CodeHighlighter.com/<br /><br />-->Field Name    Mandatory    Allowed Values    Allowed Special Characters<br />Seconds         YES            0-59                        , - * /<br />Minutes          YES            0-59                        , - * /<br />Hours             YES            0-23                        , - * /<br />Day of month  YES            1-31                        , - * ? / L W<br />Month             YES            1-12 or JAN-DEC      , - * /<br />Day of week    YES            1-7 or SUN-SAT        , - * ? / L #<br />Year                NO            empty, 1970-2099     , - * /<br /><br />可以看到只有W四、六两个位置允许使用"?"<br />q就说明q?个位|是怺依赖?br /><tt style="margin: 0px; padding: 0px; border: 0px; font-size: 13px; line-height: 1; font-family: inherit; color: #555555; background-color: #f9f9f9;"><strong style="margin: 0px; padding: 0px; border: 0px; font-size: 13px; line-height: inherit; font-family: inherit;">?</strong></tt><span style="color: #555555; font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px; background-color: #f9f9f9;"> (</span><em style="margin: 0px; padding: 0px; border: 0px; font-size: 13px; font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #555555; background-color: #f9f9f9;">"no specific value"</em><span style="color: #555555; font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px; background-color: #f9f9f9;">) - useful when you need to specify something in one of the two fields in which the character is allowed, but not the other. For example, if I want my trigger to fire on a particular day of the month (say, the 10th), but don't care what day of the week that happens to be, I would put "10" in the day-of-month field, and "?" in the day-of-week field. See the examples below for clarification.</span><br /><br />所以一旦用??"Q就说明q个字段不v作用了,对应的另一个字Dv作用Q?/div><br />所以:<br />1. 配置一个Q务在每天凌晨2点运行做出截止到当日的报表,但是周末因ؓ没h值班所以不需要生成报表,q个表达式就?br />    <span style="background-color: #eeeeee; font-size: 13px;">0</span><span style="background-color: #eeeeee; font-size: 13px;"> </span><span style="background-color: #eeeeee; font-size: 13px;">0</span><span style="background-color: #eeeeee; font-size: 13px;"> 2 </span><span style="background-color: #eeeeee; font-size: 13px;">?</span><span style="background-color: #eeeeee; font-size: 13px;"> </span><span style="background-color: #eeeeee; font-size: 13px;">*</span><span style="background-color: #eeeeee; font-size: 13px;"> MON</span><span style="background-color: #eeeeee; font-size: 13px;">-FRI</span><br />2. 配置一个Q务在每个月的最后一天夜?1点运?br />    <span style="background-color: #eeeeee; font-size: 13px;">0</span><span style="background-color: #eeeeee; font-size: 13px;"> </span><span style="background-color: #eeeeee; font-size: 13px;">0</span><span style="background-color: #eeeeee; font-size: 13px;"> </span><span style="background-color: #eeeeee; font-size: 13px;">23</span><span style="background-color: #eeeeee; font-size: 13px;"> L </span><span style="background-color: #eeeeee; font-size: 13px;">*</span><span style="background-color: #eeeeee; font-size: 13px;"> </span><span style="background-color: #eeeeee; font-size: 13px;">?<br /><br /><br /><br />如果想用数据库驱动这个时间怎么办呢Q请问下面大虄做法Q?br /></span><div style="background-color:#eeeeee;font-size:13px;border:1px solid #CCCCCC;padding-right: 5px;padding-bottom: 4px;padding-left: 4px;padding-top: 4px;width: 98%;word-break:break-all"><!--<br /><br />Code highlighting produced by Actipro CodeHighlighter (freeware)<br />http://www.CodeHighlighter.com/<br /><br />-->Dec 22nd, 2008, 01:53 AM #2 Siva Krishna  <br /><span style="font-size: 13px;">Hello,</span><br /><br />I got almost similar requirement, <strong style="color: #ff0000;">making the schedulers as DB driven</strong>, and handled it in the following way.<br /><br />I created a <span style="color: #0000FF; ">new</span> UI that takes start time & interval time and saves them in DB. Then<strong style="color: #ff0000;"> a method is called to refresh the given jobs/schedulers</strong>. <br /><br />Here is the snippet.<br /><br />Code:<br /><span style="color: #0000FF; ">try</span> {<br />    scheduler = (StdScheduler) context.getBean(schedulerVO.getSchedulerName());<br />    triggerNames = <span style="color: #0000FF; ">new</span> String[] {};<br /><br />    <span style="color: #0000FF; ">if</span> (scheduler != <span style="color: #0000FF; ">null</span>) {<br />        <span style="color: #0000FF; ">try</span> {<br />            <span style="color: #008000; ">//</span><span style="color: #008000; "> throws SchedulerException</span><span style="color: #008000; "><br /></span>            triggerNames = scheduler.getTriggerNames("DEFAULT");<br />            triggerName = triggerNames.length > 0 ? triggerNames[0] : "";<br />            trigger = (CronTrigger) scheduler.getTrigger(triggerName, "DEFAULT");<br />            <span style="color: #0000FF; ">if</span> (trigger != <span style="color: #0000FF; ">null</span>) {<br /><span style="font-size: 13px;">                </span><span style="font-size: 13px; color: #008000;">//</span><span style="font-size: 13px; color: #008000;"> throws ParseException                                    </span><br />                trigger.<strong style="color: #000080;">setCronExpression</strong>(getCronExpression(schedulerVO.getStartTime(), schedulerVO.getInterval()));<br /><br />                <span style="color: #008000; ">//</span><span style="color: #008000; "> throws SchedulerException</span><span style="color: #008000; "><br /></span>                scheduler.<strong style="color: #000080;">rescheduleJob</strong>(triggerName, "DEFAULT",trigger);<br />            } <br />        } <span style="color: #0000FF; ">catch</span> (SchedulerException e) {                    <br />            logger.error(e);<br />        } <span style="color: #0000FF; ">catch</span> (ParseException e) {<br />            logger.error(e);<br />        }<br />    }<br />} <span style="color: #0000FF; ">catch</span> (NoSuchBeanDefinitionException e) {<br />    logger.error(e);<br />}<br /><br /><br />Computing the cronExpression with <span style="color: #0000FF; ">this</span> method.<br /><br />Code:<br /><span style="color: #0000FF; ">private</span> String getCronExpression(String startTime, String interval) {        <br /><span style="font-size: 13px;">    String cronExpression </span><span style="font-size: 13px;">=</span><span style="font-size: 13px;"> </span><span style="font-size: 13px;">""</span><span style="font-size: 13px;">;</span><br /><span style="font-size: 13px;">    </span><span style="font-size: 13px; color: #0000ff;">if</span><span style="font-size: 13px;"> (</span><span style="font-size: 13px;">"</span><span style="font-size: 13px;">0</span><span style="font-size: 13px;">"</span><span style="font-size: 13px;">.equals(startTime) </span><span style="font-size: 13px;">||</span><span style="font-size: 13px;"> </span><span style="font-size: 13px;">"</span><span style="font-size: 13px;">0</span><span style="font-size: 13px;">"</span><span style="font-size: 13px;">.equals(interval)) {</span><br />        <span style="color: #008000; ">//</span><span style="color: #008000; "> default trigger runs at 10AM & 10PM            </span><span style="color: #008000; "><br /></span>            cronExpression = "0 0 10/12 * * ?";<br />    } <span style="color: #0000FF; ">else</span> {<br />        cronExpression = "0 0 " + startTime + "/" + interval + " * * ?";<br />        }<br />    <span style="color: #0000FF; ">return</span> cronExpression;<br />}<br />As I need to run the job every day and not concerned about minutes the above approach worked <span style="color: #0000FF; ">for</span> me.<br /><br />Hope <span style="color: #0000FF; ">this</span> gives an idea to you.<br /><br />Regards<br />Siva Krishna.</div><img src ="http://www.aygfsteel.com/crazycy/aggbug/400287.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/crazycy/" target="_blank">crazycy</a> 2013-06-06 11:35 <a href="http://www.aygfsteel.com/crazycy/archive/2013/06/06/400287.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>ant脚本的javac怎么源码文件夹是否存在 ant javac check folder exists or nothttp://www.aygfsteel.com/crazycy/archive/2013/04/16/397918.htmlcrazycycrazycyTue, 16 Apr 2013 06:52:00 GMThttp://www.aygfsteel.com/crazycy/archive/2013/04/16/397918.htmlhttp://www.aygfsteel.com/crazycy/comments/397918.htmlhttp://www.aygfsteel.com/crazycy/archive/2013/04/16/397918.html#Feedback3http://www.aygfsteel.com/crazycy/comments/commentRss/397918.htmlhttp://www.aygfsteel.com/crazycy/services/trackbacks/397918.htmltr\src
tr\src_x1 for prj X1
tr\src_x2 for prj X2
_______  for prj X3, X3中没有,怎么讄ant脚本呢?

<target name="compile-tr">
        <mkdir dir="${tr.classes.dir}" />
        <javac destdir="${tr.classes.dir}" debug="${compiler.debug}" optimize="${compiler.optimize}" source="${compiler.source}" target="${compiler.target}" deprecation="true">
            <classpath>
                <path refid="devel.lib" />
            </classpath>
            <src path="${tr.src.dir}" />
            <src path="${tr.src.dir}_${project.code}" />
        </javac>
</target>

在编译X3的时候,q肯定是p|的?br />
怎么办呢Q?通过Condition和Avaliable来实现。(贴一个粗p的C实现Q?br />

<target name="compile-3tr" depends="dir.check" if="dir.exists">
        <mkdir dir="${tr.classes.dir}" />
        <javac destdir="${tr.classes.dir}" debug="${compiler.debug}" optimize="${compiler.optimize}" source="${compiler.source}" target="${compiler.target}" deprecation="true">
            <classpath>
                <path refid="devel.lib" />
            </classpath>
            <src path="${tr.src.dir}" />
            <src path="${tr.src.dir}_${project.code}" />
        </javac>
</target>
    
    <target name="dir.check">
        <condition property="dir.exists" value="true">
            <available file="${tr.src.dir}_${project.code}" type="dir"/>
        </condition>
        <mkdir dir="${tr.classes.dir}" />
    </target>

居然在网上找C个更赞的?br />

<target name="go" depends="file-checks, do-something-with-first-file, do-something-with-second-file"/>

<target name="file-checks">
   <available file="/home/doc/somefile"  property="first.file.found"/>
   <available file="/usr/local/somefile" property="second.file.found"/>
</target>

<target name="do-something-with-first-file" if="first.file.found">
   ???
</target>

<target name="do-something-with-second-file" if="second.file.found">
   ???
</target>

原来if....then....else需?span style="font-family: Arial, 'Liberation Sans', 'DejaVu Sans', sans-serif; line-height: 18px; background-color: #ffffff;">ant-contrib的支持,怪不得我一直失?br />
ant-contrib

<if>
    <available file="file1"/>
    <then>
      <property name="file.exists" value="true"/>
    </then>
    <else>
      <if>
        <available file="file2"/>
        <then>
          <copy file="file2" tofile="file1"/>
          <property name="file.exists" value="true"/>
        </then>
      </if>
    </else>
  </if>

最后我很生气的扑ֈ了apache本n的技术文?nbsp;

If/Unless Attributes

http://ant.apache.org/manual/properties.html#if+unless

If/Unless Attributes

The <target> element and various tasks (such as <fail>) and task elements (such as <test> in <junit>) support if and unless attributes which can be used to control whether the item is run or otherwise takes effect.

In Ant 1.7.1 and earlier, these attributes could only be property names. The item was enabled if a property with that name was defined - even to be the empty string or false - and disabled if the property was not defined. For example, the following works but there is no way to override the file existence check negatively (only positively):

<target name="-check-use-file">
    <available property="file.exists" file="some-file"/>
</target>
<target name="use-file" depends="-check-use-file" if="file.exists">
    <!-- do something requiring that file -->
</target>
<target name="lots-of-stuff" depends="use-file,other-unconditional-stuff"/>
  
As of Ant 1.8.0, you may instead use property expansion; a value of true (or on or yes) will enable the item, while false (or off or no) will disable it. Other values are still assumed to be property names and so the item is enabled only if the named property is defined.

Compared to the older style, this gives you additional flexibility, because you can override the condition from the command line or parent scripts:

<target name="-check-use-file" unless="file.exists">
    <available property="file.exists" file="some-file"/>
</target>
<target name="use-file" depends="-check-use-file" if="${file.exists}">
    <!-- do something requiring that file -->
</target>
<target name="lots-of-stuff" depends="use-file,other-unconditional-stuff"/>
  
Now ant -Dfile.exists=false lots-of-stuff will run other-unconditional-stuff but not use-file, as you might expect, and you can disable the condition from another script too:

<antcall target="lots-of-stuff">
    <param name="file.exists" value="false"/>
</antcall>
  
Similarly, an unless attribute disables the item if it is either the name of property which is defined, or if it evaluates to a true-like value. For example, the following allows you to define skip.printing.message=true in my-prefs.properties with the results you might expect:

<property file="my-prefs.properties"/>
<target name="print-message" unless="${skip.printing.message}">
    <echo>hello!</echo>
</target>



crazycy 2013-04-16 14:52 发表评论
]]>
Spring-pȝ启动时初始化数据库的数据/pȝ启动时操作数据库http://www.aygfsteel.com/crazycy/archive/2013/03/17/396562.htmlcrazycycrazycySun, 17 Mar 2013 11:55:00 GMThttp://www.aygfsteel.com/crazycy/archive/2013/03/17/396562.htmlhttp://www.aygfsteel.com/crazycy/comments/396562.htmlhttp://www.aygfsteel.com/crazycy/archive/2013/03/17/396562.html#Feedback0http://www.aygfsteel.com/crazycy/comments/commentRss/396562.htmlhttp://www.aygfsteel.com/crazycy/services/trackbacks/396562.html
摸烦QSBean可以IoC注入需要的资源比如DataSource;

Spring Bean Config
<bean id="idPoolsInitilizedProcessor" class="utils.IDPoolsInitilizedListener" scope="singleton" >
        <property name="datasource" ref="dataDS"/>
 </bean>

Spring Bean Code
public class JcIDPoolsInitilizedListener {
    private DataSource datasource = null
  
  public JcIDPoolsInitilizedBean() {
    System.out.println("%%%%%%%%%%%%%%");    
    try {
      //initilize msgid
      String refName = CxcConstants.REFCOUNTER_MSGID; 
      String sql = "update refcounter set nextnumber=(select max(msgid)+1 from msg) where refcounterid=?";
      update(sql, new Object[]{refName}); 
    } catch (Exception ex) {
      ex.printStackTrace();
    }
  }
    private int update(String anSql, Object[] args) throws Exception {
      int affactRows = 0;
      Connection con = null;
      PreparedStatement stmt = null;
      try {
        con = datasource.getConnection();
        stmt = con.prepareStatement(anSql);
        setSQLParams(stmt, args);
        affactRows = stmt.executeUpdate();
        return affactRows;
      } finally {
        try
          if (null != stmt) {
            stmt.close();
          }
          if (null != con) {
            con.close();
          }
        } catch (Exception ex) {
          ex.printStackTrace();
        }
      }
    }
    
    private void setSQLParams(PreparedStatement stmt, Object[] args) throws Exception {
      if (null != args && 0 < args.length) {
        for (int i = 0, n = args.length; i < n; i++) {
          stmt.setObject(i + 1, args[i]);
        }
      }
    }

    public DataSource getDatasource() {
      return datasource;
    }

    public void setDatasource(DataSource datasource) {
      this.datasource = datasource;
    }
}

l果Q程序启动的时候会抛出NullPointExceptionQ因?span style="font-size: 13px; background-color: #eeeeee;">datasourceq没有初始化好?br />
摸烦QSpring的事件机Ӟ实现ApplicationListenerQ在onApplicationEvent的方法进行数据初始化操作Q只要容器启动,׃执行q里的代码?br />
public class JcIDPoolsInitilizedListener implements ApplicationListener {
  
  private DataSource datasource = null
  
  public void onApplicationEvent(ApplicationEvent argo) {
    //todo: code is same as previous 
  }
    
  //todo: all the other part is same as previous
}

成功?br />
然后的然后呢Q会发现E序中这个初始化被多ơ调用?br />Z么呢Q?原因是Listener定义不到位?br />Z么呢Q?只要是ApplicationEvent都会触发Q默认的事g是org.springframework.security.access.event.PublicInvocationEventQ肯定触发的?br />
怎么办呢Q?br />好吧Q既然是ListenerQd告诉它Listen什么Event吧?br />W一 定义Listener
public class JcIDPoolsInitilizedListener implements ApplicationListener {
  
  private DataSource datasource = null
  
  public void onApplicationEvent(ApplicationEvent argo) {
     if (argo instanceof IDPoolsInitilizedEvent) {
        //todo: code is same as previous 
     }
   
     //todo: all the other part is same as previous
}

W二 定义Event
public class IDPoolsInitilizedEvent extends ApplicationEvent{
  private static final long serialVersionUID = 646140097162842368L;
  
  public IDPoolsInitilizedEvent(Object source){
     super(source);
  }
}

W三 定义Event抛出?br />

public class IDPoolsInitilizedBean implements ApplicationContextAware{
  private ApplicationContext applicationContext;
  public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
    this.applicationContext = applicationContext;
    IDPoolsInitilizedEvent event = new IDPoolsInitilizedEvent("IDPoolsInitilized");
    this.applicationContext.publishEvent(event);
  }
}

W四 定义配置文g
<bean id="idPoolsInitilizedListenerProcessor" class="utils.IDPoolsInitilizedListenerBean"
        scope
="singleton" >
        <property name="datasource" ref="dataDS"/>
    </bean>
    <bean id="idPoolsInitilizedProcessor" class="utils.IDPoolsInitilizedBean"
        scope
="singleton" />


crazycy 2013-03-17 19:55 发表评论
]]>
eclipse高亮选中的变量失效的Ҏ eclipse highlight occurrences not workinghttp://www.aygfsteel.com/crazycy/archive/2013/01/26/394802.htmlcrazycycrazycySat, 26 Jan 2013 08:48:00 GMThttp://www.aygfsteel.com/crazycy/archive/2013/01/26/394802.htmlhttp://www.aygfsteel.com/crazycy/comments/394802.htmlhttp://www.aygfsteel.com/crazycy/archive/2013/01/26/394802.html#Feedback0http://www.aygfsteel.com/crazycy/comments/commentRss/394802.htmlhttp://www.aygfsteel.com/crazycy/services/trackbacks/394802.html1. 要显C哪些类?/div>
windows->preferences->java->Editor-> Mark Occurrences
2. 高亮昄的颜?/div>
Window->Preferences->General->Editors->Text Editors->Annotations->Occurrences
3. 或者用快捷键 
Alt + Shift + o
4.q不行?
要检查工E中的build path看看是不是有library~少或者是不是JDK配置错误


crazycy 2013-01-26 16:48 发表评论
]]> վ֩ģ壺 | | | | | ƽԭ| | | ƽ| | | ˮ| | | | ʩ| ũ| | ܿ| | ˻| | | հ| Ͽ| ƽ½| Դ| | ԰| Ϸ| º| | | | | | Դ| | ¯| | |