weblogic无法处理任何请求

时间:2015-11-26 09:03:23

标签: java oracle java-ee weblogic

最近我们的weblogic在启动几个小时后经常挂起,当它挂起时,它无法处理任何请求。 我们看到了线程转储,大多数线程都是这样做的:

 "[ACTIVE] ExecuteThread: '195' for queue: 'weblogic.kernel.Default (self-tuning)'" - Thread t@5932
   java.lang.Thread.State: RUNNABLE
        at java.util.Hashtable.get(Hashtable.java:335)
        at java.util.Properties.getProperty(Properties.java:774)
        at java.lang.System.getProperty(System.java:630)
        at oracle.net.nl.NVPair.<init>(Unknown Source)
        at oracle.net.nl.NVFactory._readNVPair(Unknown Source)
        at oracle.net.nl.NVFactory._readNVList(Unknown Source)
        at oracle.net.nl.NVFactory._readNVList(Unknown Source)
        at oracle.net.nl.NVFactory._readNVList(Unknown Source)
        at oracle.net.nl.NVFactory._readNVPair(Unknown Source)
        at oracle.net.nl.NVFactory.createNVPair(Unknown Source)
        at oracle.net.nt.TcpNTAdapter.<init>(Unknown Source)
        at oracle.net.nt.ConnOption.getNT(Unknown Source)
        at oracle.net.nt.ConnOption.connect(Unknown Source)
        at oracle.net.nt.ConnStrategy.execute(Unknown Source)
        at oracle.net.resolver.AddrResolution.resolveAndExecute(Unknown Source)
        at oracle.net.ns.NSProtocol.establishConnection(Unknown Source)
        at oracle.net.ns.NSProtocol.connect(Unknown Source)
        at oracle.jdbc.ttc7.TTC7Protocol.connect(TTC7Protocol.java:1774)
        at oracle.jdbc.ttc7.TTC7Protocol.logon(TTC7Protocol.java:215)
        at oracle.jdbc.driver.OracleConnection.<init>(OracleConnection.java:362)
        at oracle.jdbc.driver.OracleDriver.getConnectionInstance(OracleDriver.java:536)
        at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:328)
        at weblogic.jdbc.common.internal.ConnectionEnvFactory.makeConnection(ConnectionEnvFactory.java:300)
        at weblogic.jdbc.common.internal.ConnectionEnvFactory.createResource(ConnectionEnvFactory.java:204)
        at weblogic.common.resourcepool.ResourcePoolImpl.makeResources(ResourcePoolImpl.java:1057)
        at weblogic.common.resourcepool.ResourcePoolImpl.makeResources(ResourcePoolImpl.java:982)
        at weblogic.common.resourcepool.ResourcePoolImpl.reserveResourceInternal(ResourcePoolImpl.java:371)
        at weblogic.common.resourcepool.ResourcePoolImpl.reserveResource(ResourcePoolImpl.java:294)
        at weblogic.common.resourcepool.ResourcePoolImpl.reserveResource(ResourcePoolImpl.java:284)
        at weblogic.jdbc.common.internal.ConnectionPool.reserve(ConnectionPool.java:466)
        at weblogic.jdbc.common.internal.ConnectionPool.reserve(ConnectionPool.java:357)
        at weblogic.jdbc.common.internal.ConnectionPoolManager.reserve(ConnectionPoolManager.java:83)
        at weblogic.jdbc.common.internal.ConnectionPoolManager.reserve(ConnectionPoolManager.java:96)
        at weblogic.jdbc.pool.Driver.connect(Driver.java:150)
        at weblogic.jdbc.jts.Driver.getNonTxConnection(Driver.java:647)
        at weblogic.jdbc.jts.Driver.connect(Driver.java:137)
        at weblogic.jdbc.common.internal.RmiDataSource.getConnection(RmiDataSource.java:359)
        at com.xx.core.database.Database.connect(Database.java:187)
        at com.xx.core.database.Database.connect(Database.java:148)
        at com.xx.core.database.Database.newInstance(Database.java:816)
        at com.xx.DatabaseProvider.getDatabase(DatabaseProvider.java:10)
        at com.xx.Tools.getDatabase(Tools.java:91)
        at com.xx.PopInfo.doGet(PopInfo.java:179)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:743)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
        at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:225)
        at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:127)
        at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:283)
        at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
        at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42)
        at com.anychart.servlet.ResourceFilter.doFilter(ResourceFilter.java:53)
        at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42)
        at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3212)
        at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
        at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
        at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:1983)
        at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:1890)
        at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1344)
        at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
        at weblogic.work.ExecuteThread.run(ExecuteThread.java:181)

通过这个堆栈跟踪,似乎所有这些线程都在等待获取数据库连接,但是当我们看到oracle时,我们看到了很多非活动的jdbc连接。
为什么这么多线程都在等待连接,但同时数据库有很多inactie jdbc连接,我们如何解决这个问题,请帮助我们,谢谢。

1 个答案:

答案 0 :(得分:0)

从堆栈跟踪中看,它们在访问系统属性时由于死锁而陷入困境。可以请更改jdbc驱动程序并尝试。我不确定使用哪个jar文件oracle.net.nl.NVPair类。当我从几个罐子里检查oracle.net.nl.NVPair的源代码时,我看到的对系统属性的唯一引用是private String _linesep = System.getProperty("line.separator"); 。这与您的堆栈跟踪at oracle.net.nl.NVPair.(Unknown Source)

匹配