Deploying example application - java

I am trying to deploy the example form based authentication application to my glassfish server, but everytime I launch the application, I am redirected to yahoo, saying that
The requested URL "http://localhost:8080/com-byteslounge-jaas/" cannot be found or is not available. Please check the spelling or try again later.
Anyone have any ideas? I downloaded the source straight from here:
http://www.byteslounge.com/tutorials/jaas-form-based-authentication-in-tomcat-example

You can also launch Server Domain Console (http://localhost:4848 by default) and there, in Applications section, You should have Your app listed. You can see the URL to Your app either by clicking it's name or by clicking Launch link on the right.

The example in your linked article describe the URL is http://localhost:8080/com-byteslounge-jaas-1.0-SNAPSHOT, have you ensured you deploy the app to the same context path you're requesting? Check glassfish log to see what context path your app is deployed as

Related

Web application running without a name

I just made a simple web application (using java and jersey as i want to start making a rest endpoint). I am working on intelliJ idea
I used this tutorial to build it.
I gave the project a name, group id and artifact.
Now when i run it in my local tomcat server, it runs successfully but does not show me the name of my web application in URL. It only shows localhost:8080 as can be seen in the screen shot below.
Why is it displayed like that? How can i give my application a name/URL?
Basically, you need to watch this video first: Domains and the Domain Name System and then fully understand what the following paragraph means. Then your question will solve itself. Good luck! :D
localhost is the IP address of the server where the tomcat (which is an application server) is running. 8080 is the port. The localhost maps (from Windows hosts file) to 127.0.0.1 and this is a loopback IP address (meaning that it is, in fact, yourself).
p.s. that's what about the name in the URL. About the actual browser tab name, it's the <title> HTML tag.
How can i give my application a name/URL?
You need to buy a domain name.
So what i was looking for was to set the application context in tomcat server.
Here is how i did it: On IntelliJ idea, clicked on 'Edit configuration' -> than on 'Deployment' tab.
There is an option for "application context' there. I give it the name of my application(or any name that i like) and click 'apply' and restarted the server.
Here is how it appears in the browser now:

Azure web api with java

[Update: Problem Solved, Clear solution unable to be achieved. More information in comments]
I am new to azure and I am attempting to create a API Application following the tutorial found here https://azure.microsoft.com/en-us/documentation/articles/app-service-api-java-api-app/
Everything works fine on the local machine but when I attempt to push it to the live site and do a Postman request for http://talkapi.azurewebsites.net/api/contacts/2 I get resource not available.
I don't know what bugging tools I have and where to start. I was wondering if anyone had some advice on where to start debugging or what the problem is.
According to the tuturial and per my experience, it seems that the issue of 404 not found was caused by the incorrect deployment on Azure.
Please access the link https://talkapi.scm.azurewebsites.net/DebugConsole the Kudu tool of your API App and move to the path D:\home\site\wwwroot\webapps, then you will see the fig below.
Try to drag your ROOT.war file and drop here (\webapps), and tomcat will auto-decompress the war file and replace the directory ROOT, then you can try to request the api http://talkapi.azurewebsites.net/api/contacts/2 again.
Kudu is the engine behind git deployments in Azure Web Sites includes Azure API App, you can see more detals at https://github.com/projectkudu/kudu/wiki.
Hope it helps. Any update, please feel free to let me know.

Google App Engine (Java) custom page is "Unable to resolve the server's DNS address" caused by corrupted Application Settings. How can I fix it?

I'm trying to display a custom admin page in the "Custom" section of GAE's admin console (Java). I've got the html file in the war directory. My appengine-web.xml contains the admin-console tag:
<admin-console>
<page name="Hello World" url="/helloWorld.html" />
</admin-console>
To view the custom admin page, I need to deploy to app engine (searching on stack overflow I found that custom pages do not show up in the dev environment). When I deploy, I see the link under the "Custom" section as "Hello World". When I click on it, I get an error message:
Unable to resolve the server's DNS address
You can find a screenshot of the error message here: http://i.stack.imgur.com/656P9.jpg
Debugging steps taken:
Is the html page available when I try to access it directly. i.e. app-id.appspot.com/helloWorld.html?
Yes
If I create a new app in app engine (let's call this app2) and deploy this same code, can I access the custom page from within the admin console?
Yes
If I create a new app by copying the settings from my original app (let's call this app3) using the "Duplicate Application Settings" from Application Settings in the Admin Console and then deploy this same code, can I access the custom page from within the admin console?
No
Are the Application Settings of app2 and app3 the same (Application Settings is accessible from the Admin Console)?
Yes (except for the "Application Title" and "Application Identifier")
Am I using a Custom domain? [1]
No
Am I using Google Accounts API for the "Authentication Type"? [1]
Yes
[1] Stack Overflow post: Datastore admin - Unable to resolve the server's DNS address
This leads me to believe that my Application Settings are somehow corrupted and I cannot fix this from the Application Settings section in the Admin Console. Is there a way that I can "clean" my Application Settings or "restore to factory defaults" to fix this, without affecting the data in my app?
Any help with how to fix this is greatly appreciated! Thanks!
I posted this on HN for more exposure, link to discussion: https://news.ycombinator.com/item?id=9443973
One of the comments suggested that I redeploy with a new version name and delete the old version. that did the trick! thanks #jirungaray

cPanel with Tomcat 7 installation successful but not showing /usr/local/jakarta folder under root

I have successfully installed Tomcat 7 using cPanel on IWEB server. I got the installation successful message too. I am able to hit the tomcat home page using www.domain.com:8080 and it directs me to Tomcat's home page. You may take a look at http://67.205.89.174:8080/
The main challenge is, in order to access Manager App, I need admin credentials, which should ideally be found in /root/usr/local/jakarta/..../tomcat-users.xml
When I connect to 67.205.89.174 using WinSCP, I don't see any "jakarta" folder located there.
This is my first time I am trying to host a website and everything is new to me. I am doing my self study by going through some online documentations, blogs, videos etc.. related to cPanel-Tomcat 7 installation.
I would appreciate any help by guru's online here so that it can drastically save my time.
Thanks in advance!
Tomcat 7 configuration directory is /usr/local/easy/share/easy-tomcat7/conf and you can check your user configuration in /usr/local/easy/share/easy-tomcat7/conf/tomcat-users.xml file.

How do I know the URL of a web app on my machine?

So I just got internship at this company, and they would like me to complete a project(Web application) which someone else did but didn't finish two years ago. But the person didn't leave any documentation about this web app. Right now I would like to run and test this web app, but I couldn't get it started.
So it's running on WebSphere Application Server in IBM Rational Application Developer, the code is written in java and javascript. (I could start the server, but I don't know where to go and open up the web app)
Sorry I'm really new to this, questions might be stupid, appreciate any help:)
Do you know what port it's running on? You should be able to access it from a web browser on the host machine by going to
http://127.0.0.1:XX
where XX is the port in question. If you don't know, try 80 - that's the default HTTP port and it's worth a shot.
The default websphere web port is 9080, so try http://localhost:9080/
So it's running on WebSphere Application Server in IBM Rational Application Developer
and
I could start the server
Assuming you are able to start the server via RAD as I assume from the above and you are able to publish the app to WebSphere via RAD, you should then be able to right click on the project folder and choose "Run on Server." It will walk you through publishing the app to the server and will then launch a browser to the index page or URL via the context path and web project settings. You can have RAD use an embedded browser (default) or adjust it to launch an external browser via Preferences -> Web Browser.
To manually check where a webapp will be deployed you can either check application.xml (if you have one) OR you can right click on the project root folder in RAD, choose Properties, and Web Project Settings. The context path is in a field there.
Run-On-Server will show you both server/hostname (usually localhost), port, and application context path in one operation.

Categories