Search posterous

Search all posts and users. Type a name, type a favorite song title, whatever! See what comes up.
  

More posterous blogs











More recommended blogs »

Here are posterous posts filed under tomcat...

cenrak says...

Three days ago, I faced a tomcat problem with Red Hat Network Satellite Server. The problem was that whenever I tried to start the Red Hat Satellite Server service it said

[root@RHS run]# service rhn-satellite start
Starting rhn-satellite...
Starting Jabber services                                   [  OK  ]
Starting osa-dispatcher:                                   [  OK  ]
Starting RHN Taskomatic...
Starting tomcat5:                                          [  OK  ]
Starting satellite-httpd:                                  [  OK  ]
Starting rhn-search...
Done.

So, everything should work perfectly. Not really.

[root@RHS run]# service rhn-satellite status
jabberd router (pid 3002) is running...
osa-dispatcher (pid  3074) is running...
RHN Taskomatic is running (3433).
lock file found but no process running for pid 3888
httpd (pid 3956 3955 3954 3953 3952 3951 3950 3949 3922) is running...
rhn-search is running (3947).

I tried several solutions in the Internet just to solve the problem but I could not find a solution that really solved it. I had to compare our two Red Hat Network Satellite to "detect" the main cause.

First, I needed to get my tomcat packages. I ran

rpm -qa | grep tomcat | grep -v rhn-oracle-jdbc-tomcat5-1.0-13.el5 | xargs rpm -ql > /tmp/tomcatfiles

which gave me all tomcat files I have. Then I executed

for file in `cat /tmp/tomcatfiles`; do ll $file; done > /tmp/tomcatFilesPermission

 

to see all my files with their permissions (I did not want to miss anything :)). When I compared the results from my two Red Hat Network Satellite, the one with "lock file" was missing some jar files under /var/lib/tomcat5/common/lib. When I copied them

scp -r /var/lib/tomcat5/common/lib NewRedHatSatelliteServer:/var/lib/tomcat5/common/lib

I went to the Satellite Server with the problem and started the service

[root@RHS common]# service rhn-satellite start
Starting rhn-satellite...
Starting Jabber services                                   [  OK  ]
Starting osa-dispatcher:                                   [  OK  ]
Starting RHN Taskomatic...
Starting tomcat5:                                          [  OK  ]
Starting satellite-httpd:                                  [  OK  ]
Starting rhn-search...
Done.
[root@RHS common]# service rhn-satellite status
jabberd router (pid 11539) is running...
osa-dispatcher (pid  11563) is running...
RHN Taskomatic is running (11588).
/etc/init.d/tomcat5 is already running (12141)
httpd (pid 12200 12199 12198 12197 12196 12195 12194 12193 12166) is running...
rhn-search is running (12192).

everything worked just fine :)

Filed under: tomcat

krzychukula says...

First:
To set(generally increase) Java VM(Tomcat is running on JVM:)) Heap Size use: -Xms32m -Xmx128m
PermGen size is default 64MB no matter how Heap Size is big, so to change it use: -XX:MaxPermSize=128m

Second:
I have realised that my English is worst becouse I'm not using it (nor writing or spiking) so I will try to write post on my blog mainly in English to practice at least writing.

I have request to all readers to show me errors in my posts

Polish version:

PL:
Aby ustawić Heap Size dla maszyny wirtualnej, lub np. Tomcata który przecież też jej używa należy użyć: -Xms32m -Xmx128m

Domyślnie PermGen ma wielkość 64MB niezależnie od wielkości Heap Size, alby podwoić: -XX:MaxPermSize=128m

Aby ćwiczyć angielski przerzucam się na prowadzenie bloga po angielsku, przy czym prośba o wytykanie mi błędów jeśli ktoś takowe zauważy

Jeśli komuś zależy na czytaniu tego bloga po polskiemu proszę dać znać a postaram się pisać wersje np. dwujęzyczne. Jeśli nie to będę pisał wyłącznie po angielsku(lub prawie po angielsku zważywszy na to jak wyszedłem z wprawy i ile zapomniałem przez ostatnie 3 lata)

Filed under: Tomcat

Matt says...

One of the best kept secrets that's bundled with your Java 6 JDK is VisualVM. VisualVM is an absolutely fantastic, free monitoring tool for Java that you may not realize is right under your nose.

In a nutshell, when you fire up VisualVM it provides you with a ton of monitoring tools for everything running on the JVM. By default VisualVM will monitor the VM from which it's launched, so if for example you launch VisualVM from the bin directory of jdk1.6.0_17, then anything using that JVM will show up as a process in VisualVM that can be monitored. Note that in some cases certain processes will not appear in VisualVM, which is the real point of this post; I'll get to that in a moment.

I'm attaching a few screenshots to this post. The first shows what VisualVM looks like when I fired it up just now on my Linux laptop, the second shows a snapshot of the main monitor screen (in this case I'm monitoring Tomcat), and the third shows a snapshot of the thread monitoring screen (note the Open BlueDragon threads!). VisualVM can also take and load snapshots so you really hone in on problems at the VM level quite easily.

One major point I'd like to make is that VisualVM will monitor any Java application running on the JVM. So in the CFML world this means if you have OpenBD, Railo, or ColdFusion running, they can all be monitored quite nicely using VisualVM.

VisualVM can also monitor remote JVMs via JMX (Java Management Extensions), so if you're having trouble on a remote server and want to see what's going on, as long as the JMX ports are open and accessible you can launch VisualVM from your local machine and connect to the remote VM. Note that monitoring is a very lightweight process so VisualVM can be used to monitor production servers with virtual no impact. Visual VM also does profiling, however, which is a much more heavyweight process. It provides a huge amount of useful information, but should be used only when absolutely needed on production servers since it will have a noticeable impact on performance.

Now to the real point of this post. When I launched VisualVM on a Windows 2003 server today I was surprised that Tomcat didn't show up as a process running under the VM. Turns out that if you install Tomcat as a service, even if it's running under the same user account that you used to launch VisualVM, Tomcat won't appear by default in the VisualVM process list.

Luckily it's easy enough to resolve. Simply open the Tomcat Configuration application and add the following in the Java Options box on the Java tab:

-Dcom.sun.management.jmxremote.port=8086
-Dcom.sun.management.jmxremote.ssl=false
 -Dcom.sun.management.jmxremote.authenticate=false

After making this change you do have to restart Tomcat.

This will enable JMX in Tomcat and allow VisualVM to connect to it. You can choose any port you like, and note that if you want to use SSL or authentication you would set those options to true. I haven't personally messed with authentication so I'm not sure what that authenticates against, but know that if you want to have JMX available on a production system that you can secure it this way, or of course through firewall rules.

With JMX enabled in Tomcat you then go into VisualVM, add a new JMX connection, and point it to localhost:8086 (or whatever port you set JMX to run on). That's it--you're now monitoring Tomcat!

VisualVM is a great, free tool that you likely already have on your machine, so you really owe it to yourself to check it out.

     
Click here to download:
Monitoring_Tomcat_with_Java_Vi.zip (171 KB)

Filed under: Tomcat

Matt says...

I'm replacing one of our ColdFusion 8 installs with Tomcat 6.0.20 and Open BlueDragon, and this is on a 64-bit Windows 2003 server. Easy enough conceptually, but it turns out running Tomcat as a service on 64-bit Windows has a small trick involved.

A couple of potential solutions are outlined on StackOverflow (and numerous other places), but it still involved a bit of hunting around, so I thought a step-by-step with specific links would be helpful both to others and to myself when I forget how to do this next time. ;-)

  1. Install a 64-bit JDK if you haven't already.
  2. Download and run the Windows Service Installer of Tomcat.
    1. Make sure and point to your 64-bit JVM at the appropriate spot in the install process.
    2. At the end of the install, uncheck the box to start Tomcat. It won't start anyway at this point since the startup script included in the download is 32-bit.
  3. Grab the 64-bit versions of tomcat6.exe and tomcat6w.exe from the SVN repository. Even though it says "amd64" in the URL these files work on Intel chips as well.
  4. Replace the tomcat6.exe and tomcat6w.exe in Tomcat's bin directory with the new 64-bit versions you downloaded.
  5. Start up Tomcat!
That should be all there is to it. The one thing that doesn't work for me is the "Monitor Tomcat" application, but that really isn't a big deal since it doesn't do or tell you anything you can't get from the Services panel. I haven't dug into that at all so if anyone knows why that doesn't run I'd be curious to know.

After this is all installed make sure and go into the Tomcat Configuration app to take advantage of all the RAM you need or want to for your applications.

Filed under: Tomcat

Matt says...

the biggest news was probably the timeframe announcement for Apache Tomcat version 7.  According to Jim Jagielski, chairman of the Apache board of directors, Tomcat is used in at least 75% of Java-based websites.  Mark Thomas, a member of the Apache Tomcat Project Management Committee, said that the alpha release of Tomcat 7 is expected in December 2009 or January 2010.  DZone spoke with Thomas for an exclusive interview about the upcoming version of Tomcat. 

Cool new stuff coming in Tomcat 7, and I didn't realize an alpha was so close.

Filed under: Tomcat

Matt says...

Here's a PDF of my "Building and Deploying CFML on an Open Source Stack" presentation from BFusion 2009. The VirtualBox VM we used in the session is available here (2.9 GB zip file), and the user/password on the VM is "floss" (without the quotes) for both. The VM includes:

  • Ubuntu 9.04
  • Java 1.6.0 Update 16
  • MySQL 5
  • Apache
  • Tomcat 6.0.20
  • OpenBD (WAR and pre-deployed)
  • Eclipse with CFEclipse and Subclipse
  • A ColdTonica WAR to practice deployment

The one thing we didn't get to in my session is connecting Apache to Tomcat, but that's simple enough so give me a shout if you have trouble with that.

What we did get to (that I'm glad we did) is monitoring Tomcat and OpenBD with VisualVM, and a lot of people (based on the reaction) seemed not to be aware of that tool.

Once again this is a GREAT conference (I'd be lying if I said Ben Nadel's portion of the keynote didn't get me a little teary eyed) with great technical content and day-long training sessions. If you aren't here this year, get here next year!

Filed under: Tomcat

reklame says...

Linus.

Filed under: tomcat

trapo says...

Fast tip: you can use tomcat maven plugin to run Trapo in development mode. Just open a prompt, go to trapo directory and run the following command:
 
>> mvn clean tomcat:run 
Voilá! Besides the fact that Trapo runs ok in Tomcat, I'm just trying compatibilities issues here. Tomcat is more heavy than Jetty for restarts, something that I need to change-save-and-see developement.

Filed under: tomcat

Matt says...

GlassFish has just recorded a record-setting September in terms of downloads, registrations, and admin pings. The GlassFish downloads graph is indicative of a "breakout" for GlassFish within the application server market sphere.

I'm still a big Tomcat fan myself, but have others made the switch from Tomcat to Glassfish (or use both)? Any big advantage to Glassfish if I don't need the full JEE bits?

I wonder also if this includes downloads of Glassfish with NetBeans. Since it's the default servlet container with the full version of NetBeans that could skew the numbers a bit.

Filed under: Tomcat

trapo says...

So, do you want to run Trapo and see how it looks like?

CURRENT STATE

For now, you can just run it in development mode. You will need:
  1. You need Java, because Trapo is developed using Java. You need version 1.5 or newer
  2. PostgreSQL (8.2 or newer) with a database named trapo and with an user "trapo" with password "trapo"
  3. And you need maven.
Once you have all this stuff installed and configured in your box, you can run Trapo using one of the these two ways:

RUN TRAPO THROUGH MAVEN

Piece of cake, just travel to Trapo directory and type:

> mvn clean jetty:run

Probably, maven will try to download the whole internet and so the command may take a while to run. But this will occur just first time you run the command. Open your browser and go to http://localhost:8080/trapo/index.html

CREATING AND DEPLOYING A WAR

If you choose this option, you will need a servlet container (Tomcat, Jetty, Glassfish, etc). Just follow the steps below:
  1. Travel to Trapo directory and run: > mvn war
  2. Maven will generate a war file, rename it to trapo.war
  3. Deploy the trapo.war (usually you just need to copy the file to a directory inside your container)
Open your browser and go to http://localhost:8080/trapo/index.html

Filed under: tomcat