You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@geronimo.apache.org by Jason Dillon <ja...@coredevelopers.net> on 2003/08/24 19:55:45 UTC

[twiddle] Twiddle is now booting Geronimo

I finished my initial checkin to allow a Twiddle command to start 
Geronimo.

To start Geronimo, after building you can:

cd target
./geronimo-DEV/bin/start

or

cd target
./geronimo-DEV/bin/twiddle geronimo/start

Right now you need to be in the target directory.  I will resolve this 
soon, but for now dat is how it be ;-)

Help (via ./geronimo-DEV/bin/start --help) looks like:

usage: geronimo/start [options]

Options:
   -d,--deploy <arg>    Deploy URL
   -h,--help            Display this help message
   -m,--mlet <arg>      MLet URL

So you can change the config urls.  It does spit out a lot of debug 
too, which I will get around to fixing, though some of that is 
dependent on getting the Commons Logging package to properly handle 
trace for Log4j (patch pending... right James?).

Unfortunately Commons CLI does not order options, so the options are a 
bit scrambled... need to see about fixing this.

Removed the CLI bits from Main, as StartCommand handles these details 
now.  The top-level run goal should still work as I changed it to 
behave like the twiddle script.

Twiddle boots with Werken Forehead to make the initial setup of 
classpath nice and simple for me.  You can control Forehead via 
etc/forehead.conf

  * * *

I still need to create windows scripts (ick).

Also we need to start thinking a little about the release structure.  I 
am currently thinking of a structure similar to... well you know... 
something like this:

geronimo-<release>/
     README.txt
     LICENSE.txt
     VERSION.txt
     docs/
         <html docs>
     bin/
         <scripts>
     lib/
         <boot-libraries>
     etc/
         forehead.conf
         twiddle.conf
         twiddle/
             geronimo.conf
             <twiddle-command-configs>
     config/
         global/
             lib/
                 <libs global to all configs>
             resources/
                 <resources files global to all configs>
             deploy/
                 <deployments global to all configs>
         <config-name>/
             lib/
                 <libraries>
             resources/
                 < resources files>
             deploy/
                 <deployment files>
             tmp/
                 <temporary files>
             data/
                 <non-transient data/state files>
             log/
                 <log files>

I am wondering if anyone else has any ideas.

--jason


Re: [twiddle] Twiddle is now booting Geronimo

Posted by Jason Dillon <ja...@coredevelopers.net>.
Currently there is only the wiki page:

http://nagoya.apache.org/wiki/apachewiki.cgi?ApacheJ2EE/Twiddle

--jason


On Monday, August 25, 2003, at 09:55  AM, Uijin Hong wrote:

> This could be a newbie's annoying question. Anyway, Is there any 
> document
> that describes what Twiddle is and where is it come from, and what for?
>
> Thanks.
>
>
> "Jason Dillon" <ja...@coredevelopers.net>
> wrote in message
> news:2F85C9EC-D65C-11D7-94CB-000A9566A360@coredevelopers.net...
>> I finished my initial checkin to allow a Twiddle command to start
>> Geronimo.
>>
>> To start Geronimo, after building you can:
>>
>> cd target
>> ./geronimo-DEV/bin/start
>>
>> or
>>
>> cd target
>> ./geronimo-DEV/bin/twiddle geronimo/start
>>
>> Right now you need to be in the target directory.  I will resolve this
>> soon, but for now dat is how it be ;-)
>>
>> Help (via ./geronimo-DEV/bin/start --help) looks like:
>>
>> usage: geronimo/start [options]
>>
>> Options:
>>    -d,--deploy <arg>    Deploy URL
>>    -h,--help            Display this help message
>>    -m,--mlet <arg>      MLet URL
>>
>> So you can change the config urls.  It does spit out a lot of debug
>> too, which I will get around to fixing, though some of that is
>> dependent on getting the Commons Logging package to properly handle
>> trace for Log4j (patch pending... right James?).
>>
>> Unfortunately Commons CLI does not order options, so the options are a
>> bit scrambled... need to see about fixing this.
>>
>> Removed the CLI bits from Main, as StartCommand handles these details
>> now.  The top-level run goal should still work as I changed it to
>> behave like the twiddle script.
>>
>> Twiddle boots with Werken Forehead to make the initial setup of
>> classpath nice and simple for me.  You can control Forehead via
>> etc/forehead.conf
>>
>>   * * *
>>
>> I still need to create windows scripts (ick).
>>
>> Also we need to start thinking a little about the release structure.  
>> I
>> am currently thinking of a structure similar to... well you know...
>> something like this:
>>
>> geronimo-<release>/
>>      README.txt
>>      LICENSE.txt
>>      VERSION.txt
>>      docs/
>>          <html docs>
>>      bin/
>>          <scripts>
>>      lib/
>>          <boot-libraries>
>>      etc/
>>          forehead.conf
>>          twiddle.conf
>>          twiddle/
>>              geronimo.conf
>>              <twiddle-command-configs>
>>      config/
>>          global/
>>              lib/
>>                  <libs global to all configs>
>>              resources/
>>                  <resources files global to all configs>
>>              deploy/
>>                  <deployments global to all configs>
>>          <config-name>/
>>              lib/
>>                  <libraries>
>>              resources/
>>                  < resources files>
>>              deploy/
>>                  <deployment files>
>>              tmp/
>>                  <temporary files>
>>              data/
>>                  <non-transient data/state files>
>>              log/
>>                  <log files>
>>
>> I am wondering if anyone else has any ideas.
>>
>> --jason
>>
>>
>
>
>


Re: [twiddle] Twiddle is now booting Geronimo

Posted by Uijin Hong <He...@runeconsulting.com>.
This could be a newbie's annoying question. Anyway, Is there any document
that describes what Twiddle is and where is it come from, and what for?

Thanks.


"Jason Dillon" <ja...@coredevelopers.net>
wrote in message
news:2F85C9EC-D65C-11D7-94CB-000A9566A360@coredevelopers.net...
> I finished my initial checkin to allow a Twiddle command to start
> Geronimo.
>
> To start Geronimo, after building you can:
>
> cd target
> ./geronimo-DEV/bin/start
>
> or
>
> cd target
> ./geronimo-DEV/bin/twiddle geronimo/start
>
> Right now you need to be in the target directory.  I will resolve this
> soon, but for now dat is how it be ;-)
>
> Help (via ./geronimo-DEV/bin/start --help) looks like:
>
> usage: geronimo/start [options]
>
> Options:
>    -d,--deploy <arg>    Deploy URL
>    -h,--help            Display this help message
>    -m,--mlet <arg>      MLet URL
>
> So you can change the config urls.  It does spit out a lot of debug
> too, which I will get around to fixing, though some of that is
> dependent on getting the Commons Logging package to properly handle
> trace for Log4j (patch pending... right James?).
>
> Unfortunately Commons CLI does not order options, so the options are a
> bit scrambled... need to see about fixing this.
>
> Removed the CLI bits from Main, as StartCommand handles these details
> now.  The top-level run goal should still work as I changed it to
> behave like the twiddle script.
>
> Twiddle boots with Werken Forehead to make the initial setup of
> classpath nice and simple for me.  You can control Forehead via
> etc/forehead.conf
>
>   * * *
>
> I still need to create windows scripts (ick).
>
> Also we need to start thinking a little about the release structure.  I
> am currently thinking of a structure similar to... well you know...
> something like this:
>
> geronimo-<release>/
>      README.txt
>      LICENSE.txt
>      VERSION.txt
>      docs/
>          <html docs>
>      bin/
>          <scripts>
>      lib/
>          <boot-libraries>
>      etc/
>          forehead.conf
>          twiddle.conf
>          twiddle/
>              geronimo.conf
>              <twiddle-command-configs>
>      config/
>          global/
>              lib/
>                  <libs global to all configs>
>              resources/
>                  <resources files global to all configs>
>              deploy/
>                  <deployments global to all configs>
>          <config-name>/
>              lib/
>                  <libraries>
>              resources/
>                  < resources files>
>              deploy/
>                  <deployment files>
>              tmp/
>                  <temporary files>
>              data/
>                  <non-transient data/state files>
>              log/
>                  <log files>
>
> I am wondering if anyone else has any ideas.
>
> --jason
>
>




Re: [twiddle] Twiddle is now booting Geronimo

Posted by Jason Dillon <ja...@coredevelopers.net>.
> would it be possible to implement the mentioned (ssh|telnet) server,
> as JMX connectors instead of making them a part of Twiddle?

Sure, though I do not want to limit the telnet/ssh console to only jmx 
commands.


> in that case other client side tools (RAD IDEs, the Ant sshexec task
>  etc.) would be able to leverage those connectors as well ...

Either way this would be true.


> or was that already the plan and i did not completly get the idea?

;-)

--jason


Re: [twiddle] Twiddle is now booting Geronimo

Posted by "Daniel S. Haischt" <me...@daniel.stefan.haischt.name>.
Jeremy Boynes wrote:

[...]

>>The long-term vision is to turn Twiddle into a Geronimo component, so
>>that one could telnet/ssh into the server to run commands on the live
>>instance, especially to run a script interpreter command (using BSF or
>>something) so that one could evaluate a Jython or BeanShell script on
>>the live server.
>>
> 
> 
> I'm not convinced this is necessary. Twiddle can be a client-side shell
> environment communicating with the server using the same protocols as other
> admin tools - this seems to work for products such as PostgreSQL, Postfix,
> Cyrus-IMAP, Oracle, ...
> 


just a note ...

would it be possible to implement the mentioned (ssh|telnet) server,
as JMX connectors instead of making them a part of Twiddle?

in that case other client side tools (RAD IDEs, the Ant sshexec task
  etc.) would be able to leverage those connectors as well ...

or was that already the plan and i did not completly get the idea?

regards

daniel s. haischt
--


Re: Cant run/debug geronimo, please help...

Posted by Emerson Cargnin <ec...@bol.com.br>.
I got it to work, but I had to modify three files :
classworlds.conf :
took ou all the jar's loading (so I can get the changes applied):
# Allow access to resources
load ${twiddle.home}/etc/
# Load required libraries
load ${twiddle.home}/lib/xerces-*.jar
load ${twiddle.home}/lib/castor-*.jar
...

twiddle.conf :

<include>${twiddle.home}/etc/twiddle/geronimo.conf</include>
changed * to geronimo. So I could get rid of the error when parsing the URL
at
URL baseURL = Strings.toURL(globspec); (Configurator.parseGlobURLs()). This
ocurred when the include at conf file had '*'


the Configurator.java :

from :
if (!baseURL.getProtocol().equals("file")) {
to
if (baseURL.getProtocol().equals("file")) {

In a way it won't try to find the * at the file name when it's passed a
absolute and unique file.
I didn't get too much of the code at configurator. Jason, parseGlobURLs()
are the one's with *  to match multiple files? Could you explain a little
better it's pourpose or put some javadoc? Is it happening just with me?

The spec covers this method, I can take a look if it does. (since it has the
trace : "Parsing glob URLs from spec: " + globspec;)

----- Original Message -----
From: "Emerson Cargnin" <ec...@bol.com.br>
To: <ge...@incubator.apache.org>; "Emerson Cargnin"
<ec...@bol.com.br>
Sent: Monday, August 25, 2003 11:22 PM
Subject: Re: Cant run/debug geronimo, please help...


> I made a change in twiddle.conf (give it a absolute file, as there is just
> one) :
>
>   <includes>
>     <include>${twiddle.home}/etc/twiddle/geronimo.conf</include>
>   </includes>
>
>
> It goes farther, but not much :
>
> configureIncludes of Configurator always expects an * ?
>
> int i = glob.indexOf("*");
> final String prefix = glob.substring(0, i);
>
> neddless to say that the blog (geronimo.conf) has no "*", so giving an
> StringIndexOutOfBoundsException exception.
>
> And when using the original value *.conf (at twiddle), it stops at
>
>  url = new URL(urlspec); line 701 of Strings, method toURL.
>
>
> I tried to make the following code work, but i doens't (out of geronimo)
> new
>
URL("C:/eclipse/workspace/incubator-geronimo/target/geronimo-DEV/etc/twiddle
> /*.conf")
>
>
>
> ----- Original Message -----
> From: "Emerson Cargnin" <ec...@bol.com.br>
> To: <ge...@incubator.apache.org>
> Sent: Monday, August 25, 2003 10:48 PM
> Subject: Cant run/debug geronimo, please help...
>
>
> > Sorry for the long post, but i've been through some problems, I'd like
to
> > share with you(and help me to solve it too :).
> >
> > I'm trying to boot geronimo (windows 2000 , Sun jdk1.4.2), but without
> > success :
> >
> > 1- going to \target\geronimo-DEV\bin and typing start just opens a new
> > screen
> >
> > 2 - inside bin, I type twiddle, and I get the following stacktrace :
> >
> > C:\temp\geronimo\bin>edit twiddle.bat
> >
> > C:\temp\geronimo\bin>twiddle
> > 21:03:54,859 DEBUG [Main] Home URL: file:/C:/temp/geronimo/
> > 21:03:54,859 DEBUG [Main] Configuration URL:
> > file:/C:/temp/geronimo/etc/twiddle.conf
> > 21:03:54,953 DEBUG [ConfigurationReader] Reading:
> > file:/C:/temp/geronimo/etc/twiddle.conf
> > 21:03:55,359 DEBUG [NestedThrowable]
> > org.apache.geronimo.common.NestedThrowable.parentTraceEnabled=true
> > 21:03:55,359 DEBUG [NestedThrowable]
> > org.apache.geronimo.common.NestedThrowable.nestedTraceEnabled=false
> > 21:03:55,375 DEBUG [NestedThrowable]
> > org.apache.geronimo.common.NestedThrowable.detectDuplicateNesting=true
> > org.apache.geronimo.twiddle.config.ConfigurationException: Failed to
> process
> > include: ${twiddle.home}/etc/twiddle/*.conf; - nested throwable:
> > (java.net.MalformedURLException: Failed to create URL from filespec:
> > C:\temp\geronimo\bin\../etc/twiddle/*.conf)
> >
> > I tried to debuig in eclipse :
> >
> > java.io.FileNotFoundException: C:\eclipse\workspace\etc\twiddle.conf (O
> > sistema não pode encontrar o caminho especificado)
> > at java.io.FileInputStream.open(Native Method)
> > at java.io.FileInputStream.<init>(FileInputStream.java:106)
> > at java.io.FileInputStream.<init>(FileInputStream.java:66)
> > at
> >
>
sun.net.www.protocol.file.FileURLConnection.connect(FileURLConnection.java:6
> > 9)
> > at
> >
>
sun.net.www.protocol.file.FileURLConnection.getInputStream(FileURLConnection
> > .java:156)
> > at java.net.URL.openStream(URL.java:913)
> > at
> >
>
org.apache.geronimo.twiddle.config.ConfigurationReader.read(ConfigurationRea
> > der.java:115)
> > at org.apache.geronimo.twiddle.cli.Main.boot(Main.java:199)
> > at org.apache.geronimo.twiddle.cli.Main.main(Main.java:223)
> > at org.apache.geronimo.twiddle.cli.Main.main(Main.java:236)
> > ...
> >
> > As you can see, it goes a dir up than it should (maybe because i'm
running
> > the code out of the twiddle jar, maybe another approache to discover
home
> > location would be better).
> >
> > the following code in Twiddle.getHomeDir() :
> >
> > String path =
> >
>
Twiddle.class.getProtectionDomain().getCodeSource().getLocation().getFile();
> > path = URLDecoder.decode(path, "UTF-8");
> > // home dir is expected to be lib/..
> > dir = new File(path).getParentFile().getParentFile();
> >
> > Maybe it's happening becouse i'm debugging the code directly and not
using
> > the twiddle from the jar.
> >
> > Now I set the TWIDDLE_HOME, but the code :
> >
> > // Determine what our home directory is
> > String temp = System.getProperty(TWIDDLE_HOME);
> >
> > doesn't work.
> >
> > What should be the solution for this?
> >
> > I solved it sending a parameter :
>
> -Dtwiddle.home=C:/eclipse/workspace/incubator-geronimo/target/geronimo-DEV
> > But it should be using the system properties, isn't?
> >
> > Now : ) I got and error in
> > _includeList=[${twiddle.home}/etc/twiddle/*.conf]
> > the value
> >
>
C:/eclipse/workspace/incubator-geronimo/target/geronimo-DEV/etc/twiddle/*.co
> > nf
> > in the  code (commons/Strings.makeURLFromFilespec) :
> >
> > // make sure it is canonical (no ../ and such)
> > file = file.getCanonicalFile();
> >
> > It looks like *.conf from twiddles.conf file is causing the error
> > <includes>
> > <include>${twiddle.home}/etc/twiddle/*.conf</include>
> > </includes>
> >
> > should I conf  each file? is it just me?
> > Stack-trace :
> >
> > org.apache.geronimo.twiddle.config.ConfigurationException: Failed to
> process
> > include: ${twiddle.home}/etc/twiddle/*.conf; - nested throwable:
> > (java.net.MalformedURLException: Failed to create URL from filespec:
> >
>
C:/eclipse/workspace/incubator-geronimo/target/geronimo-DEV/etc/twiddle/*.co
> > nf)
> > at
> >
>
org.apache.geronimo.twiddle.config.Configurator.configureIncludes(Configurat
> > or.java:158)
> > at
> >
>
org.apache.geronimo.twiddle.config.Configurator.configure(Configurator.java:
> > 115)
> > at org.apache.geronimo.twiddle.Twiddle.configure(Twiddle.java:203)
> > at org.apache.geronimo.twiddle.cli.Main.boot(Main.java:202)
> > at org.apache.geronimo.twiddle.cli.Main.main(Main.java:223)
> > at org.apache.geronimo.twiddle.cli.Main.main(Main.java:236)
> > Caused by: java.net.MalformedURLException: Failed to create URL from
> > filespec:
> >
>
C:/eclipse/workspace/incubator-geronimo/target/geronimo-DEV/etc/twiddle/*.co
> > nf
> > at org.apache.geronimo.common.Strings.toURL(Strings.java:713)
> > at org.apache.geronimo.common.Strings.toURL(Strings.java:752)
> > at
> >
>
org.apache.geronimo.twiddle.config.Configurator.parseGlobURLs(Configurator.j
> > ava:173)
> > at
> >
>
org.apache.geronimo.twiddle.config.Configurator.configureIncludes(Configurat
> > or.java:151)
> > ... 5 more
> > Caused by: java.io.IOException: O sistema não pode encontrar o caminho
> > especificado
> > at java.io.WinNTFileSystem.canonicalize0(Native Method)
> > at java.io.Win32FileSystem.canonicalize(Win32FileSystem.java:352)
> > at java.io.File.getCanonicalPath(File.java:513)
> > at java.io.File.getCanonicalFile(File.java:534)
> > at
> org.apache.geronimo.common.Strings.makeURLFromFilespec(Strings.java:735)
> > at org.apache.geronimo.common.Strings.toURL(Strings.java:709)
> > ... 8 more
> >
> >
> > ---
> > Outgoing mail is certified Virus Free.
> > Checked by AVG anti-virus system (http://www.grisoft.com).
> > Version: 6.0.512 / Virus Database: 309 - Release Date: 19/8/2003
> >
>
>
> ---
> Outgoing mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.512 / Virus Database: 309 - Release Date: 19/8/2003
>


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.512 / Virus Database: 309 - Release Date: 20/8/2003


Re: Cant run/debug geronimo, please help...

Posted by Emerson Cargnin <ec...@bol.com.br>.
IT WORKED, OUT-OF-THE-BOX!!!!  :)
just  : maven clean, build, and run 

Thanks
Have to sleep, maybe tomorrow I can look for some other issues :)


----- Original Message ----- 
From: "Jason Dillon" <ja...@coredevelopers.net>
To: <ge...@incubator.apache.org>
Sent: Tuesday, August 26, 2003 4:56 AM
Subject: Re: Cant run/debug geronimo, please help...


> >>> configureIncludes of Configurator always expects an * ?
> >>>
> >>> int i = glob.indexOf("*");
> >>> final String prefix = glob.substring(0, i);
> >>
> >> This has been fixed.
> > but the cvs still has the '!'. At least my synchronize don't show it 
> > up.
> 
> You are right this has not been checked in yet... my bad.
> 
> --jason
> 


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.512 / Virus Database: 309 - Release Date: 20/8/2003

Re: Cant run/debug geronimo, please help...

Posted by Jason Dillon <ja...@coredevelopers.net>.
>>> configureIncludes of Configurator always expects an * ?
>>>
>>> int i = glob.indexOf("*");
>>> final String prefix = glob.substring(0, i);
>>
>> This has been fixed.
> but the cvs still has the '!'. At least my synchronize don't show it 
> up.

You are right this has not been checked in yet... my bad.

--jason


Re: Cant run/debug geronimo, please help...

Posted by Emerson Cargnin <ec...@bol.com.br>.
> > configureIncludes of Configurator always expects an * ?
> >
> > int i = glob.indexOf("*");
> > final String prefix = glob.substring(0, i);
>
> This has been fixed.
but the cvs still has the '!'. At least my synchronize don't show it up.

I've compile all my quest to get geronimo debugging/running under eclipse,
if anyother newbie want to try out :

http://echofloripa.sytes.net/personalblog

There I put the classpath (hiram, the maven plugin don't generate all the
classpath for all modules, and it uses MAVEN_REPO var, that didn't work,
although i had it configured), and my exported preferences, to help to
configure eclipse. And all the way through to get it running.

Anyway, thanks for all and keep up this great work!!!!


Emerson

>
>
> > neddless to say that the blog (geronimo.conf) has no "*", so giving an
> > StringIndexOutOfBoundsException exception.
> >
> > And when using the original value *.conf (at twiddle), it stops at
> >
> >  url = new URL(urlspec); line 701 of Strings, method toURL.
>
> This I am looking into resolving now.
>
> Looks like the WinNT WinNTFileSystem.canonicalize() does not like any
> '*' but Unix versions work fine.
>
> --jason
>


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.512 / Virus Database: 309 - Release Date: 20/8/2003


Re: Cant run/debug geronimo, please help...

Posted by Jason Dillon <ja...@coredevelopers.net>.
> configureIncludes of Configurator always expects an * ?
>
> int i = glob.indexOf("*");
> final String prefix = glob.substring(0, i);

This has been fixed.


> neddless to say that the blog (geronimo.conf) has no "*", so giving an
> StringIndexOutOfBoundsException exception.
>
> And when using the original value *.conf (at twiddle), it stops at
>
>  url = new URL(urlspec); line 701 of Strings, method toURL.

This I am looking into resolving now.

Looks like the WinNT WinNTFileSystem.canonicalize() does not like any 
'*' but Unix versions work fine.

--jason


Re: Cant run/debug geronimo, please help...

Posted by Emerson Cargnin <ec...@bol.com.br>.
I made a change in twiddle.conf (give it a absolute file, as there is just
one) :

  <includes>
    <include>${twiddle.home}/etc/twiddle/geronimo.conf</include>
  </includes>


It goes farther, but not much :

configureIncludes of Configurator always expects an * ?

int i = glob.indexOf("*");
final String prefix = glob.substring(0, i);

neddless to say that the blog (geronimo.conf) has no "*", so giving an
StringIndexOutOfBoundsException exception.

And when using the original value *.conf (at twiddle), it stops at

 url = new URL(urlspec); line 701 of Strings, method toURL.


I tried to make the following code work, but i doens't (out of geronimo)
new
URL("C:/eclipse/workspace/incubator-geronimo/target/geronimo-DEV/etc/twiddle
/*.conf")



----- Original Message -----
From: "Emerson Cargnin" <ec...@bol.com.br>
To: <ge...@incubator.apache.org>
Sent: Monday, August 25, 2003 10:48 PM
Subject: Cant run/debug geronimo, please help...


> Sorry for the long post, but i've been through some problems, I'd like to
> share with you(and help me to solve it too :).
>
> I'm trying to boot geronimo (windows 2000 , Sun jdk1.4.2), but without
> success :
>
> 1- going to \target\geronimo-DEV\bin and typing start just opens a new
> screen
>
> 2 - inside bin, I type twiddle, and I get the following stacktrace :
>
> C:\temp\geronimo\bin>edit twiddle.bat
>
> C:\temp\geronimo\bin>twiddle
> 21:03:54,859 DEBUG [Main] Home URL: file:/C:/temp/geronimo/
> 21:03:54,859 DEBUG [Main] Configuration URL:
> file:/C:/temp/geronimo/etc/twiddle.conf
> 21:03:54,953 DEBUG [ConfigurationReader] Reading:
> file:/C:/temp/geronimo/etc/twiddle.conf
> 21:03:55,359 DEBUG [NestedThrowable]
> org.apache.geronimo.common.NestedThrowable.parentTraceEnabled=true
> 21:03:55,359 DEBUG [NestedThrowable]
> org.apache.geronimo.common.NestedThrowable.nestedTraceEnabled=false
> 21:03:55,375 DEBUG [NestedThrowable]
> org.apache.geronimo.common.NestedThrowable.detectDuplicateNesting=true
> org.apache.geronimo.twiddle.config.ConfigurationException: Failed to
process
> include: ${twiddle.home}/etc/twiddle/*.conf; - nested throwable:
> (java.net.MalformedURLException: Failed to create URL from filespec:
> C:\temp\geronimo\bin\../etc/twiddle/*.conf)
>
> I tried to debuig in eclipse :
>
> java.io.FileNotFoundException: C:\eclipse\workspace\etc\twiddle.conf (O
> sistema não pode encontrar o caminho especificado)
> at java.io.FileInputStream.open(Native Method)
> at java.io.FileInputStream.<init>(FileInputStream.java:106)
> at java.io.FileInputStream.<init>(FileInputStream.java:66)
> at
>
sun.net.www.protocol.file.FileURLConnection.connect(FileURLConnection.java:6
> 9)
> at
>
sun.net.www.protocol.file.FileURLConnection.getInputStream(FileURLConnection
> .java:156)
> at java.net.URL.openStream(URL.java:913)
> at
>
org.apache.geronimo.twiddle.config.ConfigurationReader.read(ConfigurationRea
> der.java:115)
> at org.apache.geronimo.twiddle.cli.Main.boot(Main.java:199)
> at org.apache.geronimo.twiddle.cli.Main.main(Main.java:223)
> at org.apache.geronimo.twiddle.cli.Main.main(Main.java:236)
> ...
>
> As you can see, it goes a dir up than it should (maybe because i'm running
> the code out of the twiddle jar, maybe another approache to discover home
> location would be better).
>
> the following code in Twiddle.getHomeDir() :
>
> String path =
>
Twiddle.class.getProtectionDomain().getCodeSource().getLocation().getFile();
> path = URLDecoder.decode(path, "UTF-8");
> // home dir is expected to be lib/..
> dir = new File(path).getParentFile().getParentFile();
>
> Maybe it's happening becouse i'm debugging the code directly and not using
> the twiddle from the jar.
>
> Now I set the TWIDDLE_HOME, but the code :
>
> // Determine what our home directory is
> String temp = System.getProperty(TWIDDLE_HOME);
>
> doesn't work.
>
> What should be the solution for this?
>
> I solved it sending a parameter :
> -Dtwiddle.home=C:/eclipse/workspace/incubator-geronimo/target/geronimo-DEV
> But it should be using the system properties, isn't?
>
> Now : ) I got and error in
> _includeList=[${twiddle.home}/etc/twiddle/*.conf]
> the value
>
C:/eclipse/workspace/incubator-geronimo/target/geronimo-DEV/etc/twiddle/*.co
> nf
> in the  code (commons/Strings.makeURLFromFilespec) :
>
> // make sure it is canonical (no ../ and such)
> file = file.getCanonicalFile();
>
> It looks like *.conf from twiddles.conf file is causing the error
> <includes>
> <include>${twiddle.home}/etc/twiddle/*.conf</include>
> </includes>
>
> should I conf  each file? is it just me?
> Stack-trace :
>
> org.apache.geronimo.twiddle.config.ConfigurationException: Failed to
process
> include: ${twiddle.home}/etc/twiddle/*.conf; - nested throwable:
> (java.net.MalformedURLException: Failed to create URL from filespec:
>
C:/eclipse/workspace/incubator-geronimo/target/geronimo-DEV/etc/twiddle/*.co
> nf)
> at
>
org.apache.geronimo.twiddle.config.Configurator.configureIncludes(Configurat
> or.java:158)
> at
>
org.apache.geronimo.twiddle.config.Configurator.configure(Configurator.java:
> 115)
> at org.apache.geronimo.twiddle.Twiddle.configure(Twiddle.java:203)
> at org.apache.geronimo.twiddle.cli.Main.boot(Main.java:202)
> at org.apache.geronimo.twiddle.cli.Main.main(Main.java:223)
> at org.apache.geronimo.twiddle.cli.Main.main(Main.java:236)
> Caused by: java.net.MalformedURLException: Failed to create URL from
> filespec:
>
C:/eclipse/workspace/incubator-geronimo/target/geronimo-DEV/etc/twiddle/*.co
> nf
> at org.apache.geronimo.common.Strings.toURL(Strings.java:713)
> at org.apache.geronimo.common.Strings.toURL(Strings.java:752)
> at
>
org.apache.geronimo.twiddle.config.Configurator.parseGlobURLs(Configurator.j
> ava:173)
> at
>
org.apache.geronimo.twiddle.config.Configurator.configureIncludes(Configurat
> or.java:151)
> ... 5 more
> Caused by: java.io.IOException: O sistema não pode encontrar o caminho
> especificado
> at java.io.WinNTFileSystem.canonicalize0(Native Method)
> at java.io.Win32FileSystem.canonicalize(Win32FileSystem.java:352)
> at java.io.File.getCanonicalPath(File.java:513)
> at java.io.File.getCanonicalFile(File.java:534)
> at
org.apache.geronimo.common.Strings.makeURLFromFilespec(Strings.java:735)
> at org.apache.geronimo.common.Strings.toURL(Strings.java:709)
> ... 8 more
>
>
> ---
> Outgoing mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.512 / Virus Database: 309 - Release Date: 19/8/2003
>


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.512 / Virus Database: 309 - Release Date: 19/8/2003


Cant run/debug geronimo, please help...

Posted by Emerson Cargnin <ec...@bol.com.br>.
Sorry for the long post, but i've been through some problems, I'd like to
share with you(and help me to solve it too :).

I'm trying to boot geronimo (windows 2000 , Sun jdk1.4.2), but without
success :

1- going to \target\geronimo-DEV\bin and typing start just opens a new
screen

2 - inside bin, I type twiddle, and I get the following stacktrace :

C:\temp\geronimo\bin>edit twiddle.bat

C:\temp\geronimo\bin>twiddle
21:03:54,859 DEBUG [Main] Home URL: file:/C:/temp/geronimo/
21:03:54,859 DEBUG [Main] Configuration URL:
file:/C:/temp/geronimo/etc/twiddle.conf
21:03:54,953 DEBUG [ConfigurationReader] Reading:
file:/C:/temp/geronimo/etc/twiddle.conf
21:03:55,359 DEBUG [NestedThrowable]
org.apache.geronimo.common.NestedThrowable.parentTraceEnabled=true
21:03:55,359 DEBUG [NestedThrowable]
org.apache.geronimo.common.NestedThrowable.nestedTraceEnabled=false
21:03:55,375 DEBUG [NestedThrowable]
org.apache.geronimo.common.NestedThrowable.detectDuplicateNesting=true
org.apache.geronimo.twiddle.config.ConfigurationException: Failed to process
include: ${twiddle.home}/etc/twiddle/*.conf; - nested throwable:
(java.net.MalformedURLException: Failed to create URL from filespec:
C:\temp\geronimo\bin\../etc/twiddle/*.conf)

I tried to debuig in eclipse :

java.io.FileNotFoundException: C:\eclipse\workspace\etc\twiddle.conf (O
sistema não pode encontrar o caminho especificado)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.<init>(FileInputStream.java:106)
at java.io.FileInputStream.<init>(FileInputStream.java:66)
at
sun.net.www.protocol.file.FileURLConnection.connect(FileURLConnection.java:6
9)
at
sun.net.www.protocol.file.FileURLConnection.getInputStream(FileURLConnection
.java:156)
at java.net.URL.openStream(URL.java:913)
at
org.apache.geronimo.twiddle.config.ConfigurationReader.read(ConfigurationRea
der.java:115)
at org.apache.geronimo.twiddle.cli.Main.boot(Main.java:199)
at org.apache.geronimo.twiddle.cli.Main.main(Main.java:223)
at org.apache.geronimo.twiddle.cli.Main.main(Main.java:236)
...

As you can see, it goes a dir up than it should (maybe because i'm running
the code out of the twiddle jar, maybe another approache to discover home
location would be better).

the following code in Twiddle.getHomeDir() :

String path =
Twiddle.class.getProtectionDomain().getCodeSource().getLocation().getFile();
path = URLDecoder.decode(path, "UTF-8");
// home dir is expected to be lib/..
dir = new File(path).getParentFile().getParentFile();

Maybe it's happening becouse i'm debugging the code directly and not using
the twiddle from the jar.

Now I set the TWIDDLE_HOME, but the code :

// Determine what our home directory is
String temp = System.getProperty(TWIDDLE_HOME);

doesn't work.

What should be the solution for this?

I solved it sending a parameter :
-Dtwiddle.home=C:/eclipse/workspace/incubator-geronimo/target/geronimo-DEV
But it should be using the system properties, isn't?

Now : ) I got and error in
_includeList=[${twiddle.home}/etc/twiddle/*.conf]
the value
C:/eclipse/workspace/incubator-geronimo/target/geronimo-DEV/etc/twiddle/*.co
nf
in the  code (commons/Strings.makeURLFromFilespec) :

// make sure it is canonical (no ../ and such)
file = file.getCanonicalFile();

It looks like *.conf from twiddles.conf file is causing the error
<includes>
<include>${twiddle.home}/etc/twiddle/*.conf</include>
</includes>

should I conf  each file? is it just me?
Stack-trace :

org.apache.geronimo.twiddle.config.ConfigurationException: Failed to process
include: ${twiddle.home}/etc/twiddle/*.conf; - nested throwable:
(java.net.MalformedURLException: Failed to create URL from filespec:
C:/eclipse/workspace/incubator-geronimo/target/geronimo-DEV/etc/twiddle/*.co
nf)
at
org.apache.geronimo.twiddle.config.Configurator.configureIncludes(Configurat
or.java:158)
at
org.apache.geronimo.twiddle.config.Configurator.configure(Configurator.java:
115)
at org.apache.geronimo.twiddle.Twiddle.configure(Twiddle.java:203)
at org.apache.geronimo.twiddle.cli.Main.boot(Main.java:202)
at org.apache.geronimo.twiddle.cli.Main.main(Main.java:223)
at org.apache.geronimo.twiddle.cli.Main.main(Main.java:236)
Caused by: java.net.MalformedURLException: Failed to create URL from
filespec:
C:/eclipse/workspace/incubator-geronimo/target/geronimo-DEV/etc/twiddle/*.co
nf
at org.apache.geronimo.common.Strings.toURL(Strings.java:713)
at org.apache.geronimo.common.Strings.toURL(Strings.java:752)
at
org.apache.geronimo.twiddle.config.Configurator.parseGlobURLs(Configurator.j
ava:173)
at
org.apache.geronimo.twiddle.config.Configurator.configureIncludes(Configurat
or.java:151)
... 5 more
Caused by: java.io.IOException: O sistema não pode encontrar o caminho
especificado
at java.io.WinNTFileSystem.canonicalize0(Native Method)
at java.io.Win32FileSystem.canonicalize(Win32FileSystem.java:352)
at java.io.File.getCanonicalPath(File.java:513)
at java.io.File.getCanonicalFile(File.java:534)
at org.apache.geronimo.common.Strings.makeURLFromFilespec(Strings.java:735)
at org.apache.geronimo.common.Strings.toURL(Strings.java:709)
... 8 more


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.512 / Virus Database: 309 - Release Date: 19/8/2003


RE: [twiddle] Twiddle is now booting Geronimo

Posted by Jeremy Boynes <je...@coredevelopers.net>.
> Specifically what do you think must be changed?
>

I don't think core should depend on twiddle - for what StartCommand is
doing, it could quite happily be a part of twiddle rather than the core; the
only class it uses from core is Main vs. a bucketload from twiddle.

twiddle will be one UI to the system but there will be many others - e.g. a
HTML GUI, a RMI based management console, plugins for Eclipse, ... These are
likely to have their own interfaces to the core, probably via JMX, and will
not use twiddle at all.

So, specifically, move StartCommand into twiddle and remove any new
dependencies that were added to project/maven.xml

You could put the main method back into Main too - it's not super functional
but is damn simple.

>   * * *
>
> Here is a little background on Twiddle (the concept and the future)...
>
> Twiddle aims to be a simple command shell, sporting and interactive
> console, to make it simple to write command-line tools.  Command line
> tools should have a consistent interface and be easily organized
> (instead of littering up bin/* with scripts).
>
> The short-term vision is to provide a simple container for commands
> (which is mostly done).
>
> The medium-term vision is to use Twiddle as the bootstrap for Geronimo,
> letting Twiddle handle the details of the initial footprint, as well as
> to provide a set of admin commands to work on Geronimo
> (start/stop/deploy/status/...) using either interactive or
> non-interactive console modes.
>

This is cool, but make sure that twiddle uses the same management interface
as other tools. I'd hate to be in a position where some things could only be
done using twiddle because it had a 'special' interface.

> The long-term vision is to turn Twiddle into a Geronimo component, so
> that one could telnet/ssh into the server to run commands on the live
> instance, especially to run a script interpreter command (using BSF or
> something) so that one could evaluate a Jython or BeanShell script on
> the live server.
>

I'm not convinced this is necessary. Twiddle can be a client-side shell
environment communicating with the server using the same protocols as other
admin tools - this seems to work for products such as PostgreSQL, Postfix,
Cyrus-IMAP, Oracle, ...

--
Jeremy


Re: [twiddle] Twiddle is now booting Geronimo

Posted by Jason Dillon <ja...@coredevelopers.net>.
> Normally I try to be positive, but I am having a very hard time with 
> this
> change.

Sorry to give you a hard time.  Some explanations and comments below.


> You have now made the core dependent on twiddle, which in turn is 
> dependent
> on a load of other things like commons-cli, forehead, classworlds, 
> castor,
> dunno what else. Do we really need to add all this?

Core is dependent on Twiddle because the Geronimo StartCommand is 
specific to the core.  Other commands, like a deploy command, shutdown 
command, etc. would also be specific to the core and will live in the 
core module.

I understand there might be some concern over the initial footprint for 
Twiddle, which I will get around to slimming down, netbooting or 
whatever, but I did not believe that it was critical to implement 
initially.  As for having the core module depend on the twiddle model I 
do not see that is a big deal at all.

Specifically why do you not like that core is dependent on twiddle?


> What about all the other ways to start the server e.g. raw embedding, a
> WinNT service, ??? Even a basic Windows bat script would be useful.

Raw embedding still works by creating a new instance of 
org.apache.geronimo.Main, only the command line bits have moved to 
StartCommand, but StartCommand will in turn hand over the rest of the 
details to Main.  Or if you like you can create a Twiddle instance and 
then call twiddle.execute("geronimo/start") if you like.

As for WinNT services, I have not given it too much thought but I do 
not believe that the introduction of Twiddle as the bootstrap will make 
it any more or less difficult to load Geronimo as a service.

I will get a batch file up soon.  I did not see that as super critical 
initially either since `maven run` will start Geronimo up for testing.


> What about IDE support as well - I used to be able to just run the 
> server
> directly by invoking Main, but I don't seem to have that option any 
> more.
> What do I need to do to get this back again?

My mistake here, I was not under the impression that anyone was doing 
this, so the removal of Main.main(String[]) hosed this.  I was 
following the contract in README.txt to make sure everything still 
worked and did not think that people were loading Main directly from 
and IDE.

My concern would be that eventually when there is more complicated 
class loading going on to setup the bootstrap environment that invoking 
Main like this would cause problems.  This is one reason why I started 
to create a release structure under target/geronimo-* so that the 
server would run under and environment similar to what a user would see 
after they extract an archive.  I believe that this is a good thing and 
we should try to keep it that way, but I understand that for 
development it would be ideal to have an IDE start the instance for 
debugging and such.

Which IDE are you using?  Should not matter too, too much.  To get a 
realistic-what-the-user-would-see instance you have a few options:

1) Boot like twiddle does, via ForeHead:

main-class: com.werken.forehead.Forehead
arguments: -Dforehead.conf.file= target/geronimo-DEV/etc/forehead.conf 
geronimo/start

2) Boot twiddle directly:

main-class: org.apache.geronimo.twiddle.cli.Main
arguments: geronimo/start

You just need to include the right class-path, which was why I wanted 
to know which IDE you were using.


> And where was the advance notice? I couldn't see any discussion on the 
> list
> and this wasn't exactly a zero-impact change.

I had typed up email days ago, but now that I check it is still in my 
drafts folder... :-(  Not terribly helpful I know.


> All in all I think this was a bad move and would ask you to back some 
> of the
> more intrusive bits out - at least remove core's dependency on twiddle.

Specifically what do you think must be changed?

  * * *

Here is a little background on Twiddle (the concept and the future)...

Twiddle aims to be a simple command shell, sporting and interactive 
console, to make it simple to write command-line tools.  Command line 
tools should have a consistent interface and be easily organized 
(instead of littering up bin/* with scripts).

The short-term vision is to provide a simple container for commands 
(which is mostly done).

The medium-term vision is to use Twiddle as the bootstrap for Geronimo, 
letting Twiddle handle the details of the initial footprint, as well as 
to provide a set of admin commands to work on Geronimo 
(start/stop/deploy/status/...) using either interactive or 
non-interactive console modes.

The long-term vision is to turn Twiddle into a Geronimo component, so 
that one could telnet/ssh into the server to run commands on the live 
instance, especially to run a script interpreter command (using BSF or 
something) so that one could evaluate a Jython or BeanShell script on 
the live server.

* * *

I believe that it makes sense to let Twiddle handle all of the 
command-line fluff, be it initial bootstrap or command-line tools like 
deploy or shutdown.

The only downside I can think of is that the size of initial footprint, 
but I believe this problem can be addressed.  I do not believe that 
using Twiddle limits the ability to embed Geronimo, run Geronimo as a 
WinNT service or integrate it into a IDE for development in any way.

Anyways, I apologize about the lack of advance notice and any 
frustration you ran into due to the removal of Main.main().  Let me 
know if there is anything I can do to make things less frustrating for 
you.

--jason


RE: [twiddle] Twiddle is now booting Geronimo

Posted by Jeremy Boynes <je...@coredevelopers.net>.
Normally I try to be positive, but I am having a very hard time with this
change.

You have now made the core dependent on twiddle, which in turn is dependent
on a load of other things like commons-cli, forehead, classworlds, castor,
dunno what else. Do we really need to add all this?

What about all the other ways to start the server e.g. raw embedding, a
WinNT service, ??? Even a basic Windows bat script would be useful.

What about IDE support as well - I used to be able to just run the server
directly by invoking Main, but I don't seem to have that option any more.
What do I need to do to get this back again?

And where was the advance notice? I couldn't see any discussion on the list
and this wasn't exactly a zero-impact change.

All in all I think this was a bad move and would ask you to back some of the
more intrusive bits out - at least remove core's dependency on twiddle.

--
Jeremy

> -----Original Message-----
> From: Jason Dillon [mailto:jason@coredevelopers.net]
> Sent: Sunday, August 24, 2003 10:56 AM
> To: geronimo-dev@incubator.apache.org
> Subject: [twiddle] Twiddle is now booting Geronimo
>
>
> I finished my initial checkin to allow a Twiddle command to start
> Geronimo.
>
> To start Geronimo, after building you can:
>
> cd target
> ./geronimo-DEV/bin/start
>
> or
>
> cd target
> ./geronimo-DEV/bin/twiddle geronimo/start
>
> Right now you need to be in the target directory.  I will resolve this
> soon, but for now dat is how it be ;-)
>
> Help (via ./geronimo-DEV/bin/start --help) looks like:
>
> usage: geronimo/start [options]
>
> Options:
>    -d,--deploy <arg>    Deploy URL
>    -h,--help            Display this help message
>    -m,--mlet <arg>      MLet URL
>
> So you can change the config urls.  It does spit out a lot of debug
> too, which I will get around to fixing, though some of that is
> dependent on getting the Commons Logging package to properly handle
> trace for Log4j (patch pending... right James?).
>
> Unfortunately Commons CLI does not order options, so the options are a
> bit scrambled... need to see about fixing this.
>
> Removed the CLI bits from Main, as StartCommand handles these details
> now.  The top-level run goal should still work as I changed it to
> behave like the twiddle script.
>
> Twiddle boots with Werken Forehead to make the initial setup of
> classpath nice and simple for me.  You can control Forehead via
> etc/forehead.conf
>
>   * * *
>
> I still need to create windows scripts (ick).
>
> Also we need to start thinking a little about the release structure.  I
> am currently thinking of a structure similar to... well you know...
> something like this:
>
> geronimo-<release>/
>      README.txt
>      LICENSE.txt
>      VERSION.txt
>      docs/
>          <html docs>
>      bin/
>          <scripts>
>      lib/
>          <boot-libraries>
>      etc/
>          forehead.conf
>          twiddle.conf
>          twiddle/
>              geronimo.conf
>              <twiddle-command-configs>
>      config/
>          global/
>              lib/
>                  <libs global to all configs>
>              resources/
>                  <resources files global to all configs>
>              deploy/
>                  <deployments global to all configs>
>          <config-name>/
>              lib/
>                  <libraries>
>              resources/
>                  < resources files>
>              deploy/
>                  <deployment files>
>              tmp/
>                  <temporary files>
>              data/
>                  <non-transient data/state files>
>              log/
>                  <log files>
>
> I am wondering if anyone else has any ideas.
>
> --jason
>
>