I think this happens because the only argument supported by phoenix are:

help, log-file, apps-path, debug-init, remote-manager, disable-hook,
application, persistent, configfile

If you pass an unknown parameter it throws an error: the error message
could be more helpful, but I don't think it is wrong to fail on bad
arguments.

The question is: WHY do you need to pass arguments to the Main?

Stefano

[EMAIL PROTECTED] ha scritto:
> Actually I already found what was "wrong". (Previously I checked on internet
> to see if other people had already the same problem and, actually, some
> people had the same.)
> 
>  
> 
> *         The problem is:
> 
> If you call the method main in "org.apache.avalon.phoenix.launcher.Main"
> WITH an argument, you will have the error:
> 
>  
> 
> java.lang.NullPointerException at
> org.apache.avalon.phoenix.frontends.CLISetup.parseCommandLineOptions(CLISetu
> p.java:202)
> 
>  
> 
>  
> 
> (If you want to try this in the script run.bat, change the last line
> 
>  
> 
> "%PHOENIX_JAVACMD%" %DEBUG%
> "-Djava.ext.dirs=%PHOENIX_HOME%\lib;%PHOENIX_HOME%\tools\lib"
> "-Dphoenix.home=%PHOENIX_HOME%"
> "-Djava.security.policy=jar:file:%PHOENIX_HOME%/bin/phoenix-loader.jar!/META
> -INF/java.policy" %PHOENIX_JVM_OPTS% %PHOENIX_SM% -jar
> "%PHOENIX_HOME%\bin\phoenix-loader.jar" %1 %2 %3 %4 %5 %6 %7 %8 %9
> 
>  
> 
> By
> 
>  
> 
> "%PHOENIX_JAVACMD%" %DEBUG%
> "-Djava.ext.dirs=%PHOENIX_HOME%\lib;%PHOENIX_HOME%\tools\lib"
> "-Dphoenix.home=%PHOENIX_HOME%"
> "-Djava.security.policy=jar:file:%PHOENIX_HOME%/bin/phoenix-loader.jar!/META
> -INF/java.policy" %PHOENIX_JVM_OPTS% %PHOENIX_SM% -jar
> "%PHOENIX_HOME%\bin\phoenix-loader.jar" toto)   --> toto or titi or tutu or
> ....
> 
>  
> 
>  
> 
> *         Occurs in:
> 
> JAMES-2.3.0. Otherwise this problem does NOT occur in 2.2.0 (I did not
> checked other versions)
> 
>  
> 
>  
> 
> *         How did I fix this problem in my Java code:
> 
> If you want to launch JAMES in Java, use the following code:
> 
>  
> 
>                              try {
> 
>                                    Class clazz =
> Class.forName(cmdLine_p[0]);
> 
>                                    Class[] argsTypes = { String[].class };
> 
>                                    // JAMES ne supporte pas qu'il y ait des
> arguments.
> 
>                                    Object[] args = { new String[0] }; // If
> it's not JAMES and you want to pass args, do Object[] args = { cmdLine_p };
> 
>                                    Method method = clazz.getMethod("main",
> argsTypes);
> 
>                                    method.invoke(clazz, args);
> 
>                              } catch (Exception e) {
> 
>                                    _log.error("coudn't run the " +
> cmdLine_p[0], e);
> 
>                              }
> 
>  
> 
> With: String[] cmdLine_p :   cmdLine_p[0] =
> "org.apache.avalon.phoenix.launcher.Main"
> 
>                              cmdLine_p[1] = argument 0 (here we do not have
> any args) 
> 
>                              cmdLine_p[2] = argument 1 (here we do not have
> any args), etc...
> 
>  
> 
>  
> 
>  
> 
> Nota: maybe it will help other users to add this mail in JAMES-794.
> 
>  
> 
> Thank you!
> 
>  
> 
> Max



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to