• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Converting Tomcat app from Windows to Ubuntu

 
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have a web application working in Tomcat 6 under Windows. I need to run it in Ubuntu Server.

I installed Tomcat on Ubuntu and http://192.168.1.9/index.html I get the base "It Works" screen from Tomcat. 192.168.1.9 is the IP of the Ubuntu server.

I created a WAR file of my application (I will call myapp) off of windows. I tested it on the Windows, placing the war file in the webapps directory and it auto deployed correctly.

In Ubuntu, I placed the war file in the webapps directory (/usr/share/tomcat6/webapps), this file was moved through a samba share, not FTP.
I restarted tomcat and it does not deploy, and yes, autoDeploy is set to true in the server.xml file.

I then tried to copy in all the files manually. This is everything under the webapps directory for "myapp" (this is the jsp's, servlets class files, etc.). Again, after restarting tomcat, the application is still not running.

http://192.168.1.9/manager/list gives:
OK - Listed applications for virtual host localhost
/manager:running:0:/usr/share/tomcat6-admin/manager
/:running:0:ROOT
/host-manager:running:0:/usr/share/tomcat6-admin/host-manager

What am I missing?

Thanks in advance for any help,

Don

(Ubuntu 10.04, Windows 2000, Tomcat 6, MySql 5.1,
Ubuntu java version "1.6.0_20" OpenJDK Runtime Environment (IcedTea6 1.9.2) (6b20-1.9.2-0ubuntu1~10.04.1)
Windows java version "1.6.0_20" Java(TM) SE Runtime Environment (build 1.6.0_20-b02),
connects to the same remote MySql database)
 
Rancher
Posts: 618
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Have you checked the log files? What does your web.xml file look like? Do you have any paths in your xml files that refer to your Windows box? Is your MySql database configured to allow access from your Ubuntu box?
 
Ranch Hand
Posts: 74
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
First try with your 8080 port (or whatever your Tomcat is listening on), since the "It works" message seems to come from your Apache web server (not tomcat !).
You seem to have some proxy configured in Apache, but most likely not the way you want it.
 
don cline
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Tom,

Thank you for your post.

Briefly, I am pretty sure that I what I am doing wrong is very basic. I have copied the log files and as you will see, Tomcat did not try to even deploy the app.


Have you checked the log files?
The log files follow:
catalina.out
Jan 2, 2011 8:05:56 PM org.apache.catalina.core.AprLifecycleListener init
INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: /
usr/lib/jvm/java-6-openjdk/jre/lib/i386/client:/usr/lib/jvm/java-6-openjdk/jre/lib/i386:/usr/lib/jvm/java-6-openjdk/jre/../lib/i386:/usr/java/packages
/lib/i386:/usr/lib/jni:/lib:/usr/lib
Jan 2, 2011 8:05:57 PM org.apache.coyote.http11.Http11Protocol init
INFO: Initializing Coyote HTTP/1.1 on http-80
Jan 2, 2011 8:05:57 PM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 4331 ms
Jan 2, 2011 8:05:58 PM org.apache.catalina.core.StandardService start
INFO: Starting service Catalina
Jan 2, 2011 8:05:58 PM org.apache.catalina.core.StandardEngine start
INFO: Starting Servlet Engine: Apache Tomcat/6.0.24
Jan 2, 2011 8:05:58 PM org.apache.catalina.startup.HostConfig deployDescriptor
INFO: Deploying configuration descriptor ROOT.xml
Jan 2, 2011 8:05:59 PM org.apache.catalina.startup.HostConfig deployDescriptor
INFO: Deploying configuration descriptor host-manager.xml
Jan 2, 2011 8:06:00 PM org.apache.catalina.startup.HostConfig deployDescriptor
INFO: Deploying configuration descriptor manager.xml
Jan 2, 2011 8:06:00 PM org.apache.coyote.http11.Http11Protocol start
INFO: Starting Coyote HTTP/1.1 on http-80
Jan 2, 2011 8:06:00 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 3215 ms


catalina.2011-01-02.log
Jan 2, 2011 8:05:56 PM org.apache.catalina.core.AprLifecycleListener init
INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: /
usr/lib/jvm/java-6-openjdk/jre/lib/i386/client:/usr/lib/jvm/java-6-openjdk/jre/lib/i386:/usr/lib/jvm/java-6-openjdk/jre/../lib/i386:/usr/java/packages
/lib/i386:/usr/lib/jni:/lib:/usr/lib
Jan 2, 2011 8:05:57 PM org.apache.coyote.http11.Http11Protocol init
INFO: Initializing Coyote HTTP/1.1 on http-80
Jan 2, 2011 8:05:57 PM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 4331 ms
Jan 2, 2011 8:05:58 PM org.apache.catalina.core.StandardService start
INFO: Starting service Catalina
Jan 2, 2011 8:05:58 PM org.apache.catalina.core.StandardEngine start
INFO: Starting Servlet Engine: Apache Tomcat/6.0.24
Jan 2, 2011 8:05:58 PM org.apache.catalina.startup.HostConfig deployDescriptor
INFO: Deploying configuration descriptor ROOT.xml
Jan 2, 2011 8:05:59 PM org.apache.catalina.startup.HostConfig deployDescriptor
INFO: Deploying configuration descriptor host-manager.xml
Jan 2, 2011 8:06:00 PM org.apache.catalina.startup.HostConfig deployDescriptor
INFO: Deploying configuration descriptor manager.xml
Jan 2, 2011 8:06:00 PM org.apache.coyote.http11.Http11Protocol start
INFO: Starting Coyote HTTP/1.1 on http-80
Jan 2, 2011 8:06:00 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 3215 ms


localhost.2011-01-02.log
this was empty


What does your web.xml file look like?
The contents follows:
<?xml version="1.0" encoding="ISO-8859-1"?>

<web-app xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
version="2.5">

<description>
Servlet and JSP Examples.
</description>
<display-name>NeuralNetII</display-name>
<!-- Define servlets that are included in the NeuralNetII application -->

<servlet>
<servlet-name>Reflect</servlet-name>
<servlet-class>Reflect</servlet-class>
</servlet>

<servlet-mapping>
<servlet-name>Reflect</servlet-name>
<url-pattern>/Reflect</url-pattern>
</servlet-mapping>

<servlet>
<servlet-name>SymbolMaintenanceAddSymbol</servlet-name>
<servlet-class>SymbolMaintenanceAddSymbol</servlet-class>
</servlet>

<servlet-mapping>
<servlet-name>SymbolMaintenanceAddSymbol</servlet-name>
<url-pattern>/SymbolMaintenanceAddSymbol</url-pattern>
</servlet-mapping>

<servlet>
<servlet-name>SymbolMaintenanceSymbolDelete</servlet-name>
<servlet-class>SymbolMaintenanceSymbolDelete</servlet-class>
</servlet>

<servlet-mapping>
<servlet-name>SymbolMaintenanceSymbolDelete</servlet-name>
<url-pattern>/SymbolMaintenanceSymbolDelete</url-pattern>
</servlet-mapping>

<servlet>
<servlet-name>SymbolMaintenanceSplitDelete</servlet-name>
<servlet-class>SymbolMaintenanceSplitDelete</servlet-class>
</servlet>

<servlet-mapping>
<servlet-name>SymbolMaintenanceSplitDelete</servlet-name>
<url-pattern>/SymbolMaintenanceSplitDelete</url-pattern>
</servlet-mapping>

<servlet>
<servlet-name>SymbolMaintenanceSplitAdd</servlet-name>
<servlet-class>SymbolMaintenanceSplitAdd</servlet-class>
</servlet>

<servlet-mapping>
<servlet-name>SymbolMaintenanceSplitAdd</servlet-name>
<url-pattern>/SymbolMaintenanceSplitAdd</url-pattern>
</servlet-mapping>

<servlet>
<servlet-name>SymbolMaintenanceExtendForwardRemote</servlet-name>
<servlet-class>SymbolMaintenanceExtendForwardRemote</servlet-class>
</servlet>

<servlet-mapping>
<servlet-name>SymbolMaintenanceExtendForwardRemote</servlet-name>
<url-pattern>/SymbolMaintenanceExtendForwardRemote</url-pattern>
</servlet-mapping>

<servlet>
<servlet-name>SymbolMaintenanceExtendBackRemote</servlet-name>
<servlet-class>SymbolMaintenanceExtendBackRemote</servlet-class>
</servlet>

<servlet-mapping>
<servlet-name>SymbolMaintenanceExtendBackRemote</servlet-name>
<url-pattern>/SymbolMaintenanceExtendBackRemote</url-pattern>
</servlet-mapping>

<servlet>
<servlet-name>SymbolMaintenanceCalculateLastFewRemote</servlet-name>
<servlet-class>SymbolMaintenanceCalculateLastFewRemote</servlet-class>
</servlet>

<servlet-mapping>
<servlet-name>SymbolMaintenanceCalculateLastFewRemote</servlet-name>
<url-pattern>/SymbolMaintenanceCalculateLastFewRemote</url-pattern>
</servlet-mapping>

<servlet>
<servlet-name>SymbolMaintenanceCalculateAllRemote</servlet-name>
<servlet-class>SymbolMaintenanceCalculateAllRemote</servlet-class>
</servlet>

<servlet-mapping>
<servlet-name>SymbolMaintenanceCalculateAllRemote</servlet-name>
<url-pattern>/SymbolMaintenanceCalculateAllRemote</url-pattern>
</servlet-mapping>

<servlet>
<servlet-name>NetDefinitionMaintenanceSave</servlet-name>
<servlet-class>NetDefinitionMaintenanceSave</servlet-class>
</servlet>

<servlet-mapping>
<servlet-name>NetDefinitionMaintenanceSave</servlet-name>
<url-pattern>/NetDefinitionMaintenanceSave</url-pattern>
</servlet-mapping>

<servlet>
<servlet-name>NetDefinitionMaintenanceDelete</servlet-name>
<servlet-class>NetDefinitionMaintenanceDelete</servlet-class>
</servlet>

<servlet-mapping>
<servlet-name>NetDefinitionMaintenanceDelete</servlet-name>
<url-pattern>/NetDefinitionMaintenanceDelete</url-pattern>
</servlet-mapping>

<servlet>
<servlet-name>RunDefinitionMaintenanceDelete</servlet-name>
<servlet-class>RunDefinitionMaintenanceDelete</servlet-class>
</servlet>

<servlet-mapping>
<servlet-name>RunDefinitionMaintenanceDelete</servlet-name>
<url-pattern>/RunDefinitionMaintenanceDelete</url-pattern>
</servlet-mapping>

<servlet>
<servlet-name>RunDefinitionMaintenanceSave</servlet-name>
<servlet-class>RunDefinitionMaintenanceSave</servlet-class>
</servlet>

<servlet-mapping>
<servlet-name>RunDefinitionMaintenanceSave</servlet-name>
<url-pattern>/RunDefinitionMaintenanceSave</url-pattern>
</servlet-mapping>

<servlet>
<servlet-name>RunDefinitionMaintenanceTrainRemote</servlet-name>
<servlet-class>RunDefinitionMaintenanceTrainRemote</servlet-class>
</servlet>

<servlet-mapping>
<servlet-name>RunDefinitionMaintenanceTrainRemote</servlet-name>
<url-pattern>/RunDefinitionMaintenanceTrainRemote</url-pattern>
</servlet-mapping>

<servlet>
<servlet-name>TrainedNetMaintenanceDelete</servlet-name>
<servlet-class>TrainedNetMaintenanceDelete</servlet-class>
</servlet>

<servlet-mapping>
<servlet-name>TrainedNetMaintenanceDelete</servlet-name>
<url-pattern>/TrainedNetMaintenanceDelete</url-pattern>
</servlet-mapping>


<servlet>
<servlet-name>TrainedNetMaintenanceDeleteBackTest</servlet-name>
<servlet-class>TrainedNetMaintenanceDeleteBackTest</servlet-class>
</servlet>

<servlet-mapping>
<servlet-name>TrainedNetMaintenanceDeleteBackTest</servlet-name>
<url-pattern>/TrainedNetMaintenanceDeleteBackTest</url-pattern>
</servlet-mapping>


<servlet>
<servlet-name>TrainedNetMaintenanceScoreRemote</servlet-name>
<servlet-class>TrainedNetMaintenanceScoreRemote</servlet-class>
</servlet>

<servlet-mapping>
<servlet-name>TrainedNetMaintenanceScoreRemote</servlet-name>
<url-pattern>/TrainedNetMaintenanceScoreRemote</url-pattern>
</servlet-mapping>

<servlet>
<servlet-name>BackTestRunDefinitionMaintenanceDelete</servlet-name>
<servlet-class>BackTestRunDefinitionMaintenanceDelete</servlet-class>
</servlet>

<servlet-mapping>
<servlet-name>BackTestRunDefinitionMaintenanceDelete</servlet-name>
<url-pattern>/BackTestRunDefinitionMaintenanceDelete</url-pattern>
</servlet-mapping>

<servlet>
<servlet-name>BackTestRunDefinitionMaintenanceSave</servlet-name>
<servlet-class>BackTestRunDefinitionMaintenanceSave</servlet-class>
</servlet>

<servlet-mapping>
<servlet-name>BackTestRunDefinitionMaintenanceSave</servlet-name>
<url-pattern>/BackTestRunDefinitionMaintenanceSave</url-pattern>
</servlet-mapping>

<servlet>
<servlet-name>BackTestRunDefinitionMaintenanceBackTestRemote</servlet-name>
<servlet-class>BackTestRunDefinitionMaintenanceBackTestRemote</servlet-class>
</servlet>

<servlet-mapping>
<servlet-name>BackTestRunDefinitionMaintenanceBackTestRemote</servlet-name>
<url-pattern>/BackTestRunDefinitionMaintenanceBackTestRemote</url-pattern>
</servlet-mapping>

</web-app>



Do you have any paths in your xml files that refer to your Windows box?
I am pretty confident that I do not. There is one jsp dialog that is not yet OS neutral, but all of the rest should be. I would simply expect this jsp to fail in its function.


Is your MySql database configured to allow access from your Ubuntu box?
The Ubuntu box is already accessing the MySql database. Much of this application runs as a stand alone Java app or under tomcat. The standalone part is running on that Ubuntu box (192.168.1.9) and accessing the database. BTW, MySql is running on another Ubuntu server box (192.168.1.7).

Thank you for you suggestion. But, the log files were not a big help to me. Again, the war file is placed in /usr/share/tomcat6/webapps and tomcat seems to not even try to deploy it.

Don
 
Costi Ciudatu
Ranch Hand
Posts: 74
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
On ubunbu, it seems like the webapps directory is under: /var/lib/tomcat6/webapps.
Actually, /var/lib/tomcat6 is set as CATALINA_HOME by the init script.

Is that /usr/share/tomcat6/webapps created by you (no such directory is created when the package is installed) ?
 
don cline
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Costi,

Thank you for your post.

I do not have Apache installed. I am running Tomcat as a standalone application. I have changed the port it listens to, to port 80 in /etc/tomcat6/server.xml

Of course, I had to change /etc/default/tomcat6 to allow it to turn on AUTHBIND.

The first two lines of http://192.168.1.9/ are:
It works !

If you're seeing this page via a web browser, it means you've setup Tomcat successfully. Congratulations!


So Tomcat is running.

But, in developing an answer to your post I discovered the problem

I was using /usr/share/tomcat6/webapps as the root apps directory and place to put the war file rathar than /var/lib/tomcat6/webapps

So, it all works. Thanks to both that posted for your help.



Don

 
Costi Ciudatu
Ranch Hand
Posts: 74
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I beat you to it, apparently, as when I realised my first post was useless I actually checked the ubuntu tomcat configuration just to make it up.
 
Your mother was a hamster and your father was a tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic