not able to deploy war file in jelastic cloud - glassfish

I developed a web application using java and mongodb. I used glassfish server.
I tried to deploy it on jelastic cloud service
I uploaded my war file. But when I run it after deploying the war file it shows a 404 error. Why? The project works fine on my machine.

There are at least few potential causes:
your app needs some resources which are not started by default (such as DerbyDB). In this case you can check GlassFish log file - server_instance.log for more details.
you are trying to get resources from wrong context, make sure you are trying to get it via correct context name

Related

What's the best strategy for flutter-web to access its resources on server?

I've deployed a release in an ubuntu server with apache. When I access the deployed app, it shows in console: Error while trying to use the following icon from the Manifest: https://mydomain/icons/Icon-192.png (Download error or resource isn't a valid image).
Seems like flutter web is trying to download the Icon-192.png that resides on a subdirectory without permissions, giving me a Forbidden error.
I'd like to know, what's the best approach to access contents (assets like favicon, images, etc) on the deployed directory and subdirectories without making it public.

Hosting blazor wasm asp.net core hosted app in kestrel

I am having troubles hosting the blazor wasm asp.net core hosted application.. The solution has 3 projects: Client, Shared, and Server.
when I run the command dotnet publish --configuration Release it publishes the libraries to their respective folders in solution like this:
WebWorkbench3\Client\bin\Release\net5.0\publish
WebWorkbench3\Server\bin\Release\net5.0\publish
...
I would assume that since the server project is referencing a client - then my steps to host the application are following:
Open WebWorkbench3\Server\bin\Release\net5.0\publish in powershell
Run command dotnet .\WebWorkbench3.Server.dll
Navigate to: https://localhost:5001/
Result:
Expected: client page opened
Actual: page is stuck at "Loading.." string. In the console we see that there was an error about _framework/blazor.webassembly.js not being loaded.
If we were to check the wwwroot folder contents in the server app we will see the following:
So this explains why the error is shown. However my question at this point - should the publishing process/configuration in project take care of copying client's wwwroot contents into the the server's app output directory? If we start a debugging session in the VisualStudio, then we use the server as the startup point, so the project should have some idea where to look up the blazor.webassembly.js file at..
So why doesn't the same process occurs during the publishing?
Note: I was able to fix the issue by manually copying the client's wwwroot directory and by placing the contents into the server's wwwroot directory... But I don't think that is is how serving is supposed to work?
EDIT: I have just tried to set-up the client blazor application in IIS. And it works. Kind of. The page is opened. But then when it tries to make a REST GET request to the server - it uses the same hostname:port combination. So if my app is hosted on mysite.local:50001 then the request to API will look like mysite.local:50001/data/loadall where data is the controller name and loadall is the action name.. So basically the client uses the same base address as the server.. The problem, is that I cannot start the server on the same port as the client! In attempt in doing so - you will see following output:
So basically I have the same question as before - how to host the wasm application that is split between client and the server? I am pretty sure that I can make it work by forcing the client to use the non-standard server port and serving the server part on that port.. However, I believe there should be a reason why current configuration (default configuration in the blazor wasm template) is configured in this way so it should be possible to run the project somehow without any additional changes at all..
Well this will be a self-answer.. Instead of publishing (dotnet publish --configuration Release) the application on solution level - do the publishing on project level..
before ..\repos\WebWorkbench3\WebWorkbench3
after ..\repos\WebWorkbench3\WebWorkbench3\Server
In 1 case the compiler does not copy the _framework folder (and possibly some other files) into the wwwroot.. Once you have published the Server correctly you can access the app by serving it with dotnet .\WebWorkbench3.Server.dll command.
Having the samie issue as explained above:
Before:
The solution file
had the same name
was in the same folder
as the server project
Resolved
I moved the solution to the project root (one level up).
Now, dotnet publish within the server project produced the __framework folder + content as expected.

grails.app.context being ignored deploying to Tomcat

I have an Apache server proxying all traffic from mainhost.com/subdirectory to someec2instance/subdirectory. When I start Apache and hit someec2instance.com, I get the ROOT war page. That works fine. If I deploy my app as ROOT.war, everything works fine form someec2instance.com.
However, when I access mainhost.com/subdirectory, all the asset urls and link_to urls are wrong and point to mainhost.com instead of mainhost.com/subdirectory.
I've set grails.app.context and confirmed via application.properties that the correct grails.env is being set.
Why isn't grails.app.context being respected when I deploy as ROOT.war? I would expect the site to be accessible on someec2instance.com/context, but it's like it ignore grails.app.context entirely.
The reason is doesn't work is that those settings are for running locally, not when deployed as a WAR file. When you use the tomcat or jetty plugin in run-app we configure the container to make it look like it's running an "exploded" war (similar to when a WAR gets unpacked to the file system by various servers). Since the container is running in embedded mode, it's easy to configure it programmatically as needed.
But when you deploy a WAR file there's nowhere near as much configurability. In run-app the build logic of Grails starts the server, configures it, and deploys the app, but a WAR file deployed to a "real" server is managed by the server and not the other way around.

How to deploy war file in amazon AWS apache tomcat and access using domain name

I want to access the application through the domain name. For Example www.xyz.com/login.jsp. For the same i have placed my web app in ROOT folder of the apache tomcat in AWS, and i can access the app.
But i want to deploy the war file and access the application. If i put the war file in ROOT folder i am not able to access the application. Cab you please help me out on this like where to put the war file in apache tomcat folder in AWS
and if i have 2 application like client application and webservcie application. Where to deploy these 2 appliation so that whenever request comes from client it should call the webservice and gives the response back.
Can you please help me out in configuring my application in AWS apache tomcat.

Deploying Saiku UI on Glassfish

When I try to deploy saiku-ui-2.4.war to Glassfish I get
"There is no installed container capable of handling this application
ROOT. Please see server.log for more details."
The server.log shows:
[#|2013-08-16T17:50:36.595-0400|SEVERE|oracle-glassfish3.1.2|javax.enterprise.system.core.com.sun.enterprise.v3.server|_ThreadID=24;_ThreadName=Thread-2;|There
is no installed container capable of handling this application ROOT|#]
[#|2013-08-16T17:50:36.610-0400|INFO|oracle-glassfish3.1.2|org.glassfish.admingui|_ThreadID=23;_ThreadName=Thread-2;|Exception Occurred :Error occurred during deployment: There is no installed container capable of handling this application ROOT. Please see server.log for more details.|#]
Any idea how to get around this? I searched Saiku's own forum with no luck. I even have a post on there.
Saiku has a prepared package that comes with Tomcat. Saiku UI is deployed as Tomcat ROOT application. This package works fine but I want to try to deploy it on Glassfish.
What's interesting is Saiku has a download saiku-ui-master. This is a separate UI package that needs node.js installed. I've gotten this to work but I want to run it on Glassfish.
Solved it! Added WEB-INF and web.xml then it deployed with no issue!
Actually you need to unpack content of the saiku-ui.war in docroot of your domain as there is static content only.