wood burning stoves*
The moose likes Linux / UNIX and the fly likes Red Hat 9.0 & J2EE Reference Imp 1.3 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Engineering » Linux / UNIX
Bookmark "Red Hat 9.0 & J2EE Reference Imp 1.3" Watch "Red Hat 9.0 & J2EE Reference Imp 1.3" New topic
Author

Red Hat 9.0 & J2EE Reference Imp 1.3

Unnsse Khan
Ranch Hand

Joined: Nov 12, 2001
Posts: 511
Hello,
I am using Linux (Red Hat 9.0) distro, and have installed the:
1) Java 2 SE SDK 1.4.2_02 SDK
2) Java 2 SE 1.4.2_2 JRE
3) Java 2 EE SDK 1.3 (reference implementation)
under /usr/java/ (as the "root" user).
I then did this:
(1) cd /etc/profile.d/
(2) vim java.sh
In the java.sh file, this is what I put:
export JAVA_HOME=/usr/java/j2sdk1.4.2_02
export J2EE_HOME=/usr/java/j2sdkee1.3
export CLASSPATH=$JAVA_HOME/lib/tools.jar:$JAVA_HOME/jre/lib/rt.jar:$J2EE_HOME/lib/j2ee.jar
export PATH=$PATH:$JAVA_HOME/bin:$J2EE_HOME/bin
After creating and saving this file...
I typed:
source java.sh
Now since its in /etc/profile.d/
All users have access to my bin directories and logging in as "untz" on Red Hat 9.0, I can successfully use the javac & java command line tools...
Now, here's my problem...
When I login as "untz"
and type:
$ j2ee (in order to start the J2EE server)
This is what happens:
----------------------------------------------------------------------------
Warning: This J2EE SDK release is designed to run on J2SE 1.3
J2EE server listen port: 1050
java.io.FileNotFoundException: /usr/java/j2sdkee1.3/logs/localhost.localdomain/j2ee/j2ee/system.out (Permission denied)
at java.io.FileOutputStream.openAppend(Native Method)
at java.io.FileOutputStream.<init>(FileOutputStream.java:177)
at java.io.FileOutputStream.<init>(FileOutputStream.java:102)
at com.sun.enterprise.server.J2EEServer.redirectStreams(J2EEServer.java:534)
at com.sun.enterprise.server.J2EEServer.run(J2EEServer.java:209)
at com.sun.enterprise.server.J2EEServer.main(J2EEServer.java:913)
java.io.FileNotFoundException: /usr/java/j2sdkee1.3/logs/localhost.localdomain/j2ee/j2ee/system.out (Permission denied)
at java.io.FileOutputStream.openAppend(Native Method)
at java.io.FileOutputStream.<init>(FileOutputStream.java:177)
at java.io.FileOutputStream.<init>(FileOutputStream.java:102)
at com.sun.enterprise.server.J2EEServer.redirectStreams(J2EEServer.java:534)
at com.sun.enterprise.server.J2EEServer.run(J2EEServer.java:209)
at com.sun.enterprise.server.J2EEServer.main(J2EEServer.java:913)

java.lang.RuntimeException: /usr/java/j2sdkee1.3/logs/localhost.localdomain/j2ee/j2ee/system.out (Permission denied)
at com.sun.enterprise.server.J2EEServer.run(J2EEServer.java:350)
at com.sun.enterprise.server.J2EEServer.main(J2EEServer.java:913)
J2EE server reported the following error: /usr/java/j2sdkee1.3/logs/localhost.localdomain/j2ee/j2ee/system.out (Permission denied)
Error executing J2EE server ...
----------------------------------------------------------------------------
Here are the the questions:
1. Why did this happen? Is it because it was supposed to run with the J2SE 1.3 instead of J2SE 1.4.2_02?
2. Why was permission denied?
From the best of my knowledge, logging in as "root" and typing in:
$ j2ee -verbose
works like a charm, why didn't it work on the usr "untz"?
Any advice, suggestions, commentary, etc. will be greatly appreciated.
Until next time ...
Anonymous
Ranch Hand

Joined: Nov 22, 2008
Posts: 18944
You said it yourself. You installed this as root into your /usr/local directory. Per default you are not allowed to create / edit files in this folder. Change the permissions with chmod 777 directoryname (be careful this gives free access to everybody to this directory!!). After that it will work without exception.
The warning is just a warning and i think yes it is because it was designed for J2SE 1.3 but i have never seen this warning before (or haven't recognized it)
Unnsse Khan
Ranch Hand

Joined: Nov 12, 2001
Posts: 511
When I did what you suggested:
chmod 777
It still had the same error when I logged in as "untz"
George Brown
Ranch Hand

Joined: Sep 26, 2000
Posts: 919
As Oliver stated, this is a permissions-related problem.
For some reason the Sun J2EE implementation is trying to write to a logfile in a location that your 'untz' user doesn't have permissions to write to.
That's what the following line says (it always helps to read the error text):

java.io.FileNotFoundException: /usr/java/j2sdkee1.3/logs/localhost.localdomain/j2ee/j2ee/system.out (Permission denied)

Either change the permissions on your logfiles or run the j2ee server as the user that first ran it (so that the log files already have the appropriate permissions - the file wouldmost likely have been created by the first user to run the j2ee server). It's your choice whether you expose those logfiles further or not.
HTH.
[ November 11, 2003: Message edited by: George Brown ]
Unnsse Khan
Ranch Hand

Joined: Nov 12, 2001
Posts: 511
Dear Mr. Brown,
Thank for responding... I do look at the error text. I logged in as root and did the chmod 777 on /usr/java/j2dkee1.3/ and I still get the above error when I login as untz and run the J2EE RI... Doesn't the chmod 777 apply to a directory and all of its subdirectories?
Can anyone help me with this? Would I have to download the J2EE RI, all over again and install it under:
/home/untz/ ?
Any advice, help, suggestions, etc. will be beneficial...
Thanks again,
Unnsse
George Brown
Ranch Hand

Joined: Sep 26, 2000
Posts: 919
if you type 'man chmod' you will find that chmod is only recursive if you give it the '-R' option.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Red Hat 9.0 & J2EE Reference Imp 1.3