Karaf will need to be able to write to that directory by default.
What user are you using to run karaf?  Does he have permissions to
write to /usr/local/java/apache-karaf-3.0.2?


On Mon, Oct 13, 2014 at 8:51 AM, David Leangen <apa...@leangen.net> wrote:
>
> Hi,
>
> Just another idea that crosses my mind.
> Did you place the extracted Karaf folder in some restricted folders?
> Where does it actually reside in?
>
>
> Not sure exactly what you mean by “restricted”, but it resides in
> /usr/local/java.]
>
> This is where I install all my apache apps. No problems so far, except for
> karaf. :-)
>
>
> Cheers,
> =David
>
>
>
> 2014-10-13 14:43 GMT+02:00 Jean-Baptiste Onofré <j...@nanthrax.net>:
>>
>> KARAF_HOME is the location where you uncompressed Karaf.
>>
>> For instance, if you uncompressed Karaf in /opt/apache-karaf (and so, you
>> have /opt/apache-karaf/bin, /opt/apache-karaf/lib, etc), KARAF_HOME is
>> /opt/apache-karaf.
>> However, by default, KARAF_HOME is defined relatively to the bin/karaf.
>>
>> By the way, do you use the default shell on Mac OS ?
>>
>> Regards
>> JB
>>
>>
>> On 10/13/2014 02:35 PM, David Leangen wrote:
>>>
>>>
>>>> OK, I think we narrow the problem.
>>>>
>>>> I bet your KARAF_HOME is defined by empty or it's not correct (I guess
>>>> that /usr/local/lib folder is not your actual KARAF_HOME).
>>>>
>>>> I would advise to unset KARAF_BASE, KARAF_HOME, etc to let the bin/karaf
>>>> script to define it for you.
>>>
>>>
>>> Sure.
>>>
>>> What, very precisely, should be KARAF_HOME?
>>>
>>> =David
>>>
>>>
>>>
>>>> On 10/13/2014 02:14 PM, David Leangen wrote:
>>>>>
>>>>>
>>>>> Hi,
>>>>>
>>>>>> in the bin/karaf script, can you confirm that you have something like:
>>>>>>
>>>>>> exec “$JAVA” […]
>>>>>
>>>>>
>>>>> Yes.
>>>>>
>>>>>
>>>>>> Do you define some env variables like KARAF_BASE/KARAF_HOME/KARAF_ETC,
>>>>>> ?
>>>>>
>>>>>
>>>>> I tried both. Same results.
>>>>>
>>>>>
>>>>>> A possible cause is that KARAF_HOME is not well setted or a CLASSPATH
>>>>>> system variable interfere. In bin/karaf, we do:
>>>>>>
>>>>>>     for file in "$KARAF_HOME"/lib/karaf*.jar
>>>>>>     do
>>>>>>         if [ -z "$CLASSPATH" ]; then
>>>>>>             CLASSPATH="$file"
>>>>>>         else
>>>>>>             CLASSPATH="$CLASSPATH:$file"
>>>>>>         fi
>>>>>>     done
>>>>>> to load the karaf*.jar file from the Karaf lib folder.
>>>>>
>>>>>
>>>>> Yes, I can see this in the bin/karaf file.
>>>>>
>>>>> For the fun of it, I added the line “echo $file” in the for loop. In
>>>>> the output, all I see is “/usr/local/lib/karaf*.jar. Weird.
>>>>>
>>>>>
>>>>> Cheers,
>>>>> =David
>>>>>
>>>>>
>>>>>
>>>>>> On 10/13/2014 01:56 PM, David Leangen wrote:
>>>>>>>
>>>>>>>
>>>>>>>> Really weird,
>>>>>>>
>>>>>>>
>>>>>>> :-)
>>>>>>>
>>>>>>>
>>>>>>>> Can you do a java -version and send the result.
>>>>>>>
>>>>>>>
>>>>>>> java version "1.7.0_67"
>>>>>>> Java(TM) SE Runtime Environment (build 1.7.0_67-b01)
>>>>>>> Java HotSpot(TM) 64-Bit Server VM (build 24.65-b04, mixed mode)
>>>>>>>
>>>>>>>> Can you also send the data/log/karaf.log to me ?
>>>>>>>
>>>>>>>
>>>>>>> There is no file (assuming that it is in $KARAF_HOME, i.e. the
>>>>>>> directory
>>>>>>> where Karaf is installed).
>>>>>>>
>>>>>>> Cheers,
>>>>>>> =David
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>> On 10/13/2014 01:47 PM, David Leangen wrote:
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>> It looks like the lib folder doesn’t contain the
>>>>>>>>>> karaf-jmx-boot.jar
>>>>>>>>>> file (providing the MBeanServerBuilder).
>>>>>>>>>> Can you check that this jar is in the lib folder ?
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> Yes, it is there.
>>>>>>>>>
>>>>>>>>>> Do you have something in bin/setenv ?
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> No, using defaults.
>>>>>>>>>
>>>>>>>>>> By the way, can you try with Java7 (instead of Java6) ?
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> I installed Java7. Same problem. :-(
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> Cheers,
>>>>>>>>> =David
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>> On 10/13/2014 10:39 AM, David Leangen wrote:
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> Wow! Impressive response. :-) Thank you!
>>>>>>>>>>>
>>>>>>>>>>>> Can you make a try with 3.0.2 (currently on staging) ?
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> Tried. Same problem. :-(
>>>>>>>>>>>
>>>>>>>>>>>> which version of Java are you using?
>>>>>>>>>>>> Please note with Karaf 3.0.1 it's still recommended to use Java7
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> Hmmm. I am still a luddite with 1.6 (more precisely
>>>>>>>>>>> 1.6.0_65-b14-462-11M4609).
>>>>>>>>>>>
>>>>>>>>>>>> I’m running 3.0.1 on Mac out of the box. You’ll likely need to
>>>>>>>>>>>> describe more about your circumstances, e.g. the JVM used, what
>>>>>>>>>>>> commands you’ve run (to start Karaf and at it’s own command
>>>>>>>>>>>> line),
>>>>>>>>>>>> what bundles you’ve installed (if any), the complete stack
>>>>>>>>>>>> trace, etc?
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> I ran “karaf” with the default (i.e. “out-of-the-box”)
>>>>>>>>>>> installation, and
>>>>>>>>>>> before Karaf could start, it died with the following:
>>>>>>>>>>>
>>>>>>>>>>> *$ karaf*
>>>>>>>>>>> javax.management.JMRuntimeException: Failed to load
>>>>>>>>>>> MBeanServerBuilder
>>>>>>>>>>> class org.apache.karaf.management.boot.KarafMBeanServerBuilder:
>>>>>>>>>>> java.lang.ClassNotFoundException:
>>>>>>>>>>> org.apache.karaf.management.boot.KarafMBeanServerBuilder
>>>>>>>>>>> at
>>>>>>>>>>>
>>>>>>>>>>> javax.management.MBeanServerFactory.checkMBeanServerBuilder(MBeanServerFactory.java:481)
>>>>>>>>>>> at
>>>>>>>>>>>
>>>>>>>>>>> javax.management.MBeanServerFactory.getNewMBeanServerBuilder(MBeanServerFactory.java:512)
>>>>>>>>>>> at
>>>>>>>>>>>
>>>>>>>>>>> javax.management.MBeanServerFactory.newMBeanServer(MBeanServerFactory.java:299)
>>>>>>>>>>> at
>>>>>>>>>>>
>>>>>>>>>>> javax.management.MBeanServerFactory.createMBeanServer(MBeanServerFactory.java:214)
>>>>>>>>>>> at
>>>>>>>>>>>
>>>>>>>>>>> javax.management.MBeanServerFactory.createMBeanServer(MBeanServerFactory.java:175)
>>>>>>>>>>> at
>>>>>>>>>>>
>>>>>>>>>>> sun.management.ManagementFactory.createPlatformMBeanServer(ManagementFactory.java:302)
>>>>>>>>>>> at
>>>>>>>>>>>
>>>>>>>>>>> java.lang.management.ManagementFactory.getPlatformMBeanServer(ManagementFactory.java:504)
>>>>>>>>>>> at
>>>>>>>>>>>
>>>>>>>>>>> sun.management.jmxremote.ConnectorBootstrap.startLocalConnectorServer(ConnectorBootstrap.java:458)
>>>>>>>>>>> at sun.management.Agent.startAgent(Agent.java:135)
>>>>>>>>>>> at sun.management.Agent.startAgent(Agent.java:239)
>>>>>>>>>>> Caused by: java.lang.ClassNotFoundException:
>>>>>>>>>>> org.apache.karaf.management.boot.KarafMBeanServerBuilder
>>>>>>>>>>> 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:306)
>>>>>>>>>>> at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
>>>>>>>>>>> at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
>>>>>>>>>>> at
>>>>>>>>>>>
>>>>>>>>>>> javax.management.MBeanServerFactory.loadBuilderClass(MBeanServerFactory.java:424)
>>>>>>>>>>> at
>>>>>>>>>>>
>>>>>>>>>>> javax.management.MBeanServerFactory.checkMBeanServerBuilder(MBeanServerFactory.java:466)
>>>>>>>>>>> ... 9 more
>>>>>>>>>>> Exception thrown by the agent :
>>>>>>>>>>> javax.management.JMRuntimeException:
>>>>>>>>>>> Failed to load MBeanServerBuilder class
>>>>>>>>>>> org.apache.karaf.management.boot.KarafMBeanServerBuilder:
>>>>>>>>>>> java.lang.ClassNotFoundException:
>>>>>>>>>>> org.apache.karaf.management.boot.KarafMBeanServerBuilder
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> Cheers,
>>>>>>>>>>> =David
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>> On 10/13/2014 10:15 AM, David Leangen wrote:
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>> Hi!
>>>>>>>>>>>>>
>>>>>>>>>>>>> I am new to Karaf. I am trying to set up v3.0.1 on my Mac, but
>>>>>>>>>>>>> am
>>>>>>>>>>>>> getting a JMRuntimeException: Failed to load
>>>>>>>>>>>>> MBeanServerBuilder.
>>>>>>>>>>>>>
>>>>>>>>>>>>> I noticed this thread:
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>> http://mail-archives.apache.org/mod_mbox/karaf-user/201404.mbox/%3ccagrrcrxmqe-v65jecwpakmatc6qap+hvyb_abmgxk8zpvko...@mail.gmail.com%3E
>>>>>>>>>>>>>
>>>>>>>>>>>>> <http://mail-archives.apache.org/mod_mbox/karaf-user/201404.mbox/<cagrrcrxmqe-v65jecwpakmatc6qap+hvyb_abmgxk8zpvko...@mail.gmail.com>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>> However, it does not seem to be relevant to me, and I did not
>>>>>>>>>>>>> find any
>>>>>>>>>>>>> other reference to this problem.
>>>>>>>>>>>>>
>>>>>>>>>>>>> Assuming that Karaf is intended to run out of the box, is there
>>>>>>>>>>>>> a
>>>>>>>>>>>>> quick
>>>>>>>>>>>>> recommended fix for this?
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>> Cheers,
>>>>>>>>>>>>> =David
>>>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> --
>>>>>>>>>> Jean-Baptiste Onofré
>>>>>>>>>> jbono...@apache.org <mailto:jbono...@apache.org>
>>>>>>>>>> <mailto:jbono...@apache.org>
>>>>>>>>>> http://blog.nanthrax.net
>>>>>>>>>> Talend - http://www.talend.com
>>>>>>>>>
>>>>>>>>>
>>>>>>>>
>>>>>>>> --
>>>>>>>> Jean-Baptiste Onofré
>>>>>>>> jbono...@apache.org <mailto:jbono...@apache.org>
>>>>>>>> http://blog.nanthrax.net
>>>>>>>> Talend - http://www.talend.com
>>>>>>>
>>>>>>>
>>>>>>
>>>>>> --
>>>>>> Jean-Baptiste Onofré
>>>>>> jbono...@apache.org
>>>>>> http://blog.nanthrax.net
>>>>>> Talend - http://www.talend.com
>>>>>
>>>>>
>>>>
>>>> --
>>>> Jean-Baptiste Onofré
>>>> jbono...@apache.org
>>>> http://blog.nanthrax.net
>>>> Talend - http://www.talend.com
>>>
>>>
>>
>> --
>> Jean-Baptiste Onofré
>> jbono...@apache.org
>> http://blog.nanthrax.net
>> Talend - http://www.talend.com
>
>
>
>
> --
>
> Apache Member
> Apache Karaf <http://karaf.apache.org/> Committer & PMC
> OPS4J Pax Web <http://wiki.ops4j.org/display/paxweb/Pax+Web/> Committer &
> Project Lead
> blog <http://notizblog.nierbeck.de/>
> Co-Author of Apache Karaf Cookbook <http://bit.ly/1ps9rkS>
>
> Software Architect / Project Manager / Scrum Master
>
>

Reply via email to