Dear Nick, You may have already solved your issue, but I noticed the same warning about SecureRandom causing Tomcat to start up slowly. On two of my DSpace servers the issue was more pronounced:
tomcat7[30294]: WARNING: Creation of SecureRandom instance for session ID generation using [SHA1PRNG] took [201,733] milliseconds. I had gotten very used to DSpace taking forever to start up, though I can't remember when the problem began. This particular warning message is due to the JVM using /dev/random to create SecureRandom. The issue is that /dev/random blocks when it runs out of entropy. This is normally a good thing if your threat model includes nation state agencies, but for an institutional repository it's completely unnecessary. Recent Linux operating systems provide /dev/urandom which is "unlimited" random and it is perfectly acceptable to use in this case¹. On my system with OpenJDK 8u292 I had to change the following line in /etc/java-8-openjdk/security/java.security: securerandom.source=file:/dev/urandom Now my Tomcat instances start up much faster and the warning is not printed at all. I don't know if this affects other areas in DSpace where SecureRandom is used, perhaps it does! Come to think of it, if DSpace is trying to use SecureRandom backed by /dev/random and it blocks, then this could absolutely affect normal DSpace operation. Anyways, I hope that helps some other people! ¹ https://www.2uo.de/myths-about-urandom/ On Mon, Apr 5, 2021 at 5:27 PM Nick Lauland <[email protected]> wrote: > FYI Found extra JNDI section in tomcat's server.xml from previous version > of dspace (5 probably). Likely the issue. Will post if so. > > On Friday, April 2, 2021 at 3:30:40 PM UTC-5 Nick Lauland wrote: > >> Hi guys, >> >> We run ~20 dspaces and one is having strange problems beyond my ability >> to diagnose. I'm not a developer so I'm pretty clueless what is going on. >> I apologize for the large amount of log listings, I'm not sure which are >> important or not. >> >> In tomcat's catalina.out I see the following: >> >> This repeated 20+ times >> 28-Mar-2021 08:09:07.220 WARNING [ajp-nio-127.0.0.1-8009-exec-484] >> org.apache.catalina.util.SessionIdGeneratorBase.creat >> eSecureRandom Creation of SecureRandom instance for session ID generation >> using [SHA1PRNG] took [11,253] milliseconds. >> >> Many of these mentioning different beans: >> INFO [localhost-startStop-1] (DefaultListableBeanFactory.java:675) - >> Overriding bean definition for bean 'org.dspace.id >> entifier.service.IdentifierService': replacing [Generic bean: class >> [org.dspace.identifier.IdentifierServiceImpl]; scope >> =singleton; abstract=false; lazyInit=false; autowireMode=2; >> dependencyCheck=0; autowireCandidate=true; primary=false; fa >> ctoryBeanName=null; factoryMethodName=null; initMethodName=null; >> destroyMethodName=null; defined in URL [jar:file:/ebs/t >> amucc-dspace/webapps/swordv2/WEB-INF/lib/dspace-api-6.4-SNAPSHOT.jar!/spring/spring-dspace-core-services.xml]] >> with [Gen >> eric bean: class [org.dspace.identifier.IdentifierServiceImpl]; >> scope=singleton; abstract=false; lazyInit=false; autowir >> eMode=2; dependencyCheck=0; autowireCandidate=true; primary=false; >> factoryBeanName=null; factoryMethodName=null; initMet >> hodName=null; destroyMethodName=null; defined in file >> [/ebs/tamucc-dspace/config/spring/api/identifier-service.xml]] >> >> And finally, probably (?) the key: >> 29-Mar-2021 08:09:10.503 WARNING [main] >> org.apache.catalina.core.NamingContextListener.addResource >> naming.jmxRegistratio >> nFailed >> 29-Mar-2021 08:09:10.547 SEVERE [main] >> org.apache.catalina.mbeans.GlobalResourcesLifecycleListener.createMBeans >> Exceptio >> n processing Global JNDI Resources >> javax.naming.NamingException: Could not create resource factory instance >> [Root exception is java.lang.ClassNotFo >> undException: org.apache.tomcat.dbcp.dbcp2.BasicDataSourceFactory] >> >> The problem is it will stay up for days with no major issues. >> >> When it finally crashes, no messages in catalina.out, but these repeating >> in dspace.log: >> 2021-04-02 07:35:46,568 WARN >> org.hibernate.engine.jdbc.spi.SqlExceptionHelper @ SQL Error: 0, SQLState: >> null >> 2021-04-02 07:35:47,071 ERROR >> org.hibernate.engine.jdbc.spi.SqlExceptionHelper @ Cannot get a connection, >> pool error Timeout waiting for idle object >> ... >> 2021-04-02 07:36:32,634 ERROR >> org.dspace.app.xmlui.cocoon.DSpaceCocoonServletFilter @ Serious Error >> Occurred Processing Request! >> javax.servlet.ServletException: org.apache.cocoon.ProcessingException: >> Sitemap: error invoking action >> ... >> Caused by: org.hibernate.exception.GenericJDBCException: Could not open >> connection >> >> If any of this rings a bell, I'd appreciate any info. Thanks! >> >> -- > All messages to this mailing list should adhere to the Code of Conduct: > https://duraspace.org/about/policies/code-of-conduct/ > --- > You received this message because you are subscribed to the Google Groups > "DSpace Technical Support" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/dspace-tech/a53e6427-fc7d-4c7a-88e7-b47afa98932bn%40googlegroups.com > <https://groups.google.com/d/msgid/dspace-tech/a53e6427-fc7d-4c7a-88e7-b47afa98932bn%40googlegroups.com?utm_medium=email&utm_source=footer> > . > -- Alan Orth [email protected] https://picturingjordan.com https://englishbulgaria.net https://mjanja.ch -- All messages to this mailing list should adhere to the Code of Conduct: https://www.lyrasis.org/about/Pages/Code-of-Conduct.aspx --- You received this message because you are subscribed to the Google Groups "DSpace Technical Support" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/dspace-tech/CAKKdN4Xz_H9Gd4OTYiR8%3DBXn3jQddLkz4uJC4%3Dee6AE%3DcL1cFw%40mail.gmail.com.
