我想用maven jetty插件运行我的web应用程序.但是在启动一段时间后,它会给出错误:
[INFO] Web defaults = org/eclipse/jetty/webapp/webdefault.xml
[INFO] Web overrides = none
2014-08-10 17:39:45.840:INFO:oejs.Server:main: jetty-9.2.2.v20140723
2014-08-10 17:40:54.961:WARN:oejw.WebAppContext:main: Failed startup of context o.e.j.m.p.JettyWebAppContext@1e2c8{/asd,file:/C:/dev/project/hope/target/asd-1.0/,STARTING}{C:\dev\project\hope\target\asd-1.0.war}
java.lang.Exception: Timeout scanning annotations
at org.eclipse.jetty.annotations.AnnotationConfiguration.scanForAnnotations(AnnotationConfiguration.java:570)
at org.eclipse.jetty.annotations.AnnotationConfiguration.configure(AnnotationConfiguration.java:440)
at org.eclipse.jetty.webapp.WebAppContext.configure(WebAppContext.java:471)
at org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1329)
at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:741)
at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:497)
at org.eclipse.jetty.maven.plugin.JettyWebAppContext.doStart(JettyWebAppContext.java:365)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:132)
at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:114)
at org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:61)
Run Code Online (Sandbox Code Playgroud)
我正在使用带有注释的spring mvc,我认为它存在问题.
当我尝试在eclipse jetty插件上运行它时,它会成功启动,但是使用maven插件,它会产生错误.
有任何想法吗?
我正在寻找一个拦截器或触发器来知道,所有的上下文 bean 都被销毁了,applicationcontext 实例即将销毁自己。所以我可以在应用程序生命周期结束时执行一个过程。
有这个事件类型 ContextClosedEvent,它与我想做的事情很接近,但是它在销毁 bean后抛出事件。我认为它带有 applicationcontext 的 close() 方法。所以它不适合我的需要
有任何想法吗?
问候
阿里
我有3个表,如:
A AB B
------------- ------------ ---------------
a1 a1,b1 b1
Run Code Online (Sandbox Code Playgroud)
AB是A和B之间的转换表
有了这个,我的类在这两个类中没有相互组合.但我想知道,使用JPQL查询,如果我的元素存在于AB表中的A表中的任何记录.只需数字或布尔值就是我需要的.
因为AB是一个转换表,所以没有模型对象,我想知道我是否可以使用我的Repository对象中的@Query来完成此操作.
有没有办法(api函数)在没有编写转换器或任何java代码的情况下读取camel中文件的整个内容(或逐行)?
谢谢
我想在我的 select 语句的结果中使用循环索引“i”,以便将它插入到另一个表中。是这样的:
set i=0;
while i<25 do
insert into a (x,y,z)
select a,b,i
from table1;
set i= i+1;
end while;
Run Code Online (Sandbox Code Playgroud)
有什么方法可以做到?
我有一个关于coherence lock-unlock机制的测试样本,如下所示:
public class Test {
public static void main(String[] args) throws InterruptedException, IOException, IllegalArgumentException, IllegalAccessException {
Trt test=new Trt();
test.lock();
Thread a=new Thread(test);
a.start();
}
public static class Trt implements Runnable{
NamedCache cache=null;
@Override
public void run() {
System.out.println(cache.unlock("asd"));
}
public void lock(){
cache= CacheFactory.getCache(Globals.REGISTRY_CACHE_NAME);
System.out.println(cache.lock("asd"));
}
}
}
Run Code Online (Sandbox Code Playgroud)
结果是:
true
false
Run Code Online (Sandbox Code Playgroud)
我期待的结果是:
true
true
Run Code Online (Sandbox Code Playgroud)
但情况是,我只有一个项目'test',我都在使用它,它只有一个缓存实例.因此缓存的所有者就是缓存实例.
为什么它无法关闭它并false最终返回?
谢谢
阿里
我在我的项目中使用spring 3.1,为了发送电子邮件,我使用的是春季邮件.当我尝试发送电子邮件时,我发现此错误:
org.springframework.mail.MailAuthenticationException: Authentication failed; nested exception is javax.mail.AuthenticationFailedException: No authentication mechansims supported by both server and client
Run Code Online (Sandbox Code Playgroud)
我的邮件服务器不需要用户名/密码,根据这个事实,这个错误似乎正常.但案件是; 我找不到在春天邮件的org.springframework.mail.javamail.JavaMailSenderImpl类中不传递用户名/密码的方法.
我的配置是:
<jee:jndi-lookup id="mailSession" jndi-name="${abc.app.mailSession}" cache="true"/>
<bean id="jndiMailSender" class="com.abc.service.mail.JndiJavaMailService">
<property name="session" ref="mailSession"/>
<property name="defaultEncoding" value="${mail.defaultEncoding}"/>
<property name="username" value="${abc.mail.username}"/>
<property name="password" value="${abc.mail.password}"/>
<property name="mailMasterAdress" value="${abc.mail.mailMasterAdress}"/>
</bean>
Run Code Online (Sandbox Code Playgroud)
Mailserver在weblogic中,它的配置是:
mail.smtp.host = 10.200.123.135 mail.transport.protocol = smtp
有任何想法吗?
我在 MYSQL 服务器上的 y db 中有一个存储过程。当我尝试调用它时,它给出了错误:
com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException:PROCEDURE thu.productGetter 的参数数量不正确;预期为2,在org.springframework.jdbc.support.SQLExceptionSubclassTranslator.doTranslate(SQLExceptionSubclassTranslator.java:95)在org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:73)在org.springframework.jdbc得到0。 support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:81) 在 org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:1137) 在 org.springframework.jdbc.core.JdbcTemplate.call(JdbcTemplate.java:1173)在 org.springframework.jdbc.core.simple.AbstractJdbcCall.executeCallInternal(AbstractJdbcCall.java:378) 在 org.springframework.jdbc.core.simple.AbstractJdbcCall.doExecute(AbstractJdbcCall.java:363)
Java代码是:
SimpleJdbcCall jdbcCall = new SimpleJdbcCall(getJdbcTemplate())
.withSchemaName("thu")
.withProcedureName("productGetter");
jdbcCall.addDeclaredParameter(new SqlParameter("maxPrice", Types.DOUBLE));
jdbcCall.addDeclaredParameter(new SqlParameter("minPrice", Types.DOUBLE));
Map<String, Object> params=new HashMap<String, Object>();
params.put("maxPrice", maxPrice);
params.put("minPrice", minPrice);
jdbcCall.execute(params);
Run Code Online (Sandbox Code Playgroud)
存储过程数据库代码是:
CREATE DEFINER=`root`@`localhost` PROCEDURE `productGetter`(IN maxPrice double,minPrice double)
BEGIN
...
END$$
Run Code Online (Sandbox Code Playgroud)
我检查了很多例子,但找不到任何解决我的问题的方法。
有任何想法吗?
我正在尝试编写样本以学习沙发基础.我正在尝试使用它与spring boot和它的crud存储库.
所以我已经下载了最新的docker镜像,但重点是:我找不到桶的密码.couchbase控制台只允许用户创建,但在春天,没有像用户名/密码那样的用法.它只允许使用与couchbase 5不兼容的bucketName和密码.
我在这里遗漏了什么,或者春天与couchbase 5不兼容?如果spring不兼容,哪个版本的couchbase可以吗?
谢谢
我在安装mvn后将weblogic.xml放在WEB-INF文件夹下时遇到问题.我的weblogic.xml文件在src/main/resources/weblogic.xml下,我希望它在安装后放在WEB-INF下.(顺便打包是"战争")
我试过这个:
<resources>
<resource>
<directory>src/main/resources</directory>
<targetPath>../resources</targetPath>
<excludes><exclude>web.xml</exclude><exclude>weblogic.xml</exclude></excludes>
</resource>
<resource>
<directory>src/main/resources/config</directory>
<targetPath>..</targetPath>
<includes><include>weblogic.xml</include></includes>
</resource>
</resources>
Run Code Online (Sandbox Code Playgroud)
它正在使用安装,但是当我想要使用eclipse:eclipse的类路径时,它会给出错误:
说明资源路径位置类型无法在输出文件夹'ResponseManager/target/WEB-INF'内嵌套输出文件夹'ResponseManager/target/WEB-INF/resources'ResponseManager构建路径构建路径问题
因为classpath中的这个conf:
<classpathentry kind="src" path="src/main/resources" output="target/WEB-INF/resources" excluding="web.xml|weblogic.xml|**/*.java"/>
<classpathentry kind="src" path="src/main/resources/config" output="target/WEB-INF" including="weblogic.xml" excluding="**/*.java"/>
Run Code Online (Sandbox Code Playgroud)
有任何想法吗?
java ×5
spring ×3
annotations ×1
apache-camel ×1
caching ×1
classpath ×1
couchbase ×1
destroy ×1
email ×1
file ×1
jdbctemplate ×1
jetty ×1
jpa ×1
jpql ×1
locking ×1
loops ×1
maven ×1
maven-2 ×1
mysql ×1
spring-boot ×1
spring-data ×1
spring-mvc ×1
sql ×1
war ×1
weblogic ×1