Alan McKinnon wrote:
> On Thursday 11 February 2010 22:06:50 dhk wrote:
>> Another question about this.
>>
>> Where's a good place to set J2EE_HOME (/opt/sun-j2ee-1.3.1/) and
>> JAVA_HOME? Should it be in each user's profile? If I wanted to set
>> them globally for all users should they go in /etc/profile ?
>
> How many users use it?
>
> One? Put it in their profile.
> Many? put it in the system profile.
>
> This is not a decision peculiar to j2ee, you must make the identical decision
> for hundreds of packages - same principles apply.
>
> Or you could use the absurd method Sybase uses, but we won't go there now...
>
>
>> Also when starting j2ee I get the following error.
>> # /opt/sun-j2ee-1.3.1/bin/j2ee -verbose
>> /opt/sun-j2ee-1.3.1/bin/j2ee: line 14: /opt/sun-j2ee-1.3.1//bin/java: No
>> such file or directory
>>
>> Is there another java package I need to install? /bin/java doesn't exist.
>
> I'm not surprised.
>
> it's not /bin/java
> it's /opt/sun-j2ee-1.3.1/bin/java
> an entirely different thing.
>
> When I last played with j2ee, the package from Sun did not have a JVM, you
> had
> to install that first.
>
> You probably need to install a jdk or jvm, which is odd as that should be a
> DEPEND.
> If you do have a jdk or jvm, you need a symlink:
>
> ln -s /usr/bin/java /opt/sun-j2ee-1.3.1/bin/java
>
>
I think it's almost working.
My /usr/bin/java was linked to run-java-tool, don't know what that is.
# ll /usr/bin/java
lrwxrwxrwx 1 root root 13 Feb 11 11:20 /usr/bin/java -> run-java-tool
I installed a jdk
emerge dev-java/sun-jdk
Removed the /usr/bin/java sym link and made another to the newly
installed java.
ln -s /opt/sun-jdk-1.6.0.18/bin/java /usr/bin/java
I set some environment variables.
export J2EE_HOME="/opt/sun-j2ee-1.3.1/"
export JAVA_HOME="/opt/sun-jdk-1.6.0.18"
Then reinstalled j2ee
emerge dev-java/sun-j2ee
Tried starting j2ee
/opt/sun-j2ee-1.3.1/bin/j2ee -verbose
Checked processes, but no j2ee was running.
Then looked at the error log. Looks like it can't find this com.sun...
directory.
# cat /opt/sun-j2ee-1.3.1/logs/dhcppc3/j2ee/j2ee/system.err
Logging for J2EE Server Version: 1.3.1-b17 started at: Thu Feb 11
16:44:31 EST 2010..
Using the Java HotSpot(TM) 64-Bit Server VM and the version number
1.6.0_18 from Sun Microsystems Inc..
VM is using the classpath:
/opt/sun-j2ee-1.3.1/lib/system/cloudscape.jar:/opt/sun-j2ee-1.3.1/lib/system/cloudutil.jar:/opt/sun-j2ee-1.3.1/lib/cloudscape/RmiJdbc.jar:/opt/sun-j2ee-1.3.1/lib/cloudscape/cloudclient.jar:/opt/sun-j2ee-1.3.1/lib/classes:/opt/sun-j2ee-1.3.1/classes:/opt/sun-j2ee-1.3.1/lib/j2ee.jar:/opt/sun-j2ee-1.3.1/lib/toolclasses:/opt/sun-j2ee-1.3.1/lib/j2eetools.jar:/opt/sun-j2ee-1.3.1/lib/locale::/opt/sun-jdk-1.6.0.18/lib/tools.jar:/opt/sun-j2ee-1.3.1/lib/jhall.jar
.
J2EE Home Directory has been set to: /opt/sun-j2ee-1.3.1.
Exception in thread "main" java.lang.NoClassDefFoundError:
com/sun/corba/se/internal/util/IdentityHashtable
at com.sun.corba.ee.internal.javax.rmi.CORBA.Util.<clinit>(Util.java:87)
at com.sun.corba.ee.internal.POA.POAImpl.activate(POAImpl.java:935)
at
com.sun.corba.ee.internal.POA.POAImpl.activate_object(POAImpl.java:895)
at
com.sun.corba.ee.internal.CosNaming.TransientNameService.initialize(TransientNameService.java:117)
at
com.sun.corba.ee.internal.CosNaming.TransientNameService.<init>(TransientNameService.java:70)
at
com.sun.enterprise.iiop.POAProtocolMgr.initializeNaming(POAProtocolMgr.java:103)
at com.sun.enterprise.server.J2EEServer.run(J2EEServer.java:226)
at com.sun.enterprise.server.J2EEServer.main(J2EEServer.java:972)
Caused by: java.lang.ClassNotFoundException:
com.sun.corba.se.internal.util.IdentityHashtable
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
... 8 more
Logging for J2EE Server Version: 1.3.1-b17 started at: Thu Feb 11
17:03:04 EST 2010..
Using the Java HotSpot(TM) 64-Bit Server VM and the version number
1.6.0_18 from Sun Microsystems Inc..
VM is using the classpath:
/opt/sun-j2ee-1.3.1/lib/system/cloudscape.jar:/opt/sun-j2ee-1.3.1/lib/system/cloudutil.jar:/opt/sun-j2ee-1.3.1/lib/cloudscape/RmiJdbc.jar:/opt/sun-j2ee-1.3.1/lib/cloudscape/cloudclient.jar:/opt/sun-j2ee-1.3.1/lib/classes:/opt/sun-j2ee-1.3.1/classes:/opt/sun-j2ee-1.3.1/lib/j2ee.jar:/opt/sun-j2ee-1.3.1/lib/toolclasses:/opt/sun-j2ee-1.3.1/lib/j2eetools.jar:/opt/sun-j2ee-1.3.1/lib/locale::/opt/sun-jdk-1.6.0.18/lib/tools.jar:/opt/sun-j2ee-1.3.1/lib/jhall.jar
.
J2EE Home Directory has been set to: /opt/sun-j2ee-1.3.1.
Exception in thread "main" java.lang.NoClassDefFoundError:
com/sun/corba/se/internal/util/IdentityHashtable
at com.sun.corba.ee.internal.javax.rmi.CORBA.Util.<clinit>(Util.java:87)
at com.sun.corba.ee.internal.POA.POAImpl.activate(POAImpl.java:935)
at
com.sun.corba.ee.internal.POA.POAImpl.activate_object(POAImpl.java:895)
at
com.sun.corba.ee.internal.CosNaming.TransientNameService.initialize(TransientNameService.java:117)
at
com.sun.corba.ee.internal.CosNaming.TransientNameService.<init>(TransientNameService.java:70)
at
com.sun.enterprise.iiop.POAProtocolMgr.initializeNaming(POAProtocolMgr.java:103)
at com.sun.enterprise.server.J2EEServer.run(J2EEServer.java:226)
at com.sun.enterprise.server.J2EEServer.main(J2EEServer.java:972)
Caused by: java.lang.ClassNotFoundException:
com.sun.corba.se.internal.util.IdentityHashtable
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
... 8 more
Thanks,
dhk