我有一个奇怪的问题,其中两个带有Oracle JDBC驱动程序的Web应用程序会相互冲突.我必须将JDBC驱动程序JAR放在公共文件夹TOMCAT_HOME/lib中.这是什么原因?
我正在使用Hibernate和glassfish Server运行java Web应用程序.我正进入(状态
java.lang.OutOfMemoryError: PermGen space 在我多次部署之后的异常.
我试过-XX:MaxPermSize=128M我的环境变量,但它不起作用.
我正在使用springboot 1.5.9.RELEASE + Java 8 + tomcat 9 + Jersey + Oracle和我的应用程序已安排的方法定义如下:
@Configuration
@EnableScheduling
public class ScheduleConfig implements SchedulingConfigurer {
@Override
public void configureTasks(ScheduledTaskRegistrar taskRegistrar) {
taskRegistrar.setScheduler(taskExecutor());
}
@Bean(destroyMethod = "shutdown")
public Executor taskExecutor() {
return Executors.newScheduledThreadPool(100);
}
}
Run Code Online (Sandbox Code Playgroud)
工作班:
@Component
public class ClearCacheJob {
@Scheduled(fixedRate = 3600000, initialDelay = 10000)
public void clearErrorCodesCache() {
try {
logger.info("######## ClearCacheJob #########");
} catch (Exception e) {
logger.error("Exception in ClearCacheJob", e);
}
}
}
Run Code Online (Sandbox Code Playgroud)
我也有一个类来取消注册oracle驱动程序,如下所示:
@WebListener
public class ContainerContextClosedHandler implements …Run Code Online (Sandbox Code Playgroud) 我尝试部署我的war文件.
但成功部署后.
我得到这个日志:
[root@dfdfdf bin]# export JAVA_HOME="/usr/java/jdk1.8.0_112/"
[root@dfdfdfdbin]# ./startup.sh
Using CATALINA_BASE: /root/apache-tomcat-8.5.8
Using CATALINA_HOME: /root/apache-tomcat-8.5.8
Using CATALINA_TMPDIR: /root/apache-tomcat-8.5.8/temp
Using JRE_HOME: /usr/java/jdk1.8.0_112/
Using CLASSPATH: /root/apache-tomcat-8.5.8/bin/bootstrap.jar:/root/apache-tomcat-8.5.8/bin/tomcat-juli.jar
Tomcat started.
[root@satubangau bin]# tail -f ../logs/catalina.out
06-Feb-2017 07:21:27.881 SEVERE [localhost-startStop-2] org.apache.catalina.loader.WebappClassLoaderBase.checkThreadLocalMapForLeaks The web application [ROOT] created a ThreadLocal with key of type [org.springframework.core.NamedThreadLocal] (value [Request attributes]) and a value of type [org.grails.web.servlet.mvc.GrailsWebRequest] (value [ServletWebRequest: uri=/error]) but failed to remove it when the web application was stopped. Threads are going to be renewed over time to …Run Code Online (Sandbox Code Playgroud) java ×3
memory-leaks ×2
tomcat ×2
exception ×1
glassfish ×1
grails ×1
jdbc ×1
spring ×1
spring-boot ×1