Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 192787

Summary: www-servers/tomcat-5.5.23-r6 doesn't support JDK-1.4
Product: Gentoo Linux Reporter: Jiri Tyr <jiri.tyr>
Component: New packagesAssignee: Java team <java>
Status: RESOLVED FIXED    
Severity: normal    
Priority: High    
Version: 2007.0   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on: 191611    
Bug Blocks:    
Attachments: package.env
emerge.info
dep.txt

Description Jiri Tyr 2007-09-17 09:11:37 UTC
I just installed www-servers/tomcat-5.5.23-r6 and when I tried to start it I have got this error message:

/etc/init.d/tomcat-5.5 start
 * Starting Tomcat ...
 * Tomcat has been compiled with java5 USE flag set.
 * Tomcat now requires a VM >=1.5 to run.
 * Please check your VM version, and restart Tomcat.

I have compiled Tomcat WITHOUT the java5 USE flag:

[ebuild   R   ] www-servers/tomcat-5.5.23-r6  USE="admin doc examples test -java5 -source"

and during the compilation it was used JDK-1.4:

* Using: blackdown-jdk-1.4.2

So it should allow to me to start Tomcat with JDK-1.4 but it doesn't. The same behaviour have www-servers/tomcat-5.5.25 as well. I need Tomcat with JDK-1.4 support for commercial application WebMathematica. I would appreciate if there will be Tomcat with JDK-1.4 support in the portage tree in the future.
Comment 1 William L. Thomson Jr. (RETIRED) gentoo-dev 2007-09-17 14:44:47 UTC
Looking into this, seems to be a problem or bug with gjl. Since it's what does a java bytecode version check or etc on the package before trying to run it with an improper vm version.

You should not see or get that error, without the java5 USE flag set. You should be able to run tomcat with a 1.4 vm if the java5 USE flag is not set.
Comment 2 Petteri Räty (RETIRED) gentoo-dev 2007-09-17 15:01:40 UTC
Works just fine here.

pena kde # grep sun-jdk /etc/conf.d/tomcat-5.5
# Example: GENTOO_VM="sun-jdk-1.5"
GENTOO_VM="sun-jdk-1.4"
# JSSE_HOME="/opt/sun-jdk-1.4.1.02/jre/lib/"

pena kde # /etc/init.d/tomcat-5.5 start
tomcat-5.5        | * Caching service dependencies ...                                                                                                                                                 [ ok ]
tomcat-5.5        | * Starting Tomcat ...                                                                                                                                                              [ ok ]

betelgeuse@pena /var/tmp/portage/x11-apps/grandr-0.1/work/grandr-0.1 $ qdepends -k USE tomcat-6 | grep java5
betelgeuse@pena /var/tmp/portage/x11-apps/grandr-0.1/work/grandr-0.1 $ 
Comment 3 Petteri Räty (RETIRED) gentoo-dev 2007-09-17 15:08:03 UTC
You need to give output of:
qdepends -k USE tomcat-6 | grep java5
grep GENTOO_VM /etc/conf.d/tomcat-5.5
eselect java-vm list
Comment 4 Jiri Tyr 2007-09-17 15:17:14 UTC
(In reply to comment #3)
> You need to give output of:
> qdepends -k USE tomcat-6 | grep java5

aaa ~ # qdepends -k USE tomcat-5 | grep java5
aaa ~ #

> grep GENTOO_VM /etc/conf.d/tomcat-5.5

aaa ~ # grep GENTOO_VM /etc/conf.d/tomcat-5.5
# Example: export GENTOO_VM="sun-jdk-1.5"
export GENTOO_VM="blackdown-jdk-1.4.2"
aaa ~ # grep JSSE_HOME= /etc/conf.d/tomcat-5.5
JSSE_HOME="/opt/blackdown-jdk-1.4.2.03/jre/lib/"

> eselect java-vm list

aaa ~ # eselect java-vm list
Available Java Virtual Machines:
  [1]   blackdown-jdk-1.4.2  system-vm
  [2]   sun-jdk-1.5
Comment 5 Petteri Räty (RETIRED) gentoo-dev 2007-09-17 15:20:07 UTC
And forgot to add:
gjl -p tomcat-5.5 --get-vm
GENTOO_VM=blackdown-jdk-1.4.2 gjl -p tomcat-5.5 --get-vm
Comment 6 Jiri Tyr 2007-09-17 15:24:25 UTC
(In reply to comment #5)
> And forgot to add:
> gjl -p tomcat-5.5 --get-vm

aaa ~ $ gjl -p tomcat-5.5 --get-vm
gjl_vm="sun-jdk-1.5"

> GENTOO_VM=blackdown-jdk-1.4.2 gjl -p tomcat-5.5 --get-vm

aaa ~ $ GENTOO_VM="blackdown-jdk-1.4.2" gjl -p tomcat-5.5 --get-vm
gjl_vm="sun-jdk-1.5"
Comment 7 William L. Thomson Jr. (RETIRED) gentoo-dev 2007-09-21 02:23:57 UTC
So where are we at with this? Did we find a global bug, or ruling it out as a local issue?
Comment 8 Petteri Räty (RETIRED) gentoo-dev 2007-09-21 06:40:16 UTC
(In reply to comment #7)
> So where are we at with this? Did we find a global bug, or ruling it out as a
> local issue?
> 

Well for some reason gjl thinks his Tomcat needs >=1.5 but it does not seem to be compiled with java5 support. I also noticed that emerge --info is missing and also please attach /usr/share/tomcat-5.5/package.env
Comment 9 Jiri Tyr 2007-09-21 17:54:42 UTC
Created attachment 131541 [details]
package.env
Comment 10 Jiri Tyr 2007-09-21 17:55:10 UTC
Created attachment 131543 [details]
emerge.info
Comment 11 ic+gentoo 2007-09-27 21:29:31 UTC
I'm having the same issue. However it doesn't seem to bother tomcat, it starts and works properly. It's just annoying
Comment 12 William L. Thomson Jr. (RETIRED) gentoo-dev 2007-10-16 17:30:56 UTC
There is not much I can do here to resolve this. I can't replicate the problem. Furthermore I really didn't want to add the check to the init script in the first place. Others felt it would be a fail safe for users who did IMHO dumb stuff like emerge tomcat with java5 flag and leave the system vm as 1.4 or etc.

One of the main reasons I did not want to add such fail safes. Was because it allowed users to be lazy and not pay attention by relying on a failsafe. Another reason was potential bugs that could arise from it like this one.

So if we can't track down and resolve. Others continue to be effected by it and etc. I will just remove the fail safe check from the init script. Those that relied on it as a fail safe, will just have to pay more attention :)
Comment 13 William L. Thomson Jr. (RETIRED) gentoo-dev 2007-10-16 18:14:55 UTC
Ok, let me take a newb stance. If I do patch this and etc. Will we then be looking to rush stabilize it, to address the security issue? That seems like the logical steps if we are acting on a security issue no?

Likely will just go ahead and just patch to make all happy and move on with this. Just sucks, because Tomcat 5.5.25 was just stabilized. So will have to get others involved there again. Was just hoping to limit extra work for all, unless it was absolutely necessary.
Comment 14 William L. Thomson Jr. (RETIRED) gentoo-dev 2007-10-16 18:15:18 UTC
Damit commented on wrong bug, sry for spam.
Comment 15 Petteri Räty (RETIRED) gentoo-dev 2007-11-28 03:08:18 UTC
I got an idea about this bug. gjl would report that 1.4 can't run Tomcat even if USE="java5" is not on if you have something in the deptree that is 1.5 binary. Could you please run the following:
for jar in $(java-config -dp tomcat-5.5 | tr ":" " "); do class-version-verify.py -t 1.4 $jar >/dev/null || echo $jar; done
Comment 16 Jiri Tyr 2007-11-29 16:36:58 UTC
(In reply to comment #15)
> for jar in $(java-config -dp tomcat-5.5 | tr ":" " "); do
> class-version-verify.py -t 1.4 $jar >/dev/null || echo $jar; done

Here is the result of the command:

$ for jar in $(java-config -dp tomcat-5.5 | tr ":" " "); do class-version-verify.py -t 1.4 $jar >/dev/null || echo $jar; done
$

It didn't print any line. It means that all packages are compiled with Java 1.4 right? It should be, because I have set 1.4 VM as the system VM:

$ java-config -L
The following VMs are available for generation-2:
*)      Blackdown JDK 1.4.2.03 [blackdown-jdk-1.4.2]
2)      Sun JDK 1.5.0.13 [sun-jdk-1.5]
Comment 17 William L. Thomson Jr. (RETIRED) gentoo-dev 2007-11-29 19:46:59 UTC
What about this. Make sure the java5 use flag is disabled globally. Do an explicit -java5 in make.conf USE flags. Then do a emerge -DNpv world to see if anything is picked up as having it's use flag change.

If nothing shows up there, and the other suggestion doesn't return any jars. Then it's really hard to determine what is causing this. At the moment we are leaning toward it coming from some dep that was compiled with java5 USE flag, and/or compiled to 1.5 bytecode. Thus gjl or etc is picking it up there and spitting out error/warning.
Comment 18 Jiri Tyr 2007-11-30 08:26:22 UTC
Created attachment 137376 [details]
dep.txt

There are couple of packages which need jdk >= 1.5. Maybe this case the error. What do you think?
Comment 19 Jiri Tyr 2007-11-30 08:27:38 UTC
(In reply to comment #17)
> What about this. Make sure the java5 use flag is disabled globally. Do an
> explicit -java5 in make.conf USE flags. Then do a emerge -DNpv world to see if
> anything is picked up as having it's use flag change.

I tried it but it didn't give me any java package with USE="-java5" to recompile.
Comment 20 Petteri Räty (RETIRED) gentoo-dev 2007-11-30 12:50:55 UTC
(In reply to comment #19)
> 
> I tried it but it didn't give me any java package with USE="-java5" to
> recompile.
> 

It's probably best for us to write some debug info into gjl and get the answer straight from the horse's mouth.
Comment 21 Petteri Räty (RETIRED) gentoo-dev 2007-11-30 12:55:05 UTC
Please post the output of:
betelgeuse@pena ~ $ grep 'TARGET="1.5"' /usr/share/*/package.env
Comment 22 Jiri Tyr 2007-11-30 13:39:30 UTC
(In reply to comment #21)
> Please post the output of:
> betelgeuse@pena ~ $ grep 'TARGET="1.5"' /usr/share/*/package.env

$ grep 'TARGET="1.5"' /usr/share/*/package.env
/usr/share/sun-javamail/package.env:TARGET="1.5"
Comment 23 Petteri Räty (RETIRED) gentoo-dev 2007-12-05 01:08:50 UTC
(In reply to comment #22)
> (In reply to comment #21)
> > Please post the output of:
> > betelgeuse@pena ~ $ grep 'TARGET="1.5"' /usr/share/*/package.env
> 
> $ grep 'TARGET="1.5"' /usr/share/*/package.env
> /usr/share/sun-javamail/package.env:TARGET="1.5"
> 

Does this go away when you re-emerge sun-javamail? If so please post the output of qlop -l sun-javamail and qdepends -k repository sun-javamail.
Comment 24 Jiri Tyr 2007-12-05 09:42:52 UTC
(In reply to comment #23)
> Does this go away when you re-emerge sun-javamail? If so please post the output
> of qlop -l sun-javamail and qdepends -k repository sun-javamail.
 
I reemerged the sun-javamail and I executed the commands:
$ qlop -l sun-javamail
Wed Dec  5 10:36:59 2007 >>> dev-java/sun-javamail-1.4
$ qdepends -k repository sun-javamail
dev-java/sun-javamail-1.4: gentoo

During the emerge -av1 sun-javamail, I have got this messages:
>>> Emerging (1 of 1) dev-java/sun-javamail-1.4 to /
 * sun-javamail-1.4.tar.bz2 RMD160 SHA1 SHA256 size ;-) ...                     [ ok ]
 * checking ebuild checksums ;-) ...                                            [ ok ]
 * checking auxfile checksums ;-) ...                                           [ ok ]
 * checking miscfile checksums ;-) ...                                          [ ok ]
 * checking sun-javamail-1.4.tar.bz2 ;-) ...                                    [ ok ]
 * Using: sun-jdk-1.5
>>> Unpacking source...
>>> Unpacking sun-javamail-1.4.tar.bz2 to /var/tmp/portage/dev-java/sun-javamail-1.4/work
>>> Source unpacked.
...

I said that it use sun-jdk-1.5 instead of 1.4. Couldn't it be the problem?
Comment 25 Petteri Räty (RETIRED) gentoo-dev 2007-12-05 13:39:08 UTC
(In reply to comment #24)
>  * Using: sun-jdk-1.5
> >>> Unpacking source...
> >>> Unpacking sun-javamail-1.4.tar.bz2 to /var/tmp/portage/dev-java/sun-javamail-1.4/work
> >>> Source unpacked.
> ...
> 
> I said that it use sun-jdk-1.5 instead of 1.4. Couldn't it be the problem?
> 

No. That's expected and wanted. I am guessing that this bug existed in sun-javamail at some point in distant past and most people have since re-emerged it and as such fixed the problem. How come you only have one entry for sun-javamail? Have you been a paludis user or something? paludis is known to have had problems with our eclasses. You also didn't answer whether re-emerging fixed the problem or not.
Comment 26 Jiri Tyr 2007-12-05 15:28:53 UTC
(In reply to comment #25)
> You also didn't answer whether re-emerging fixed the problem or not.

I'm sorry I forgot to restart tomcat ;o) Now it works for me:
/etc/init.d/tomcat-5.5 restart
 * Stopping Tomcat ...        [ ok ]
 * Starting Tomcat ...        [ ok ]

Thank you for your collaboration.