Hi Armin,

That's unexpected...but, let me ask a few questions to make sure I understand 
your setup correctly & am not making assumptions.

1) I'm assuming both​ the UI and the backend are running on the same 
machine/server?  That's the only way you can run them both on 'localhost' under 
HTTP...otherwise, at least the backend needs a valid, public URL and be running 
under HTTPS.
2) Is the backend/REST API accessible in your browser at 
http://localhost:8080/server/ ?   It should be, as that's the URL your UI is 
trying to use.
3) Could you verify there are no other errors in your Tomcat logs?  Sometimes 
if Tomcat throws a major error, it can result in a CORS error (as a side effect 
of the larger error)

Finally, we have started to create a guide for "Common Installation Issues".  
Check out the advice in that section to see if any of it is helpful : 
https://wiki.lyrasis.org/display/DSDOC7x/Installing+DSpace#InstallingDSpace-CommonInstallationIssues

If you figure it out, please let us know what it was.  We have found a variety 
of scenarios that can result in these sorts of issues (hence the guide) and 
we're trying to document them all.  So far, though, the problem has always been 
a configuration issue....so, I'd recommend taking a closer look there first.  
But, glad to try and offer more advice if you are still hitting issues.

Tim

________________________________
From: [email protected] <[email protected]> on behalf of 
Armin Wenz <[email protected]>
Sent: Tuesday, May 4, 2021 7:32 AM
To: DSpace Technical Support <[email protected]>
Subject: [dspace-tech] DSpace7b5: Cross-Origin Request Blocked

Hallo,

Installed DSpace7 beta5 and got tomcat9 running on localhost:8080 and
dspace-angular on localhost:4000

I can reach the HAL Browser, log in and request all the stuff that's there.

I started dspace-angular with yarn run start:dev which ends with
** Angular Live Development Server is listening on localhost:4000, open
your browser on http://localhost:4000/ **
: Compiled successfully.

my environment.dev.ts is

export const environment = {
   ui: {
     ssl: false,
     host: 'localhost',
     port: 4000,
     nameSpace: '/'
   },
   rest: {
     ssl: false,
     host: 'localhost',
     port: 8080,
     nameSpace: '/server'
   },
};

When trying to connect to localhost:4000 with the browser, I see the
DSpace angular header and moving sot. In the developer console I found
the error:

Cross-Origin Request Blocked: The Same Origin Policy disallows reading
the remote resource at http://localhost:8080/server/api.

After searching a while I found a similar thread on gihub
(https://github.com/DSpace/dspace-angular/issues/1036) and set

rest.cors.allowed-origins = ${dspace.ui.url}, http://localhost:4000,
http://localhost:8080

I did not set proxies.trusted.ipranges according to
https://github.com/DSpace/DSpace/pull/3171.

Any ideas what I have missed?
--

Armin Wenz
Universitätsbibliothek Mainz
Leitung Bibliotheksanwendungen
Jakob-Welder-Weg 12
55128 Mainz
Tel.: +49 6131 39-29830
http://www.ub.uni-mainz.de

--
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/8a2c2b0b-7f3c-6b2e-3ad5-72e56c2ced98%40ub.uni-mainz.de.

-- 
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/DM5PR2201MB1148376267190CD84A1FB536ED5A9%40DM5PR2201MB1148.namprd22.prod.outlook.com.

Reply via email to