PDA

View Full Version : FC5 and Sun's Java



mastahnke
29th March 2006, 06:29 AM
In an attempt to get some tomcat applications working, I installed sun's jvm. I used the tar.gz as the documentation indicates from Fedora that using the RPM could break during yum updates due to the "provides" methods of the Sun's RPM.

Step 1. install Sun's JRE
Step 2. Place it in /opt/jre1.5
Step 3. Mess with the hell that is attempting to start tomcat5, configure tomcat5, figure out how to use the alternatives command, use it, google a bunch and still get errors.

Here's the startup error.
[
root@xxx ~]# service tomcat5 start
Starting tomcat5: /usr/bin/rebuild-jar-repository: error: Could not find jdbc-stdext Java extension for this JVM
/usr/bin/rebuild-jar-repository: error: Could not find jndi Java extension for this JVM
/usr/bin/rebuild-jar-repository: error: Some detected jars were not found for this jvm
/usr/bin/rebuild-jar-repository: error: Could not find jaas Java extension for this JVM
/usr/bin/rebuild-jar-repository: error: Some detected jars were not found for this jvm
find: warning: you have specified the -mindepth option after a non-option argument -type, but options are not positional (-mindepth affects tests specified before it as well as those specified after it). Please specify options before other arguments.

find: warning: you have specified the -maxdepth option after a non-option argument -type, but options are not positional (-maxdepth affects tests specified before it as well as those specified after it). Please specify options before other arguments.

Using CATALINA_BASE: /usr/share/tomcat5
Using CATALINA_HOME: /usr/share/tomcat5
Using CATALINA_TMPDIR: /usr/share/tomcat5/temp
Using JRE_HOME:
[ OK ]

Lots of googling and forum reading led me to believe I was close. Certainly, I could rip everything out and use jpackage.org's documentation and packaging methods, but I actually wanted a Fedora system, just with Sun's Java. I wouldn't think that is too hard.

I am kind of a Java administration noob, so please be gentle!

Here is my alternatives list.
[
root@xxx ~]# alternatives --display java
java - status is manual.
link currently points to /opt/jre1.5/bin/java
/usr/lib/jvm/jre-1.4.2-gcj/bin/java - priority 1420
slave rmiregistry: /usr/lib/jvm/jre-1.4.2-gcj/bin/rmiregistry
slave jre_exports: /usr/lib/jvm-exports/jre-1.4.2-gcj
slave jre: /usr/lib/jvm/jre-1.4.2-gcj
/opt/jre1.5/bin/java - priority 2
slave rmiregistry: /opt/jre1.5/bin/rmiregistry
slave jre_exports: (null)
slave jre: /opt/jre1.5
Current `best' version is /usr/lib/jvm/jre-1.4.2-gcj/bin/java.


I can't find a jre_exports in /opt/jre1.5.


I hope it's something obvious.

MIKE

bob
29th March 2006, 12:50 PM
Mike, I know NOTHING about Java programming, but Stan Finley's instructions here: http://stanton-finley.net/fedora_core_5_installation_notes.html#Java have Sun Java working for Firefox and other programs on my system. Might want to compare notes.

herrib
29th March 2006, 07:10 PM
You'll have to initialize the slave references. In a console, type (with root rights):


# JRE=/opt/jdk1.5
# /usr/sbin/alternatives \
--install /usr/bin/java java $JRE/bin/java 15004 \
--slave /usr/bin/rmiregistry rmiregistry $JRE/bin/rmiregistry \
--slave /usr/share/man/man1/java.1 java.1 $JRE/man/man1/java.1 \
--slave /usr/share/man/man1/rmiregistry.1 rmiregistry.1 $JRE/man/man1/rmiregistry.1 \
--slave /usr/lib/jvm/jre jre $JRE/jre \
--slave /usr/lib/jvm-exports/jre jre_exports $JRE/jre/lib

This document (http://www.fedora-france.org/modules/wiwimod/index.php?page=Java+Sun+:+installation+(plugin,+JR E,+JDK)+pour+Fedora+4&back=Installation+et+Syst%E8me) is written in french but may be a help for you (just read the examples ...).

brunson
29th March 2006, 08:05 PM
The base Sun jre package does not include jndi or jdbc, you have to download and install them separately. Also, I'd recommend using the rpm release from Sun.

mastahnke
30th March 2006, 05:01 AM
I still haven't got it working. I tried to switch to the SDK, instead of the just the JRE to see if that would help. No luck thus far. I can't believe I am the only one who has had this problem.

Also, is the jdbc stuff a separate package from Sun? I looked for it briefly, but didn't come up with much. Also, the tomcat error logs are not all that helpful to me, but I could attach them.

here's my current alternatives list.


[root@xxx ~]# alternatives --display java
java - status is manual.
link currently points to /opt/jre1.5/bin/java
/usr/lib/jvm/jre-1.4.2-gcj/bin/java - priority 1420
slave rmiregistry: /usr/lib/jvm/jre-1.4.2-gcj/bin/rmiregistry
slave jre_exports: /usr/lib/jvm-exports/jre-1.4.2-gcj
slave jre: /usr/lib/jvm/jre-1.4.2-gcj
slave java.1: (null)
slave rmiregistry.1: (null)
/opt/jre1.5/bin/java - priority 2
slave rmiregistry: /opt/jre1.5/bin/rmiregistry
slave jre_exports: /opt/jre1.5/jre/lib
slave jre: /opt/jre1.5/jre
slave java.1: /opt/jre1.5/man/man1/java.1
slave rmiregistry.1: /opt/jre1.5/man/man1/rmiregistry.1
Current `best' version is /usr/lib/jvm/jre-1.4.2-gcj/bin/java.



I also have set the Java option for the second set of alternatives.

mastahnke
30th March 2006, 06:11 AM
Ok, after more fiddleing, I found this: http://fedoraproject.org/wiki/JavaFAQ

This certainly made the JVM part easier. I then deployed my app (I guess anyway, I cp'ed a .war file) to the webapps directory. I can run the jar file from the command line fine, so I think all the java works.

Now I am getting tomcat specific errors (I think). Any suggestions? This is the cataline.out log file. (a snip)


Mar 29, 2006 11:07:05 PM org.apache.catalina.startup.HostConfig deployWAR
INFO: Deploying web application archive source.war
Mar 29, 2006 11:07:06 PM org.apache.coyote.http11.Http11BaseProtocol start
INFO: Starting Coyote HTTP/1.1 on http-8080
Mar 29, 2006 11:07:06 PM org.apache.jk.common.ChannelSocket init
INFO: JK: ajp13 listening on /0.0.0.0:8009
Mar 29, 2006 11:07:06 PM org.apache.jk.server.JkMain start
INFO: Jk running ID=0 time=0/34 config=null
Mar 29, 2006 11:07:06 PM org.apache.catalina.storeconfig.StoreLoader load
INFO: Find registry server-registry.xml at classpath resource
Mar 29, 2006 11:07:07 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 1777 ms
Mar 29, 2006 11:10:59 PM org.apache.jk.common.MsgAjp processHeader
SEVERE: BAD packet signature 18245
Mar 29, 2006 11:10:59 PM org.apache.jk.common.ChannelSocket processConnection
SEVERE: Error, processing connection
java.lang.IndexOutOfBoundsException
at java.io.BufferedInputStream.read(BufferedInputStre am.java:306)
at org.apache.jk.common.ChannelSocket.read(ChannelSoc ket.java:607)
at org.apache.jk.common.ChannelSocket.receive(Channel Socket.java:564)
at org.apache.jk.common.ChannelSocket.processConnecti on(ChannelSocket.java:672)
at org.apache.jk.common.ChannelSocket$SocketConnectio n.runIt(ChannelSocket.java:876)
at org.apache.tomcat.util.threads.ThreadPool$ControlR unnable.run(ThreadPool.java:684)
at java.lang.Thread.run(Thread.java:595)
[root@netbox opt]#

csfalcon
30th March 2006, 06:19 AM
JDBC is provided by the database provider, look for it on the database provider's website.

Here is how I install tomcat: http://www.csfalcon.com/wiki/csfalcon/TomcatServer

did you set the JAVA_HOME environment variable?

mastahnke
30th March 2006, 06:37 AM
I think I got it. I guess by default tomcat has no applications deployed. Not even a welcome screen, at least under FC5 defaults. I went to my specific directory and I got data back. I guess that's good.