Tomcat Intellij Idea: Remote deploy - linux

RackSpace Cloud Server Ubuntu-12.04, Intellij Idea-11.1.2, Windows-8, Tomcat-7.0.26, JDK-6.
On Intellij Idea when i try to run jsf project on my remote Tomcat 7 server it says:
Error running servername: Unable to connect to the ip-address:1099
It seems problem is about JNDI port which is 1099 but I couldn't activate it I guess. Tomcat config is sth. like that:
What I've tried?
Setting CATALINA_OPTS or JAVA_OPTS on the server side with:
CATALINA_OPTS=-Dcom.sun.management.jmxremote
-Dcom.sun.management.jmxremote.port=1099
-Dcom.sun.management.jmxremote.ssl=false
-Dcom.sun.management.jmxremote.authenticate=false
and
JAVA_OPTS=-Dcom.sun.management.jmxremote
-Dcom.sun.management.jmxremote.port=1099
-Dcom.sun.management.jmxremote.ssl=false
-Dcom.sun.management.jmxremote.authenticate=false
But this one did not work, any ideas?

My answer to my question:
The correct way to deploy remotely is editing JAVA_OPTS environment variable on the remote server. Just enter the command below:
export JAVA_OPTS="-Dcom.sun.management.jmxremote=
-Dcom.sun.management.jmxremote.port=1099
-Dcom.sun.management.jmxremote.ssl=false
-Dcom.sun.management.jmxremote.authenticate=false"
If that's not going to work and if you don't have any obsession to deploy your website via Intellij Idea, I've got the solution for this problem. To be able to run your website under Tomcat, you can/should get artifact in form of .war file.
It can be done in Intellij from project settings(ctrl+alt+shift+s) then hit the plus button and add new artifact(web:application archieve)
After rebuilding the artifact, .war file can be seen in project-folder\out\artifacts. Next, you should place this file into your tomcat/webapps folder.
For example if you are using Tomcat-7, the folder that I mean exists in /var/lib/tomcat7/webapps. Before copying your .war file you should rename it as ROOT.war. This provides to access your site directly by http://youripaddress:8080. After restarting Tomcat7 service you can access the site.
But not finished yet, you can debug your project remotely like you are debugging your project at your local machine with Intellij Idea. Open Run/Debug Configuration in Idea, hit the plus button and there must be Remote. This is the way to debug your projects for application servers like JBoss, Glassfish as well in Idea. Enter your host and port numbers, select your project as a module.
Before starting to debug, as Intellij says you should give the following parameter to your server JVM:
JAVA_OPTS="$JAVA_OPTS -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5005"
To be able to do that in Ubuntu and for Tomcat-7, modified the catalina.sh file in usr/share/tomcat7 folder. I inserted the parameter above of the if [ -z "$LOGGING_MANAGER" ]; then line. It must be on the middle part of the file. Then you should be able to debug your project with Intellij Idea.

Related

Access Remote Glassfish4 Server from Eclipse Luna

I am working on a Mac.
I am running Linux Ubuntu server in a VirtualBox. GlassFish 4 and MySql are already running there. The Linux IP is 10.0.1.12.
On the guest system (Mac) I am running Eclipse Luna. I installed the GlassFish Tools for Eclipse Luna and restarted Eclipse.
Then I wanted to add server for GlassFish4. But Eclipse is asking me for "Server root" and I have no clue what it means! I entered "10.0.1.12:4848/" just as I can access GlassFish from the host system (Mac OS) by a browser. But it just doesn't accept that URL. It seems to expect a local directory path. Here is the dialog box:
Thanks in advance for any hints!!
You need to install a Glassfish4 Server to your local machine (the one Eclipse is running on) despite the fact that you want to connect to and manage a remote Glassfish server; Eclipse will use some of the files in that local installation to manage the remote Glassfish server. Assuming you already have Glassfish4 installed on a remote machine:
[For example purposes]
Let's assume the remote Glassfish server is at 192.168.2.7 on default port 4848 for administration and you've set a password for 'admin' user as 'gfish'.
Let's also assume that your local desktop (development machine running Eclipse Luna) is at 192.168.2.3
Download Glassfish4 Open Source edition zip
Unzip the contents to a directory on your local machine: let's say inside of path /glassfish_server/ you will now have:
/glassfish_server/glassfish4/glassfish/ structure
Back in Eclipse:
Create a New Server -> Select 'Glassfish4' option
Server's Hostname =[remote ip address] // E.G. 192.168.2.7
Server Name: GlassFish 4 at 192.168.2.7 // get's auto-filled
[Next] This is the page you were specifically having issue with:
Set the Root Path to your Local Glassfish Server install directory
so in this example: /glassfish_server/glassfish4/glassfish/ should be accepted
[Next] Now use the credentials and configuration for your remote glassfish server. Run a Ping-Test to test connection.
The server root means the directory where GlassFish is located. This might be, for example, /opt/glassfish4/glassfish. Eclipse needs this so that it can look for the bin/ directory and be able to start/stop the server using the scripts in there.

Webapp Logback Logging Does Not Work Using Tomee Plus 1.6.0 on Linux

I am able to get logback logging to work correctly on my development environment (Windows) using Tomee 1.6.0.1; however, whenever I try to deploy the webapp on my Tomee server on Linux, it never creates the "test.app.log" file specified in the logback.xml configuration file inside of the WEB-INF/classes directory of the webapp.
Using maven, I have included logback-classic-1.1.2 and logback-core-1.1.2 in the WEB-INF/lib directory of the webapp.
I double check permissions for the directory to which I wish to write (CATALINA_BASE/logs), but it is set to rw for all users so I doubt that is the problem.
No matter what I try, all of my logs keep getting pushed to catalina.out. Can anybody solve the mystery as to why logging with logback works correctly on Windows (development environment) but not Linux?
It turns out that we were separating our EJB's into another directory and adding that directory as a "Deployment dir" in tomee.xml. This unhooks the webapp independent logging.
Romain, from Tomee fame, suggested I use either VirtualWebappLoader or jars.txt implementations.

Beginner - setting up local host for Angular app using XAMPP on Windows 7

I have taken a Angular App which works on Local host when I use visual studio IIE server.
I don't want to use Visual Studio and I am trying to test the app locally using XAMPP.
I am a complete beginner, and I cannot get the local host to pick-up the html initialization file. I have checked the following:
Skype is off and the port is set to 80 in XAMMP
the root server in HTTPd.conf is setup correctly (no slash at end)
I am getting a little confused as to 'how' angular will work on the XAMMP local host.
Do I need to get Yeoman or grunt (seen these apps in some posts, but they seem to be for command line environment).
Any help, or even a pointer to a step by step set-up would be great!
Angular is no different from a normal html web page, when it comes to working in a localhost.
Does your XAMPP work with standard HTML files?
Do you have any error generated?
OK. Got this sorted. I was over complicating things entirely, angular runs sweet on regular XAMPP, no Grunt/ Yeoman etc. required.
All you need to do is: 1. install XAMPP 2. Close Skype 3. Place you app, libraries and everything else in the folder C:\xampp\htdocs\
localhost/Angularappstartpage.html
BOOM!
it works.
You may need to adjust the port number on the localhost (default is 80 e.g. localhost:80/...)
You can also change the root folder in your XAMPP config setup to point to your local GIT.
Do this by changing the line in the HTTPD.conf file (click 'config' on the apache module)
DocumentRoot "C:/xampp/htdocs" to DocumentRoot "C:/myLocalGIT"
Hopefully this will help all the new guys out there. Good luck!
Skype blocks the port 80, which is used for browsing. XAMPP uses the same port so exactly.
https://support.skype.com/en/faq/FA148/which-ports-need-to-be-open-to-use-skype-for-windows-desktop
If you use mysql, also open first XAMPP and start your services and then keep working on your SO as always.

Netbeans and Xdebug in Linux

I have installed Xdebug, and I can confirm from phpinfo() that it is correctly installed. I have taken all the steps given in all of the sites that come up with I google "netbeans xdebug install, etc".
It still does not work in Netbeans.
Is there any advice that someone can offer?
Here is my php.ini debug section...
[xdebug]
zend_extension = /usr/lib/php5/20090626/xdebug.so
xdebug.remote_enable = 1
xdebug.remote_mode = "req"
xdebug.remote_handler = dbgp
xdebug.remote_host = 127.0.0.1
xdebug.remote_port = 9000
xdebug.idekey = "netbeans-xdebug"
Any help would be greatly appreciated!
Since the information available to me is very sparse, I have to describe the settings in more detail.
Netbeans and xdebug settings.
Ubuntu 12.04 LTS Precise Pangolin
What ought to be installed.
Global settings:
Tools -- Options
PHP settings:
With phpinfo() you get.. see below image.
Only one php.ini is important ! Look at Loaded Configuration File
If you wrote a xdebug entry into another "php.ini" file be sure to clear all these entries again. ( xdebug ONLY in one php.ini ). Look also at Additional .ini files parsed. We come to this later.
zend_extension="/usr/lib/php5/20090626+lfs/xdebug.so"
xdebug.remote_enable=1
xdebug.remote_handler=dbgp
xdebug.remote_mode=req
xdebug.remote_host=localhost
xdebug.remote_port=9000
Additional .ini files parsed.
Add or controlling, only the first line must be the same as in the "php.ini".( Without " " )
Make sure that the file is really there!
Make sure that the session.save_path is really there!
Control the xdebug version that should be equal to or greater.( Matching PHP Version-5.3.10-1 ). If everything was done as described in this answer, and it does not work, then it is with great probability of an incorrect or defective "xdebug.so".
Create a new Php Project:
Project Properties:
Sources
In our test program, it is important the Project Folder and Source Folder are exactly alike!
Run Configuration
Start Debug: -- press Debug button
The default Browser opens and remains at Connecting .. stand while Netbeans in debug mode is.
(If Netbeans do not open a Browser or can not connect, go back to Advanced Web Configuration and select Do Not Open Web Browser. Close an reopen the browser and type the URL as seen below)
Go through your code. You will see only something in the browser when you're done with the debugging. Don't forget to press the Stop Button . If you forget this xdebug is running on.
Done:
Try using xdebug.remote_connect_back=1 instead of xdebug.remote_host to avoid security issues
In fact,
zend_extension=path/to/xdebug.so
xdebug.remote_enable=1
xdebug.remote_connect_back=1
Must be enough.
Make sure that project properties->run configuration->advanced->do not open web browser option is NOT selected (in netbeans project config).
Also, check project url value in run configuration
The issue wasn't with the configuration of xdebug itself, but how I had NetBeans configured. It was a simple error... basically I was having NetBeans navigate to my /var/www/Application directory, which I hadn't actually set up yet.
Thanks to everyone for their help. I learned a lot about how xdebug works!
Make sure the remote port is set to 9000 in the xdebug.ini file, mine was set to 8000 and once I changed it, xdebug worked immediately.

PHP JAVA Bridge

I am very new to Linux but I am trying best to learn. We have dedicated hosting server of CentOS 6. It is configure with Apache Server as our public website. Now we need to install PHP JAVA Bridge on it.
What I did is, I install TomCat 6 and jdk 1.6. Then I copy JavaBridge.war file to $CATALINA_HOME/webapps folder and jar files on $CATALINA_HOME/lib folder. When I check from tomcat 8080 port JavaBridge is working very good.
Then I make symlink of $CATALINA_HOME/webapps/JavaBridge on my apache server. Untill here everything is okay
But when I try to browse from browser like http://www.xxx.com/JavaBridge I will get following error
You don't have permission to access /JavaBridge/ on this server.
Apache Server at www.gizeleonline.com Port 80
Now my question is that do I am doing it in wrong way or do I have to get rid of Apache server or I am missing something.
Kindly help on this experts :)
Actually it was my mistake. I just re-image my server and re-install everything it start working everything. thanx for help every body

Resources