I'm happy to say that in the last 5 minutes of my work-day yesterday, I finally got the REST API working correctly. I'm not a 100% certain of what the cause of the issue I had was, but it *might* have been because I had two different versions of openjdk installed (openjdk8 and openjdk11); I knew this even when I started back on Tuesday. The reason I'm not entirely certain this was the cause is because I verified that Maven and Tomcat were both using the openjdk11 version and had my JAVA_HOME set to /usr/local/openjdk11, but I wasn't able to verify which version Ant was using.
The reason I didn't initially just uninstall openjdk8 was because the maven33, tomcat9 and apache-ant FreeBSD packages all required it as a dependency, so I couldn't uninstall it without it uninstalling those as well. So my solution was to first delete openjdk8 anyway. Then I just got binary install packages from the vendors themselves for Tomcat, Maven and Ant. They're almost as easy to install, configure and run as just using FreeBSD packages. As a side note, I got so desperate yesterday that one of the other things I tried was using Jetty instead of Tomcat. Couldn't figure out the deployment part or at least not in the time I had. Thanks for all your help. I learned a lot, got to know all these different parts of the software better and I hope this helps someone in the future. - Gavin On Thursday, September 23, 2021 at 12:46:43 PM UTC-7 Tim Donohue wrote: > Hi Gavin, > > I'm running the latest and greatest code (pre-7.1), so my MANIFEST.MF > might have slightly different versions than yours, but here's what mine > says: > > Manifest-Version: 1.0 > Created-By: Maven Archiver 3.4.0 > Build-Jdk-Spec: 11 > Specification-Title: DSpace Server Webapp:: Local Customizations > Specification-Version: 7.1 > Specification-Vendor: LYRASIS > Implementation-Title: DSpace Server Webapp:: Local Customizations > Implementation-Version: 7.1-SNAPSHOT > Implementation-Vendor: LYRASIS > > Yours should be similar, but the "*-Version" tags might say 7.0 > > Tim > ------------------------------ > *From:* [email protected] <[email protected]> on behalf > of Gavin Spomer <[email protected]> > *Sent:* Thursday, September 23, 2021 12:45 PM > > *To:* DSpace Technical Support <[email protected]> > *Subject:* Re: [dspace-tech] After 7.0 Installation Server / Hal Browser > Not Loading CSS Or Javascript > Thanks! This is helpful despite still being stuck. > > Can you tell me what's in your server/META-INF/MANIFEST.MF file in your > working installation? > > > On Wednesday, September 22, 2021 at 3:07:21 PM UTC-7 Tim Donohue wrote: > > Hi Gavin, > > Huh, this is an odd one. Nothing is jumping out in your description here > as being obviously "off/wrong". > > Just to verify, that "browser" directory is embedded in a JAR...it's not > supposed to exist separately under "/server", so that's definitely not the > issue here. I've double checked my own local copy, and it has no "browser" > folder & everything works fine. The "browser" folder (and related css and > js) is embedded as part of "spring-data-rest-hal-browser" dependency, which > is the third-party tool we use to view our REST API. This dependency should > be auto-installed in your WEB-INF/lib (as > "spring-data-rest-hal-browser-3.2.6.RELEASE.jar"). It should be loaded by > Tomcat where Tomcat will find the "browser" folder in that JAR. > > (If you really want to know how this all works, it's a bit of Java webapp > magic implemented by the Spring project in this class which maps the JAR > resources to the path "/browser": > https://github.com/spring-projects/spring-data-rest/blob/3.2.x/spring-data-rest-hal-browser/src/main/java/org/springframework/data/rest/webmvc/halbrowser/HalBrowserConfiguration.java#L38-L41 > ) > > As long as the ownership is correct in the Tomcat webapp, that *should* > be enough. There's no special scripts in there or anything. The DSpace > REST API is just a Java-based webapp. > > I'm a bit stumped right now, as this all "sounds correct" so far. Your > dependencies look OK at a glance. You might double check from "mvn -v" that > Maven is pointing at your Java 11 install...it should be, but sometimes it > can get mixed up if you have more than one Java installed. > > It looks like that past email thread (from May) that you linked to was > solved by a simple reinstall (they said they just did a "mvn clean" and > reinstalled and it worked... see this last message: > https://groups.google.com/g/dspace-community/c/-JKj_xrgLYM/m/VjAA0BnYBQAJ > ). > > I don't see any email messages since 7.0 was released (on Aug 2) that are > similar...so, this is definitely an odd one. I'm hoping *maybe* someone > else on this list will notice something that I might be overlooking...or > maybe something will come to mind later on. > > Tim > > > ------------------------------ > *From:* [email protected] <[email protected]> on behalf > of Gavin Spomer <[email protected]> > *Sent:* Wednesday, September 22, 2021 4:10 PM > > *To:* DSpace Technical Support <[email protected]> > *Subject:* Re: [dspace-tech] After 7.0 Installation Server / Hal Browser > Not Loading CSS Or Javascript > My apologies, I accidentally clicked "Reply to author" instead of "Reply > to All". And thanks again for all your help. > > Addressing your last (private) message: > > - Nothing in the *install* failed. Just getting the REST API / Backend > page to have the correct output, linking to css and js in the non-existent > "browser" directory is what I'm working on fixing. After building with > Maven it shows everything successful. Ditto for installing with Ant. > > - I have looked in *all* my tomcat logs: The catalina and localhost logs > only had [INFO] level messages, no errors. The localhost_access_log has all > the 404's. The manager and host-manage logs have nothing in them. > > - I believe I have all the correct dependencies / versions: > FreeBSD 12.2-RELEASE > *openjdk11-11.0.12* > maven33-3.3.9 > apache-ant-1.10.8 > postgresql12-server-12.8 > t*omcat9-9.0.52* > apache-solr-8.9.0 > > - My /usr/local/apache-tomcat-9.0/webapps/server directory and everything > below are owned by "www" which is the tomcat user on my system. As for > permissions, they look normal at a glance. Is there anything in this > directory tree that needs executable permissions? > > - I have rebuilt and deployed via maven & ant a ton of times, but thanks > for checking on that. And yes, I've been running "mvn clean" before running > "mvn package" again.Thanks for the tips on doing "mvn clean package" and > "ant update" (instead of "ant fresh_install" like I've been doing every > time). > > - There *has* been someone else with this issue, but unfortunately no > resolution, but I wouldn't expect you to remember this post > <https://groups.google.com/g/dspace-community/c/-JKj_xrgLYM> from back in > May. > > I'll keep plugging away and trying different things... > > On Wednesday, September 22, 2021 at 10:42:13 AM UTC-7 Tim Donohue wrote: > > Hi Gavin, > > I'm a bit lost in the info you've provided as it's not clear to me whether > you are able to access the REST API from your browser, or not. Are the > errors you are seeing related to accessing the UI or the REST API in your > browser? Can you verify that you are able to see the REST API in your > browser similar to our demo site REST API at > https://api7.dspace.org/server/ ? You could also test to verify that > login works from your REST API (click login on that basic REST API page). > > I'd highly recommend taking a step back and verifying first that you can > see & login via the REST API as a standalone webapp. If you are not seeing > logs in [dspace]/logs/ for your REST API, check also the Tomcat logs where > that is running. > > The "browser" errors you are referencing sound like they might be coming > from the UI layer, in which case they have nothing to do with the backend > "server" webapp (where the REST API is running). So, once the REST API is > working for you, verify that the same public URL is in your UI's > "environment.prod.ts" file in the "rest" section. Then try the UI again. > > (As a sidenote, your /usr/local/dspace/webapps/server/ sounds > correct...most of the files there are compiled Java code in JAR files under > WEB-INF/lib/. There are not many HTML files on the backend/REST API, as > nearly all of that will live instead in the location where you installed > the User Interface.) > > If you've tried all this before, then I think we'd need more info > regarding your configuration, setup, etc. It's unclear to me exactly how > you've configured your REST API's local.cfg and the UI's > environment.prod.ts, and even whether you've set these both up with HTTPS > or are trying to just get it running on localhost, etc. > > Good luck, > > Tim > > > > > ------------------------------ > *From:* [email protected] <[email protected]> on behalf > of Gavin Spomer <[email protected]> > *Sent:* Wednesday, September 22, 2021 12:26 PM > > *To:* DSpace Technical Support <[email protected]> > *Subject:* Re: [dspace-tech] After 7.0 Installation Server / Hal Browser > Not Loading CSS Or Javascript > > Thanks Tim. > > The links you provided above were the first things I checked. I always do > everything I possibly can to resolve an issue before trying to get outside > help. That includes the docs at the links you provided, reviewing the > instructions (several times) and Google searching. I also searched AND > browsed this list before submitting this post. > > The browser console just affirms what I already knew; there's a bunch of > 404's for anything in the (non-existent) "browser" directory. My > localhost_access_log.2021-09-22.txt log for tomcat9 indicates this too > much. I didn't find any logs in /usr/local/dspace/log/. What other logs can > I check? > > If my dspace installation directory is in /usr/local/dspace, shouldn't > there be a "browser" directory tree in /usr/local/dspace/webapps/server/? > > The output of "ant fresh_install" indicated it installed 1009 files in > /usr/local/dspace/webapps/. Is this correct or should there be more files? > What could be some reasons that Ant isn't installing all the necessary > files? This is all I see in /usr/local/dspace/webapps/server/: > > [image: 2021-09-22_10-23-16.png] > > Thanks again for your help. > > - Gavin > > On Wednesday, September 22, 2021 at 7:44:20 AM UTC-7 Tim Donohue wrote: > > Hi Gavin, > > Could you look for errors on the backend or in your browser's dev tools? > Those are the easiest ways to narrow down the problem. Here's a guide for > finding those errors in either the front or backend: > > https://wiki.lyrasis.org/display/DSPACE/Troubleshoot+an+error#Troubleshootanerror-DSpace7.x(orabove) > > I strongly suspect it's a configuration issue, and likely you'll find one > of these common installation issues in either the backend logs or in your > browser's dev tools: > > https://wiki.lyrasis.org/display/DSDOC7x/Installing+DSpace#InstallingDSpace-CommonInstallationIssues > > That said, it's hard to say exactly what the problem is without first > finding the error that is thrown. You also should verify that both you and > the server running the frontend can access the REST API....if there's a > proxy or firewall blocking access to the REST API that'd definitely be an > issue. > > Good luck, and let us know what you find on this list. > > Tim > ------------------------------ > *From:* [email protected] <[email protected]> on behalf > of Gavin Spomer <[email protected]> > *Sent:* Tuesday, September 21, 2021 2:05 PM > *To:* DSpace Technical Support <[email protected]> > *Subject:* [dspace-tech] After 7.0 Installation Server / Hal Browser Not > Loading CSS Or Javascript > > Just did an install of 7.0 and the /server page isn't loading css or js. > When I view source and click on the hyperlinks for any css or js, I get > 404's from tomcat. The css and js files all seem to be in a subdirectory of > a directory named "browser", I used the find utility from the command line > and there is no such directory in webapps/server. > The only content on the page is links for "Go To Entry Point", "About The > HAL Browser" and "Login". The Login page flashes a message "Could Not Load > / Failed to connect with backend. Please check for errors in Javascript > console". > > My system / dependancies: > > - FreeBSD 12.2-RELEASE > - > > DSpace-dspace-7.0 > - > > openjdk11-11.0.12 > - > > maven33-3.3.9 > - > > apache-ant-1.10.8 > - > > postgresql12-server-12.8 > - > > apache-solr-8.9.0 > > Building with Maven it indicates everything built just fine: > > [INFO] > ------------------------------------------------------------------------ > [INFO] Reactor Summary: > [INFO] > [INFO] DSpace Parent Project .............................. SUCCESS [ > 2.131 s] > [INFO] DSpace Services Framework :: API and Implementation SUCCESS [ > 9.354 s] > [INFO] DSpace Kernel :: API and Implementation ............ SUCCESS [ > 57.350 s] > [INFO] DSpace Addon Modules ............................... SUCCESS [ > 0.336 s] > [INFO] DSpace Kernel :: Additions and Local Customizations SUCCESS [ > 1.094 s] > [INFO] DSpace OAI-PMH ..................................... SUCCESS [ > 1.181 s] > [INFO] DSpace RDF ......................................... SUCCESS [ > 0.568 s] > [INFO] DSpace SWORD ....................................... SUCCESS [ > 4.036 s] > [INFO] DSpace SWORD v2 .................................... SUCCESS [ > 0.523 s] > [INFO] DSpace Server Webapp ............................... SUCCESS [ > 9.174 s] > [INFO] DSpace Server Webapp:: Local Customizations ........ SUCCESS [ > 10.084 s] > [INFO] DSpace Assembly and Configuration .................. SUCCESS [ > 19.344 s] > [INFO] > ------------------------------------------------------------------------ > [INFO] BUILD SUCCESS > [INFO] > ------------------------------------------------------------------------ > [INFO] Total time: 01:55 min > [INFO] Finished at: 2021-09-20T14:56:01-07:00 > [INFO] Final Memory: 154M/524M > [INFO] > ------------------------------------------------------------------------ > > Apache Ant suggest it was successful installing everything: > > copy_webapps: > > [copy] Copying 1008 files to /usr/local/dspace/webapps > > [copy] Copying 1 file to /usr/local/dspace/webapps > > build_webapps_wars: > > check_spiders: > > init_spiders: > > [echo] > > [echo] > ==================================================================== > > [echo] The DSpace code has been installed. > > [echo] > > [echo] To complete installation, you should do the following: > > [echo] > > [echo] * Setup your Web servlet container (e.g. Tomcat) to look for > your > > [echo] DSpace web applications in: /usr/local/dspace/webapps/ > > [echo] > > [echo] OR, copy any web applications from > /usr/local/dspace/webapps/ to > > [echo] the appropriate place for your servlet container. > > [echo] (e.g. '$CATALINA_HOME/webapps' for Tomcat) > > [echo] > > [echo] * Start up your servlet container (e.g. Tomcat). DSpace now > will > > [echo] initialize the database on the first startup. > > [echo] > > [echo] * Make an initial administrator account (an e-person) in > DSpace: > > [echo] > > [echo] /usr/local/dspace/bin/dspace create-administrator > > [echo] > > [echo] You should then be able to access your DSpace's REST API: > > [echo] > > [echo] http://barristan.lib.cwu.edu:8080/server > > [echo] > > [echo] > ==================================================================== > > [echo] > > BUILD SUCCESSFUL > > Total time: 12 seconds > > I've meticulously gone over everything in the installation process three > times now. I've also tried several Google searches to try to find the > answer on my own, but am just plain stuck. I did find this post > <https://groups.google.com/g/dspace-community/c/-JKj_xrgLYM> with someone > having the same issue, but it is unclear how it was actually solved. > > - Gavin > > -- > 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/ed497c51-b5d4-4af8-b035-2b40983f6da9n%40googlegroups.com > > <https://groups.google.com/d/msgid/dspace-tech/ed497c51-b5d4-4af8-b035-2b40983f6da9n%40googlegroups.com?utm_medium=email&utm_source=footer> > . > > -- > 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/05db88cc-430d-4ecf-b941-1e34d257ccc5n%40googlegroups.com > > <https://groups.google.com/d/msgid/dspace-tech/05db88cc-430d-4ecf-b941-1e34d257ccc5n%40googlegroups.com?utm_medium=email&utm_source=footer> > . > > -- > 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/e832f13a-bbb3-455c-93bb-6aa2ed74963bn%40googlegroups.com > > <https://groups.google.com/d/msgid/dspace-tech/e832f13a-bbb3-455c-93bb-6aa2ed74963bn%40googlegroups.com?utm_medium=email&utm_source=footer> > . > > -- > 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/0406b20b-2cad-4e3d-a8ff-5b4167926e38n%40googlegroups.com > > <https://groups.google.com/d/msgid/dspace-tech/0406b20b-2cad-4e3d-a8ff-5b4167926e38n%40googlegroups.com?utm_medium=email&utm_source=footer> > . > -- 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/feb7fe09-b752-491b-82e0-9b18a71245adn%40googlegroups.com.
