[Netarchivesuite-users] Problems while starting NAS after server update

Meelis Mihhailov meelis at nlib.ee
Wed Oct 1 12:30:35 CEST 2014


Hi,

I have a problem starting NAS after server update (and restart) and hope 
someone can help me to resolve this issue :)

Server had java update as well and now NAS cannot start because of 
errors while connecting to derby database.

Using NAS 3.21 as a quickstart setup
Java version "1.6.0_31"
Server : Debian GNU/Linux 7

While using the "startall" script I get the following errors:

----------------------------------------------------------------------------------------------------------

Beginning database upgrade
log4j:WARN No appenders could be found for logger (com.mchange.v2.log.MLog).
log4j:WARN Please initialize the log4j system properly.
Exception in thread "main" dk.netarkivet.common.exceptions.IOFailure: 
Can't connect to database with DBurl: 
'jdbc:derby://localhost:8121/harvestDatabase/fullhddb' using driver 
'org.apache.derby.jdbc.ClientDriver'
SQLException trace:
SQL State:null
Error Code:0
java.sql.SQLException: Connections could not be acquired from the 
underlying database!
         at com.mchange.v2.sql.SqlUtils.toSQLException(SqlUtils.java:106)
         at 
com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool.checkoutPooledConnection(C3P0PooledConnectionPool.java:529)
         at 
com.mchange.v2.c3p0.impl.AbstractPoolBackedDataSource.getConnection(AbstractPoolBackedDataSource.java:128)
         at 
dk.netarkivet.harvester.datamodel.HarvestDBConnection.get(HarvestDBConnection.java:110)
         at 
dk.netarkivet.harvester.datamodel.DBSpecifics.updateTable(DBSpecifics.java:127)
         at 
dk.netarkivet.harvester.datamodel.DBSpecifics.updateTables(DBSpecifics.java:625)
         at 
dk.netarkivet.harvester.tools.HarvestdatabaseUpdateApplication.main(HarvestdatabaseUpdateApplication.java:45)
Caused by: com.mchange.v2.resourcepool.CannotAcquireResourceException: A 
ResourcePool could not acquire a resource from its primary factory or 
source.
         at 
com.mchange.v2.resourcepool.BasicResourcePool.awaitAvailable(BasicResourcePool.java:1319)
         at 
com.mchange.v2.resourcepool.BasicResourcePool.prelimCheckoutResource(BasicResourcePool.java:557)
         at 
com.mchange.v2.resourcepool.BasicResourcePool.checkoutResource(BasicResourcePool.java:477)
         at 
com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool.checkoutPooledConnection(C3P0PooledConnectionPool.java:525)
         ... 5 more
End of SQLException trace
         at 
dk.netarkivet.harvester.datamodel.HarvestDBConnection.get(HarvestDBConnection.java:119)
         at 
dk.netarkivet.harvester.datamodel.DBSpecifics.updateTable(DBSpecifics.java:127)
         at 
dk.netarkivet.harvester.datamodel.DBSpecifics.updateTables(DBSpecifics.java:625)
         at 
dk.netarkivet.harvester.tools.HarvestdatabaseUpdateApplication.main(HarvestdatabaseUpdateApplication.java:45)
Caused by: java.sql.SQLException: Connections could not be acquired from 
the underlying database!
         at com.mchange.v2.sql.SqlUtils.toSQLException(SqlUtils.java:106)
         at 
com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool.checkoutPooledConnection(C3P0PooledConnectionPool.java:529)
         at 
com.mchange.v2.c3p0.impl.AbstractPoolBackedDataSource.getConnection(AbstractPoolBackedDataSource.java:128)
         at 
dk.netarkivet.harvester.datamodel.HarvestDBConnection.get(HarvestDBConnection.java:110)
         ... 3 more
Caused by: com.mchange.v2.resourcepool.CannotAcquireResourceException: A 
ResourcePool could not acquire a resource from its primary factory or 
source.
         at 
com.mchange.v2.resourcepool.BasicResourcePool.awaitAvailable(BasicResourcePool.java:1319)
         at 
com.mchange.v2.resourcepool.BasicResourcePool.prelimCheckoutResource(BasicResourcePool.java:557)
         at 
com.mchange.v2.resourcepool.BasicResourcePool.checkoutResource(BasicResourcePool.java:477)
         at 
com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool.checkoutPooledConnection(C3P0PooledConnectionPool.java:525)
         ... 5 more
----------------------------------------------------------------------------------------------------------

and etc.

After doing some investigation I found in derby.log:


----------------------------------------------------------------------------------------------------------
Wed Oct 01 13:09:23 EEST 2014 : access denied (java.net.SocketPermission 
localhost:8121 listen,resolve)
java.security.AccessControlException: access denied 
(java.net.SocketPermission localhost:8121 listen,resolve)
         at 
java.security.AccessControlContext.checkPermission(AccessControlContext.java:399)
         at 
java.security.AccessController.checkPermission(AccessController.java:557)
         at 
java.lang.SecurityManager.checkPermission(SecurityManager.java:549)
         at java.lang.SecurityManager.checkListen(SecurityManager.java:1134)
         at java.net.ServerSocket.bind(ServerSocket.java:335)
         at java.net.ServerSocket.<init>(ServerSocket.java:202)
         at 
javax.net.DefaultServerSocketFactory.createServerSocket(ServerSocketFactory.java:189)
         at 
org.apache.derby.impl.drda.NetworkServerControlImpl.createServerSocket(Unknown 
Source)
         at 
org.apache.derby.impl.drda.NetworkServerControlImpl.access$000(Unknown 
Source)
         at 
org.apache.derby.impl.drda.NetworkServerControlImpl$1.run(Unknown Source)
         at java.security.AccessController.doPrivileged(Native Method)
         at 
org.apache.derby.impl.drda.NetworkServerControlImpl.blockingStart(Unknown Source)
         at 
org.apache.derby.impl.drda.NetworkServerControlImpl.executeWork(Unknown 
Source)
         at org.apache.derby.drda.NetworkServerControl.main(Unknown Source)
tail: /arhiiv/CRAWLER/NLIB/derby.log: file truncated
Wed Oct 01 13:09:28 EEST 2014 : access denied (java.net.SocketPermission 
localhost:8120 listen,resolve)
java.security.AccessControlException: access denied 
(java.net.SocketPermission localhost:8120 listen,resolve)
         at 
java.security.AccessControlContext.checkPermission(AccessControlContext.java:399)
         at 
java.security.AccessController.checkPermission(AccessController.java:557)
         at 
java.lang.SecurityManager.checkPermission(SecurityManager.java:549)
         at java.lang.SecurityManager.checkListen(SecurityManager.java:1134)
         at java.net.ServerSocket.bind(ServerSocket.java:335)
         at java.net.ServerSocket.<init>(ServerSocket.java:202)
         at 
javax.net.DefaultServerSocketFactory.createServerSocket(ServerSocketFactory.java:189)
         at 
org.apache.derby.impl.drda.NetworkServerControlImpl.createServerSocket(Unknown 
Source)
         at 
org.apache.derby.impl.drda.NetworkServerControlImpl.access$000(Unknown 
Source)
         at 
org.apache.derby.impl.drda.NetworkServerControlImpl$1.run(Unknown Source)
         at java.security.AccessController.doPrivileged(Native Method)
         at 
org.apache.derby.impl.drda.NetworkServerControlImpl.blockingStart(Unknown Source)
         at 
org.apache.derby.impl.drda.NetworkServerControlImpl.executeWork(Unknown 
Source)
         at org.apache.derby.drda.NetworkServerControl.main(Unknown Source)
----------------------------------------------------------------------------------------------------------

So this seems to point to some sort of java security problem. Right ... 
looked at the default java.policy file and added these lines:

permission java.net.SocletPermission "localhost:8120", "listen,resolve";
permission java.net.SocletPermission "localhost:8121", "listen,resolve";

Nothing ... still errors. So I looked around the installation to see if 
there are any other files I can alter. Found two additional files:

/INSTALL_DIR/DEPLOY_DIR/conf/security.policy
/INSTALL_DIR/localhost/security.policy

did the changes as in default java.policy file and again ... errors 
while starting NAS.

Even added firewall rules just to be safe but nothing. Cannot start NAS 
and do not understand where can I change the permissions in order to 
give derby db access for NAS.

Any ideas and suggestions are welcome :)



-- 
-----------------------------------------------------
Meelis Mihhailov
Eesti Rahvusraamatukogu / National Library Of Estonia

Telefon: 630 7178 / Phone: +372 630 7178
E-post: meelis at nlib.ee / E-mail: meelis at nlib.ee

Tõnismägi 2, 15189 Tallinn, ESTONIA

www.eestirahvusraamatukogu.ee
-----------------------------------------------------


More information about the NetarchiveSuite-users mailing list