[ 
https://issues.apache.org/jira/browse/KARAF-189?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12907560#action_12907560
 ] 

guillaume delafosse commented on KARAF-189:
-------------------------------------------

I also reproduced with an empty main program running with the 
karaf/lib/endorsed file.
I recompiled your Exception class and commented some lines in order to isolate 
the trouble (see below). Finally I obtained to following exception :
Exception in thread "(unnamed thread)" java/lang/ExceptionInInitializerError
        at java/lang/J9VMInternals.initialize (J9VMInternals.java:222)
        at java/lang/J9VMInternals.initialize (J9VMInternals.java:167)
        at java/lang/Exception.<clinit> (Exception.java:82)
        at java/lang/J9VMInternals.initializeImpl (Native Method)
        at java/lang/J9VMInternals.initialize (J9VMInternals.java:200)
        at java/lang/J9VMInternals.initialize (J9VMInternals.java:167)
java/lang/NullPointerException
        at java/lang/SecurityManager.getRootGroup (SecurityManager.java:605)
        at java/lang/SecurityManager.<clinit> (SecurityManager.java:602)
        at java/lang/J9VMInternals.initializeImpl (Native Method)
        at java/lang/J9VMInternals.initialize (J9VMInternals.java:200)
        at java/lang/J9VMInternals.initialize (J9VMInternals.java:167)
        at java/lang/Exception.<clinit> (Exception.java:82)
        at java/lang/J9VMInternals.initializeImpl (Native Method)
        at java/lang/J9VMInternals.initialize (J9VMInternals.java:200)
        at java/lang/J9VMInternals.initialize (J9VMInternals.java:167)
JVMJ9VM015W Initialization error for library jclscar_24(14): JVMJ9VM009E 
J9VMDllMain failed
Could not create the Java virtual machine.

I had a look at SecurityManager.java:605, so it seems that IBM JVM 6 returns 
null for Thread.currentThread() at this moment.
It clearly looks an IBM bug.

/***************** My modified Exception class ***************************/

/*
 *  Licensed to the Apache Software Foundation (ASF) under one or more
 *  contributor license agreements.  See the NOTICE file distributed with
 *  this work for additional information regarding copyright ownership.
 *  The ASF licenses this file to You under the Apache License, Version 2.0
 *  (the "License"); you may not use this file except in compliance with
 *  the License.  You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 *  Unless required by applicable law or agreed to in writing, software
 *  distributed under the License is distributed on an "AS IS" BASIS,
 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *  See the License for the specific language governing permissions and
 *  limitations under the License.
 */

package java.lang;

/**
 * {...@code Exception} is the superclass of all classes that represent 
recoverable
 * exceptions. When exceptions are thrown, they may be caught by application
 * code.
 * 
 * @see Throwable
 * @see Error
 * @see RuntimeException
 */
public class Exception extends Throwable {
        private static final long serialVersionUID = -3387516993124229948L;

        // private transient Class[] classContext = 
sm.getThrowableContext(this);

        /**
         * Constructs a new {...@code Exception} that includes the current 
stack trace.
         */
        public Exception() {
                super();
        }

        /**
         * Constructs a new {...@code Exception} with the current stack trace 
and the
         * specified detail message.
         * 
         * @param detailMessage
         *            the detail message for this exception.
         */
        public Exception(String detailMessage) {
                super(detailMessage);
        }

        /**
         * Constructs a new {...@code Exception} with the current stack trace, 
the
         * specified detail message and the specified cause.
         * 
         * @param detailMessage
         *            the detail message for this exception.
         * @param throwable
         *            the cause of this exception.
         */
        public Exception(String detailMessage, Throwable throwable) {
                super(detailMessage, throwable);
        }

        /**
         * Constructs a new {...@code Exception} with the current stack trace 
and the
         * specified cause.
         * 
         * @param throwable
         *            the cause of this exception.
         */
        public Exception(Throwable throwable) {
                super(throwable);
        }

        public Class[] getClassContext() {
                // return classContext;
                return null;
        }

        private static final SecurityManagerEx sm = new SecurityManagerEx();

        static class SecurityManagerEx extends SecurityManager {
                public Class[] getClassContext() {
                        return super.getClassContext();
                }

                public Class[] getThrowableContext(Throwable t) {
                        try {
                                Class[] context = getClassContext();
                                int nb = 0;
                                for (;;) {
                                        if (context[context.length - 1 - nb] == 
t.getClass()) {
                                                break;
                                        }
                                        nb++;
                                }
                                Class[] nc = new Class[nb];
                                System.arraycopy(context, context.length - nb, 
nc, 0, nb);
                                return nc;
                        } catch (Exception e) {
                                return null;
                        }
                }
                
        }

}

> Java endorsed dirs on AIX (IBM JVM)
> -----------------------------------
>
>                 Key: KARAF-189
>                 URL: https://issues.apache.org/jira/browse/KARAF-189
>             Project: Karaf
>          Issue Type: Bug
>    Affects Versions: 2.0.0
>         Environment: AIX 5.3, IBM jre 1.6 sr8, power-pc
> Ubuntu linux 10.04, IBM jre sr8, x86
>            Reporter: haedri
>            Priority: Minor
>
> I have troubles launching karaf 2.0 on AIX, using an IBM jre (1.6 sr8), here 
> are the relevant lines of the output :
> IBM J9 VM (build 2.4, JRE 1.6.0 IBM J9 2.4 AIX ppc-32
> jvmap3260sr8-20100401_55940 (JIT enabled, AOT enabled)
> Unhandled exception
> Type=Segmentation error vmState=0x00000000
> (...)
> After trying everything possible (setting LDR_CTRL, LIBPATH, ulimit,...) it 
> appears the problem is linked to the "-Djava.endorsed.dirs" parameter from 
> the java startup command line, if I remove the "${KARAF_HOME}/lib/endorsed" 
> entry, then karaf starts successfully.
> I've been able to reproduce the problem on a linux ubuntu on a x86 processor, 
> using the same IBM jvm version 
> (http://www.ibm.com/developerworks/java/jdk/linux/download.html)
> I think problem comes from IBM jre (because it works on a jre 1.6 sr0), but I 
> din't investigate enough to be sure

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to