0

I'm trying to run mule-3.1.2 on 64bit IBM AIX, but the java wrapper can't be executed (Found but not executable.). I'm sure I have set the right permission. Besides, I also can't run mule on a ia64 machine, same problem.

So can I run the mule just as a java application not using the java wrapper?

Pengyi Wang
  • 123
  • 1
  • 16

1 Answers1

0

There are different ways to start Mule without using the wrapper: besides embedding it in a java or web-application, you can also start main() on org.mule.MuleServer.

Edit: 1

A good resource suggested by @rocwing is: Configuring Mule to Run From a Script

Edit 2:

Below is a script that can start Mule standalone: logging is not correctly configured and the shutdown sequence is a little... challenged, but it should get you started.

#!/bin/sh
for f in $MULE_HOME/lib/boot/*.jar
do MULE_CLASSPATH="$MULE_CLASSPATH":$f ; 
done

for f in $MULE_HOME/lib/mule/*.jar
do MULE_CLASSPATH="$MULE_CLASSPATH":$f ; 
done

for g in $MULE_HOME/lib/opt/*.jar
do MULE_CLASSPATH="$MULE_CLASSPATH":$g ;
done

java -Djava.endorsed.dir=$MULE_HOME/lib/endorsed -cp "$MULE_CLASSPATH" org.mule.MuleServer -config ~/my/mule-config.xml
David Dossot
  • 33,403
  • 4
  • 38
  • 72
  • thanks! [Configuring Mule to Run From a Script](http://www.mulesoft.org/documentation-3.2/display/MULE3USER/Configuring+Mule+to+Run+From+a+Script) – Pengyi Wang Nov 13 '12 at 01:47
  • It seems doesn't work... I use this:java -cp ./lib/mule;./lib/opt org.mule.MuleServer -config mule-config.xml, but can't run mule, the error is below: D:\mule-standalone-3.1.2>java -cp ./lib/mule;./lib/opt org.mule.MuleServer -conf ig mule-config.xml Exception in thread "main" java.lang.NoClassDefFoundError: org/mule/MuleServer Caused by: java.lang.ClassNotFoundException: org.mule.MuleServer ..... Could not find the main class: org.mule.MuleServer. Program will exit. – Pengyi Wang Nov 13 '12 at 06:11
  • Adding a directory in the classpath doesn't add all the JARs it contains on the classpath: you need to add the JARs you need one by one (use a script to do that). – David Dossot Nov 13 '12 at 15:45
  • thank you for reply, I use this script: @echo off setlocal EnableDelayedExpansion set MULE_CLASSPATH=%MULE_HOME%;%JAVA_HOME%\lib\tools.jar;%JAVA_HOME%\lib;%JAVA_HOME%\jre\lib FOR %%c in ("%MULE_HOME%\lib\mule\*.jar") DO set MULE_CLASSPATH=!MULE_CLASSPATH!;%%c FOR %%d in ("%MULE_HOME%\lib\opt\*.jar") DO set MULE_CLASSPATH=!MULE_CLASSPATH!;%%d FOR %%e in ("%MULE_HOME%\lib\boot\*.jar") DO set MULE_CLASSPATH=!MULE_CLASSPATH!;%%e echo %MULE_CLASSPATH% java -cp "!MULE_CLASSPATH!" org.mule.MuleServer -config mule-config.xml but nothing happens, no error and log, just quit – Pengyi Wang Nov 14 '12 at 06:37
  • Looks like Windows shell, I won't be able to test this :( I'm surprised to see the JRE libs on the classpath, aren't they there by default? Also "nothing happens" is very surprising... I mean there should be an error or something written in the console from where you started the script. – David Dossot Nov 15 '12 at 05:32
  • I used this script on Linux:#!/bin/sh for f in /df8003/home/soa/esb/mule-standalone-3.3.0/lib/mule/*.jar do MULE_CLASSPATH="$MULE_CLASSPATH":$f done for g in /df8003/home/soa/esb/mule-standalone-3.3.0/lib/opt/*.jar do MULE_CLASSPATH="$MULE_CLASSPATH":$g done java -cp "$MULE_CLASSPATH" org.mule.MuleServer -config mule-config.xml The error is below: – Pengyi Wang Nov 15 '12 at 07:06
  • [11-15 15:00:22] WARN FileConnector [main]: MULE-1773: cannot configure maxDispatchersActive when using outputAppend. New value not set Exception in thread "main" java.lang.IllegalStateException: Shutdown in progress at java.lang.ApplicationShutdownHooks.remove(ApplicationShutdownHooks.java:55) at java.lang.Runtime.removeShutdownHook(Runtime.java:220) at org.mule.MuleServer.unregisterShutdownHook(MuleServer.java:522) at org.mule.MuleServer.shutdown(MuleServer.java:453) at org.mule.MuleServer.run(MuleServer.java:303) – Pengyi Wang Nov 15 '12 at 07:09
  • I just copied a mule-config.xml from apps directory, I'm not sure whether this is OK. – Pengyi Wang Nov 15 '12 at 07:11
  • 1
    I've done a few changes to your script (missing /boot and endorsed dirs) and Mule starts and loads up the passed configuration. It's not 100% perfect but should get you going. – David Dossot Nov 16 '12 at 00:28