Tomcat 6 not working in Opensuse 11.0

Hi,

I am very new to Opensuse.
Earlier I used Windows OS. I learnt so many things about the Linux / Opensuse. It might be so many things to me but less to u guys. I want to write whole history here.
I just installed Opensuse 11.0 2 weeks back. I installed java 6 with update 13. I downloaded from java website and installed.
Then when i checked the Java_home path, it was /usr/lib/jvm/java .
Then we linked installed home directory to the above path, then JAVA_HOME showed as /usr/lib/jvm/java .
When I was installing java 6, i didnt specify any directory, it took by itself automatically.

Then I installed tomcat from the yast. It got tomcat 6.0.16-6.4 version.
I selected

  1. struts-webapps-tomcat6 - Sample struts webapps for tomcat6
  2. tomcat6 - Apache Servlet/JSP Engine, RI for Servlet 2.5/JSP 2.1 API
  3. tomcat6-admin-webapps - The host-manager and manager web applications for Apache Tomcat
  4. tomcat6-docs-webapp - The docs web application for Apache Tomcat
  5. tomcat6-javadoc - Javadoc generated documentation for Apache Tomcat
  6. tomcat6-jsp-2_1-api - Apache Tomcat JSP API implementation classes
  7. tomcat6-lib - Libraries needed to run the Tomcat Web container
  8. tomcat6-servlet-2_5-api - Apache Tomcat Servlet API implementation classes
  9. tomcat6-webapps - The ROOT and examples web applications for Apache Tomcat

After that I added the user in the tomcat-user.xml.
<user username=“admin” password=“ADMIN_PASSWORD” roles=“manager”/>

The same thing reflected into /usr/share/tomcat6/conf/tomcat-users.xml

Now I can start the tomcat by using the command ./etc/init.d/tomcat6 start.
It started properly.
I can open that in browser by using url http://localhost:8080/

Every thing is fine untill now.
The problem is when I click Tomcat Manager or Status, its giving error message. HTTP status 401.
Even i used the following link also http://localhost:8080/struts-examples/
It gave message like this
org.apache.jasper.JasperException: java.lang.IllegalStateException: No Java compiler available
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:522)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:350)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:337)

Can any body please solve my problem

Thanks and Regards
Ratna

Probably means exactly what it says, you don’t have a Java compiler. You have a Java runtime in the JRE, since the webapp runs, but you need to install a SDK so that it can compile JSPs. Do this:

rpm -qa | grep java

and post the results.

Hi,

I ran the command that you gave me to run.
Here are the results.

ratnalt:/ # rpm -qa | grep java
sun-javadb-demo-10.4.2-1.1
sun-javadb-common-10.4.2-1.1
java-1_6_0-sun-plugin-1.6.0.u13-0.1
sun-javadb-core-10.4.2-1.1
sun-javadb-javadoc-10.4.2-1.1
sun-javadb-client-10.4.2-1.1
java-1_6_0-sun-1.6.0.u13-0.1
tomcat6-javadoc-6.0.16-6.4
sun-javadb-docs-10.4.2-1.1

And I am sure jdk is installed. I am using the same system as my working computer and Now I am coding in java.
I have already gave the JAVA_HOME path earlier.

ANother doubt -----------
In windows we need to set path = JAVA_HOME/bin.
Dont we need to set like that or else will it take the default.

Thanks and Regards
Ratna

You only have JRE - install SDK.

zypper in java-1_6_0-sun-devel

Java variables are defined in /etc/java/java.conf and are automatically read, you don’t need to define HOME etc.

Hi Chrisantine,

I have executed the command that you asked me to run.
Here are the results.

ratnalt:/ # zypper in java-1_6_0-sun-devel
Reading installed packages…

The following NEW package is going to be installed:
java-1_6_0-sun-devel

Overall download size: 13.2 M. After the operation, additional 52.4 M will be used.
Continue? [YES/no]: yes
Downloading package java-1_6_0-sun-devel-1.6.0.u13-0.1.i586 (1/1), 13.2 M (52.4 M unpacked)
Downloading: java-1_6_0-sun-devel-1.6.0.u13-0.1.i586.rpm [done (1.1 K/s)]
Installing: java-1_6_0-sun-devel-1.6.0.u13-0.1 [done]

Now what i have to do make the Tomcat run.
I know its silly question for you, but its big for me.

Thanks and Regards
Ratna

I just restarted the tomcat its behaving like sameway how i explained earlier. Please help me to run the tomcat.

You also have to make the SDK package the default Java. Do this:

/usr/sbin/update-alternatives --display java

If it shows that it’s pointing to the JRE, you are still using the wrong one. You can set the SDK to be the default Java by running:

/usr/sbin/update-alternatives --config java

and following the interactive prompts.

As root of course.

Hi I am pasting the results that i got

ratnalt:~ # /usr/sbin/update-alternatives --display java
java - status is auto.
link currently points to /usr/lib/jvm/jre-1.6.0-sun/bin/java
/usr/lib/jvm/jre-1.6.0-sun/bin/java - priority 1614
slave policytool.1.gz: /usr/share/man/man1/policytool-java-1_6_0-sun.1.gz
slave keytool.1.gz: /usr/share/man/man1/keytool-java-1_6_0-sun.1.gz
slave rmid.1.gz: /usr/share/man/man1/rmid-java-1_6_0-sun.1.gz
slave orbd.1.gz: /usr/share/man/man1/orbd-java-1_6_0-sun.1.gz
slave rmid: /usr/lib/jvm/jre-1.6.0-sun/bin/rmid
slave servertool.1.gz: /usr/share/man/man1/servertool-java-1_6_0-sun.1.gz
slave javaws.1.gz: /usr/share/man/man1/javaws-java-1_6_0-sun.1.gz
slave jre_exports: /usr/lib/jvm-exports/jre-1.6.0-sun
slave javaws: /usr/lib/jvm/jre-1.6.0-sun/bin/javaws
slave policytool: /usr/lib/jvm/jre-1.6.0-sun/bin/policytool
slave orbd: /usr/lib/jvm/jre-1.6.0-sun/bin/orbd
slave rmiregistry: /usr/lib/jvm/jre-1.6.0-sun/bin/rmiregistry
slave tnameserv: /usr/lib/jvm/jre-1.6.0-sun/bin/tnameserv
slave rmiregistry.1.gz: /usr/share/man/man1/rmiregistry-java-1_6_0-sun.1.gz
slave ControlPanel: /usr/lib/jvm/jre-1.6.0-sun/bin/ControlPanel
slave tnameserv.1.gz: /usr/share/man/man1/tnameserv-java-1_6_0-sun.1.gz
slave keytool: /usr/lib/jvm/jre-1.6.0-sun/bin/keytool
slave jre: /usr/lib/jvm/jre-1.6.0-sun
slave servertool: /usr/lib/jvm/jre-1.6.0-sun/bin/servertool
slave java.1.gz: /usr/share/man/man1/java-java-1_6_0-sun.1.gz
Current `best’ version is /usr/lib/jvm/jre-1.6.0-sun/bin/java.

ratnalt:~ # /usr/sbin/update-alternatives --config java

There is only 1 program which provides java
(/usr/lib/jvm/jre-1.6.0-sun/bin/java). Nothing to configure.

Can you please what i need to do.

Thanks and Regards
Ratna

Dunno. You don’t seem to have the SDK installed and I don’t run 11.0 any more.

Is that problem with 11.0, do i need to install 11.1.
Thanks and Regards
ratna

Hmm.

I tested installing Tomcat 6+Struts+Web apps in a 11.0 virtual machine without any issues.

tomcat6-webapps-6.0.16-6.4                    Thu Jun 25 10:47:16 2009
jakarta-taglibs-standard-1.1.1-211.1          Thu Jun 25 10:47:14 2009
tomcat6-admin-webapps-6.0.16-6.4              Thu Jun 25 10:47:05 2009
struts-webapps-tomcat6-1.2.9-198.2            Thu Jun 25 10:46:14 2009
struts-1.2.9-198.2                            Thu Jun 25 10:46:09 2009
jakarta-commons-validator-1.1.4-239.1         Thu Jun 25 10:46:07 2009
jakarta-commons-digester-1.7-240.1            Thu Jun 25 10:46:07 2009
jakarta-commons-fileupload-1.1.1-31.1         Thu Jun 25 10:46:06 2009
jakarta-commons-beanutils-1.7.0-245.1         Thu Jun 25 10:46:06 2009
jakarta-commons-collections-3.2-31.1          Thu Jun 25 10:46:05 2009
servletapi5-5.0.18-210.1                      Thu Jun 25 10:45:59 2009
oro-2.0.8-210.1                               Thu Jun 25 10:45:59 2009
tomcat6-6.0.16-6.4                            Thu Jun 25 10:45:45 2009
tomcat6-lib-6.0.16-6.4                        Thu Jun 25 10:45:44 2009
tomcat6-jsp-2_1-api-6.0.16-6.4                Thu Jun 25 10:45:37 2009
tomcat6-servlet-2_5-api-6.0.16-6.4            Thu Jun 25 10:45:36 2009
ecj-3.3-58.1                                  Thu Jun 25 10:45:31 2009
jakarta-commons-logging-1.0.4-244.1           Thu Jun 25 10:45:28 2009
jakarta-commons-daemon-1.0.1-205.1            Thu Jun 25 10:45:28 2009

You have struts package installed, of course?

I too installed without any error.
BUt the thing is can you run the struts-example application.
using the link http://localhost:8080/struts-examples
Or can you click the Tomcat Manager link the home page
http://localhost:8080/.

OK

Thanks and Regards
ratna

Yes, I can view them without any errors - the admin page (after giving the admin user an account) and struts examples pages open fine.

You could look at your catalina/tomcat logfiles in /usr/share/tomcat6/logs/

Perhaps they have additional errors that can help us to debug what’s causing this error.

When i start the tomcat server, here are the logs.

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-1.6.0-sun-1.6.0/jre/lib/i386/server:/usr/lib/jvm/java-1.6.0-sun-1.6.0/jre/lib/i386:/usr/lib/jvm/java-1.6.0-sun-1.6.0/jre/…/lib/i386:/usr/java/packages/lib/i386:/lib:/usr/lib
Jun 25, 2009 9:32:12 AM org.apache.coyote.http11.Http11Protocol init
INFO: Initializing Coyote HTTP/1.1 on http-8080
Jun 25, 2009 9:32:12 AM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 1723 ms
Jun 25, 2009 9:32:12 AM org.apache.catalina.core.StandardService start
INFO: Starting service Catalina
Jun 25, 2009 9:32:12 AM org.apache.catalina.core.StandardEngine start
INFO: Starting Servlet Engine: Apache Tomcat/6.0.16
Jun 25, 2009 9:32:12 AM org.apache.catalina.startup.HostConfig deployDescriptor
WARNING: A docBase /srv/tomcat6/webapps/struts-examples inside the host appBase has been specified, and will be ignored
Jun 25, 2009 9:32:14 AM org.apache.struts.validator.ValidatorPlugIn initResources
INFO: Loading validation rules file from ‘/WEB-INF/validator-rules.xml’
Jun 25, 2009 9:32:14 AM org.apache.struts.validator.ValidatorPlugIn initResources
INFO: Loading validation rules file from ‘/WEB-INF/validator/validation.xml’
Jun 25, 2009 9:32:29 AM org.apache.catalina.startup.HostConfig deployDescriptor
WARNING: A docBase /srv/tomcat6/webapps/struts-tiles-documentation inside the host appBase has been specified, and will be ignored
Jun 25, 2009 9:32:30 AM org.apache.struts.tiles.TilesPlugin initDefinitionsFactory
INFO: Tiles definition factory loaded for module ‘’.
Jun 25, 2009 9:32:30 AM org.apache.struts.tiles.TilesPlugin initDefinitionsFactory
INFO: Tiles definition factory loaded for module ‘/examples’.
Jun 25, 2009 9:32:30 AM org.apache.struts.tiles.TilesPlugin initDefinitionsFactory
INFO: Tiles definition factory loaded for module ‘/test’.
Jun 25, 2009 9:32:30 AM org.apache.struts.tiles.TilesPlugin initDefinitionsFactory
INFO: Tiles definition factory loaded for module ‘/tutorial’.
Jun 25, 2009 9:32:30 AM org.apache.catalina.startup.HostConfig deployDescriptor
WARNING: A docBase /srv/tomcat6/webapps/struts-blank inside the host appBase has been specified, and will be ignored
Jun 25, 2009 9:32:30 AM org.apache.struts.tiles.TilesPlugin initDefinitionsFactory
INFO: Tiles definition factory loaded for module ‘’.
Jun 25, 2009 9:32:30 AM org.apache.struts.validator.ValidatorPlugIn initResources
INFO: Loading validation rules file from ‘/WEB-INF/validator-rules.xml’
Jun 25, 2009 9:32:30 AM org.apache.struts.validator.ValidatorPlugIn initResources
INFO: Loading validation rules file from ‘/WEB-INF/validation.xml’
Jun 25, 2009 9:33:03 AM org.apache.catalina.startup.HostConfig deployDescriptor
WARNING: A docBase /srv/tomcat6/webapps/struts-documentation inside the host appBase has been specified, and will be ignored
Jun 25, 2009 9:33:03 AM org.apache.catalina.startup.HostConfig deployDescriptor
WARNING: A docBase /srv/tomcat6/webapps/struts-example inside the host appBase has been specified, and will be ignored
Jun 25, 2009 9:33:03 AM org.apache.struts.webapp.example.memory.MemoryDatabasePlugIn init
INFO: Initializing memory database plug in from ‘/WEB-INF/database.xml’
Jun 25, 2009 9:33:04 AM org.apache.struts.validator.ValidatorPlugIn initResources
INFO: Loading validation rules file from ‘/WEB-INF/validator-rules.xml’
Jun 25, 2009 9:33:04 AM org.apache.struts.validator.ValidatorPlugIn initResources
INFO: Loading validation rules file from ‘/WEB-INF/validation.xml’
Jun 25, 2009 9:33:08 AM org.apache.catalina.core.StandardContext addApplicationListener
INFO: The listener “listeners.ContextListener” is already configured for this context. The duplicate definition has been ignored.
Jun 25, 2009 9:33:08 AM org.apache.catalina.core.StandardContext addApplicationListener
INFO: The listener “listeners.SessionListener” is already configured for this context. The duplicate definition has been ignored.
Jun 25, 2009 9:33:08 AM org.apache.coyote.http11.Http11Protocol start
INFO: Starting Coyote HTTP/1.1 on http-8080
Jun 25, 2009 9:33:08 AM org.apache.jk.common.ChannelSocket init
INFO: JK: ajp13 listening on /0.0.0.0:8009
Jun 25, 2009 9:33:08 AM org.apache.jk.server.JkMain start
INFO: Jk running ID=0 time=0/39 config=null
Jun 25, 2009 9:33:08 AM org.apache.catalina.startup.Catalina start
INFO: Server startup in 56384 ms

I think the main problem is JDK is not set properly.
Tomcat is taking JRE as a jdk.

Thanks and Regards
Ratna Sekhar.K

I’ve had the same problem: For no visible reason tomcat refused to compile jsp pages and gave that “no compiler”-error.
As my last try i uninstalled sun-jdk and tomcat with yast, then reinstalled and everything went fine.

This occured in suse 11.1, susestudio.com build as vmware image.

Hope this helps