我正在使用注释来动态创建Bean,我收到以下错误.
package demoproject;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
@Configuration
public class ProductFactory {
public ProductFactory() {
// TODO Auto-generated constructor stub
}
@Bean
public Product josh(){
Product josh = new Battery();
josh.setId("cdrw");
josh.setPrice(100);
return josh;
}
}
Run Code Online (Sandbox Code Playgroud)
web.xml中
<!-- Bean for JavaConfig -->
<bean class='demoproject.ProductFactory' />
<!-- be sure to include the JavaConfig bean post-processor -->
<bean class="org.springframework.config.java.process.ConfigurationPostProcessor"/>
Run Code Online (Sandbox Code Playgroud)
错误日志
Exception in thread "main" org.springframework.beans.factory.CannotLoadBeanClassException: Cannot find class [org.springframework.config.java.process.ConfigurationPostProcessor] for bean with name 'org.springframework.config.java.process.ConfigurationPostProcessor#0' defined in class path resource [web.xml]; nested exception …
Run Code Online (Sandbox Code Playgroud) 有时我可以得到一个连接,有时它会失败
MongoDB shell version: 2.4.3
connecting to: test
Wed Jul 3 13:07:09.878 Socket recv() errno:104 Connection reset by peer 127.0.0.1:27017
Wed Jul 3 13:07:09.878 SocketException: remote: 127.0.0.1:27017 error: 9001 socket exception [1] server [127.0.0.1:27017]
Wed Jul 3 13:07:09.878 DBClientCursor::init call() failed
Wed Jul 3 13:07:09.880 JavaScript execution failed: Error: DBClientBase::findN: transport error: 127.0.0.1:27017 ns: admin.$cmd query: { whatsmyuri: 1 } at src/mongo/shell/mongo.js:L112
exception: connect failed
Run Code Online (Sandbox Code Playgroud) 我对Jquery比较熟悉,但我正在使用Google Closure.我想知道在Google Closure中是否有任何函数或库,比如jQuery中的.is(),所以我可以检查目标元素是否与css选择器匹配.我找到了一个插件goog.dom.query,但这不是我需要的,因为它用于查找元素.