The error is weblogic.descriptor.DescriptorException: Unmarshaller failed

在将使用MyEclipse生成的2.5版本web.xml的项目部署到Weblogic 9.2时,遇到DescriptorException: Unmarshaller failed错误。问题源于Weblogic 9.2不支持2.5版本的web.xml。解决方法包括将web.xml版本改为2.4,或者创建weblogic.xml配置上下文根。第一种方法被证实有效。

部署 web project 到weblogic92(换成10.3就不会出问题了)上后,错误解决

常见错误Unmarshaller failed:
<Unable to load descriptor D:\bea\user_projects\domains\base_domain\.\autodeploy\demo/
WEB-INF/web.xml of module webProject. The error is weblogic.descriptor.DescriptorException: Unmarshaller failed

 at weblogic.descriptor.internal.MarshallerFactory$1.createDescriptor

Caused by: com.bea.xml.XmlException: failed to load java type corresponding to e=web-app@http://java.sun.com/xml/ns/javaee

 at com.bea.staxb.runtime.internal.UnmarshalResult.getPojoBindingType

......

问题描述:

Weblogic9.2 不支持用 MyEclipse 自动生成2.5版本的web.xml,如下:

<web-app version="2.5" 

                      xmlns="http://java.sun.com/xml/ns/javaee" 

                      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 

                      xsi:schemaLocation="http://java.sun.com/xml/ns/javaee 

                      http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">

新建项目 采用 J2EE1.4

<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.4"
xmlns="http://java.sun.com/xml/ns/j2ee"
                    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                   xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
                   http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
</web-app>

解决办法:

1.web.xml文件改成2.4版本

将下面内容,覆盖你原有的web.xml文件

 <?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">

</web-app>

2.增加 weblogic 上下文根:

   解决方法是:在项目的WEB-INF/下面增加一个 weblogic.xml文件  里面写上:

    

<? xml  version = "1.0"  encoding = "GB2312" ?>    

<! DOCTYPE  weblogic-web-app   

   PUBLIC  "-//BEA Systems, Inc.//DTD Web Application 8.1//EN"  

   "http://www.bea.com/servers/wls810/dtd/weblogic810-web-jar.dtd" >    

  

< weblogic-web-app >    

<!--配置访问地址上下文配置-->    

      < context-root > /webLogicDemo/ </ context-root >    

</ weblogic-web-app >   

以上两种方法感觉第一种方法实用,第二种没有试成功

2025-11-04 16:47:05.706 INFO 25365 --- [[ACTIVE] ExecuteThread: '59' for queue: 'weblogic.kernel.Default (self-tuning)'] c.o.group.apps.core.aop.ConsolePrintAop : 浏览器 : CHROME11 2025-11-04 16:47:05.706 INFO 25365 --- [[ACTIVE] ExecuteThread: '59' for queue: 'weblogic.kernel.Default (self-tuning)'] c.o.group.apps.core.aop.ConsolePrintAop : 浏览器版本 : 117.0.0.0 2025-11-04 16:47:05.713 INFO 25365 --- [[ACTIVE] ExecuteThread: '99' for queue: 'weblogic.kernel.Default (self-tuning)'] c.o.g.apps.logging.aspect.LoggingAspect : 方法规则式拦截: supplierAvg 2025-11-04 16:47:05.713 INFO 25365 --- [[ACTIVE] ExecuteThread: '99' for queue: 'weblogic.kernel.Default (self-tuning)'] c.o.group.apps.core.aop.ConsolePrintAop : 请求Url : http://sbsfn.smecs.com:80/coa/chart/supplier 2025-11-04 16:47:05.713 INFO 25365 --- [[ACTIVE] ExecuteThread: '99' for queue: 'weblogic.kernel.Default (self-tuning)'] c.o.group.apps.core.aop.ConsolePrintAop : 请求ip : 10.190.84.235 2025-11-04 16:47:05.714 INFO 25365 --- [[ACTIVE] ExecuteThread: '99' for queue: 'weblogic.kernel.Default (self-tuning)'] c.o.group.apps.core.aop.ConsolePrintAop : 浏览器 : CHROME11 2025-11-04 16:47:05.714 INFO 25365 --- [[ACTIVE] ExecuteThread: '99' for queue: 'weblogic.kernel.Default (self-tuning)'] c.o.group.apps.core.aop.ConsolePrintAop : 浏览器版本 : 117.0.0.0 2025-11-04 16:47:11.740 ERROR 25365 --- [[ACTIVE] ExecuteThread: '22' for queue: 'weblogic.kernel.Default (self-tuning)'] c.o.g.a.c.c.e.Error500Controller : 捕获到错误: MyBatisSystemException: nested exception is org.apache.ibatis.executor.ExecutorException: Error selecting key or setting result to parameter object. Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Failed to obtain JDBC Connection; nested exception is weblogic.jdbc.extensions.PoolLimitSQLException: weblogic.common.resourcepool.ResourceLimitException: No resources currently available in pool JDBC-ORACLE-COA to allocate to applications, please increase the size of the pool and retry.. 2025-11-04 16:47:11.741 ERROR 25365 --- [[ACTIVE] ExecuteThread: '25' for queue: 'weblogic.kernel.Default (self-tuning)'] c.o.g.a.c.c.e.Error500Controller : 捕获到错误: MyBatisSystemException: nested exception is org.apache.ibatis.executor.ExecutorException: Error selecting key or setting result to parameter object. Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Failed to obtain JDBC Connection; nested exception is weblogic.jdbc.extensions.PoolLimitSQLException: weblogic.common.resourcepool.ResourceLimitException: No resources currently available in pool JDBC-ORACLE-COA to allocate to applications, please increase the size of the pool and retry.. 2025-11-04 16:47:16.388 ERROR 25365 --- [[ACTIVE] ExecuteThread: '56' for queue: 'weblogic.kernel.Default (self-tuning)'] c.o.group.apps.core.aop.ConsolePrintAop : 抛出异常 : nested exception is org.apache.ibatis.exceptions.PersistenceException: ### Error querying database. Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Failed to obtain JDBC Connection; nested exception is weblogic.jdbc.extensions.PoolLimitSQLException: weblogic.common.resourcepool.ResourceLimitException: No resources currently available in pool JDBC-ORACLE-COA to allocate to applications, please increase the size of the pool and retry.. ### The error may exist in URL [zip:/home/weblogic/weblogic/user_projects/domains/smecs/servers/AdminServer/tmp/_WL_user/coa_1.0.0/svf14e/war/WEB-INF/lib/_wl_cls_gen.jar!/mybatis/mapper/CoaLotParameterMapper.xml] ### The error may involve com.smec.apps.coa.mapper.CoaLotParameterMapper.listLotParameterForDashboardStdDev ### The error occurred while executing a query ### Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Failed to obtain JDBC Connection; nested exception is weblogic.jdbc.extensions.PoolLimitSQLException: weblogic.common.resourcepool.ResourceLimitException: No resources currently available in pool JDBC-ORACLE-COA to allocate to applications, please increase the size of the pool and retry.. 2025-11-04 16:47:16.417 ERROR 25365 --- [[ACTIVE] ExecuteThread: '4' for queue: 'weblogic.kernel.Default (self-tuning)'] c.o.group.apps.core.aop.ConsolePrintAop : 抛出异常 : nested exception is org.apache.ibatis.exceptions.PersistenceException: ### Error querying database. Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Failed to obtain JDBC Connection; nested exception is weblogic.jdbc.extensions.PoolLimitSQLException: weblogic.common.resourcepool.ResourceLimitException: No resources currently available in pool JDBC-ORACLE-COA to allocate to applications, please increase the size of the pool and retry.. ### The error may exist in URL [zip:/home/weblogic/weblogic/user_projects/domains/smecs/servers/AdminServer/tmp/_WL_user/coa_1.0.0/svf14e/war/WEB-INF/lib/_wl_cls_gen.jar!/mybatis/mapper/CoaLotParameterMapper.xml] ### The error may involve com.smec.apps.coa.mapper.CoaLotParameterMapper.listLotParameterForDashboardStdDev ### The error occurred while executing a query ### Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Failed to obtain JDBC Connection; nested exception is weblogic.jdbc.extensions.PoolLimitSQLException: weblogic.common.resourcepool.ResourceLimitException: No resources currently available in pool JDBC-ORACLE-COA to allocate to applications, please increase the size of the pool and retry.. 2025-11-04 16:47:16.427 ERROR 25365 --- [[ACTIVE] ExecuteThread: '99' for queue: 'weblogic.kernel.Default (self-tuning)'] c.o.group.apps.core.aop.ConsolePrintAop : 抛出异常 : nested exception is org.apache.ibatis.exceptions.PersistenceException: ### Error querying database. Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Failed to obtain JDBC Connection; nested exception is weblogic.jdbc.extensions.PoolLimitSQLException: weblogic.common.resourcepool.ResourceLimitException: No resources currently available in pool JDBC-ORACLE-COA to allocate to applications, please increase the size of the pool and retry.. ### The error may exist in URL [zip:/home/weblogic/weblogic/user_projects/domains/smecs/servers/AdminServer/tmp/_WL_user/coa_1.0.0/svf14e/war/WEB-INF/lib/_wl_cls_gen.jar!/mybatis/mapper/CoaLotParameterMapper.xml] ### The error may involve com.smec.apps.coa.mapper.CoaLotParameterMapper.listLotParameterForDashboardStdDev ### The error occurred while executing a query ### Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Failed to obtain JDBC Connection; nested exception is weblogic.jdbc.extensions.PoolLimitSQLException: weblogic.common.resourcepool.ResourceLimitException: No resources currently available in pool JDBC-ORACLE-COA to allocate to applications, please increase the size of the pool and retry.. 2025-11-04 16:47:16.511 ERROR 25365 --- [[ACTIVE] ExecuteThread: '63' for queue: 'weblogic.kernel.Default (self-tuning)'] c.o.group.apps.core.aop.ConsolePrintAop : 抛出异常 : nested exception is org.apache.ibatis.exceptions.PersistenceException: ### Error querying database. Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Failed to obtain JDBC Connection; nested exception is weblogic.jdbc.extensions.PoolLimitSQLException: weblogic.common.resourcepool.ResourceLimitException: No resources currently available in pool JDBC-ORACLE-COA to allocate to applications, please increase the size of the pool and retry.. ### The error may exist in URL [zip:/home/weblogic/weblogic/user_projects/domains/smecs/servers/AdminServer/tmp/_WL_user/coa_1.0.0/svf14e/war/WEB-INF/lib/_wl_cls_gen.jar!/mybatis/mapper/CoaLotParameterMapper.xml] ### The error may involve com.smec.apps.coa.mapper.CoaLotParameterMapper.listLotParameterForDashboardStdDev ### The error occurred while executing a query ### Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Failed to obtain JDBC Connection; nested exception is weblogic.jdbc.extensions.PoolLimitSQLException: weblogic.common.resourcepool.ResourceLimitException: No resources currently available in pool JDBC-ORACLE-COA to allocate to applications, please increase the size of the pool and retry.. 2025-11-04 16:47:16.521 ERROR 25365 --- [[ACTIVE] ExecuteThread: '36' for queue: 'weblogic.kernel.Default (self-tuning)'] c.o.group.apps.core.aop.ConsolePrintAop : 抛出异常 : nested exception is org.apache.ibatis.exceptions.PersistenceException: ### Error querying database. Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Failed to obtain JDBC Connection; nested exception is weblogic.jdbc.extensions.PoolLimitSQLException: weblogic.common.resourcepool.ResourceLimitException: No resources currently available in pool JDBC-ORACLE-COA to allocate to applications, please increase the size of the pool and retry.. ### The error may exist in URL [zip:/home/weblogic/weblogic/user_projects/domains/smecs/servers/AdminServer/tmp/_WL_user/coa_1.0.0/svf14e/war/WEB-INF/lib/_wl_cls_gen.jar!/mybatis/mapper/CoaLotParameterMapper.xml] ### The error may involve com.smec.apps.coa.mapper.CoaLotParameterMapper.listLotParameterForDashboardStdDev ### The error occurred while executing a query ### Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Failed to obtain JDBC Connection; nested exception is weblogic.jdbc.extensions.PoolLimitSQLException: weblogic.common.resourcepool.ResourceLimitException: No resources currently available in pool JDBC-ORACLE-COA to allocate to applications, please increase the size of the pool and retry.. 2025-11-04 16:47:16.547 ERROR 25365 --- [[ACTIVE] ExecuteThread: '7' for queue: 'weblogic.kernel.Default (self-tuning)'] c.o.group.apps.core.aop.ConsolePrintAop : 抛出异常 : nested exception is org.apache.ibatis.exceptions.PersistenceException: ### Error querying database. Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Failed to obtain JDBC Connection; nested exception is weblogic.jdbc.extensions.PoolLimitSQLException: weblogic.common.resourcepool.ResourceLimitException: No resources currently available in pool JDBC-ORACLE-COA to allocate to applications, please increase the size of the pool and retry.. ### The error may exist in URL [zip:/home/weblogic/weblogic/user_projects/domains/smecs/servers/AdminServer/tmp/_WL_user/coa_1.0.0/svf14e/war/WEB-INF/lib/_wl_cls_gen.jar!/mybatis/mapper/CoaLotParameterMapper.xml] ### The error may involve com.smec.apps.coa.mapper.CoaLotParameterMapper.listLotParameterForDashboardStdDev ### The error occurred while executing a query ### Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Failed to obtain JDBC Connection; nested exception is weblogic.jdbc.extensions.PoolLimitSQLException: weblogic.common.resourcepool.ResourceLimitException: No resources currently available in pool JDBC-ORACLE-COA to allocate to applications, please increase the size of the pool and retry.. 2025-11-04 16:47:16.553 ERROR 25365 --- [[ACTIVE] ExecuteThread: '74' for queue: 'weblogic.kernel.Default (self-tuning)'] c.o.group.apps.core.aop.ConsolePrintAop : 抛出异常 : nested exception is org.apache.ibatis.exceptions.PersistenceException: ### Error querying database. Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Failed to obtain JDBC Connection; nested exception is weblogic.jdbc.extensions.PoolLimitSQLException: weblogic.common.resourcepool.ResourceLimitException: No resources currently available in pool JDBC-ORACLE-COA to allocate to applications, please increase the size of the pool and retry.. ### The error may exist in URL [zip:/home/weblogic/weblogic/user_projects/domains/smecs/servers/AdminServer/tmp/_WL_user/coa_1.0.0/svf14e/war/WEB-INF/lib/_wl_cls_gen.jar!/mybatis/mapper/CoaLotParameterMapper.xml] ### The error may involve com.smec.apps.coa.mapper.CoaLotParameterMapper.listLotParameterForDashboardStdDev ### The error occurred while executing a query ### Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Failed to obtain JDBC Connection; nested exception is weblogic.jdbc.extensions.PoolLimitSQLException: weblogic.common.resourcepool.ResourceLimitException: No resources currently available in pool JDBC-ORACLE-COA to allocate to applications, please increase the size of the pool and retry.. 2025-11-04 16:47:16.559 ERROR 25365 --- [[ACTIVE] ExecuteThread: '67' for queue: 'weblogic.kernel.Default (self-tuning)'] c.o.group.apps.core.aop.ConsolePrintAop : 抛出异常 : nested exception is org.apache.ibatis.exceptions.PersistenceException: ### Error querying database. Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Failed to obtain JDBC Connection; nested exception is weblogic.jdbc.extensions.PoolLimitSQLException: weblogic.common.resourcepool.ResourceLimitException: No resources currently available in pool JDBC-ORACLE-COA to allocate to applications, please increase the size of the pool and retry.. ### The error may exist in URL [zip:/home/weblogic/weblogic/user_projects/domains/smecs/servers/AdminServer/tmp/_WL_user/coa_1.0.0/svf14e/war/WEB-INF/lib/_wl_cls_gen.jar!/mybatis/mapper/CoaLotParameterMapper.xml] ### The error may involve com.smec.apps.coa.mapper.CoaLotParameterMapper.listLotParameterForDashboardStdDev ### The error occurred while executing a query ### Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Failed to obtain JDBC Connection; nested exception is weblogic.jdbc.extensions.PoolLimitSQLException: weblogic.common.resourcepool.ResourceLimitException: No resources currently available in pool JDBC-ORACLE-COA to allocate to applications, please increase the size of the pool and retry.. 2025-11-04 16:47:16.561 ERROR 25365 --- [[ACTIVE] ExecuteThread: '66' for queue: 'weblogic.kernel.Default (self-tuning)'] c.o.group.apps.core.aop.ConsolePrintAop : 抛出异常 : nested exception is org.apache.ibatis.exceptions.PersistenceException: ### Error querying database. Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Failed to obtain JDBC Connection; nested exception is weblogic.jdbc.extensions.PoolLimitSQLException: weblogic.common.resourcepool.ResourceLimitException: No resources currently available in pool JDBC-ORACLE-COA to allocate to applications, please increase the size of the pool and retry.. ### The error may exist in URL [zip:/home/weblogic/weblogic/user_projects/domains/smecs/servers/AdminServer/tmp/_WL_user/coa_1.0.0/svf14e/war/WEB-INF/lib/_wl_cls_gen.jar!/mybatis/mapper/CoaLotParameterMapper.xml] ### The error may involve com.smec.apps.coa.mapper.CoaLotParameterMapper.listLotParameterForDashboardStdDev ### The error occurred while executing a query ### Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Failed to obtain JDBC Connection; nested exception is weblogic.jdbc.extensions.PoolLimitSQLException: weblogic.common.resourcepool.ResourceLimitException: No resources currently available in pool JDBC-ORACLE-COA to allocate to applications, please increase the size of the pool and retry.. 2025-11-04 16:47:16.582 ERROR 25365 --- [[ACTIVE] ExecuteThread: '18' for queue: 'weblogic.kernel.Default (self-tuning)'] c.o.group.apps.core.aop.ConsolePrintAop : 抛出异常 : nested exception is org.apache.ibatis.exceptions.PersistenceException: ### Error querying database. Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Failed to obtain JDBC Connection; nested exception is weblogic.jdbc.extensions.PoolLimitSQLException: weblogic.common.resourcepool.ResourceLimitException: No resources currently available in pool JDBC-ORACLE-COA to allocate to applications, please increase the size of the pool and retry.. ### The error may exist in URL [zip:/home/weblogic/weblogic/user_projects/domains/smecs/servers/AdminServer/tmp/_WL_user/coa_1.0.0/svf14e/war/WEB-INF/lib/_wl_cls_gen.jar!/mybatis/mapper/CoaLotParameterMapper.xml] ### The error may involve com.smec.apps.coa.mapper.CoaLotParameterMapper.listLotParameterForDashboardStdDev ### The error occurred while executing a query ### Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Failed to obtain JDBC Connection; nested exception is weblogic.jdbc.extensions.PoolLimitSQLException: weblogic.common.resourcepool.ResourceLimitException: No resources currently available in pool JDBC-ORACLE-COA to allocate to applications, please increase the size of the pool and retry.. 2025-11-04 16:47:16.596 ERROR 25365 --- [[ACTIVE] ExecuteThread: '51' for queue: 'weblogic.kernel.Default (self-tuning)'] c.o.group.apps.core.aop.ConsolePrintAop : 抛出异常 : nested exception is org.apache.ibatis.exceptions.PersistenceException: ### Error querying database. Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Failed to obtain JDBC Connection; nested exception is weblogic.jdbc.extensions.PoolLimitSQLException: weblogic.common.resourcepool.ResourceLimitException: No resources currently available in pool JDBC-ORACLE-COA to allocate to applications, please increase the size of the pool and retry.. ### The error may exist in URL [zip:/home/weblogic/weblogic/user_projects/domains/smecs/servers/AdminServer/tmp/_WL_user/coa_1.0.0/svf14e/war/WEB-INF/lib/_wl_cls_gen.jar!/mybatis/mapper/CoaLotParameterMapper.xml] ### The error may involve com.smec.apps.coa.mapper.CoaLotParameterMapper.listLotParameterForDashboardStdDev ### The error occurred while executing a query ### Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Failed to obtain JDBC Connection; nested exception is weblogic.jdbc.extensions.PoolLimitSQLException: weblogic.common.resourcepool.ResourceLimitException: No resources currently available in pool JDBC-ORACLE-COA to allocate to applications, please increase the size of the pool and retry.. 2025-11-04 16:47:16.606 ERROR 25365 --- [[ACTIVE] ExecuteThread: '104' for queue: 'weblogic.kernel.Default (self-tuning)'] c.o.group.apps.core.aop.ConsolePrintAop : 抛出异常 : nested exception is org.apache.ibatis.exceptions.PersistenceException: ### Error querying database. Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Failed to obtain JDBC Connection; nested exception is weblogic.jdbc.extensions.PoolLimitSQLException: weblogic.common.resourcepool.ResourceLimitException: No resources currently available in pool JDBC-ORACLE-COA to allocate to applications, please increase the size of the pool and retry.. ### The error may exist in URL [zip:/home/weblogic/weblogic/user_projects/domains/smecs/servers/AdminServer/tmp/_WL_user/coa_1.0.0/svf14e/war/WEB-INF/lib/_wl_cls_gen.jar!/mybatis/mapper/CoaLotParameterMapper.xml] ### The error may involve com.smec.apps.coa.mapper.CoaLotParameterMapper.listLotParameterForDashboardStdDev ### The error occurred while executing a query ### Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Failed to obtain JDBC Connection; nested exception is weblogic.jdbc.extensions.PoolLimitSQLException: weblogic.common.resourcepool.ResourceLimitException: No resources currently available in pool JDBC-ORACLE-COA to allocate to applications, please increase the size of the pool and retry.. 2025-11-04 16:47:16.607 ERROR 25365 --- [[ACTIVE] ExecuteThread: '26' for queue: 'weblogic.kernel.Default (self-tuning)'] c.o.group.apps.core.aop.ConsolePrintAop : 抛出异常 : nested exception is org.apache.ibatis.exceptions.PersistenceException: ### Error querying database. Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Failed to obtain JDBC Connection; nested exception is weblogic.jdbc.extensions.PoolLimitSQLException: weblogic.common.resourcepool.ResourceLimitException: No resources currently available in pool JDBC-ORACLE-COA to allocate to applications, please increase the size of the pool and retry.. ### The error may exist in URL [zip:/home/weblogic/weblogic/user_projects/domains/smecs/servers/AdminServer/tmp/_WL_user/coa_1.0.0/svf14e/war/WEB-INF/lib/_wl_cls_gen.jar!/mybatis/mapper/CoaLotParameterMapper.xml] ### The error may involve com.smec.apps.coa.mapper.CoaLotParameterMapper.listLotParameterForDashboardStdDev ### The error occurred while executing a query ### Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Failed to obtain JDBC Connection; nested exception is weblogic.jdbc.extensions.PoolLimitSQLException: weblogic.common.resourcepool.ResourceLimitException: No resources currently available in pool JDBC-ORACLE-COA to allocate to applications, please increase the size of the pool and retry.. 2025-11-04 16:47:16.628 ERROR 25365 --- [[ACTIVE] ExecuteThread: '101' for queue: 'weblogic.kernel.Default (self-tuning)'] c.o.group.apps.core.aop.ConsolePrintAop : 抛出异常 : nested exception is org.apache.ibatis.exceptions.PersistenceException: ### Error querying database. Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Failed to obtain JDBC Connection; nested exception is weblogic.jdbc.extensions.PoolLimitSQLException: weblogic.common.resourcepool.ResourceLimitException: No resources currently available in pool JDBC-ORACLE-COA to allocate to applications, please increase the size of the pool and retry.. ### The error may exist in URL [zip:/home/weblogic/weblogic/user_projects/domains/smecs/servers/AdminServer/tmp/_WL_user/coa_1.0.0/svf14e/war/WEB-INF/lib/_wl_cls_gen.jar!/mybatis/mapper/CoaLotParameterMapper.xml] ### The error may involve com.smec.apps.coa.mapper.CoaLotParameterMapper.listLotParameterForDashboardStdDev ### The error occurred while executing a query ### Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Failed to obtain JDBC Connection; nested exception is weblogic.jdbc.extensions.PoolLimitSQLException: weblogic.common.resourcepool.ResourceLimitException: No resources currently available in pool JDBC-ORACLE-COA to allocate to applications, please increase the size of the pool and retry.. 2025-11-04 16:47:16.633 ERROR 25365 --- [[ACTIVE] ExecuteThread: '59' for queue: 'weblogic.kernel.Default (self-tuning)'] c.o.group.apps.core.aop.ConsolePrintAop : 抛出异常 : nested exception is org.apache.ibatis.exceptions.PersistenceException: ### Error querying database. Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Failed to obtain JDBC Connection; nested exception is we这是啥异常
最新发布
11-06
你提供的日志非常完整,它清晰地揭示了一个 **典型的生产级 Java Web 应用中出现的严重性能瓶颈问题**。 --- ## ✅ 最终结论:这是什么异常? > 🔥 **根本异常是:`weblogic.common.resourcepool.ResourceLimitException: No resources currently available in pool JDBC-ORACLE-COA`** > > 👉 表示:**WebLogic 中名为 `JDBC-ORACLE-COA` 的数据库连接池已耗尽,所有连接都被占用,新的请求无法获取数据库连接。** 这是一个 **数据库资源枯竭型异常**,会导致大量接口失败、页面加载超时或报错。 --- ## 🚨 详细异常链分析 ```log Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Failed to obtain JDBC Connection; nested exception is weblogic.jdbc.extensions.PoolLimitSQLException: weblogic.common.resourcepool.ResourceLimitException: No resources currently available in pool JDBC-ORACLE-COA to allocate to applications, please increase the size of the pool and retry.. ``` ### 分层解释: | 异常层级 | 含义 | |--------|------| | `MyBatisSystemException` / `PersistenceException` | MyBatis 执行 SQL 查询失败 | | `ExecutorException` | MyBatis 在执行查询过程中出错 | | `CannotGetJdbcConnectionException` (Spring) | Spring 框架无法从数据源获取数据库连接 | | `PoolLimitSQLException` (WebLogic) | WebLogic 特有的连接池限制异常 | | `ResourceLimitException` | 核心原因:**连接池没有可用连接了!** | --- ## 🔍 关键线索提取 ### 1. **出问题的接口和 SQL** ```log The error may involve com.smec.apps.coa.mapper.CoaLotParameterMapper.listLotParameterForDashboardStdDev ``` 👉 这个方法正在尝试执行一个查询(很可能是仪表盘上的标准差统计),但它拿不到数据库连接。 ### 2. **并发请求激增** 从日志看,在 **16:47:16 秒内,有至少 15 个线程同时抛出该异常**: - `ExecuteThread: '7'`, `'18'`, `'26'`, `'51'`, `'63'`... 👉 说明此时系统正面临高并发压力,多个用户/前端轮询同时访问此接口。 ### 3. **浏览器与 IP 来源** ```log 浏览器 : CHROME11 浏览器版本 : 117.0.0.0 请求ip : 10.190.84.235 ``` 👉 用户使用 Chrome 浏览器访问 `http://sbsfn.smecs.com:80/coa/chart/supplier` 这个 `/chart/supplier` 很可能是一个 **图表展示页面**,会自动刷新数据。 --- ## ⚠️ 根本原因推断 结合所有信息,可以得出以下结论: | 因素 | 推理 | |------|------| | ❌ 高频调用 + 耗时长 | 前端每几秒就请求一次 `/chart/supplier` → 触发 `listLotParameterForDashboardStdDev` 查询 | | ❌ 查询本身较慢 | 可能涉及大数据量聚合计算(如标准差)、未加索引、全表扫描等 | | ❌ 连接池配置过小 | `JDBC-ORACLE-COA` 最大连接数可能只有 30~50,被占满后新请求拿不到连接 | | ❌ 连接未及时释放 | 存在长事务、未关闭 ResultSet 或死循环等问题 | | ❌ 缺少缓存机制 | 相同数据反复查库,浪费资源 | 最终导致: > 💥 **连接池被“慢查询”占满 → 新请求拿不到连接 → 抛出 `ResourceLimitException` → 页面报错或空白** --- ## ✅ 是否会导致“空指针异常”? ### 答案:**不会直接抛 `NullPointerException`,但前端很可能显示“空数据”或崩溃。** #### 原因如下: - 后端因拿不到数据库连接,返回的是 **500 错误或空 JSON 数据**; - 前端 JS 如果不判空,直接访问 `data.list.length` 就会触发: > `TypeError: Cannot read property 'length' of null`(相当于 JS 的 NPE) - 用户看到的就是“白屏”、“加载失败”、“数据为空” 所以虽然不是 Java 层面的 NPE,但用户体验上等同于“系统崩了”。 --- ## ✅ 解决方案(立即 + 长期) ### ✅ 1. 【紧急】扩大连接池容量(WebLogic 控制台) 进入 WebLogic 控制台 → 数据源 `JDBC-ORACLE-COA` → 连接池配置: | 参数 | 建议值 | |------|--------| | Initial Capacity | 20 | | Maximum Capacity | 100 ~ 200(原可能是 30) | | Statement Cache Size | 50 ~ 100 | | Test Connections On Reserve | ✅ 开启 | | Seconds To Idle Before Shrink | 300 | 📌 注意:不要设为无限,需匹配 Oracle 数据库的 `processes` 上限。 --- ### ✅ 2. 【优化】优化慢 SQL:`listLotParameterForDashboardStdDev` 检查对应的 SQL 是否高效: ```xml <!-- mybatis/mapper/CoaLotParameterMapper.xml --> <select id="listLotParameterForDashboardStdDev" resultType="..."> SELECT material_type, AVG(value), STDDEV(value) FROM coa_lot_parameter WHERE create_time > SYSDATE - 7 GROUP BY material_type </select> ``` #### 优化建议: - ✅ 给 `create_time`, `material_type` 加联合索引; - ✅ 分页或限制返回种类数量; - ✅ 避免对大表做 `STDDEV()` 实时计算; --- ### ✅ 3. 【架构】添加缓存(强烈推荐) 对于这种“图表类接口”,完全可以缓存结果 30 秒 ~ 5 分钟。 #### 示例:使用 Spring Cache 缓存结果 ```java @Cacheable(value = "dashboard", key = "#root.methodName", condition = "#materialType == null") public List<StdDevResult> listLotParameterForDashboardStdDev(String materialType) { return coaLotParameterMapper.listLotParameterForDashboardStdDev(materialType); } ``` 配合 Redis 或 Caffeine,可大幅降低 DB 压力。 --- ### ✅ 4. 【前端】减少无效轮询 如果前端每 5 秒轮询一次: ```js setInterval(() => fetch('/chart/supplier'), 5000); ``` 建议改为: - 延长到 30 秒; - 使用 WebSocket 主动推送变化; - 添加防抖/节流机制; - 失败后指数退避重试; --- ### ✅ 5. 【监控】增加连接池监控 - 使用 WebLogic JMX 监控 `ActiveConnectionsCurrentCount`; - 设置告警:当连接使用率 > 80% 时通知运维; - 记录哪些 SQL 执行时间超过 2 秒(Druid 监控页面); --- ## ✅ 总结 | 项目 | 内容 | |------|------| | **异常类型** | 数据库连接池资源耗尽 | | **根本原因** | 高频调用慢查询导致连接池被占满 | | **影响范围** | 所有依赖该数据源的接口全部不可用 | | **解决方案** | 扩大连接池 + 优化 SQL + 添加缓存 + 减少轮询 | --- ###
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值