环境:Applciation服务器:Apache 7.0.54 Java:"1.8.0_05"OS:Mac OS X 10.9.3
库:Spring 3.2 REST应用程序
以下是我在部署期间收到的错误:
localhost.2014.06.09.log
Jun 09, 2014 3:37:47 PM org.apache.catalina.core.ApplicationContext log
INFO: No Spring WebApplicationInitializer types detected on classpath
Jun 09, 2014 3:37:47 PM org.apache.catalina.core.ApplicationContext log
INFO: Initializing Spring root WebApplicationContext
Jun 09, 2014 3:37:47 PM org.apache.catalina.core.StandardContext listenerStart
SEVERE: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener
java.lang.IllegalArgumentException
at org.springframework.asm.ClassReader.<init>(Unknown Source)
at org.springframework.asm.ClassReader.<init>(Unknown Source)
at org.springframework.asm.ClassReader.<init>(Unknown Source)
at org.springframework.core.type.classreading.SimpleMetadataReader.<init>(SimpleMetadataReader.java:52)
at org.springframework.core.type.classreading.SimpleMetadataReaderFactory.getMetadataReader(SimpleMetadataReaderFactory.java:80)
at org.springframework.core.type.classreading.CachingMetadataReaderFactory.getMetadataReader(CachingMetadataReaderFactory.java:101)
at org.springframework.core.type.classreading.SimpleMetadataReaderFactory.getMetadataReader(SimpleMetadataReaderFactory.java:76)
at org.springframework.context.annotation.ConfigurationClassParser.getImports(ConfigurationClassParser.java:298)
at org.springframework.context.annotation.ConfigurationClassParser.getImports(ConfigurationClassParser.java:300)
at …Run Code Online (Sandbox Code Playgroud) 如何通过注释在spring mvc 3中设置header no cache?不是
response.setHeader("Pragma","No-cache");
response.setHeader("Cache-Control","no-cache");
response.setDateHeader("Expires", 0);
Run Code Online (Sandbox Code Playgroud) 目前我org.apache.commons.lang.StringEscapeUtils escapeHtml()用来逃避我的字符串中不需要的HTML标签,但后来我意识到它也带有重音符号&something;,,这是我不想要的.
你是否知道任何逃避HTML标签的解决方案,但留下我的特别(好吧,对某些人来说,这里是正常的;])这些字母是什么?
提前致谢!
巴拉兹
我在面试中被问到这个问题.以下哪项更好用
MyInput.equals("Something");
Run Code Online (Sandbox Code Playgroud)
要么
"Something".equals(MyInput);
Run Code Online (Sandbox Code Playgroud)
谢谢
嗨,我有以下字符串:2012-05-20T09:00:00.000Z,我想将其格式化为20/05/2012,9am
如何在java中这样做?
谢谢
考虑一段示例代码.
public void testString()
{
int i = 0;
while(i < 100000000)
{
String s ="Hi hello bye" +i;
i++;
}
}
Run Code Online (Sandbox Code Playgroud)
在每次迭代中,都会创建一个新的String,并且下一次迭代不再需要它的值.我尝试打印之前消耗的内存并发布此testString()功能.这是他们的价值观.
Before invoking testString():
Total Memory: 91684864 (87.4375 MB)
Max Memory: 1360855040 (1297.8125 MB)
Free Memory: 72163552 (68.82052612304688 MB)
After invoking testString():
Total Memory: 424280064 (404.625 MB)
Max Memory: 1360855040 (1297.8125 MB)
Free Memory: 171766816 (163.80960083007812 MB).
Run Code Online (Sandbox Code Playgroud)
我看到使用了大量内存,并且由于当前处理字符串的方式,我担心JVM堆可能会超出范围.在迭代2中不再需要为迭代1生成的字符串,并且可以释放其存储空间.我相信这不会发生在这里.
我尝试使用StringBuffer和StringBuilder对象,内存使用情况似乎有很小的改善.
请帮助我更好,更好的方法.
我在web.xml中设置了这样的错误页面:
<error-page>
<exception-type>java.lang.Exception</exception-type>
<location>/errors/error.jsp</location>
</error-page>
Run Code Online (Sandbox Code Playgroud)
现在我想在JSP上打印堆栈跟踪错误(当然只在开发模式下).如何在JSP页面上打印堆栈错误?我没有为此应用程序使用任何框架,因此只有默认的servlet API可用于我的程序.
最近我一直在阅读Java中不同代的对象分配.大多数时候,新对象在Eden(Young Generation的一部分)中分配,然后如果满足以下任何条件,它们将被提升为Old Generation.
(1)物体的年龄达到了终点阈值
(2)当从伊甸园(或)另一个幸存者空间(从)复制物体时,幸存者空间(到)已满
但也有一个特殊情况,即在旧世代中直接分配对象,而不是从年轻一代中提升.当我们尝试创建的对象很大(可能是几MB的数量级)时会发生这种情况.
有没有办法知道巨大/巨大物体的大小/限制?我知道G1垃圾收集器的巨大对象标准.我只想知道Java 6之前或之中的大小限制.
谢谢你的时间 :)
我无法解析getWindow(); 出于某种原因的方法......
import java.applet.Applet;
import netscape.javascript.JSObject;
public class Class466 {
public static void method6020(Applet applet, String string, int i)
throws Throwable {
try {
JSObject.getWindow(applet).eval(string);
} catch (RuntimeException runtimeexception) {
throw Class346.method4175(runtimeexception, new StringBuilder()
.append("tf.a(").append(')').toString());
}
}
public static Object method6021(Applet applet, String string, short i)
throws Throwable {
try {
return JSObject.getWindow(applet).call(string, null);
} catch (RuntimeException runtimeexception) {
throw Class346.method4175(runtimeexception, new StringBuilder()
.append("tf.f(").append(')').toString());
}
}
public static Object method6022(Applet applet, String string,
Object[] objects, byte i) throws Throwable { …Run Code Online (Sandbox Code Playgroud) java ×10
jvm ×2
spring ×2
date ×1
datetime ×1
escaping ×1
exception ×1
html ×1
java-7 ×1
java-8 ×1
java-ee ×1
javascript ×1
jsobject ×1
jsp ×1
jstl ×1
memory-leaks ×1
networking ×1
objectsize ×1
performance ×1
servlets ×1
spring-mvc ×1
string ×1
tomcat7 ×1