我对OpenShift上的WildFly AS有一个问题。当我尝试在服务器上部署WAR时,我一直收到以下异常。
2014-12-20 04:31:33,072 INFO [org.jboss.as.connector.deployment] (MSC service thread 1-7) JBAS010406: Registered connection factory java:/JmsXA
2014-12-20 04:31:33,444 ERROR [org.hornetq.core.client] (Thread-0 (HornetQ-client-global-threads-32821528)) HQ214017: Caught unexpected Throwable: java.lang.OutOfMemoryError: unable to create new native thread
at java.lang.Thread.start0(Native Method) [rt.jar:1.8.0_05]
at java.lang.Thread.start(Thread.java:714) [rt.jar:1.8.0_05]
at java.util.concurrent.ThreadPoolExecutor.addWorker(ThreadPoolExecutor.java:950) [rt.jar:1.8.0_05]
at java.util.concurrent.ThreadPoolExecutor.execute(ThreadPoolExecutor.java:1368) [rt.jar:1.8.0_05]
at org.hornetq.core.client.impl.ClientSessionFactoryImpl$Channel0Handler.notifyTopologyChange(ClientSessionFactoryImpl.java:1618) [hornetq-core-client-2.4.5.Final.jar:]
at org.hornetq.core.client.impl.ClientSessionFactoryImpl$Channel0Handler.handlePacket(ClientSessionFactoryImpl.java:1609) [hornetq-core-client-2.4.5.Final.jar:]
at org.hornetq.core.protocol.core.impl.ChannelImpl.handlePacket(ChannelImpl.java:641) [hornetq-core-client-2.4.5.Final.jar:]
at org.hornetq.core.protocol.core.impl.RemotingConnectionImpl.doBufferReceived(RemotingConnectionImpl.java:556) [hornetq-core-client-2.4.5.Final.jar:]
at org.hornetq.core.protocol.core.impl.RemotingConnectionImpl.bufferReceived(RemotingConnectionImpl.java:532) [hornetq-core-client-2.4.5.Final.jar:]
at org.hornetq.core.client.impl.ClientSessionFactoryImpl$DelegatingBufferHandler.bufferReceived(ClientSessionFactoryImpl.java:1712) [hornetq-core-client-2.4.5.Final.jar:]
at org.hornetq.core.remoting.impl.invm.InVMConnection$1.run(InVMConnection.java:165) [hornetq-server-2.4.5.Final.jar:]
at org.hornetq.utils.OrderedExecutorFactory$OrderedExecutor$1.run(OrderedExecutorFactory.java:104) [hornetq-core-client-2.4.5.Final.jar:]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [rt.jar:1.8.0_05]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [rt.jar:1.8.0_05]
at java.lang.Thread.run(Thread.java:745) [rt.jar:1.8.0_05]
我不知道它是否相关,但我认为错误是在我将hibernate添加到我的应用程序时开始的。这是hibernate.cfg.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD 3.0//EN" "http://www.hibernate.org/dtd/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
<session-factory>
<property name="hibernate.dialect">org.hibernate.dialect.MySQLDialect</property>
<property name="connection.datasource">java:comp/env/jdbc/MyDataSource</property>
<property name="hibernate.current_session_context_class">thread</property>
<!-- GENERAL CONFIGURATION -->
<property name="connection.pool_size">1</property>
<property name="hibernate.show_sql">false</property>
<property name="hibernate.connection.release_mode">after_statement</property>
<property name="hibernate.connection.autocommit">false</property>
<property name="hibernate.connection.defaultAutoCommit">false</property>
<!-- DB MAPING -->
</session-factory>
</hibernate-configuration>
我的HibernateUtil.java:
import org.hibernate.SessionFactory;
import org.hibernate.boot.registry.StandardServiceRegistryBuilder;
import org.hibernate.cfg.Configuration;
import org.hibernate.service.ServiceRegistry;
public class HibernateUtil {
private static SessionFactory sessionFactory;
public static SessionFactory getSessionFactory() {
if (sessionFactory == null) {
// loads configuration and mappings
Configuration configuration = new Configuration().configure();
ServiceRegistry serviceRegistry
= new StandardServiceRegistryBuilder()
.applySettings(configuration.getProperties()).build();
// builds a session factory from the service registry
sessionFactory = configuration.buildSessionFactory(serviceRegistry);
}
return sessionFactory;
}
}
我登录时使用的DaoImpl的一部分:
public User login(String username, String password) {
User result = null;
Session session = HibernateUtil.getSessionFactory().openSession();
try {
String sql = "select s from User s where username=:username and password=password(:password)";
Query query = session.createQuery(sql);
query.setString("username", username);
query.setString("password", password);
result = (User) query.uniqueResult();
}
finally {
session.close();
}
return result;
}
我不是百分之百的舒尔hibernate的问题,因为我‘我们通过SSH连接删除了wildfly/standalone/deployments中的所有内容,并重新启动了应用程序,但当我执行gear start命令时,仍然会出现错误。
2014-12-20 04:46:47,792 WARN [org.hornetq.core.server] (hornetq-failure-check-thread) HQ222082: error on connection failure check: java.lang.OutOfMemoryError: unable to create new native thread
at java.lang.Thread.start0(Native Method) [rt.jar:1.8.0_05]
at java.lang.Thread.start(Thread.java:714) [rt.jar:1.8.0_05]
at java.util.concurrent.ThreadPoolExecutor.addWorker(ThreadPoolExecutor.java:950) [rt.jar:1.8.0_05]
at java.util.concurrent.ThreadPoolExecutor.execute(ThreadPoolExecutor.java:1357) [rt.jar:1.8.0_05]
at org.hornetq.utils.OrderedExecutorFactory$OrderedExecutor.execute(OrderedExecutorFactory.java:133) [hornetq-core-client-2.4.5.Final.jar:]
at org.hornetq.core.remoting.server.impl.RemotingServiceImpl$FailureCheckAndFlushThread.run(RemotingServiceImpl.java:739) [hornetq-server-2.4.5.Final.jar:]
2014-12-20 04:46:48,674 ERROR [stderr] (Thread-0 (HornetQ-scheduled-threads-30017644)) Exception in thread "Thread-0 (HornetQ-scheduled-threads-30017644)" java.lang.OutOfMemoryError: unable to create new native thread
2014-12-20 04:46:48,675 ERROR [stderr] (Thread-0 (HornetQ-scheduled-threads-30017644)) at java.lang.Thread.start0(Native Method)
2014-12-20 04:46:48,675 ERROR [stderr] (Thread-0 (HornetQ-scheduled-threads-30017644)) at java.lang.Thread.start(Thread.java:714)
2014-12-20 04:46:48,675 ERROR [stderr] (Thread-0 (HornetQ-scheduled-threads-30017644)) at java.util.concurrent.ThreadPoolExecutor.addWorker(ThreadPoolExecutor.java:950)
2014-12-20 04:46:48,676 ERROR [stderr] (Thread-0 (HornetQ-scheduled-threads-30017644)) at java.util.concurrent.ThreadPoolExecutor.processWorkerExit(ThreadPoolExecutor.java:1018)
2014-12-20 04:46:48,676 ERROR [stderr] (Thread-0 (HornetQ-scheduled-threads-30017644)) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1160)
2014-12-20 04:46:48,676 ERROR [stderr] (Thread-0 (HornetQ-scheduled-threads-30017644)) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
2014-12-20 04:46:48,677 ERROR [stderr] (Thread-0 (HornetQ-scheduled-threads-30017644)) at java.lang.Thread.run(Thread.java:745)
2014-12-20 04:46:49,675 ERROR [stderr] (Thread-2 (HornetQ-scheduled-threads-30017644)) Exception in thread "Thread-2 (HornetQ-scheduled-threads-30017644)" java.lang.OutOfMemoryError: unable to create new native thread
small gears的线程限制为250个线程,请尝试将消息服务的线程限制为50个(甚至根据应用程序的不同,尝试20个)。配置处于独立状态。xml文件。
如:
<subsystem xmlns="urn:jboss:domain:messaging:2.0">
<hornetq-server>
<thread-pool-max-size>50</thread-pool-max-size>
<scheduled-thread-pool-max-size>50</scheduled-thread-pool-max-size>
<!-- ... -->
</hornetq-server>
</subsystem>
我希望这有帮助。
看看这个线程。
我发现我不仅要禁用消息传递,还要禁用集群。J组。然而,在那之后,我偶尔会遇到OutOfMemoryError。我限制了db连接池。默认情况下,它是无限制的。
遗憾的是,这还不够,我也
仍然没有线程留给phpMyAdmin:(沮丧...
我尝试用java做一个rest web服务,并使用OpenShift服务测试服务器。 在OpenShift中,我选择Tomcat 7(JBoss EWS 2.0)作为web服务器。 当我试图将我的文件推入服务器时,在maven构建时,它会给我这些错误: 似乎错误是关于我的tools.java文件。 所以这是我的工具.java文件的代码: 我想知道,因为当我在我的PC中使用命令时,没有错误并且项目完
问题内容: 我有一个带有 Tomcat 7 和 MySQL 5.5 的不可扩展的OpenShift应用程序,并且该应用程序仅在其上运行了一个小型Java应用程序。该应用程序运行了好几个月,但是从上周开始它停止工作。当我尝试使用OpenShift仪表板重新启动应用程序时,出现以下错误消息: 显然,MySQL卡式盒无法以某种方式重新启动,但是我没有更改Java应用程序或齿轮配置中的任何内容。 有人知道
JNIEXPORT jint JNICALL Java_nc_mes_pub_hardware_PCI1761_readChanel(JNIEnv*,jobject,jint channel){ }
我想格式化和写入一个大的(1.785.530条目)的内容到一个文本文件。大约85%的条目被处理后,它变得非常慢,然后我得到一个。 即使我: 在我的
在Scrapy中,类似Requests, Response及Items的对象具有有限的生命周期: 他们被创建,使用,最后被销毁。 这些对象中,Request的生命周期应该是最长的,其会在调度队列(Scheduler queue)中一直等待,直到被处理。 更多内容请参考 架构概览 。 由于这些Scrapy对象拥有很长的生命,因此将这些对象存储在内存而没有正确释放的危险总是存在。 而这导致了所谓的”内
内存溢出 内存泄漏指由于疏忽或错误造成程序未能释放已经不再使用的内存。内存泄漏并非指内存在物理上的消失,而是应用程序分配某段内存后,由于设计错误,导致在释放该段内存之前就失去了对该段内存的控制,从而造成了内存的浪费。 内存泄漏通常情况下只能由获得程序源代码的程序员才能分析出来, 也是一个比较难以排查的问题。所有需要在开发前知道一些规范 内存溢出一直向一个 属性/变量 写数据 , 写入超过内存最大限