Apache Derby Network Server - 10.2.2.0 - (485682) 已启动并且已准备好 2008-07-29 14:27:16.171 GMT 时在端口 1527 上接受连接

作者在使用MyEclipse启动Tomcat时遇到控制台显示Apache Derby Network Server启动的问题。原因是MyEclipse默认启动了内置的Derby服务而非Tomcat。解决办法是选择正确的启动图标以确保启动的是Tomcat服务。

原贴来自:http://blog.youkuaiyun.com/wienne0417/archive/2009/03/02/3950356.aspx

 

 

Apache Derby Network Server - 10.2.2.0 - (485682) 已启动并且已准备好 2008-07-29 14:27:16.171 GMT 时在端口 1527 上接受连接

昨天在myEclipse里面启动Tomcat时控制台打出上面一串东西,不知道咋回事。
操作如下:
1.在Tomcat下部署了一个项目
2.启动Tomcat ,控制台就报了上面一串东西。(之前还是好好的)

最后看到原来点击启动服务的图标时,myeclipse启动的是其自带的myeclipse derby,所以就出了上面一串东西。我们只要选择启动服务的图标中的tomcat启动就可以了

[root@yfw ~]# cd /opt/openfire [root@yfw openfire]# sudo systemctl stop openfire [root@yfw openfire]# ps aux | grep openfire | grep -v grep [root@yfw openfire]# rm -f /opt/openfire/logs/openfire.pid [root@yfw openfire]# ss -tulnp | grep ':9090\|:5222' [root@yfw openfire]# sudo systemctl start openfire [root@yfw openfire]# tail -f /opt/openfire/logs/nohup.out at java.lang.reflect.ReflectAccess.newInstance(ReflectAccess.java:128) [?:?] at jdk.internal.reflect.ReflectionFactory.newInstance(ReflectionFactory.java:347) [?:?] at java.lang.Class.newInstance(Class.java:645) [?:?] at org.jivesoftware.openfire.starter.ServerStarter.start(ServerStarter.java:92) [startup.jar:5.0.2] at org.jivesoftware.openfire.starter.ServerStarter.main(ServerStarter.java:56) [startup.jar:5.0.2] Caused by: java.sql.SQLException: ConnectionManager.getConnection() failed to obtain a connection after 11 attempts. The exception from the last attempt is as follows: java.sql.SQLException: Failed to create database '/opt/openfire/embedded-db', see the next exception for details. at org.jivesoftware.database.DbConnectionManager.getConnection(DbConnectionManager.java:204) ~[xmppserver-5.0.2.jar:5.0.2] at org.jivesoftware.openfire.XMPPServer.verifyDataSource(XMPPServer.java:1010) ~[xmppserver-5.0.2.jar:5.0.2] ... 11 more 启动服务器出错。有关详细信息,请查看日志件。 Halting server... Server halted 16:25:21.035 [main] ERROR org.jivesoftware.database.DbConnectionManager - Failed to create database '/opt/openfire/embedded-db', see the next exception for details. java.sql.SQLException: Failed to create database '/opt/openfire/embedded-db', see the next exception for details. at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(Unknown Source) ~[derby-10.14.2.0.jar:?] at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(Unknown Source) ~[derby-10.14.2.0.jar:?] at org.apache.derby.impl.jdbc.Util.seeNextException(Unknown Source) ~[derby-10.14.2.0.jar:?] at org.apache.derby.impl.jdbc.EmbedConnection.createDatabase(Unknown Source) ~[derby-10.14.2.0.jar:?] at org.apache.derby.impl.jdbc.EmbedConnection.<init>(Unknown Source) ~[derby-10.14.2.0.jar:?] at org.apache.derby.jdbc.InternalDriver$1.run(Unknown Source) ~[derby-10.14.2.0.jar:?] at org.apache.derby.jdbc.InternalDriver$1.run(Unknown Source) ~[derby-10.14.2.0.jar:?] at java.security.AccessController.doPrivileged(AccessController.java:569) ~[?:?] at org.apache.derby.jdbc.InternalDriver.getNewEmbedConnection(Unknown Source) ~[derby-10.14.2.0.jar:?] at org.apache.derby.jdbc.InternalDriver.connect(Unknown Source) ~[derby-10.14.2.0.jar:?] at org.apache.derby.jdbc.InternalDriver.connect(Unknown Source) ~[derby-10.14.2.0.jar:?] at org.apache.derby.jdbc.AutoloadedDriver.connect(Unknown Source) ~[derby-10.14.2.0.jar:?] at java.sql.DriverManager.getConnection(DriverManager.java:681) ~[java.sql:?] at java.sql.DriverManager.getConnection(DriverManager.java:252) ~[java.sql:?] at org.apache.commons.dbcp2.DriverManagerConnectionFactory.createConnection(DriverManagerConnectionFactory.java:119) ~[commons-dbcp2-2.9.0.jar:2.9.0] at org.apache.commons.dbcp2.PoolableConnectionFactory.makeObject(PoolableConnectionFactory.java:374) ~[commons-dbcp2-2.9.0.jar:2.9.0] at org.apache.commons.pool2.impl.GenericObjectPool.create(GenericObjectPool.java:918) ~[commons-pool2-2.9.0.jar:2.9.0] at org.apache.commons.pool2.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:431) ~[commons-pool2-2.9.0.jar:2.9.0] at org.apache.commons.pool2.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:356) ~[commons-pool2-2.9.0.jar:2.9.0] at org.apache.commons.dbcp2.PoolingDataSource.getConnection(PoolingDataSource.java:141) ~[commons-dbcp2-2.9.0.jar:2.9.0] at org.jivesoftware.database.DefaultConnectionProvider.getConnection(DefaultConnectionProvider.java:88) ~[xmppserver-5.0.2.jar:5.0.2] at org.jivesoftware.database.DbConnectionManager.setConnectionProvider(DbConnectionManager.java:656) [xmppserver-5.0.2.jar:5.0.2] at org.jivesoftware.database.DbConnectionManager.ensureConnectionProvider(DbConnectionManager.java:101) [xmppserver-5.0.2.jar:5.0.2] at org.jivesoftware.database.DbConnectionManager.getConnection(DbConnectionManager.java:162) [xmppserver-5.0.2.jar:5.0.2] at org.jivesoftware.util.JiveProperties.loadProperties(JiveProperties.java:472) [xmppserver-5.0.2.jar:5.0.2] at org.jivesoftware.util.JiveProperties.init(JiveProperties.java:108) [xmppserver-5.0.2.jar:5.0.2] at org.jivesoftware.util.JiveProperties.getInstance(JiveProperties.java:84) [xmppserver-5.0.2.jar:5.0.2] at org.jivesoftware.util.JiveGlobals.getProperty(JiveGlobals.java:547) [xmppserver-5.0.2.jar:5.0.2] at org.jivesoftware.util.cache.CacheFactory.<clinit>(CacheFactory.java:102) [xmppserver-5.0.2.jar:5.0.2] at org.jivesoftware.openfire.XMPPServer.initialize(XMPPServer.java:381) [xmppserver-5.0.2.jar:5.0.2] at org.jivesoftware.openfire.XMPPServer.start(XMPPServer.java:658) [xmppserver-5.0.2.jar:5.0.2] at org.jivesoftware.openfire.XMPPServer.<init>(XMPPServer.java:221) [xmppserver-5.0.2.jar:5.0.2] at jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[?:?] at jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:77) [?:?] at jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) [?:?] at java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:499) [?:?] at java.lang.reflect.ReflectAccess.newInstance(ReflectAccess.java:128) [?:?] at jdk.internal.reflect.ReflectionFactory.newInstance(ReflectionFactory.java:347) [?:?] at java.lang.Class.newInstance(Class.java:645) [?:?] at org.jivesoftware.openfire.starter.ServerStarter.start(ServerStarter.java:92) [startup.jar:5.0.2] at org.jivesoftware.openfire.starter.ServerStarter.main(ServerStarter.java:56) [startup.jar:5.0.2] Caused by: org.apache.derby.iapi.error.StandardException: Failed to create database '/opt/openfire/embedded-db', see the next exception for details. at org.apache.derby.iapi.error.StandardException.newException(Unknown Source) ~[derby-10.14.2.0.jar:?] at org.apache.derby.impl.jdbc.SQLExceptionFactory.wrapArgsForTransportAcrossDRDA(Unknown Source) ~[derby-10.14.2.0.jar:?] ... 41 more Caused by: org.apache.derby.iapi.error.StandardException: Directory /opt/openfire/embedded-db already exists. at org.apache.derby.iapi.error.StandardException.newException(Unknown Source) ~[derby-10.14.2.0.jar:?] at org.apache.derby.iapi.error.StandardException.newException(Unknown Source) ~[derby-10.14.2.0.jar:?] at org.apache.derby.impl.services.monitor.StorageFactoryService$10.run(Unknown Source) ~[derby-10.14.2.0.jar:?] at java.security.AccessController.doPrivileged(AccessController.java:569) ~[?:?] at org.apache.derby.impl.services.monitor.StorageFactoryService.createServiceRoot(Unknown Source) ~[derby-10.14.2.0.jar:?] at org.apache.derby.impl.services.monitor.BaseMonitor.bootService(Unknown Source) ~[derby-10.14.2.0.jar:?] at org.apache.derby.impl.services.monitor.BaseMonitor.createPersistentService(Unknown Source) ~[derby-10.14.2.0.jar:?] at org.apache.derby.impl.services.monitor.FileMonitor.createPersistentService(Unknown Source) ~[derby-10.14.2.0.jar:?] at org.apache.derby.iapi.services.monitor.Monitor.createPersistentService(Unknown Source) ~[derby-10.14.2.0.jar:?] at org.apache.derby.impl.jdbc.EmbedConnection$5.run(Unknown Source) ~[derby-10.14.2.0.jar:?] at java.security.AccessController.doPrivileged(AccessController.java:569) ~[?:?] at org.apache.derby.impl.jdbc.EmbedConnection.createPersistentService(Unknown Source) ~[derby-10.14.2.0.jar:?] ... 38 more 16:25:23.579 [main] ERROR org.jivesoftware.util.JiveProperties - ConnectionManager.getConnection() failed to obtain a connection after 11 attempts. The exception from the last attempt is as follows: java.sql.SQLException: Failed to create database '/opt/openfire/embedded-db', see the next exception for details. java.sql.SQLException: ConnectionManager.getConnection() failed to obtain a connection after 11 attempts. The exception from the last attempt is as follows: java.sql.SQLException: Failed to create database '/opt/openfire/embedded-db', see the next exception for details. at org.jivesoftware.database.DbConnectionManager.getConnection(DbConnectionManager.java:204) ~[xmppserver-5.0.2.jar:5.0.2] at org.jivesoftware.util.JiveProperties.loadProperties(JiveProperties.java:472) [xmppserver-5.0.2.jar:5.0.2] at org.jivesoftware.util.JiveProperties.init(JiveProperties.java:108) [xmppserver-5.0.2.jar:5.0.2] at org.jivesoftware.util.JiveProperties.getInstance(JiveProperties.java:84) [xmppserver-5.0.2.jar:5.0.2] at org.jivesoftware.util.JiveGlobals.getProperty(JiveGlobals.java:547) [xmppserver-5.0.2.jar:5.0.2] at org.jivesoftware.util.cache.CacheFactory.<clinit>(CacheFactory.java:102) [xmppserver-5.0.2.jar:5.0.2] at org.jivesoftware.openfire.XMPPServer.initialize(XMPPServer.java:381) [xmppserver-5.0.2.jar:5.0.2] at org.jivesoftware.openfire.XMPPServer.start(XMPPServer.java:658) [xmppserver-5.0.2.jar:5.0.2] at org.jivesoftware.openfire.XMPPServer.<init>(XMPPServer.java:221) [xmppserver-5.0.2.jar:5.0.2] at jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[?:?] at jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:77) [?:?] at jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) [?:?] at java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:499) [?:?] at java.lang.reflect.ReflectAccess.newInstance(ReflectAccess.java:128) [?:?] at jdk.internal.reflect.ReflectionFactory.newInstance(ReflectionFactory.java:347) [?:?] at java.lang.Class.newInstance(Class.java:645) [?:?] at org.jivesoftware.openfire.starter.ServerStarter.start(ServerStarter.java:92) [startup.jar:5.0.2] at org.jivesoftware.openfire.starter.ServerStarter.main(ServerStarter.java:56) [startup.jar:5.0.2] Database setup or configuration error: Please verify your database settings and check the logs/openfire.log file for detailed error messages. 16:25:26.205 [main] ERROR org.jivesoftware.openfire.XMPPServer - Database could not be accessed java.sql.SQLException: ConnectionManager.getConnection() failed to obtain a connection after 11 attempts. The exception from the last attempt is as follows: java.sql.SQLException: Failed to create database '/opt/openfire/embedded-db', see the next exception for details. at org.jivesoftware.database.DbConnectionManager.getConnection(DbConnectionManager.java:204) ~[xmppserver-5.0.2.jar:5.0.2] at org.jivesoftware.openfire.XMPPServer.verifyDataSource(XMPPServer.java:1010) [xmppserver-5.0.2.jar:5.0.2] at org.jivesoftware.openfire.XMPPServer.start(XMPPServer.java:666) [xmppserver-5.0.2.jar:5.0.2] at org.jivesoftware.openfire.XMPPServer.<init>(XMPPServer.java:221) [xmppserver-5.0.2.jar:5.0.2] at jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[?:?] at jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:77) [?:?] at jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) [?:?] at java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:499) [?:?] at java.lang.reflect.ReflectAccess.newInstance(ReflectAccess.java:128) [?:?] at jdk.internal.reflect.ReflectionFactory.newInstance(ReflectionFactory.java:347) [?:?] at java.lang.Class.newInstance(Class.java:645) [?:?] at org.jivesoftware.openfire.starter.ServerStarter.start(ServerStarter.java:92) [startup.jar:5.0.2] at org.jivesoftware.openfire.starter.ServerStarter.main(ServerStarter.java:56) [startup.jar:5.0.2] java.lang.IllegalArgumentException: java.sql.SQLException: ConnectionManager.getConnection() failed to obtain a connection after 11 attempts. The exception from the last attempt is as follows: java.sql.SQLException: Failed to create database '/opt/openfire/embedded-db', see the next exception for details. at org.jivesoftware.openfire.XMPPServer.verifyDataSource(XMPPServer.java:1020) at org.jivesoftware.openfire.XMPPServer.start(XMPPServer.java:666) at org.jivesoftware.openfire.XMPPServer.<init>(XMPPServer.java:221) at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:77) at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:499) at java.base/java.lang.reflect.ReflectAccess.newInstance(ReflectAccess.java:128) at java.base/jdk.internal.reflect.ReflectionFactory.newInstance(ReflectionFactory.java:347) at java.base/java.lang.Class.newInstance(Class.java:645) at org.jivesoftware.openfire.starter.ServerStarter.start(ServerStarter.java:92) at org.jivesoftware.openfire.starter.ServerStarter.main(ServerStarter.java:56) Caused by: java.sql.SQLException: ConnectionManager.getConnection() failed to obtain a connection after 11 attempts. The exception from the last attempt is as follows: java.sql.SQLException: Failed to create database '/opt/openfire/embedded-db', see the next exception for details. at org.jivesoftware.database.DbConnectionManager.getConnection(DbConnectionManager.java:204) at org.jivesoftware.openfire.XMPPServer.verifyDataSource(XMPPServer.java:1010) ... 11 more 16:25:26.206 [main] ERROR org.jivesoftware.openfire.XMPPServer - java.sql.SQLException: ConnectionManager.getConnection() failed to obtain a connection after 11 attempts. The exception from the last attempt is as follows: java.sql.SQLException: Failed to create database '/opt/openfire/embedded-db', see the next exception for details. java.lang.IllegalArgumentException: java.sql.SQLException: ConnectionManager.getConnection() failed to obtain a connection after 11 attempts. The exception from the last attempt is as follows: java.sql.SQLException: Failed to create database '/opt/openfire/embedded-db', see the next exception for details. at org.jivesoftware.openfire.XMPPServer.verifyDataSource(XMPPServer.java:1020) ~[xmppserver-5.0.2.jar:5.0.2] at org.jivesoftware.openfire.XMPPServer.start(XMPPServer.java:666) [xmppserver-5.0.2.jar:5.0.2] at org.jivesoftware.openfire.XMPPServer.<init>(XMPPServer.java:221) [xmppserver-5.0.2.jar:5.0.2] at jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[?:?] at jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:77) [?:?] at jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) [?:?] at java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:499) [?:?] at java.lang.reflect.ReflectAccess.newInstance(ReflectAccess.java:128) [?:?] at jdk.internal.reflect.ReflectionFactory.newInstance(ReflectionFactory.java:347) [?:?] at java.lang.Class.newInstance(Class.java:645) [?:?] at org.jivesoftware.openfire.starter.ServerStarter.start(ServerStarter.java:92) [startup.jar:5.0.2] at org.jivesoftware.openfire.starter.ServerStarter.main(ServerStarter.java:56) [startup.jar:5.0.2] Caused by: java.sql.SQLException: ConnectionManager.getConnection() failed to obtain a connection after 11 attempts. The exception from the last attempt is as follows: java.sql.SQLException: Failed to create database '/opt/openfire/embedded-db', see the next exception for details. at org.jivesoftware.database.DbConnectionManager.getConnection(DbConnectionManager.java:204) ~[xmppserver-5.0.2.jar:5.0.2] at org.jivesoftware.openfire.XMPPServer.verifyDataSource(XMPPServer.java:1010) ~[xmppserver-5.0.2.jar:5.0.2] ... 11 more 启动服务器出错。有关详细信息,请查看日志文件。 tail: /opt/openfire/logs/nohup.out: file truncated 16:25:27.771 [main] ERROR org.jivesoftware.util.JiveGlobals - Unable to load default Openfire properties from: /opt/openfire/conf/openfire.xml java.io.IOException: XML properties file must be writable: openfire.xml at org.jivesoftware.util.XMLProperties.<init>(XMLProperties.java:156) ~[xmppserver-5.0.2.jar:5.0.2] at org.jivesoftware.util.JiveGlobals.loadOpenfireProperties(JiveGlobals.java:1276) [xmppserver-5.0.2.jar:5.0.2] at org.jivesoftware.util.JiveGlobals.getXMLProperty(JiveGlobals.java:308) [xmppserver-5.0.2.jar:5.0.2] at org.jivesoftware.openfire.XMPPServer.initialize(XMPPServer.java:367) [xmppserver-5.0.2.jar:5.0.2] at org.jivesoftware.openfire.XMPPServer.start(XMPPServer.java:658) [xmppserver-5.0.2.jar:5.0.2] at org.jivesoftware.openfire.XMPPServer.<init>(XMPPServer.java:221) [xmppserver-5.0.2.jar:5.0.2] at jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[?:?] at jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:77) [?:?] at jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) [?:?] at java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:499) [?:?] at java.lang.reflect.ReflectAccess.newInstance(ReflectAccess.java:128) [?:?] at jdk.internal.reflect.ReflectionFactory.newInstance(ReflectionFactory.java:347) [?:?] at java.lang.Class.newInstance(Class.java:645) [?:?] at org.jivesoftware.openfire.starter.ServerStarter.start(ServerStarter.java:92) [startup.jar:5.0.2] at org.jivesoftware.openfire.starter.ServerStarter.main(ServerStarter.java:56) [startup.jar:5.0.2] Openfire 5.0.2 [2025年11月15日 下午4:25:27] 管理控制台正在侦听 http://124.71.230.244:9090 Halting server... Server halted Halting server... Server halted 16:25:39.285 [main] ERROR org.jivesoftware.database.DbConnectionManager - Failed to create database '/opt/openfire/embedded-db', see the next exception for details. java.sql.SQLException: Failed to create database '/opt/openfire/embedded-db', see the next exception for details. at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(Unknown Source) ~[derby-10.14.2.0.jar:?] at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(Unknown Source) ~[derby-10.14.2.0.jar:?] at org.apache.derby.impl.jdbc.Util.seeNextException(Unknown Source) ~[derby-10.14.2.0.jar:?] at org.apache.derby.impl.jdbc.EmbedConnection.createDatabase(Unknown Source) ~[derby-10.14.2.0.jar:?] at org.apache.derby.impl.jdbc.EmbedConnection.<init>(Unknown Source) ~[derby-10.14.2.0.jar:?] at org.apache.derby.jdbc.InternalDriver$1.run(Unknown Source) ~[derby-10.14.2.0.jar:?] at org.apache.derby.jdbc.InternalDriver$1.run(Unknown Source) ~[derby-10.14.2.0.jar:?] at java.security.AccessController.doPrivileged(AccessController.java:569) ~[?:?] at org.apache.derby.jdbc.InternalDriver.getNewEmbedConnection(Unknown Source) ~[derby-10.14.2.0.jar:?] at org.apache.derby.jdbc.InternalDriver.connect(Unknown Source) ~[derby-10.14.2.0.jar:?] at org.apache.derby.jdbc.InternalDriver.connect(Unknown Source) ~[derby-10.14.2.0.jar:?] at org.apache.derby.jdbc.AutoloadedDriver.connect(Unknown Source) ~[derby-10.14.2.0.jar:?] at java.sql.DriverManager.getConnection(DriverManager.java:681) ~[java.sql:?] at java.sql.DriverManager.getConnection(DriverManager.java:252) ~[java.sql:?] at org.apache.commons.dbcp2.DriverManagerConnectionFactory.createConnection(DriverManagerConnectionFactory.java:119) ~[commons-dbcp2-2.9.0.jar:2.9.0] at org.apache.commons.dbcp2.PoolableConnectionFactory.makeObject(PoolableConnectionFactory.java:374) ~[commons-dbcp2-2.9.0.jar:2.9.0] at org.apache.commons.pool2.impl.GenericObjectPool.create(GenericObjectPool.java:918) ~[commons-pool2-2.9.0.jar:2.9.0] at org.apache.commons.pool2.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:431) ~[commons-pool2-2.9.0.jar:2.9.0] at org.apache.commons.pool2.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:356) ~[commons-pool2-2.9.0.jar:2.9.0] at org.apache.commons.dbcp2.PoolingDataSource.getConnection(PoolingDataSource.java:141) ~[commons-dbcp2-2.9.0.jar:2.9.0] at org.jivesoftware.database.DefaultConnectionProvider.getConnection(DefaultConnectionProvider.java:88) ~[xmppserver-5.0.2.jar:5.0.2] at org.jivesoftware.database.DbConnectionManager.setConnectionProvider(DbConnectionManager.java:656) [xmppserver-5.0.2.jar:5.0.2] at org.jivesoftware.database.DbConnectionManager.ensureConnectionProvider(DbConnectionManager.java:101) [xmppserver-5.0.2.jar:5.0.2] at org.jivesoftware.database.DbConnectionManager.getConnection(DbConnectionManager.java:162) [xmppserver-5.0.2.jar:5.0.2] at org.jivesoftware.util.JiveProperties.loadProperties(JiveProperties.java:472) [xmppserver-5.0.2.jar:5.0.2] at org.jivesoftware.util.JiveProperties.init(JiveProperties.java:108) [xmppserver-5.0.2.jar:5.0.2] at org.jivesoftware.util.JiveProperties.getInstance(JiveProperties.java:84) [xmppserver-5.0.2.jar:5.0.2] at org.jivesoftware.util.JiveGlobals.getProperty(JiveGlobals.java:547) [xmppserver-5.0.2.jar:5.0.2] at org.jivesoftware.util.cache.CacheFactory.<clinit>(CacheFactory.java:102) [xmppserver-5.0.2.jar:5.0.2] at org.jivesoftware.openfire.XMPPServer.initialize(XMPPServer.java:381) [xmppserver-5.0.2.jar:5.0.2] at org.jivesoftware.openfire.XMPPServer.start(XMPPServer.java:658) [xmppserver-5.0.2.jar:5.0.2] at org.jivesoftware.openfire.XMPPServer.<init>(XMPPServer.java:221) [xmppserver-5.0.2.jar:5.0.2] at jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[?:?] at jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:77) [?:?] at jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) [?:?] at java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:499) [?:?] at java.lang.reflect.ReflectAccess.newInstance(ReflectAccess.java:128) [?:?] at jdk.internal.reflect.ReflectionFactory.newInstance(ReflectionFactory.java:347) [?:?] at java.lang.Class.newInstance(Class.java:645) [?:?] at org.jivesoftware.openfire.starter.ServerStarter.start(ServerStarter.java:92) [startup.jar:5.0.2] at org.jivesoftware.openfire.starter.ServerStarter.main(ServerStarter.java:56) [startup.jar:5.0.2] Caused by: org.apache.derby.iapi.error.StandardException: Failed to create database '/opt/openfire/embedded-db', see the next exception for details. at org.apache.derby.iapi.error.StandardException.newException(Unknown Source) ~[derby-10.14.2.0.jar:?] at org.apache.derby.impl.jdbc.SQLExceptionFactory.wrapArgsForTransportAcrossDRDA(Unknown Source) ~[derby-10.14.2.0.jar:?] ... 41 more Caused by: org.apache.derby.iapi.error.StandardException: Directory /opt/openfire/embedded-db already exists. at org.apache.derby.iapi.error.StandardException.newException(Unknown Source) ~[derby-10.14.2.0.jar:?] at org.apache.derby.iapi.error.StandardException.newException(Unknown Source) ~[derby-10.14.2.0.jar:?] at org.apache.derby.impl.services.monitor.StorageFactoryService$10.run(Unknown Source) ~[derby-10.14.2.0.jar:?] at java.security.AccessController.doPrivileged(AccessController.java:569) ~[?:?] at org.apache.derby.impl.services.monitor.StorageFactoryService.createServiceRoot(Unknown Source) ~[derby-10.14.2.0.jar:?] at org.apache.derby.impl.services.monitor.BaseMonitor.bootService(Unknown Source) ~[derby-10.14.2.0.jar:?] at org.apache.derby.impl.services.monitor.BaseMonitor.createPersistentService(Unknown Source) ~[derby-10.14.2.0.jar:?] at org.apache.derby.impl.services.monitor.FileMonitor.createPersistentService(Unknown Source) ~[derby-10.14.2.0.jar:?] at org.apache.derby.iapi.services.monitor.Monitor.createPersistentService(Unknown Source) ~[derby-10.14.2.0.jar:?] at org.apache.derby.impl.jdbc.EmbedConnection$5.run(Unknown Source) ~[derby-10.14.2.0.jar:?] at java.security.AccessController.doPrivileged(AccessController.java:569) ~[?:?] at org.apache.derby.impl.jdbc.EmbedConnection.createPersistentService(Unknown Source) ~[derby-10.14.2.0.jar:?] ... 38 more 16:25:41.834 [main] ERROR org.jivesoftware.util.JiveProperties - ConnectionManager.getConnection() failed to obtain a connection after 11 attempts. The exception from the last attempt is as follows: java.sql.SQLException: Failed to create database '/opt/openfire/embedded-db', see the next exception for details. java.sql.SQLException: ConnectionManager.getConnection() failed to obtain a connection after 11 attempts. The exception from the last attempt is as follows: java.sql.SQLException: Failed to create database '/opt/openfire/embedded-db', see the next exception for details. at org.jivesoftware.database.DbConnectionManager.getConnection(DbConnectionManager.java:204) ~[xmppserver-5.0.2.jar:5.0.2] at org.jivesoftware.util.JiveProperties.loadProperties(JiveProperties.java:472) [xmppserver-5.0.2.jar:5.0.2] at org.jivesoftware.util.JiveProperties.init(JiveProperties.java:108) [xmppserver-5.0.2.jar:5.0.2] at org.jivesoftware.util.JiveProperties.getInstance(JiveProperties.java:84) [xmppserver-5.0.2.jar:5.0.2] at org.jivesoftware.util.JiveGlobals.getProperty(JiveGlobals.java:547) [xmppserver-5.0.2.jar:5.0.2] at org.jivesoftware.util.cache.CacheFactory.<clinit>(CacheFactory.java:102) [xmppserver-5.0.2.jar:5.0.2] at org.jivesoftware.openfire.XMPPServer.initialize(XMPPServer.java:381) [xmppserver-5.0.2.jar:5.0.2] at org.jivesoftware.openfire.XMPPServer.start(XMPPServer.java:658) [xmppserver-5.0.2.jar:5.0.2] at org.jivesoftware.openfire.XMPPServer.<init>(XMPPServer.java:221) [xmppserver-5.0.2.jar:5.0.2] at jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[?:?] at jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:77) [?:?] at jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) [?:?] at java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:499) [?:?] at java.lang.reflect.ReflectAccess.newInstance(ReflectAccess.java:128) [?:?] at jdk.internal.reflect.ReflectionFactory.newInstance(ReflectionFactory.java:347) [?:?] at java.lang.Class.newInstance(Class.java:645) [?:?] at org.jivesoftware.openfire.starter.ServerStarter.start(ServerStarter.java:92) [startup.jar:5.0.2] at org.jivesoftware.openfire.starter.ServerStarter.main(ServerStarter.java:56) [startup.jar:5.0.2] Database setup or configuration error: Please verify your database settings and check the logs/openfire.log file for detailed error messages. 16:25:44.521 [main] ERROR org.jivesoftware.openfire.XMPPServer - Database could not be accessed java.sql.SQLException: ConnectionManager.getConnection() failed to obtain a connection after 11 attempts. The exception from the last attempt is as follows: java.sql.SQLException: Failed to create database '/opt/openfire/embedded-db', see the next exception for details. at org.jivesoftware.database.DbConnectionManager.getConnection(DbConnectionManager.java:204) ~[xmppserver-5.0.2.jar:5.0.2] at org.jivesoftware.openfire.XMPPServer.verifyDataSource(XMPPServer.java:1010) [xmppserver-5.0.2.jar:5.0.2] at org.jivesoftware.openfire.XMPPServer.start(XMPPServer.java:666) [xmppserver-5.0.2.jar:5.0.2] at org.jivesoftware.openfire.XMPPServer.<init>(XMPPServer.java:221) [xmppserver-5.0.2.jar:5.0.2] at jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[?:?] at jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:77) [?:?] at jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) [?:?] at java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:499) [?:?] at java.lang.reflect.ReflectAccess.newInstance(ReflectAccess.java:128) [?:?] at jdk.internal.reflect.ReflectionFactory.newInstance(ReflectionFactory.java:347) [?:?] at java.lang.Class.newInstance(Class.java:645) [?:?] at org.jivesoftware.openfire.starter.ServerStarter.start(ServerStarter.java:92) [startup.jar:5.0.2] at org.jivesoftware.openfire.starter.ServerStarter.main(ServerStarter.java:56) [startup.jar:5.0.2] java.lang.IllegalArgumentException: java.sql.SQLException: ConnectionManager.getConnection() failed to obtain a connection after 11 attempts. The exception from the last attempt is as follows: java.sql.SQLException: Failed to create database '/opt/openfire/embedded-db', see the next exception for details. at org.jivesoftware.openfire.XMPPServer.verifyDataSource(XMPPServer.java:1020) at org.jivesoftware.openfire.XMPPServer.start(XMPPServer.java:666) at org.jivesoftware.openfire.XMPPServer.<init>(XMPPServer.java:221) at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:77) at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:499) at java.base/java.lang.reflect.ReflectAccess.newInstance(ReflectAccess.java:128) at java.base/jdk.internal.reflect.ReflectionFactory.newInstance(ReflectionFactory.java:347) at java.base/java.lang.Class.newInstance(Class.java:645) at org.jivesoftware.openfire.starter.ServerStarter.start(ServerStarter.java:92) at org.jivesoftware.openfire.starter.ServerStarter.main(ServerStarter.java:56) Caused by: java.sql.SQLException: ConnectionManager.getConnection() failed to obtain a connection after 11 attempts. The exception from the last attempt is as follows: java.sql.SQLException: Failed to create database '/opt/openfire/embedded-db', see the next exception for details. at org.jivesoftware.database.DbConnectionManager.getConnection(DbConnectionManager.java:204) at org.jivesoftware.openfire.XMPPServer.verifyDataSource(XMPPServer.java:1010) ... 11 more 16:25:44.522 [main] ERROR org.jivesoftware.openfire.XMPPServer - java.sql.SQLException: ConnectionManager.getConnection() failed to obtain a connection after 11 attempts. The exception from the last attempt is as follows: java.sql.SQLException: Failed to create database '/opt/openfire/embedded-db', see the next exception for details. java.lang.IllegalArgumentException: java.sql.SQLException: ConnectionManager.getConnection() failed to obtain a connection after 11 attempts. The exception from the last attempt is as follows: java.sql.SQLException: Failed to create database '/opt/openfire/embedded-db', see the next exception for details. at org.jivesoftware.openfire.XMPPServer.verifyDataSource(XMPPServer.java:1020) ~[xmppserver-5.0.2.jar:5.0.2] at org.jivesoftware.openfire.XMPPServer.start(XMPPServer.java:666) [xmppserver-5.0.2.jar:5.0.2] at org.jivesoftware.openfire.XMPPServer.<init>(XMPPServer.java:221) [xmppserver-5.0.2.jar:5.0.2] at jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[?:?] at jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:77) [?:?] at jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) [?:?] at java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:499) [?:?] at java.lang.reflect.ReflectAccess.newInstance(ReflectAccess.java:128) [?:?] at jdk.internal.reflect.ReflectionFactory.newInstance(ReflectionFactory.java:347) [?:?] at java.lang.Class.newInstance(Class.java:645) [?:?] at org.jivesoftware.openfire.starter.ServerStarter.start(ServerStarter.java:92) [startup.jar:5.0.2] at org.jivesoftware.openfire.starter.ServerStarter.main(ServerStarter.java:56) [startup.jar:5.0.2] Caused by: java.sql.SQLException: ConnectionManager.getConnection() failed to obtain a connection after 11 attempts. The exception from the last attempt is as follows: java.sql.SQLException: Failed to create database '/opt/openfire/embedded-db', see the next exception for details. at org.jivesoftware.database.DbConnectionManager.getConnection(DbConnectionManager.java:204) ~[xmppserver-5.0.2.jar:5.0.2] at org.jivesoftware.openfire.XMPPServer.verifyDataSource(XMPPServer.java:1010) ~[xmppserver-5.0.2.jar:5.0.2] ... 11 more 启动服务器出错。有关详细信息,请查看日志文件。 tail: /opt/openfire/logs/nohup.out: file truncated 16:25:45.770 [main] ERROR org.jivesoftware.util.JiveGlobals - Unable to load default Openfire properties from: /opt/openfire/conf/openfire.xml java.io.IOException: XML properties file must be writable: openfire.xml at org.jivesoftware.util.XMLProperties.<init>(XMLProperties.java:156) ~[xmppserver-5.0.2.jar:5.0.2] at org.jivesoftware.util.JiveGlobals.loadOpenfireProperties(JiveGlobals.java:1276) [xmppserver-5.0.2.jar:5.0.2] at org.jivesoftware.util.JiveGlobals.getXMLProperty(JiveGlobals.java:308) [xmppserver-5.0.2.jar:5.0.2] at org.jivesoftware.openfire.XMPPServer.initialize(XMPPServer.java:367) [xmppserver-5.0.2.jar:5.0.2] at org.jivesoftware.openfire.XMPPServer.start(XMPPServer.java:658) [xmppserver-5.0.2.jar:5.0.2] at org.jivesoftware.openfire.XMPPServer.<init>(XMPPServer.java:221) [xmppserver-5.0.2.jar:5.0.2] at jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[?:?] at jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:77) [?:?] at jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) [?:?] at java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:499) [?:?] at java.lang.reflect.ReflectAccess.newInstance(ReflectAccess.java:128) [?:?] at jdk.internal.reflect.ReflectionFactory.newInstance(ReflectionFactory.java:347) [?:?] at java.lang.Class.newInstance(Class.java:645) [?:?] at org.jivesoftware.openfire.starter.ServerStarter.start(ServerStarter.java:92) [startup.jar:5.0.2] at org.jivesoftware.openfire.starter.ServerStarter.main(ServerStarter.java:56) [startup.jar:5.0.2] Openfire 5.0.2 [2025年11月15日 下午4:25:45] 管理控制台正在侦听 http://ecs-124-71-230-244.compute.hwclouds-dns.com:9090 Halting server...
最新发布
11-16
你已经非常接近成功了!但目前 OpenFire 启动失败,**核心问题出在两个地方:** --- ## 🚨 核心错误分析 ### ❌ 错误 1:数据库无法创建(Derby) ```text Caused by: org.apache.derby.iapi.error.StandardException: Directory /opt/openfire/embedded-db already exists. ``` 👉 **说明:** Derby 数据库尝试创建 `/opt/openfire/embedded-db` 目录,但它已存在,并且权限不对或内容损坏。 --- ### ❌ 错误 2:配置文件不可写 ```text java.io.IOException: XML properties file must be writable: openfire.xml ``` 👉 **说明:** OpenFire 试图读取并初始化 `/opt/openfire/conf/openfire.xml`,但该文件或其所在目录没有写权限,导致无法保存配置。 --- ### ❌ 错误 3:服务反复启动又终止 ``` Halting server... Server halted ``` 这是由于数据库连接失败 → 初始化失败 → 主进程退出的连锁反应。 --- ## ✅ 解决方案:修复权限 + 清理残留数据 ### 🔧 步骤 1:停止 OpenFire 服务 ```bash sudo systemctl stop openfire ``` 确认无残留进程: ```bash ps aux | grep openfire | grep -v grep ``` 如果有,杀掉它: ```bash sudo kill -9 <PID> ``` --- ### 🔧 步骤 2:删除旧的 embedded-db(让 Derby 重新创建) > ⚠️ 注意:这会清除所有数据(用户、设置等),但由于你还没完成安装,所以没问题! ```bash rm -rf /opt/openfire/embedded-db ``` --- ### 🔧 步骤 3:确保 `conf/` 和 `logs/` 目录可被 `openfire` 用户写入 ```bash sudo chown -R openfire:openfire /opt/openfire/conf sudo chown -R openfire:openfire /opt/openfire/logs sudo chown -R openfire:openfire /opt/openfire/plugins sudo chown -R openfire:openfire /opt/openfire/lib ``` 特别检查 `openfire.xml` 是否存在且权限正确: ```bash ls -l /opt/openfire/conf/openfire.xml ``` 如果不存在,没关系,首次安装会自动生成。 如果存在但属主不对,删掉让它重建: ```bash rm -f /opt/openfire/conf/openfire.xml ``` --- ### 🔧 步骤 4:删除 .pid 文件(防止 systemd 误判) ```bash rm -f /opt/openfire/logs/openfire.pid ``` --- ### 🔧 步骤 5:重启 OpenFire 服务 ```bash sudo systemctl start openfire ``` --- ### 🔧 步骤 6:查看日志,等待 Setup 模式 ```bash tail -f /opt/openfire/logs/nohup.out ``` 你应该看到类似输出: ``` INFO [org.jivesoftware.admin.SetupFilter] Setup mode detected. Redirecting to setup page. ``` 或者: ``` Openfire 5.0.2 [日期间] Admin console listening at http://your-hostname:9090 ``` ✅ 这表示 Web 控制台已启动,等待你访问。 --- ### 🔍 补充:检查端口监听情况 ```bash ss -tulnp | grep :9090 ``` 应看到 Java 进程监听中。 --- ## 🌐 浏览器访问安装向导 打开浏览器,输入: 👉 [http://192.168.0.142:9090](http://192.168.0.142:9090) 你会进入以下流程: 1. **语言选择** → 选 “中文” 或 “English” 2. **设置向导 (Setup)** → 点击 "Continue" 3. **数据库设置**: - ✅ 推荐选择:**内嵌数据库(Embedded Database)** - 不要选 "Standard Database",除非你有 MySQL/PostgreSQL 4. **管理员账户设置**: - 设置用户名(如 admin) - 设置密码 - 邮箱可留空 5. **完成安装** --- ## 🛠️ 预防未来问题:确保 openfire 用户拥有完整权限 运行一次全面授权命令: ```bash sudo chown -R openfire:openfire /opt/openfire sudo chmod -R 755 /opt/openfire ``` > 💡 特别注意:`/opt/openfire` 下的所有子目录都必须允许 `openfire` 用户读写。 --- ## ✅ 总结操作清单 | 步骤 | 命令 | |------|------| | 1. 停止服务 | `sudo systemctl stop openfire` | | 2. 删除数据库 | `rm -rf /opt/openfire/embedded-db` | | 3. 删除配置文件 | `rm -f /opt/openfire/conf/openfire.xml` | | 4. 删除 pid 文件 | `rm -f /opt/openfire/logs/openfire.pid` | | 5. 修复权限 | `chown -R openfire:openfire /opt/openfire` | | 6. 启动服务 | `sudo systemctl start openfire` | | 7. 查看日志 | `tail -f /opt/openfire/logs/nohup.out` | | 8. 浏览器访问 | [http://192.168.0.142:9090](http://192.168.0.142:9090) | --- 🎯 **关键点回顾:** - OpenFire 必须能**写入 `/conf`、`/logs`、`/embedded-db`** - 第一次启动必须进入 **Setup Mode** 才能生成 `openfire.xml` - 使用 `systemctl` 管理服务,不要手动运行 `start.sh` - 出现 “Directory already exists” 是典型权限/残留问题 --- ###
评论 1
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值