Where to change base-url for glassfish war deployment? - deployment

Im following a glassfish tutorial for uni where i export a webapp and it tells me to deploy it. I deploy it and it provides links to launch it, but the server (by default for some reasons) launches it at: computername.ispname:8181/webapp instead of the expected localhost:4848/webappwhere if i go to, i get a 404.
Where/how can i change the base URL?
Following any of these links or localhost:4848/T4 or localhost:8080/T4 doesnt load the webapp eg. ERR_ADDRESS_UNREACHABLE

Im putting this one down to some Eclipse madness.
I setup a webEEapp and Glassfish server in IntelliJ, using the exact same Homebrew version of Glassfish from above, and this madness was gone! Jut had to fix autodeploy by updating iJ JDK and then i was fine.

Related

Tomcat on Eclipse Juno and Luna. One works, the other one doesn't

I am working on JavaEE webprojects using maven for dependencies and so on. The testing environment is Tomcat 7 for eclipse.
Now, when I made the transition to the newer eclipse (Luna) and deploy the webapp on tomcat, the tomcat instance refuses to serve the project. It gives 404 and the request on localhost:8080 doesn't produce any unusual console or log entries except the normal startup output (the exact same as on Juno).
I compared the server access log files located in /.metadata/... and the startup scripts. They are equal. No error messages, and no other clues on why the Luna Tomcat does not work. Don't get me wrong, the server 'works', as it provides a 404 message, it just does not serve the webapp that is deployed.
Does somebody have an idea on how to debug this further, or what the reason for the different behaviour could be? Thanks for any hints or advice.
-a
EDIT:
Just a few things I already did:
- Check and set project root (set to / in both cases)
- One suggestion found via google was to fiddle with the Libraries and Order and Export in Project Settings Build Path. (just move them up and down to get rid of a bug -> did not work)
- In Project Properties, set the targeted runtime to Tomcat 7 (the server in question)
- Reinstall the server
- Copy all configuration from one server path to the other.
- Set the server base path of Luna to the exact same as the working Juno instance (yes, they are in different places)
EDIT2:
Updating Eclipse to the newest version (MARS) did the job. Sadly I will now never know what the cause of the problem was. Luckily everything works again and I can focus on actually doing something :D

Run JHipster SpringApplication via eclipse

I'm trying to run the JHipster application via my Eclipse Juno, using jdk 1.7.
The app seems to be loading properly (no console errors), but when i'm trying to reach the server with the client side (or via Postman, by sending a request to the REST servlets in port 8080), it's not responding.
However, when i'm running "mvn spring-boot:run" in the command shell, the server is loaded successfully and is responding to the exact same requests. Also, I managed to run the same command via eclipse with some maven configuration but it seems to be running only the target files (jars) and not the source code. I still haven't been able to run the source code of this app using eclipse in order to properly debug it.
Any suggestions?
Thanks!
So the answer is quite trivial, but since I spent several hours to reach it, it might save some time for others-
Download & install STS IDE.
Import the project as existing Maven project.
Run/Debug the project.
I tried to run it via Eclipse the whole time (wasn't familiar with STS to be honest) and this probably needs some extra configuration (another comment with explanations on eclipse configuration will be much appreciated). Once you work with STS, it's easy.
You should not need STS, just Eclipse with the J2EE stuff.
I've imported the sample jhipster in Eclipse (without STS) as a Maven project and everything was OK, after installing the maven dependencies.
To run the project, run as an application and search for the Application (com.mycompany.myapp.Application)
This app works for me: https://github.com/jhipster/jhipster-sample-app. It is stuck on Boot RC5 which probably means it's a bit old. Maybe Julien can comment on that (or update it)?

Encoding problems running jsp web pages on Apache Tomcat

Sorry for my English.
I'm not a web page developer - I use already created jsp (I can not change them by my own), placing them together with different URL parameters - that way I create some complicated web project.
I have been using Apache Tomcat for a long time and had an error - cyrillic (cp1251) symbols doesn't show well in some places (not everywhere!) of project. Developers of jsp said, that it is a bug and they will fix it. Time goes by, but they do not.
Recently, I have imported EAR as project in Eclipse, created Tomcat server there. Before that I read this article:
http://www.vogella.de/articles/EclipseWTP/article.html
and installed all soft, specified in article to be able to work well with Tomcat project in Eclipse.
And I noticed, that when I publish project to Tomcat Server (created in Eclipse - it has it's own server) I had no errors with encoding! I think this is somehow connected to Eclipse & Eclipse Tomcat Server settings.
Question: Can I copy this settings to a real Tomcat Server (not Eclipse) for correct encoding everywhere? And what are this settings?
I also had a similar problem. My war was running on Eclipse Tomcat but when deployed manually on Tomcat, some web service involving currency symbol was facing encoding issues. Eclipse Indigo has some encoding for server.
This can be seen/edited through Run Configrations -> Common Tab. Changing this attribute produced consistent results for manual deploy and Eclipse deploy. I am not sure what this encoding is of, but it may set JVM's encoding.

eclipse requested resource not available

I have run a j2ee application in tomcat/eclipse for several months now, but suddenly (after working with changed in the css files), I get the server error:
The requested resource /appname/ is not available. I'm totally lost. I've gone through a number of posts. This one describes my problem: Eclipse is not detecting servlet libraries, but I've gone through everything in that post without finding any missing jars or servers or anything in my project.
I'm running Eclipse Java EE IDE for Web Developers.
Version: Helios Service Release 1.
Project -> Properties -> Server shows Tomcat v6.0 Server at localhost
Project -> Build path, please see attached screen dump.
Project -> Project Facets: Dynamic Web Module 2.5 and Java 1.6 is checked.
I have tried to clean and rebuild the project.
I'm running over https so I'm connecting to https://localhost:8443/appname/Start. I'm not sure if that could be the problem, but it has worked ok until now.
Can anyone give me a hint what can be wrong?
Finally got it working again, but I honestly don't know exactly what fixed it.
I started with removing some servlets/servlet mappings from the web.xml file. After having done that change, when restarting the server, the Start servlet was found, but the jsp that the servlet was forwaring to was not (and the url to the jsp page looked strange). Also the logcat property file was not found. I read in another post that the Server might need to be cleaned so I did that and then cleaned the project once again. Then restarted the Server and now it's the application is running again.
Thanks for your help anyway, Andrei.
try cleaning your tomcat from eclipse:
right click in tomcat > clean.
then restart your server

Tomcat issues inside eclipse

I am very new to Tomcat and web development in general and apologize for what may be a very silly question.
Consider 2 situations:
1.
I start Tomcat outside of Eclipse.
I use eclipse to create a war file.
I deploy it via admin console.
All is ok
2.
I start Tomcat via Eclipse
I can't access admin console
http://localhost:8080/manager/html greets me with 404 error
Same page is behaving properly when Tomcat is started outside of Eclipse
Please advise
Why might the issue be?
Why might the issue be?
You need to configure Eclipse to take control of your Tomcat installation. To do so:
double click on the Tomcat Server in the Servers view
under Server Locations, select Use Tomcat installation
This is illustrated on the screenshot below:
Eclipse creates a new Tomcat configuration separate to your Tomcat installation, in the 'Servers' project. This allows Eclipse to deploy webapps without interfering with anything you've done in your installation (via the manager app or by editing config files manually).
You can reconfigure Eclipse so that it uses the config from your Tomcat installation (see Pascal's answer), or to re-enable the manager app - but read the WTP Tomcat FAQ first as there are good reasons for it working the way it does. I don't recall ever needing to do this - the 'Servers' tab in Eclipse lets you deploy/start/stop/debug/configure apps as required.