Closed rmarteau closed 10 years ago
I run 1.2.0.Beta2 on Ubuntu 12.04.4. It used to run 1.1.0.CR5 successfully.
I don't understand where this expression comes from:
/home/admin/fabric8-karaf-1.2.0.Beta2/processes/mychild/lib/*.{jar,war}
on OS X and docker it uses a list of actual jars
I can reproduce with docker. Using the last version from from github and starting
root@1087660f519a:/home/fabric8/fabric8-karaf/processes/dockerquickstart/logs# cat err.log
Error: Could not find or load main class .home.fabric8.fabric8-karaf.processes.dockerquickstart.lib.*.war:.home.fabric8.fabric8-karaf.processes.dockerquickstart.classes
In the karaf.log
Starting dockerquickstart
Running java -javaagent:jolokia-agent.jar=host=0.0.0.0,port=9003,agentId=dockerquickstart -Dfabric8.containerId=dockerquickstart -classpath /home/fabric8/fabric8-karaf/processes/dockerquickstart/lib/*.{jar,war}:/home/fabric8/fabric8-karaf/processes/dockerquickstart/classes org.apache.camel.spring.Main
bin/launcher: 119: bin/launcher: ps: not found
Could not start dockerquickstart
Everything seems to work fine with a redhat distrub.
I was previously using ubuntu. I tried ubuntu 12 desktop, ubuntu 12 server, ubuntu 14 desktop. It is not working with ubuntu, event in a docker.
Any idea what could be the reason ?
Hmm I guess there's a different bash on ubuntu?
The Java Container copies this launcher file into processes/$containerName/bin/launcher which is used to make the classpath: https://github.com/jstrachan/fabric8/blob/micro-service/process/process-launcher/src/main/distro/bin/launcher#L75
I guess ubuntu doesn't support that line or does something odd?
I wonder if replacing that loop with something like this might work on ubuntu?
for file in "$APP_BASE"/lib/*.jar
do
if [ -z "$CLASSPATH" ]; then
CLASSPATH="$file"
else
CLASSPATH="$CLASSPATH:$file"
fi
done
for file in "$APP_BASE"/lib/*.war
do
if [ -z "$CLASSPATH" ]; then
CLASSPATH="$file"
else
CLASSPATH="$CLASSPATH:$file"
fi
done
Incidentally on ubuntu, try creating a container 'foo', it'll fail; then you should be able to try start it again as many times as you like; in the mean time edit processes/foo/bin/launcher in a text editor and try tinker with the file to get it to work. I've a feeling the above might fix it?
Your fix does work. But I have another one to suggest (a colleague pointed out to me)
#!/bin/sh
should be instead
#!/bin/bash
This fix works with ubuntu. for ubuntu, bin/sh links to bin/dash for redhat, bin/sh links to bin/bash
So, up to you to choose the best fix for Fabric8 launcher. Thanks for your support.
AHA! :) Lemme do both just to be sure :)
Thanks for your help diagnosing this one! It had me stumped for a while there!
Hello,
I am not able to deploy any quickstarts using 1.2.0.Beta2.
I get this in my container logs: err.log
out.log
cmd.log
Here are my fabric logs: