• 关于

    dbcp数据库连接失败

    的搜索结果

问题

线上的java项目访问不到线上数据库,但是这个数据库我本地可以连接到,求解。报错

" java.lang.Exception: 数据库连接失败:Cannot create PoolableConnectionFactory (Server connection failure during tra...
因为相信,所以看见。 2020-05-27 12:59:10 3 浏览量 回答数 1

回答

GetConnectionTimeoutException的Cause就是这个 请问一下,这个问题已经解决了吗? 我也查看了一下代码,发现如果创建数据库连接失败的话,通过Druid获取连接的方法会一直阻塞: 这是我用jstack看到的: <preclass="brush:java;toolbar:true;auto-links:false;">"AWT-EventQueue-0"prio=6tid=0x05068c00nid=0x151cwaitingoncondition[0x056ae000]java.lang.Thread.State:WAITING(parking)atsun.misc.Unsafe.park(NativeMethod)-parkingtowaitfor<0x2a48e958>(ajava.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)atjava.util.concurrent.locks.LockSupport.park(LockSupport.java:186)atjava.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2043)atcom.alibaba.druid.pool.DruidDataSource.takeLast(DruidDataSource.java:1376)atcom.alibaba.druid.pool.DruidDataSource.getConnectionInternal(DruidDataSource.java:1051)atcom.alibaba.druid.pool.DruidDataSource.getConnectionDirect(DruidDataSource.java:916)atcom.alibaba.druid.pool.DruidDataSource.getConnection(DruidDataSource.java:896)atcom.alibaba.druid.pool.DruidDataSource.getConnection(DruidDataSource.java:886)atcom.alibaba.druid.pool.DruidDataSource.getConnection(DruidDataSource.java:96)atorg.springframework.jdbc.datasource.DataSourceUtils.doGetConnection(DataSourceUtils.java:111) <divclass='ref'> 引用来自“losthu1998”的评论 请问一下,这个问题已经解决了吗? 我也查看了一下代码,发现如果创建数据库连接失败的话,通过Druid获取连接的方法会一直阻塞: 这是我用jstack看到的: <preclass="brush:java;toolbar:true;auto-links:false;">"AWT-EventQueue-0"prio=6tid=0x05068c00nid=0x151cwaitingoncondition[0x056ae000]java.lang.Thread.State:WAITING(parking)atsun.misc.Unsafe.park(NativeMethod)-parkingtowaitfor<0x2a48e958>(ajava.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)atjava.util.concurrent.locks.LockSupport.park(LockSupport.java:186)atjava.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2043)atcom.alibaba.druid.pool.DruidDataSource.takeLast(DruidDataSource.java:1376)atcom.alibaba.druid.pool.DruidDataSource.getConnectionInternal(DruidDataSource.java:1051)atcom.alibaba.druid.pool.DruidDataSource.getConnectionDirect(DruidDataSource.java:916)atcom.alibaba.druid.pool.DruidDataSource.getConnection(DruidDataSource.java:896)atcom.alibaba.druid.pool.DruidDataSource.getConnection(DruidDataSource.java:886)atcom.alibaba.druid.pool.DruidDataSource.getConnection(DruidDataSource.java:96)atorg.springframework.jdbc.datasource.DataSourceUtils.doGetConnection(DataSourceUtils.java:111) 谢谢,我也没什么好办法,只能换成DBCP如果数据库down掉,一般给客户端返回什么?SQLException之类的吧,你可以使用dbcp,tomcat-jdbc测试下,都可以返回异常 我也遇到这个问题,楼主咋搞定的尝试了几种方案都没能解决,加之我们当时对sql监控的需求不大,后来就放弃druid改用tomcat-jdbc了。 看这篇博客: <arel="nofollow">https://www.cnblogs.com/xchendevelop/articles/9291044.html
爱吃鱼的程序员 2020-06-14 16:56:49 0 浏览量 回答数 0

问题

项目启动链接mysql失败?报错

### Error querying database. Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Could not get JDBC Conne...
爱吃鱼的程序员 2020-06-09 13:58:53 0 浏览量 回答数 1

万券齐发助力企业上云,爆款产品低至2.2折起!

限量神券最高减1000,抢完即止!云服务器ECS新用户首购低至0.95折!

回答

看起来是ehcache配置文件报的错。有两个可能: 1,没找到ehcache.xml 2,ehcache配置文件中缺少了某个对象的配置 重点看下第二项。纠结了很久,最后把所有的缓存配置文件放到src下面,台式机和笔记本都不报错了。匪夷所思的很,现在正常了。 不才,请大家过来看看: @红薯 @Java_lilin @微名喝喝 @喵了个咪 @缪斯的情人 @yangzhiyong @zb0423 @swanky_yao @沙漠雄鹰  @阿咪 @zhangyou1010 @SuperEric @JavaGG @丛俊龙  @liueric @lwei @024 @sunnynie @TWmelody @张英泽 @神勇小白鼠 @zb0423 @Evensunny @龙凯 @枫凌渡 @宋浩 @鉴客 @整俩硬菜 @kevinwang168 @虫虫 这个错误是 Spring的吧 Errorcreatingbeanwithname'entityManagerFactory'definedinServletContextresource[/WEB-INF/schemas/spring-core.xml]:错误挺明显了!对的,问题很明显。关键是我在台式机上没有问题,放到笔记本上有问题。我家里面的笔记本式华硕的K40和东芝的。都报这个错误,放到家里面的台式机也没有错。这就是很大的问题了。 引用来自“红薯”的答案 这个错误是 Spring的吧 你是不是配置文件有问题,看异常既有spring的也有hibernate的,应该是读取相关配置文件失败了 引用来自“缪斯的情人”的答案 你是不是配置文件有问题,看异常既有spring的也有hibernate的,应该是读取相关配置文件失败了 引用来自“FortaleOpenSource”的答案 引用来自“缪斯的情人”的答案 你是不是配置文件有问题,看异常既有spring的也有hibernate的,应该是读取相关配置文件失败了回复 @缪斯的情人:肯定是匹配的,用intellijIDEA创建项目的是侯会让你选择JDK的路径的,netbeans在安装的时候就会检测jdk的路径。其实我最疑惑的是为何台式机不报错,这个不知道是不是个问题。回复 @缪斯的情人:出来公司的是netbeans外,其他的都是jetbrainsintellijIDEA回复 @FortaleOpenSource:用什么IDE来吗,比如eclipse的编译环境complier和你的jdk版本匹配吗我觉得跟编译环境没有多大的关系,华硕笔记本装的是jdk6,东芝和台式机装的是jdk7,今天我放到公司的笔记本上也是报这个错误,公司的笔记本式联想的,win764jdk6。 <?xmlversion="1.0"encoding="UTF-8"?><beansxmlns="http://www.springframework.org/schema/beans"xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xmlns:context="http://www.springframework.org/schema/context"xmlns:jpa="http://www.springframework.org/schema/data/jpa"xmlns:tx="http://www.springframework.org/schema/tx"xmlns:cache="http://www.springframework.org/schema/cache"xsi:schemaLocation="http://www.springframework.org/schema/beanshttp://www.springframework.org/schema/beans/spring-beans-3.1.xsdhttp://www.springframework.org/schema/contexthttp://www.springframework.org/schema/context/spring-context-3.1.xsdhttp://www.springframework.org/schema/data/jpahttp://www.springframework.org/schema/data/jpa/spring-jpa.xsdhttp://www.springframework.org/schema/txhttp://www.springframework.org/schema/tx/spring-tx.xsdhttp://www.springframework.org/schema/cachehttp://www.springframework.org/schema/cache/spring-cache-3.1.xsd"default-lazy-init="true"><context:property-placeholderignore-unresolvable="true"location="/WEB-INF/application.properties"/><context:component-scanbase-package="org.wb.demo"><context:exclude-filtertype="annotation"expression="org.springframework.stereotype.Controller"/></context:component-scan><!--数据源配置,使用DBCP数据库连接池--><beanid="dataSource"class="org.apache.commons.dbcp.BasicDataSource"destroy-method="close"><!--ConnectionInfo--><propertyname="driverClassName"value="${jdbc.driver}"/><propertyname="url"value="${jdbc.url}"/><propertyname="username"value="${jdbc.username}"/><propertyname="password"value="${jdbc.password}"/><!--ConnectionPoolingInfo--><propertyname="maxActive"value="${dbcp.maxActive}"/><propertyname="maxIdle"value="${dbcp.maxIdle}"/><propertyname="defaultAutoCommit"value="false"/><!--连接Idle一个小时后超时--><propertyname="timeBetweenEvictionRunsMillis"value="3600000"/><propertyname="minEvictableIdleTimeMillis"value="3600000"/></bean><!--JpaEntityManager配置--><beanid="entityManagerFactory"class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean"><propertyname="dataSource"ref="dataSource"/><propertyname="jpaVendorAdapter"ref="hibernateJpaVendorAdapter"/><propertyname="packagesToScan"value="org.wb.demo"/><propertyname="jpaProperties"><props><propkey="hibernate.hbm2ddl.auto">update</prop><propkey="hibernate.cache.region.factory_class">org.hibernate.cache.ehcache.EhCacheRegionFactory</prop><propkey="net.sf.ehcache.configurationResourceName">cache/ehcache-local.xml</prop><propkey="hibernate.ejb.naming_strategy">org.hibernate.cfg.ImprovedNamingStrategy</prop></props></property></bean><beanid="hibernateJpaVendorAdapter"class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter"><propertyname="databasePlatform"><beanfactory-method="getDialect"class="org.wb.demo.db.DbUtils"><constructor-argref="dataSource"/></bean></property></bean><jpa:repositoriesbase-package="org.wb.demo"transaction-manager-ref="transactionManager"entity-manager-factory-ref="entityManagerFactory"/><beanid="transactionManager"class="org.springframework.orm.jpa.JpaTransactionManager"><propertyname="entityManagerFactory"ref="entityManagerFactory"/></bean><tx:annotation-driventransaction-manager="transactionManager"proxy-target-class="true"/><beanid="validator"class="org.springframework.validation.beanvalidation.LocalValidatorFactoryBean"/><cache:annotation-drivencache-manager="ehCacheManager"/><beanid="ehCacheManager"class="org.springframework.cache.ehcache.EhCacheCacheManager"><propertyname="cacheManager"ref="ehcache"/></bean><beanid="ehcache"class="org.springframework.cache.ehcache.EhCacheManagerFactoryBean"><propertyname="configLocation"value="classpath:ehcache.xml"/></bean></beans>那位大神有SSH集成ehcache的实例啊,求指教
爱吃鱼的程序员 2020-06-23 11:51:46 0 浏览量 回答数 0

回答

估计是加载配置文件出错 你先把superdiamond这个服务启动起来 https://github.com/melin/super-diamond这个是项目地址这个项目采用maven分模块开发目录格式,找到htz执行一次mvncleaninstall-Dmaven.test.skip=true.需要把依赖包映射进去.当然没这么简单还有其它环境加载问题,你沿着maven构建这条思路找问题吧好的谢谢。我尝试一下,至少有方向了。只有回家熬夜弄     你还是先学习下maven吧,这个没在本人面前,没法跟你说清楚。如果人在面前,当面说,分分钟。就好比我一眼就知道男人和女人的区别,但我一个小时也没法用文字或算法描述出来 这是maven多模块项目,通常有父项目和子项目之分。你可以单独运行子项目,也可以看POM文件,找到父项目,直接编译父项目即可。但是,随机应变。 另外,grunt是前端的构建工具,和你这个java项目无关的。 或者你尝试把父项目POM贴出来,以及maven的完整报错 另外,你也完全可以直接在eclipse按照传统的方式添加一个server的方式来部署,不是非要mvntomcat:run这样。 然后去编译后的目录看看哪些文件没有编译出来好吧,当时学习maven是为了公司的项目。就只是简单的入了个门,基本上能够操作就没有继续深入了。明天研究一下,然后再把pom文件贴出来。您受累帮我看一下吧,公司给我下了一个新功能,项目跑不起来急死人了。感激不尽 这是完整的pom文件: <projectxmlns="http://maven.apache.org/POM/4.0.0"xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"      xsi:schemaLocation="http://maven.apache.org/POM/4.0.0http://maven.apache.org/xsd/maven-4.0.0.xsd">    <modelVersion>4.0.0</modelVersion>    <parent>       <groupId>htz</groupId>       <artifactId>htz-parent</artifactId>       <version>0.1.5</version>    </parent>    <groupId>huitouzi</groupId>    <artifactId>htz</artifactId>    <version>1.6.9</version>    <packaging>war</packaging>    <name>htz</name>    <properties>       <org.springframework.version>3.2.2.RELEASE</org.springframework.version>       <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>    </properties>    <dependencies>       <dependency>          <groupId>htz</groupId>          <artifactId>htz-util</artifactId>          <version>[0.1.22,0.2)</version>       </dependency>       <dependency>          <groupId>arch</groupId>          <artifactId>arch-util</artifactId>          <version>[0.1.19,0.2)</version>       </dependency>       <dependency>          <groupId>CommonService</groupId>          <artifactId>CommonServiceClient</artifactId>          <version>SNAPSHOT</version>       </dependency>       <dependency>          <groupId>javax</groupId>          <artifactId>javaee-api</artifactId>          <version>6.0</version>          <scope>provided</scope>       </dependency>       <!--Spring-->       <dependency>          <groupId>org.springframework</groupId>          <artifactId>spring-core</artifactId>          <version>${org.springframework.version}</version>       </dependency>       <dependency>          <groupId>org.springframework</groupId>          <artifactId>spring-expression</artifactId>          <version>${org.springframework.version}</version>       </dependency>       <dependency>          <groupId>org.springframework</groupId>          <artifactId>spring-beans</artifactId>          <version>${org.springframework.version}</version>       </dependency>       <dependency>          <groupId>org.springframework</groupId>          <artifactId>spring-aop</artifactId>          <version>${org.springframework.version}</version>       </dependency>       <dependency>          <groupId>org.springframework</groupId>          <artifactId>spring-context</artifactId>          <version>${org.springframework.version}</version>       </dependency>       <dependency>          <groupId>org.springframework</groupId>          <artifactId>spring-context-support</artifactId>          <version>${org.springframework.version}</version>       </dependency>       <dependency>          <groupId>org.springframework</groupId>          <artifactId>spring-tx</artifactId>          <version>${org.springframework.version}</version>       </dependency>       <dependency>          <groupId>org.springframework</groupId>          <artifactId>spring-jdbc</artifactId>          <version>${org.springframework.version}</version>       </dependency>       <dependency>          <groupId>org.springframework</groupId>          <artifactId>spring-orm</artifactId>          <version>${org.springframework.version}</version>       </dependency>       <dependency>          <groupId>org.springframework</groupId>          <artifactId>spring-oxm</artifactId>          <version>${org.springframework.version}</version>       </dependency>       <dependency>          <groupId>org.springframework</groupId>          <artifactId>spring-web</artifactId>          <version>${org.springframework.version}</version>       </dependency>       <dependency>          <groupId>org.springframework</groupId>          <artifactId>spring-webmvc</artifactId>          <version>${org.springframework.version}</version>       </dependency>       <dependency>          <groupId>org.springframework</groupId>          <artifactId>spring-webmvc-portlet</artifactId>          <version>${org.springframework.version}</version>       </dependency>       <dependency>          <groupId>org.springframework</groupId>          <artifactId>spring-test</artifactId>          <version>${org.springframework.version}</version>       </dependency>       <!--hibernate-->       <dependency>          <groupId>org.hibernate</groupId>          <artifactId>hibernate-core</artifactId>          <version>3.6.10.Final</version>       </dependency>       <dependency>          <groupId>org.hibernate.javax.persistence</groupId>          <artifactId>hibernate-jpa-2.1-api</artifactId>          <version>1.0.0.Final</version>       </dependency>       <dependency>          <groupId>org.hibernate</groupId>          <artifactId>hibernate-validator</artifactId>          <version>4.3.0.Final</version>       </dependency>       <dependency>          <groupId>asm</groupId>          <artifactId>asm</artifactId>          <version>3.1</version>       </dependency>       <!--json-->       <dependency>          <groupId>net.sf.json-lib</groupId>          <artifactId>json-lib</artifactId>          <version>2.1</version>          <classifier>jdk15</classifier>       </dependency>       <!--pdf-->       <dependency>          <groupId>htzpdf</groupId>          <artifactId>iText</artifactId>          <version>2.0.8a</version>       </dependency>       <dependency>          <groupId>htzpdf</groupId>          <artifactId>core-renderer</artifactId>          <version>4.0</version>       </dependency>       <dependency>          <groupId>htzpdf</groupId>          <artifactId>bcprov</artifactId>          <version>jdk15-1.46a</version>       </dependency>       <!--mail-->       <dependency>          <groupId>javax.mail</groupId>          <artifactId>mail</artifactId>          <version>1.4.7</version>       </dependency>       <!--apache-commons-->       <dependency>          <groupId>commons-httpclient</groupId>          <artifactId>commons-httpclient</artifactId>          <version>3.1</version>       </dependency>       <dependency>          <groupId>commons-collections</groupId>          <artifactId>commons-collections</artifactId>          <version>3.1</version>       </dependency>       <dependency>          <groupId>commons-dbcp</groupId>          <artifactId>commons-dbcp</artifactId>          <version>1.2.2</version>       </dependency>       <dependency>          <groupId>commons-fileupload</groupId>          <artifactId>commons-fileupload</artifactId>          <version>1.2.1</version>       </dependency>       <dependency>          <groupId>commons-io</groupId>          <artifactId>commons-io</artifactId>          <version>1.4</version>       </dependency>       <dependency>          <groupId>commons-beanutils</groupId>          <artifactId>commons-beanutils</artifactId>          <version>1.8.3</version>       </dependency>       <dependency>          <groupId>commons-lang</groupId>          <artifactId>commons-lang</artifactId>          <version>2.3</version>       </dependency>       <dependency>          <groupId>commons-logging</groupId>          <artifactId>commons-logging</artifactId>          <version>1.1.3</version>       </dependency>       <dependency>          <groupId>commons-pool</groupId>          <artifactId>commons-pool</artifactId>          <version>1.6</version>       </dependency>       <!--xfire-->       <dependency>          <groupId>org.codehaus.xfire</groupId>          <artifactId>xfire-all</artifactId>          <version>1.2.6</version>          <exclusions>             <exclusion>                <groupId>org.codehaus.xfire</groupId>                <artifactId>xfire-spring</artifactId>             </exclusion>             <exclusion>                <groupId>xml-apis</groupId>                <artifactId>xml-apis</artifactId>             </exclusion>             <exclusion>                <groupId>ant</groupId>                <artifactId>ant</artifactId>             </exclusion>             <exclusion>                <groupId>jdom</groupId>                <artifactId>jdom</artifactId>             </exclusion>          </exclusions>       </dependency>       <!--zxing-->       <dependency>          <groupId>htz</groupId>          <artifactId>zxing</artifactId>          <version>2.3.1</version>       </dependency>       <!--jakarta-oro-->       <dependency>          <groupId>ant</groupId>          <artifactId>ant-jakarta-oro</artifactId>          <version>1.6.1</version>       </dependency>       <!--gson-->       <dependency>          <groupId>com.google.code.gson</groupId>          <artifactId>gson</artifactId>          <version>1.7.2</version>       </dependency>       <!--xerces-->       <dependency>          <groupId>xml-apis</groupId>          <artifactId>xerces</artifactId>          <version>2.9.1</version>       </dependency>       <!--ehcache-->       <dependency>          <groupId>net.sf.ehcache</groupId>          <artifactId>ehcache</artifactId>          <version>1.5.0</version>       </dependency>       <!--castor-->       <dependency>          <groupId>org.codehaus.castor</groupId>          <artifactId>castor-xml</artifactId>          <version>1.3.2</version>       </dependency>       <!--jstl-->       <dependency>          <groupId>jstl</groupId>          <artifactId>jstl</artifactId>          <version>1.2</version>       </dependency>       <!--thirdparty-->       <dependency>          <groupId>jakarta</groupId>          <artifactId>jakarta-oro</artifactId>          <version>2.0.7</version>       </dependency>       <dependency>          <groupId>org.beanshell</groupId>          <artifactId>bsh</artifactId>          <version>2.0b4</version>       </dependency>       <dependency>          <groupId>beartool</groupId>          <artifactId>md5</artifactId>          <version>1.0.0</version>       </dependency>       <dependency>          <groupId>emayclient</groupId>          <artifactId>emayclient</artifactId>          <version>1.0.0</version>       </dependency>       <!--qq,sinaweibo -->       <dependency>          <groupId>qq-connect</groupId>          <artifactId>qq-connect</artifactId>          <version>1.0.0</version>          <classifier>no-codec</classifier>       </dependency>       <dependency>          <groupId>sina.weibo</groupId>          <artifactId>sina_weibo</artifactId>          <version>0.0.1</version>       </dependency>       <dependency>          <groupId>javassist</groupId>          <artifactId>javassist</artifactId>          <version>3.12.0.GA</version>       </dependency>       <!--edm-->       <dependency>          <groupId>redm</groupId>          <artifactId>redm-client-prnasia-services</artifactId>          <version>1.0</version>       </dependency>       <dependency>          <groupId>redm</groupId>          <artifactId>redm-server</artifactId>          <version>2.0</version>       </dependency>       <!--webserviceaxis2-->       <dependency>          <groupId>org.apache.ws.commons.axiom</groupId>          <artifactId>axiom-api</artifactId>          <version>1.2.10</version>       </dependency>       <dependency>          <groupId>org.apache.ws.commons.axiom</groupId>          <artifactId>axiom-impl</artifactId>          <version>1.2.10</version>       </dependency>       <dependency>          <groupId>org.apache.axis2</groupId>          <artifactId>axis2-kernel</artifactId>          <version>1.4.1</version>          <exclusions>             <exclusion>                <groupId>javax.servlet</groupId>                <artifactId>servlet-api</artifactId>             </exclusion>             <exclusion>                <artifactId>httpcore-nio</artifactId>                <groupId>org.apache.httpcomponents</groupId>             </exclusion>          </exclusions>       </dependency>       <dependency>          <groupId>org.apache.axis2</groupId>          <artifactId>axis2-adb</artifactId>          <version>1.4.1</version>       </dependency>       <dependency>          <groupId>backport-util-concurrent</groupId>          <artifactId>backport-util-concurrent</artifactId>          <version>3.1</version>       </dependency>       <dependency>          <groupId>org.apache.neethi</groupId>          <artifactId>neethi</artifactId>          <version>2.0.2</version>       </dependency>       <dependency>          <groupId>wsdl4j</groupId>          <artifactId>wsdl4j</artifactId>          <version>1.6.2</version>       </dependency>       <dependency>          <groupId>org.apache.ws.commons.schema</groupId>          <artifactId>XmlSchema</artifactId>          <version>1.4.2</version>       </dependency>       <!--redisclient-->       <dependency>          <groupId>redis.clients</groupId>          <artifactId>jedis</artifactId>          <version>2.0.0</version>       </dependency>       <dependency>          <groupId>org.springframework.data</groupId>          <artifactId>spring-data-redis</artifactId>          <version>1.0.0.RELEASE</version>       </dependency>       <dependency>          <groupId>com.thoughtworks.xstream</groupId>          <artifactId>xstream</artifactId>          <version>1.3.1</version>       </dependency>       <dependency>          <!--jsoupHTMLparserlibrary@http://jsoup.org/-->          <groupId>org.jsoup</groupId>          <artifactId>jsoup</artifactId>          <version>1.5.2</version>       </dependency>       <dependency>          <groupId>org.aspectj</groupId>          <artifactId>aspectjweaver</artifactId>          <version>1.6.12</version>       </dependency>       <dependency>          <groupId>commons-codec</groupId>          <artifactId>commons-codec</artifactId>          <version>1.9</version>       </dependency>       <dependency>          <groupId>com.alibaba</groupId>          <artifactId>fastjson</artifactId>          <version>1.1.31</version>       </dependency>       <!--   <dependency>        <groupId>htz</groupId>        <artifactId>jzsms</artifactId>        <version>6.0</version>        </dependency>          -->    </dependencies>    <build>       <plugins>          <plugin>             <groupId>org.eclipse.jetty</groupId>             <artifactId>jetty-maven-plugin</artifactId>             <version>9.2.4.v20141103</version>             <!--ref:http://www.eclipse.org/jetty/documentation/current/jetty-maven-plugin.html-->             <configuration>                <httpConnector>                   <port>80</port>                </httpConnector>             </configuration>          </plugin>          <!--<plugin>             <groupId>org.jasig.mojo.jspc</groupId>             <artifactId>jspc-maven-plugin</artifactId>             <version>2.0.0</version>             <executions>                <execution>                   <goals>                      <goal>compile</goal>                   </goals>                </execution>             </executions>             <configuration>                <source>1.7</source>                <target>1.7</target>             </configuration>             <dependencies>                <dependency>                   <groupId>org.jasig.mojo.jspc</groupId>                   <artifactId>jspc-compiler-tomcat7</artifactId>                   <version>2.0.0</version>                </dependency>             </dependencies>          </plugin>-->       </plugins>    </build>    <repositories>       <repository>          <id>nexus</id>          <url>http://10.144.183.125:8081/nexus/content/groups/public</url>       </repository>    </repositories> </project> 只要是有依赖关系以及父工程都倒了呀: 难道是版本号有问题?我只有从头把maven看一遍了 把validate关了先...为何不直接贴错误信息,而是给一个包目录给我们看啥 com.github.diamond.client.ConfigurationRuntimeException 这个错误是一个开源项目的错误,远程加载配置文件的服务,你先看看你们内网这太机器的服务起来没有. 去找下这个项目,把服务起来,这个错误就不会有了. 话说这个项目还不错,主动推送配置文件给客户端,客户端连接不上服务端还可以调用本地缓存的. 嗯,我去问一下运维的知不知道com.github.diamond.client.ConfigurationRuntimeException相关的服务器 搞p2p?都溜了你去填坑么。 贴报错。本地配置maven环境。查看jar包是否完整了。没有显式缺少jar包,js校验之类的还在出红叉。本地仓库都1.8G了 使用传统添加Servers方式运行所报的错: SEVERE:Exceptionsendingcontextinitializedeventtolistenerinstanceofclasscom.htz.config.HtzContextLoaderListenerjava.lang.ExceptionInInitializerError   atcom.htz.config.Global.<clinit>(Global.java:63)   atcom.htz.config.HtzContextLoaderListener.contextInitialized(HtzContextLoaderListener.java:43)   atorg.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4973)   atorg.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5467)   atorg.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)   atorg.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559)   atorg.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549)   atjava.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)   atjava.util.concurrent.FutureTask.run(FutureTask.java:166)   atjava.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)   atjava.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)   atjava.lang.Thread.run(Thread.java:722)Causedby:com.github.diamond.client.ConfigurationRuntimeException:本地没有备份配置数据,PropertiesConfiguration初始化失败。   atcom.github.diamond.client.PropertiesConfiguration.connectServer(PropertiesConfiguration.java:117)   atcom.github.diamond.client.PropertiesConfiguration.<init>(PropertiesConfiguration.java:54)   atcom.github.diamond.client.OverridablePropertiesConfiguration.<init>(OverridablePropertiesConfiguration.java:9)   atcom.htz.common.HtzConfig.<init>(HtzConfig.java:19)   atcom.htz.common.HtzConfig.fromClasspath(HtzConfig.java:50)   atcom.htz.common.HtzConfig.fromClasspath(HtzConfig.java:46)   athtz.core.common.Global.<clinit>(Global.java:18)   ...12moreCausedby:com.github.diamond.client.ConfigurationRuntimeException:本地没有备份配置数据,PropertiesConfiguration初始化失败。   atcom.github.diamond.client.PropertiesConfiguration.connectServer(PropertiesConfiguration.java:87)   ...18more四月22,201611:10:54上午org.apache.catalina.core.StandardContextstartInternalSEVERE:ErrorlistenerStart四月22,201611:10:54上午org.apache.catalina.core.StandardContextstartInternalSEVERE:Context[/htz]startupfailedduetopreviouserrors四月22,201611:10:54上午org.apache.catalina.loader.WebappClassLoaderclearReferencesThreadsSEVERE:Thewebapplication[/htz]appearstohavestartedathreadnamed[ClientReconnectTimer-thread-1]buthasfailedtostopit.Thisisverylikelytocreateamemoryleak.四月22,201611:10:54上午org.apache.catalina.loader.WebappClassLoaderclearReferencesThreadsSEVERE:Thewebapplication[/htz]appearstohavestartedathreadnamed[pool-1-thread-1]buthasfailedtostopit.Thisisverylikelytocreateamemoryleak.四月22,201611:10:54上午org.apache.catalina.loader.WebappClassLoadercheckThreadLocalMapForLeaksSEVERE:Thewebapplication[/htz]createdaThreadLocalwithkeyoftype[java.lang.ThreadLocal](value[java.lang.ThreadLocal@323b0ead])andavalueoftype[io.netty.util.internal.InternalThreadLocalMap](value[io.netty.util.internal.InternalThreadLocalMap@4340999e])butfailedtoremoveitwhenthewebapplicationwasstopped.Threadsaregoingtoberenewedovertimetotryandavoidaprobablememoryleak.四月22,201611:10:54上午org.apache.catalina.loader.WebappClassLoadercheckThreadLocalMapForLeaksSEVERE:Thewebapplication[/htz]createdaThreadLocalwithkeyoftype[java.lang.ThreadLocal](value[java.lang.ThreadLocal@323b0ead])andavalueoftype[io.netty.util.internal.InternalThreadLocalMap](value[io.netty.util.internal.InternalThreadLocalMap@46257690])butfailedtoremoveitwhenthewebapplicationwasstopped.Threadsaregoingtoberenewedovertimetotryandavoidaprobablememoryleak.四月22,201611:10:54上午org.apache.coyote.AbstractProtocolstartINFO:StartingProtocolHandler["http-bio-8080"]四月22,201611:10:54上午org.apache.coyote.AbstractProtocolstartINFO:StartingProtocolHandler["ajp-bio-8009"]四月22,201611:10:54上午org.apache.catalina.startup.CatalinastartINFO:Serverstartupin9752ms四月22,201611:10:56上午org.apache.catalina.loader.WebappClassLoaderloadClassINFO:Illegalaccess:thiswebapplicationinstancehasbeenstoppedalready. Couldnotloadio.netty.util.concurrent.DefaultPromise$2. Theeventualfollowingstacktraceiscausedbyanerrorthrownfordebuggingpurposesaswellastoattempttoterminatethethreadwhichcausedtheillegalaccess,andhasnofunctionalimpact.java.lang.IllegalStateException   atorg.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1610)   atorg.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1569)   atio.netty.util.concurrent.DefaultPromise.notifyListeners(DefaultPromise.java:589)   atio.netty.util.concurrent.DefaultPromise.setSuccess(DefaultPromise.java:397)   atio.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:155)   atjava.lang.Thread.run(Thread.java:722)Exceptioninthread"pool-1-thread-1"java.lang.NoClassDefFoundError:io/netty/util/concurrent/DefaultPromise$2   atio.netty.util.concurrent.DefaultPromise.notifyListeners(DefaultPromise.java:589)   atio.netty.util.concurrent.DefaultPromise.setSuccess(DefaultPromise.java:397)   atio.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:155)   atjava.lang.Thread.run(Thread.java:722)Causedby:java.lang.ClassNotFoundException:io.netty.util.concurrent.DefaultPromise$2   atorg.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1718)   atorg.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1569)   ...4more使用jetty:run方式所报的错误:      使用jetty:run方式运行,报的错误(太长我去掉了一些重复的): [INFO]NoSpringWebApplicationInitializertypesdetectedonclasspath2016-04-2211:14:56ERROR[main](com.github.diamond.client.netty.Netty4Client.java:141)Failedconnecttoserverlocalhost:8283fromNetty4Client169.254.166.1712016-04-2211:14:56INFO[main](com.github.diamond.client.netty.Netty4Client.java:71)StartNetty4ClientLuo/169.254.166.171connecttotheserverlocalhost[WARNING]FAILEDo.e.j.m.p.JettyWebAppContext@473cf652{/,file:/D:/HuiTouZi/GZ-worksppace/htz/src/main/webapp/,STARTING}{file:/D:/HuiTouZi/GZ-worksppace/htz/src/main/webapp/}:java.lang.ExceptionInInitializerErrorjava.lang.ExceptionInInitializerError   atcom.htz.config.Global.<clinit>(Global.java:63)   atcom.htz.config.HtzContextLoaderListener.contextInitialized(HtzContextLoaderListener.java:43)   atorg.eclipse.jetty.server.handler.ContextHandler.callContextInitialized(ContextHandler.java:798)   atorg.eclipse.jetty.servlet.ServletContextHandler.callContextInitialized(ServletContextHandler.java:444)   atorg.eclipse.jetty.server.handler.ContextHandler.startContext(ContextHandler.java:789)   atorg.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:294)   atorg.eclipse.jetty.webapp.WebAppContext.startWebapp(WebAppContext.java:1343)   atorg.eclipse.jetty.maven.plugin.JettyWebAppContext.startWebapp(JettyWebAppContext.java:296)   atorg.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1336)   atorg.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:741)   atorg.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:499)   atorg.eclipse.jetty.maven.plugin.JettyWebAppContext.doStart(JettyWebAppContext.java:365)   atorg.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)   atorg.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:132)   atorg.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:114)   atorg.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:61)   atorg.eclipse.jetty.server.handler.ContextHandlerCollection.doStart(ContextHandlerCollection.java:163)   atorg.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)   atorg.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:132)   atorg.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:114)   atorg.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:61)   atorg.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)   atorg.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:132)   atorg.eclipse.jetty.server.Server.start(Server.java:387)   atorg.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:114)   atorg.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:61)   atorg.eclipse.jetty.server.Server.doStart(Server.java:354)   atorg.eclipse.jetty.maven.plugin.JettyServer.doStart(JettyServer.java:73)   atorg.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)   atorg.eclipse.jetty.maven.plugin.AbstractJettyMojo.startJetty(AbstractJettyMojo.java:534)   atorg.eclipse.jetty.maven.plugin.AbstractJettyMojo.execute(AbstractJettyMojo.java:357)   atorg.eclipse.jetty.maven.plugin.JettyRunMojo.execute(JettyRunMojo.java:167)   atorg.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)   atorg.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:207)   atorg.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)   atorg.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)   atorg.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)   atorg.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)   atorg.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)   atorg.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)   atorg.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307)   atorg.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193)   atorg.apache.maven.DefaultMaven.execute(DefaultMaven.java:106)   atorg.apache.maven.cli.MavenCli.execute(MavenCli.java:863)   atorg.apache.maven.cli.MavenCli.doMain(MavenCli.java:288)   atorg.apache.maven.cli.MavenCli.main(MavenCli.java:199)   atsun.reflect.NativeMethodAccessorImpl.invoke0(NativeMethod)   atsun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)   atsun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)   atjava.lang.reflect.Method.invoke(Method.java:601)   atorg.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)   atorg.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)   atorg.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)   atorg.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)Causedby:com.github.diamond.client.ConfigurationRuntimeException:本地没有备份配置数据,PropertiesConfiguration初始化失败。   atcom.github.diamond.client.PropertiesConfiguration.connectServer(PropertiesConfiguration.java:117)   atcom.github.diamond.client.PropertiesConfiguration.<init>(PropertiesConfiguration.java:54)   atcom.github.diamond.client.OverridablePropertiesConfiguration.<init>(OverridablePropertiesConfiguration.java:9)   atcom.htz.common.HtzConfig.<init>(HtzConfig.java:19)   atcom.htz.common.HtzConfig.fromClasspath(HtzConfig.java:50)   atcom.htz.common.HtzConfig.fromClasspath(HtzConfig.java:46)   athtz.core.common.Global.<clinit>(Global.java:18)   ...54more FAILEDorg.eclipse.jetty.server.handler.HandlerCollection@210ea83d[org.eclipse.jetty.server.handler.ContextHandlerCollection@7ec0c236[o.e.j.m.p.JettyWebAppContext@473cf652{/,file:/D:/HuiTouZi/GZ-worksppace/htz/src/main/webapp/,STARTING}{file:/D:/HuiTouZi/GZ-worksppace/htz/src/main/webapp/}],org.eclipse.jetty.server.handler.DefaultHandler@49474dbf,org.eclipse.jetty.server.handler.RequestLogHandler@68415c2e]:java.lang.ExceptionInInitializerError  FAILEDorg.eclipse.jetty.maven.plugin.JettyServer@580bdd96:java.lang.ExceptionInInitializerError  Failedtoexecutegoalorg.eclipse.jetty:jetty-maven-plugin:9.2.4.v20141103:run(default-cli)onprojecthtz:Executiondefault-cliofgoalorg.eclipse.jetty:jetty-maven-plugin:9.2.4.v20141103:runfailed:AnAPIincompatibilitywasencounteredwhileexecutingorg.eclipse.jetty:jetty-maven-plugin:9.2.4.v20141103:run:java.lang.ExceptionInInitializerError:null
爱吃鱼的程序员 2020-06-09 15:42:40 0 浏览量 回答数 0

云产品推荐

上海奇点人才服务相关的云产品 小程序定制 上海微企信息技术相关的云产品 国内短信套餐包 ECS云服务器安全配置相关的云产品 开发者问答 阿里云建站 自然场景识别相关的云产品 万网 小程序开发制作 视频内容分析 视频集锦 代理记账服务 阿里云AIoT