deploying the rest api

34 views
Skip to first unread message

Jose Blanco

unread,
Apr 8, 2020, 2:35:54 PM4/8/20
to DSpace Technical Support
I'm able to deploy oai, solr, "/" , but the rest gives me this error:

2020-04-08 13:43:50,682 ERROR org.dspace.storage.rdbms.DatabaseUtils @ The service manager could not find the DataSource.

2020-04-08 13:43:50,682 FATAL org.dspace.core.Context @ Cannot initialize database via Flyway!

java.sql.SQLException: The DataSource is a null reference -- cannot continue.

at org.dspace.storage.rdbms.DatabaseUtils.updateDatabase(DatabaseUtils.java:546)

at org.dspace.core.Context.<clinit>(Context.java:106)

at org.dspace.app.util.AbstractDSpaceWebapp.register(AbstractDSpaceWebapp.java:74)

at org.dspace.app.util.DSpaceWebappListener.contextInitialized(DSpaceWebappListener.java:31)

at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:5197)

at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5720)

at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)

at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:1016)

at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:992)

at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:639)

at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:712)

at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:587)

at org.apache.catalina.startup.HostConfig.check(HostConfig.java:1814)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

at java.lang.reflect.Method.invoke(Method.java:607)

at org.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:303)

at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:819)

at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:801)

at org.apache.catalina.manager.ManagerServlet.check(ManagerServlet.java:1521)

at org.apache.catalina.manager.ManagerServlet.deploy(ManagerServlet.java:916)

at org.apache.catalina.manager.HTMLManagerServlet.deployInternal(HTMLManagerServlet.java:337)

at org.apache.catalina.manager.HTMLManagerServlet.doPost(HTMLManagerServlet.java:200)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:647)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)

at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)

at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)

at org.apache.catalina.filters.CsrfPreventionFilter.doFilter(CsrfPreventionFilter.java:141)

at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)

at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)

at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)

at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)

at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)

at org.apache.catalina.filters.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:109)

at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)

at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)

at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:219)

at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:110)

at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:604)

at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:165)

at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)

at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:1025)

at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)

at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:452)

at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1195)

at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:654)

at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:317)

at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1152)

at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:622)

at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)

at java.lang.Thread.run(Thread.java:748)

2020-04-08 13:43:50,699 INFO  org.dspace.event.EventServiceImpl @ EventService dispatcher pool initialized

2020-04-08 13:43:50,714 FATAL org.dspace.core.Context @ Cannot obtain the bean which provides a database connection. Check previous entries in the dspace.log to find why the db failed to initialize. The schema validator returned: Error creating bean with name 'dataSource' defined in file [/l1/dspace/repository/dev63/config/spring/api/core-hibernate.xml]: Cannot resolve reference to bean 'dspaceDataSource' while setting bean property 'defaultObject'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dspaceDataSource' defined in file [/l1/dspace/repository/dev63/config/spring/api/core-hibernate.xml]: Instantiation of bean failed; nested exception is java.lang.NoClassDefFoundError: Could not initialize class org.apache.commons.dbcp2.BasicDataSource

2020-04-08 13:43:50,889 FATAL org.dspace.core.Context @ Cannot obtain the bean which provides a database connection. Check previous entries in the dspace.log to find why the db failed to initialize. The schema validator returned: Error creating bean with name 'dataSource' defined in file [/l1/dspace/repository/dev63/config/spring/api/core-hibernate.xml]: Cannot resolve reference to bean 'dspaceDataSource' while setting bean property 'defaultObject'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dspaceDataSource' defined in file [/l1/dspace/repository/dev63/config/spring/api/core-hibernate.xml]: Instantiation of bean failed; nested exception is java.lang.NoClassDefFoundError: Could not initialize class org.apache.commons.dbcp2.BasicDataSource

Jose Blanco

unread,
Apr 8, 2020, 10:21:03 PM4/8/20
to DSpace Technical Support
In looking at the catalina log files, it seems like I'm having the issue mentioned here:

I have java version "1.7.0_251"

I'm trying to get RESTapi to run on 63.  According to the installation instructions, I should be able to use version 7 of java,  but  it seems like maybe not.  Before I upgrade to Java 8,  I want to verify this.

Thank you!
-Jose

Tim Donohue

unread,
Apr 9, 2020, 11:57:50 AM4/9/20
to Jose Blanco, DSpace Technical Support
Hi Jose,

The error described here http://dspace.2283337.n4.nabble.com/Rest-API-not-working-in-DSpace-6-2-td4687599.html occurs because you are running a version of PostgreSQL that *requires* Java 8.  

So, if you want/need to run DSpace using Java 7, you'd have to find an old version of PostgreSQL that also works for Java 7.  However, that may be difficult to do, as Java 7 has been end of life since 2015. 

It may be much much easier to just upgrade to Java 8, since whatever version of PostgreSQL you are running seems to require it.

Tim

From: dspac...@googlegroups.com <dspac...@googlegroups.com> on behalf of Jose Blanco <bla...@umich.edu>
Sent: Wednesday, April 8, 2020 9:20 PM
To: DSpace Technical Support <dspac...@googlegroups.com>
Subject: [dspace-tech] Re: deploying the rest api
 
--
All messages to this mailing list should adhere to the DuraSpace 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 dspace-tech...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/dspace-tech/CAK%3DKc-sjVMW8Ba9KURXdbgoy%3D%2BcfkgSuF7LnE59dH0O9DJrWOw%40mail.gmail.com.

Jose Blanco

unread,
Apr 9, 2020, 1:06:35 PM4/9/20
to Tim Donohue, DSpace Technical Support
Tim, Thank you!  One more question.  Do you think dspace 5.1 will run OK with Java 8. Our development machine is the same as our production machine, so if we upgrade that machine to use java 8, I just want to make sure it will not mess up anything with our production dspace 5.1.

Thank you!
-Jose

Jose Blanco

unread,
Apr 16, 2020, 10:54:35 AM4/16/20
to Tim Donohue, DSpace Technical Support
Sorry to bother you, but any thoughts on using java 8 with dspace 5.1.  Thank you!

tim.d...@lyrasis.org

unread,
Apr 16, 2020, 12:02:55 PM4/16/20
to Jose Blanco, DSpace Technical Support
While DSpace 5 was never officially tested with Java 8 (which is why it isn't listed as "supported"), my understanding is there are several sites that are successfully running DSpace 5.x on Java 8.

This is based on the feedback reported in our Java 8 upgrade ticket https://jira.lyrasis.org/browse/DS-2653

As well as other's feedback on this mailing list, for example: https://groups.google.com/d/msg/dspace-tech/M45uwUo69W0/mBO7m50mCQAJ

So, I think DSpace 5.1 will likely work on Java 8.  I cannot promise it though, as it was never officially tested on that release of Java.  That said, people seem to be having success at least running DSpace 5.9 on Java 8.  So, if 5.1 has issues, you could upgrade to a later version of 5.x.

Tim

From: Jose Blanco <bla...@umich.edu>
Sent: Thursday, April 16, 2020 9:54 AM
To: Tim Donohue <tim.d...@lyrasis.org>
Cc: DSpace Technical Support <dspac...@googlegroups.com>
Subject: Re: [dspace-tech] Re: deploying the rest api
 

emilio lorenzo

unread,
Apr 16, 2020, 1:54:22 PM4/16/20
to dspac...@googlegroups.com

We are running some Dspace instances with java1.8  and Dspace 4, 5 & 6 

Due to cross-requirements from diverse integrations with: security headers, Office365, LDAP and Twitter,  we opt in Dspace 5.x  for versions  greater than  java 1.8.0_112   but less than  1.8.0_161

in Dspace 4 we are running a Java version 1.8.0-231 without any issues (LDAP authetication )

if you need more information, don´t doubt contact me.

Emilio

Stay safe, stay at home.

elorenzo.vcf

Mark H. Wood

unread,
Apr 17, 2020, 10:26:29 AM4/17/20
to DSpace Technical Support
On Thu, Apr 16, 2020 at 04:02:42PM +0000, tim.d...@lyrasis.org wrote:
> While DSpace 5 was never officially tested with Java 8 (which is why it isn't listed as "supported"), my understanding is there are several sites that are successfully running DSpace 5.x on Java 8.
>
> This is based on the feedback reported in our Java 8 upgrade ticket https://jira.lyrasis.org/browse/DS-2653
>
> As well as other's feedback on this mailing list, for example: https://groups.google.com/d/msg/dspace-tech/M45uwUo69W0/mBO7m50mCQAJ
>
> So, I think DSpace 5.1 will likely work on Java 8. I cannot promise it though, as it was never officially tested on that release of Java. That said, people seem to be having success at least running DSpace 5.9 on Java 8. So, if 5.1 has issues, you could upgrade to a later version of 5.x.

Also no promises, but here we have a 5.6 instance and a 5.2 instance
running on OpenJDK 8. I do all of my development and testing with
Java 8 unless something needs Java 11.

--
Mark H. Wood
Lead Technology Analyst

University Library
Indiana University - Purdue University Indianapolis
755 W. Michigan Street
Indianapolis, IN 46202
317-274-0749
www.ulib.iupui.edu
signature.asc
Reply all
Reply to author
Forward
0 new messages