I have this react project, use npm run build command to generate a dist file. Then I copied it into spring boot resources/static. When I started the server and access that html, it happened an error:
Failed to load module script: Expected a JavaScript module script but the server responded with a MIME type of "application/json". Strict MIME type checking is enforced for module scripts per HTML spec. And I'm 100% sure that the generated dist files are correct, cause I put it in vscode liveserver, it works. and I put it into a tomcat server, it works.It's just dont work in springboot
Related
How can I run swagger files locally on windows ?
I know we can try it on https://editor.swagger.io/ but I am splitting swagger file into multiples files so I wanted to know how to run it on windows.
To render your own swagger files on windows, you can clone the repository on github and change the contents of index.html in the dist folder to point to the local path to your swagger file. When rendering multiple files at once, you can use the dropdown component to render each file based on your selection. That can be done in the "urls" parameter inside of the onload function in index.html. Then, you can run the app using npm start.
https://github.com/swagger-api/swagger-editor
Hi i can't deploy a scene with the DCL SDK, when i run "dcl deploy [my project]" it ask me to log, to say yes and thats ok but at the end it appear an error "✖ Failed to upload content
Error: dcl deploy Unable ro upload content. Invalid Content-type: application/vnd.unity File: garden/#/artifacts/unity/Build/unity.wasm.code.unityweb, run".
Can anyone help me?
From the error message you're getting, it looks like your project folder includes files that aren't compatible and can't be deployed, maybe something with an extension .unity
There are two possible solutions:
Delete or move the files, so that they're no longer in the project folder
Edit the .dclignore file, to tell the deploy to ignore files of that kind of extension when deploying
When deploying, you're uploading ALL of the content in the project folder, except the files that are signaled out by the .dclignore file. If you're familiar with .gitignore, the concept is quite similar.
I'm working on a springboot 1.5.1 application that I'm trying to load a WSDL included in my resources directory in the wsdl directory. Depending on where my application executes I'm getting different results (command line, intellij, cloud foundry) and I can't seem to get all three to work at the same time.
I've tried several ways of locating the resource:
From prior to the migration to springboot we had this (worked in IntelliJ but not java -jar myboot.jar):
this.getClass().getResource("/wsdl/my.wsdl");
I switched it to the typically more correct version and got it to work in IntelliJ and java -jar but not Cloud Foundry:
this.getClass().getClassLoader().getResource("/wsdl/my.wsdl");
I switched it to use the Spring Resource Loader version and it worked in IntelliJ and CloudFoundry but not java -jar:
#Value("classpath:/wsdl/my.wsdl")
private Resource wsdlResource;
wsdlResource.getURL();
On the command line what I've noticed is that it seems to be thinking that BOOT-INF/classes is a JAR file (Note the ! after classes):
Caused by: javax.xml.ws.WebServiceException: Failed to access the WSDL at: jar:file:/C:/dev/redacted/build/libs/redacted.jar!/BOOT-INF/classes!/wsdl/my.wsdl. It failed with:
JAR entry BOOT-INF/classes!/wsdl/my.wsdl not found in C:\dev\redacted\build\libs\redacted.jar.
From looking at IntelliJ's URL, it's referring to the actual source folder which explains why it seems to always work.
What is causing this and how might I universally load these class path resources successfully with springboot?
I try to integrate calendar invites in Alfresco. I use this link
https://github.com/jpotts/share-inbound-invites
I download inbound-invites-repo and just use mvn install, i don't change pom.xml
and get BUILD SUCCESS.
Than I copy inbound-invites-repo-1.1.1-SNAPSHOT.amp to $ALFRESCO_HOME/amps, then run bin/apply_amps.sh
After that when i run
http://127.0.0.1:8080/share/
I got error
HTTP Status 404 - /share/
type Status report
message /share/
description The requested resource is not available.
Apache Tomcat/7.0.x
Any idea or suggestion how to integrate calendar invites in alfresco share...?
Typically you should stop Tomcat before you run apply_amps.sh, then restart it afterward. Here's why...
When you run apply_amps.sh the alfresco.war and share.war files are backuped up. Then, the contents of the AMP files in the amps directory are merged with the alfresco.war file and the contents of the AMP files in the amps_share directory are merged with the share.war file.
Last, the exploded WAR file directories are removed.
Tomcat probably uninstalled your alfresco and/or share webapps at some point during the amp install, which is why you saw the problem.
I am developping a Jhipster web app.
My problem is that when I update some angularjs files and then deploy the new war file in Tomcat7 the modifications are not taken into account, the clients pc is still reading the old angularjs file.
Is there a way(or a jhipster configuration) to tell the client pc to reload all angularjs file in order to be up to date?
Thanks you.
When you build your app with prod profile using mvn -Pprod package or gradlew -Pprod bootRepackage the web assets are minified and prefixed with a unique code in dist folder. An older version of same file has a different prefix so if it is cached it will not prevent the new one from being loaded.
If you don't see this behavior, it's probably because you didn't set the spring.profiles.active property to prod in Tomcat and so your app is running in dev mode and not using the files from dist.
If your frontend and backend are in the same war: 0.0.1-SNAPSHOT change this version in pom.xml before making a build to avoid angular caching issues.
If your frontend is split then go to: gulp/utils.js and change this version: '0.0.5-SNAPSHOT';