How to make Intellij Idea start glassfish as sudo? - java

I am trying to run a glassfish local server from Intellij Idea and have some troubles. The server only wants to run from terminal via sudo command, and the Intellij runs by default without sudo, so how do I fix it? Do I have to make the file to always get executed as sudo(if yes, then how) or should I set in the Idea configs to run that specific file as sudo?

All information consists in this guide: "Run/Debug Configuration: GlassFish Server".

I solved this by unzipping this to my home directory and changed the location of glassfish inside idea to the new location.

Related

Deployment springboot project on server with error

I can run the project in IDEA, however,I put the project in tomcat/webapps, but it can't work. Who can help me solve this problem? thank you!
The last exception screen shot basically shows that your container did not start as the port that you have given is already in use by a different process.
Error showing that your 8080 port is already bind or running by some other application.Either change port or kill 8080 from other application.
Do mvn-clean, mvn-compile on your project directory.
Clean your tomcat server directory, right click on server->properties->switch location from workspace metadata to /server/tomcat...
If any other process is running on your server then stop it, clean Tomcat directory then restart server. If in case, then too it doesn't works then delete the server and configure it again.

How to run root commands from Tomcat on Linux?

I'm planning a project to run on Linux. I think it will be a java webapp using Tomcat. I'm not sure yet, because of the following problem and the solutions. This project will be able to configure some settings and run some system commands.
My problem is these commands need to be called from root or to use sudo. I would like to avoid this from a webapp or to avoid root to run Tomcat.
How can I run these commands (directly/indirectly) from my webapp ? Is there an architecture/design pattern/any solution for this kind of problem without to reduice the security of the system ?
Thank you.
Stef

Can't setup Tomcat 6 in Eclipse - "Could not load the Tomcat server configuration" error

For the last couple of hours, I'm desperately trying to configure apache tomcat6 in Eclipse, and I'm having some difficulties.
I tried everything I could find online, including several posts here in Stack Overflow (most of the problems I found wasn't exactly like mine).
Initially, I followed this tutorial, and after installing tomcat6 like this:
sudo apt-get install tomcat6-common
sudo apt-get install tomcat6
and making sure that the server is running.
Next, I followed the mentioned tutorial, and everything was fine, until I got to stage 5.4 in the tutorial: "Start Server".
When I click Start, I get the following error:
As I said, I tried to look online for an answer, but nothing seems to help...
Does anyone know why am I getting this error and how can I fix this?
This might be a long-shot but do you have correct permissions for the folder where the config file is located?
try to follow the steps mentioned in below link
clipse-could-not-load-the-tomcat-server-configuration
1)Close Eclipse
2)Copy all files from TOMCAT_6_HOME/conf to WORKSPACE_FOLDER/Servers/Tomcat v6.0 Server at localhost-config
3)Start Eclipse
4) Expand the Servers project, click on the Tomcat 6 project and hit F5
5) Start Tomcat from Eclipse
Try to start the server using terminal and then try in eclipse. go to /bin/ execute the command startup.sh. try this.
if you still got error. Execute this configtest.sh will provide you the proper error.
Then try set Classpath for your server. can be done using setclasspath.sh
I was able to solve it, after 3 and a half hours of trying...
Apparently, when I installed tomcat from the command line (sudo-apt-get etc) the /usr/share/tomcat6 folder (the default installation path) was missing some files, including this /conf folder, which required for Eclipse (hence the error message).
But when I removed it, and download tomcat as a tar.gz file from here, and extracted it, it somehow contains more files in it, including the /conf folder.
So then in Eclipse I created a new Server, and provided the path of the new extracted folder, instead of the previous /usr/share/tomcat.
This did the trick.

eclipse can not start up my tomcat server, how to turn the server on

when i try to run the jsp-file using eclipse, eclipse shows me that my tomcat server is turned off although i turned it on from 'startup.bat' file which is located in the bin directory inside the tomcat installation folder.
I encounter the error shown in the image posted below.how to solve it?
When you configure Tomcat using Runtime configuration in eclipse, then you need NOT to run the tomcat manually. When you execute a server side program such as jsp/servlet, eclipse will first start the associated runtime(Tomcat) and then deploy your jsp/servlet on it.
In your case, as you have manually started the Tomcat, so when eclipse tries to launch the same tomcat, it throws and error saying port already in use.
It seems your sever is already in running state and you are trying to start again.
Any chance you started your server though comand prompt, before trying in eclipse.
If exsist try kiiling the java process of the server in task manager and try again
Let Eclipse handle the Tomcat instance. Run shutdown.bat, then start Tomcat from Eclipse by clicking Windows->Show view->Servers, right click and Start.

Running JSP application using tomcat 6.0 and Eclipse

I am working on an academic project using Eclipse 3.X , jsp's, servlet's etc. The server i chosed to deploy my application is "Tomcat 6.0".
when i change any of my code in the application, i am facing problem with running the application. the changes in the code are not showing any affect even though i restart the server. the changes only get affected, if i restart my eclipse. i tried lot of ways by googling about integration of eclipse with tomcat but nothing worked?. I always have to restart the eclipse, to see my changes.
Please help me with this issue.
thanks in advance.
You should simply be able to use the "republish" feature after saving/building.
1, If the development path and deployment path is the same dictionary, make sure that the "Build Automatically" is checked, it's in "Project->Build Automatically", it can help you deploy the files which are changed.
2, If the development path and deployment path is not the same dictionary, you can write an ant task to deploy project.
if u are running in eclipse it is running the tomcat server of eclipse so for changes to be affected it should be refresh so u have to restart eclipse better way is to use outside eclipse and use localhost and tomcat manager u can restart and can see the changes or use ajax

Categories

Resources