[INFO] [war:war {execution: default-war}]
[INFO] Packaging webapp
[INFO] ------------------------------------------------------------------------
[ERROR] FATAL ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Cannot construct org.apache.maven.plugin.war.util.WebappStructure as it does not have a no-args constructor
---- Debugging information ----
message : Cannot construct org.apache.maven.plugin.war.util.WebappStructure as it does not have a no-args constructor
cause-exception : com.thoughtworks.xstream.converters.reflection.ObjectAccessException
cause-message : Cannot construct org.apache.maven.plugin.war.util.WebappStructure as it does not have a no-args constructor
class : org.apache.maven.plugin.war.util.WebappStructure
required-type : org.apache.maven.plugin.war.util.WebappStructure
path : /webapp-structure
line number : 1
-------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] Trace
com.thoughtworks.xstream.converters.ConversionException: Cannot construct …Run Code Online (Sandbox Code Playgroud) 我有以下bean声明:
<bean
class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="locations">
<list>
<value>WEB-INF/classes/config/properties/database.properties</value>
<value>classpath:config/properties/database.properties</value>
</list>
</property>
<property name="ignoreResourceNotFound" value="true"/>
</bean>
<bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource">
<property name="driverClassName" value="${jdbc.driverClassName}" />
<property name="url" value="${jdbc.url}" />
<property name="username" value="${jdbc.username}" />
<property name="password" value="${jdbc.password}" />
</bean>
Run Code Online (Sandbox Code Playgroud)
现在我想将上面的PropertyPlaceholderConfigurer更改为以下格式:
<context:component-scan base-package="org.example.config"/>
<util:properties id="jdbcProperties"
location="classpath:config/properties/database.properties"/>
Run Code Online (Sandbox Code Playgroud)
我正在使用Spring 3框架.
我用Hibernate开始了一个新项目.Hibernate注释是更好的选择还是更好的Hibernate XML映射?
我已经使用Hibernate和XML配置,但我不知道注释.
注意:我不是在比较两种技术,但我想知道在使用最新技术的应用程序中使用哪种技术(即两种方式).
如何增加蚂蚁的permgen大小?我在ANT_OPTS中给出了
-Xms768m -Xmx1024m -XX:PermSize = 128m -XX:MaxPermSize = 128m
问题1)在系统环境中指定上述设置后,我仍然因为junit的ant目标而失去了记忆错误.
Caught an exception while logging the end of the build. Exception was:
java.lang.OutOfMemoryError: PermGen space
Run Code Online (Sandbox Code Playgroud)
2)当我输入命令promt以查看ant_opts的路径时,echo%ant_opts%仅显示
-Xmx512m
和其他部分跳过.在我的道路上有什么不对劲?注意:我正在使用命令提示符来运行ant目标.
我的代码:
我正在尝试更新/插入.它被正确插入,唯一的问题是当我尝试更新它时给出了以下错误消息.
private String sessionType=null;
public String getAccountsDetails(List<Account> accountList) {
Session session = sessionFactory.openSession();
for (Account account : accountList) {
AccountDetails accountDetails = new AccountDetails();
accountDetails.setAccountsId(Long.parseLong(account.getId()));
accountDetails.setAccounttype(account.getAccountType().value());
Query query = session.createQuery("from QBAccounts qba where qba.accountsId=:accId");
List<AccountDetails> queryList = query.setParameter("accId", accountDetails.getAccountsId()).list();
if(queryList.size()>0){
session.update(accountDetails);
}else{
session.save(accountDetails);
}
}
session.flush();
session.beginTransaction().commit();
session.clear();
session.close();
return "Successfully data updated into table";
}
Run Code Online (Sandbox Code Playgroud)
错误:
org.hibernate.NonUniqueObjectException: a different object with the same identifier value was already associated with the session: [com.trinet.mulesoft.quickbooks.dto.AccountDetails#0]
at org.hibernate.engine.StatefulPersistenceContext.checkUniqueness(StatefulPersistenceContext.java:638)
at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.performUpdate(DefaultSaveOrUpdateEventListener.java:305)
at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.entityIsDetached(DefaultSaveOrUpdateEventListener.java:246) …Run Code Online (Sandbox Code Playgroud) 我已经在没有eclipse的情况下在本地设置了Maven项目,它已成功完成.现在我已经下载了Eclipse indgo 3.7.0.由于Eclipse-indigo正在使用m2e(maven 2 eclipse)插件
Eclipse-> help->安装新软件 - >使用(Indigo - http://download.eclipse.org/releases/indigo) - >通用工具 - > m2e(检查)并安装.
在eclipse中将项目添加为maven项目,但是在运行pom.xml文件时出现错误:
Downloading: http://mirrors.ibiblio.org/pub/mirrors/maven2/org/apache/maven/plugins/maven-resources-plugin/2.4.3/maven-resources-plugin-2.4.3.pom
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.625s
[INFO] Finished at: Thu Sep 15 12:33:01 CEST 2011
[INFO] Final Memory: 5M/15M
[INFO] ------------------------------------------------------------------------
[ERROR] Plugin org.apache.maven.plugins:maven-resources-plugin:2.4.3 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-resources-plugin:jar:2.4.3: Could not transfer artifact org.apache.maven.plugins:maven-resources-plugin:pom:2.4.3 from/to ibiblio.org (http://mirrors.ibiblio.org/pub/mirrors/maven2): null to http://mirrors.ibiblio.org/pub/mirrors/maven2/org/apache/maven/plugins/maven-resources-plugin/2.4.3/maven-resources-plugin-2.4.3.pom: UnresolvedAddressException -> [Help 1]
[ERROR] …Run Code Online (Sandbox Code Playgroud) INFO: Deploying web application archive test-1.0-SNAPSHOT.war
20-Sep-2011 12:08:42 org.apache.catalina.loader.WebappClassLoader validateJarFile
INFO: validateJarFile(C:\software\apache-tomcat-7.0.21\webapps\test-1.0-SNAPSHOT\WEB-INF\lib\servlet-api-2.5.jar) - jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class: javax/servlet/Servlet.class
20-Sep-2011 12:08:42 com.sun.faces.config.ConfigureListener contextInitialized
INFO: Initializing Mojarra 2.1.0 (SNAPSHOT 20100817) for context '/test-1.0-SNAPSHOT'
20-Sep-2011 12:08:42 com.sun.faces.spi.InjectionProviderFactory createInstance
INFO: JSF1048: PostConstruct/PreDestroy annotations present. ManagedBeans methods marked with these annotations will have said annotations processed.
20-Sep-2011 12:08:43 com.sun.faces.config.ConfigureListener contextInitialized
SEVERE: Critical error during deployment:
java.lang.LinkageError: loader constraint violation: when resolving interface method "javax.servlet.jsp.JspApplicationContext.getExpressionFactory()Ljavax/el/ExpressionFactory;" the class loader (instance …Run Code Online (Sandbox Code Playgroud) <target name="test" depends="compile-test">
<junit failureProperty="test.failure">
<classpath refid="classpath.test" />
<formatter type="brief" usefile="false" />
<batchtest>
<fileset dir="${tst-dir}" includes="**/Test*.class" />
</batchtest>
</junit>
<fail message="test failed" if="test.failure" />
</target>
Run Code Online (Sandbox Code Playgroud)
我想打印多少个测试用例:
仅在build.xml文件中进行更改.我怎样才能做到这一点?
我是Spring批处理的新手,正在寻找一些带有Annotation概念的Spring批处理示例.
此链接(单击)讨论Spring批处理,但不是Spring批处理注释概念.正如在给定的链接文档中所讨论的那样,目 我正在使用最新的Spring框架.我想避免xml配置.
Spring批次是批处理的非常好的工具吗?或者有没有更好的工具可用于批处理而不是Spring批处理?
Spring批次有什么限制吗?
我正在使用ant 1.7,收到以下错误:
build.xml:55:fileset不支持"erroronmissingdir"属性
1.7中的erroronmissingdir(它在1.8中)的替代属性是什么