Re: commons-daemon with JVM included in Fedora?

2006-05-27 Thread Bernard
Jean-Frederic

Your suggested solution works without problems so far.

In location.c, I added

"/usr/lib/libgcj.so.6",  /* gij (GNU libgcj) (Red Hat
4.0.0-8) */

It appears that Red Hat Fedora 4 does not set JAVA_HOME, and the
location of libgcj.so.6 is not in the same directory as the other java
executables so I could not use that.

Who creates a new version if any and when?


Would you be able to explain to me the syntax of the first line in the
file jakarta-commons-daemon.spec?

%define native  %{?_with_native:1}%{!?_with_native:0}

Where can I learn about this syntax?

Where is the syntax of the "define" keyword documented?

What does  "{?" mean?

Is this bash? I looked up "man bash" but there is nothing like "{?"

What does  "{!?" mean?

What does the whole command 
"%{?_with_native:1}%{!?_with_native:0}"
mean?

Many thanks

Bernard


On Wed, 24 May 2006 22:59:02 +0200, you wrote:

>Bernard wrote:
>
>>Hi Bill,
>>
>>How can I compile jsvc?
>>  
>>
>Read the README's.
>something like:
>sh support/buildconf.sh
>./configure --with-java=$JAVA_HOME
>make
>
>But I don't remember getting working with gij, I don't remember what was 
>the problem. But I will have a look to it.
>
>Cheers
>
>Jean-Frederic
>
>+++ CUT +++
>
>-
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]


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



Re: commons-daemon with JVM included in Fedora?

2006-05-24 Thread Bernard
Hi Bill,

How can I compile jsvc?

I have not done C development in my life.

I installed the source package
jakarta-commons-daemon-1.0.1-1jpp.src.rpm.
I modified the C source file as suggested.
Then I did "rpmbuild ba jakarta-commons-daemon.spec"
it did not appear to compile the C source. Why?

Would you have any ideas?


Regards

Bernard


On Mon, 22 May 2006 20:22:24 -0700, you wrote:

>The jsvc program requires to load the JVM .so file in order to launch the 
>JVM.  With Sun's JVM, the file is called 'libjvm.so'.  What I need to know 
>is what is the equivalent .so file called with GNU Java.  Of course, I 
>*could* download and install it and look around, but since you've already 
>got it installed, you could find this out faster than I could.
>
>After you have found it, you just need to add it to the location_jvm_default 
>table in location.c, and recompile jsvc.  However, it would be nice if you 
>post your findings back to the list so that it can be included in the 
>official version :).
>
>"Bernard" <[EMAIL PROTECTED]> wrote in message 
>news:[EMAIL PROTECTED]
>Hi Bill
>
>Thanks for your reply.
>
>I think the JVM that comes with fedora 4 is a bit different.
># eche $JAVA_HOME returns nothing
>
>From the jsvc output below I understand that jsvc has a problem
>finding the JVM.
>However it appears to be ok otherwise because I can run tomcat without
>problems.
>
>I used yum to get my jsvc packages:
>
># rpm -qa | grep jakarta-commons-daemon
>jakarta-commons-daemon-1.0.1-1jpp
>jakarta-commons-daemon-jsvc-1.0.1-1jpp
>
>These have worked for me on RedHat 9 with Sun's JVM.
>
>On Fedora 4:
>
># java -version
>java version "1.4.2"
>gij (GNU libgcj) version 4.0.0 20050519 (Red Hat 4.0.0-8)
>
>I would be grateful for any ideas.
>
>Thanks
>
>Bernard
>
>
>
>
>>I'm way too bored to actually research this myself, but if you could post
>>the results of:
>>  $ ls -lR $JAVA_HOME
>>I can probably tell you what you need to patch to get this working for GNU
>>Java.  You could also try building from SVN co, since there have been some
>>JVM compatibility fixes there, but off of the top of my head, I don't
>>remember one for GNU Java.
>
>
>Starting tomcat: Error: jsvc execution failed
>22/05/2006 22:42:42 5229 jsvc debug: +-- DUMPING PARSED COMMAND LINE
>ARGUMENTS --
>22/05/2006 22:42:42 5229 jsvc debug: | Detach:  True
>22/05/2006 22:42:42 5229 jsvc debug: | Show Version:No
>22/05/2006 22:42:42 5229 jsvc debug: | Show Help:   No
>22/05/2006 22:42:42 5229 jsvc debug: | Check Only:  Disabled
>22/05/2006 22:42:42 5229 jsvc debug: | Stop:False
>22/05/2006 22:42:42 5229 jsvc debug: | Wait:5000
>22/05/2006 22:42:42 5229 jsvc debug: | Run as service:  No
>22/05/2006 22:42:42 5229 jsvc debug: | Install service: No
>22/05/2006 22:42:42 5229 jsvc debug: | Remove service:  No
>22/05/2006 22:42:42 5229 jsvc debug: | JVM Name:"null"
>22/05/2006 22:42:42 5229 jsvc debug: | Java Home:
>"/usr/lib/jvm/java"
>22/05/2006 22:42:42 5229 jsvc debug: | PID File:
>"/var/run/jsvc.pid"
>22/05/2006 22:42:42 5229 jsvc debug: | User Name:   "myuser"
>22/05/2006 22:42:42 5229 jsvc debug: | Extra Options:   3
>22/05/2006 22:42:43 5229 jsvc debug: |
>"-Dcatalina.home=/usr/share/tomcat5"
>22/05/2006 22:42:43 5229 jsvc debug: |
>"-Djava.io.tmpdir=/usr/share/tomcat5/temp"
>22/05/2006 22:42:43 5229 jsvc debug: |
>"-Djava.class.path=/usr/lib/jvm/java/lib/tools.jar:/usr/share/java/commons-daemon.jar:/usr/share/tomcat5/bin/bootstrap.jar:/usr/share/tomcat5/bin/commons-logging-api.jar:/usr/share/java/mx4j/mx4j-impl.jar:/usr/share/java/mx4j/mx4j-jmx.jar"
>22/05/2006 22:42:43 5229 jsvc debug: | Class Invoked:
>"org.apache.catalina.startup.Bootstrap"
>22/05/2006 22:42:43 5229 jsvc debug: | Class Arguments: 0
>22/05/2006 22:42:43 5229 jsvc debug:
>+---
>22/05/2006 22:42:43 5230 jsvc debug: user changed to 'myuser'
>22/05/2006 22:42:43 5229 jsvc debug: User 'myuser' validated
>22/05/2006 22:42:43 5229 jsvc debug: Attempting to locate Java Home in
>/usr/lib/jvm/java
>22/05/2006 22:42:43 5229 jsvc debug: Attempting to locate VM
>configuration file /usr/lib/jvm/java/jre/lib/jvm.cfg
>22/05/2006 22:42:43 5229 jsvc debug: Attempting to locate VM
>configuration file /usr/lib/jvm/java/lib/jvm.cfg
>22/05/2006 22:42:43 5229 jsvc debug: Attempting to locate VM
>configuration file /usr/lib/jvm/java/jre/lib/i386/jvm.cfg
>22/05/2006 22:42:43 5229 jsvc debug: Attempting to locate VM
&

Re: commons-daemon with JVM included in Fedora?

2006-05-22 Thread Bernard
Hi Bill

Thanks for your reply.

I think the JVM that comes with fedora 4 is a bit different.
# eche $JAVA_HOME returns nothing

From the jsvc output below I understand that jsvc has a problem
finding the JVM.
However it appears to be ok otherwise because I can run tomcat without
problems.

I used yum to get my jsvc packages:

# rpm -qa | grep jakarta-commons-daemon
jakarta-commons-daemon-1.0.1-1jpp
jakarta-commons-daemon-jsvc-1.0.1-1jpp

These have worked for me on RedHat 9 with Sun's JVM.

On Fedora 4:

# java -version
java version "1.4.2"
gij (GNU libgcj) version 4.0.0 20050519 (Red Hat 4.0.0-8)

I would be grateful for any ideas.

Thanks

Bernard




>I'm way too bored to actually research this myself, but if you could post 
>the results of:
>  $ ls -lR $JAVA_HOME
>I can probably tell you what you need to patch to get this working for GNU 
>Java.  You could also try building from SVN co, since there have been some 
>JVM compatibility fixes there, but off of the top of my head, I don't 
>remember one for GNU Java.


Starting tomcat: Error: jsvc execution failed
22/05/2006 22:42:42 5229 jsvc debug: +-- DUMPING PARSED COMMAND LINE
ARGUMENTS --
22/05/2006 22:42:42 5229 jsvc debug: | Detach:  True
22/05/2006 22:42:42 5229 jsvc debug: | Show Version:No
22/05/2006 22:42:42 5229 jsvc debug: | Show Help:   No
22/05/2006 22:42:42 5229 jsvc debug: | Check Only:  Disabled
22/05/2006 22:42:42 5229 jsvc debug: | Stop:False
22/05/2006 22:42:42 5229 jsvc debug: | Wait:5000
22/05/2006 22:42:42 5229 jsvc debug: | Run as service:  No
22/05/2006 22:42:42 5229 jsvc debug: | Install service: No
22/05/2006 22:42:42 5229 jsvc debug: | Remove service:  No
22/05/2006 22:42:42 5229 jsvc debug: | JVM Name:"null"
22/05/2006 22:42:42 5229 jsvc debug: | Java Home:
"/usr/lib/jvm/java"
22/05/2006 22:42:42 5229 jsvc debug: | PID File:
"/var/run/jsvc.pid"
22/05/2006 22:42:42 5229 jsvc debug: | User Name:   "myuser"
22/05/2006 22:42:42 5229 jsvc debug: | Extra Options:   3
22/05/2006 22:42:43 5229 jsvc debug: |
"-Dcatalina.home=/usr/share/tomcat5"
22/05/2006 22:42:43 5229 jsvc debug: |
"-Djava.io.tmpdir=/usr/share/tomcat5/temp"
22/05/2006 22:42:43 5229 jsvc debug: |
"-Djava.class.path=/usr/lib/jvm/java/lib/tools.jar:/usr/share/java/commons-daemon.jar:/usr/share/tomcat5/bin/bootstrap.jar:/usr/share/tomcat5/bin/commons-logging-api.jar:/usr/share/java/mx4j/mx4j-impl.jar:/usr/share/java/mx4j/mx4j-jmx.jar"
22/05/2006 22:42:43 5229 jsvc debug: | Class Invoked:
"org.apache.catalina.startup.Bootstrap"
22/05/2006 22:42:43 5229 jsvc debug: | Class Arguments: 0
22/05/2006 22:42:43 5229 jsvc debug:
+---
22/05/2006 22:42:43 5230 jsvc debug: user changed to 'myuser'
22/05/2006 22:42:43 5229 jsvc debug: User 'myuser' validated
22/05/2006 22:42:43 5229 jsvc debug: Attempting to locate Java Home in
/usr/lib/jvm/java
22/05/2006 22:42:43 5229 jsvc debug: Attempting to locate VM
configuration file /usr/lib/jvm/java/jre/lib/jvm.cfg
22/05/2006 22:42:43 5229 jsvc debug: Attempting to locate VM
configuration file /usr/lib/jvm/java/lib/jvm.cfg
22/05/2006 22:42:43 5229 jsvc debug: Attempting to locate VM
configuration file /usr/lib/jvm/java/jre/lib/i386/jvm.cfg
22/05/2006 22:42:43 5229 jsvc debug: Attempting to locate VM
configuration file /usr/lib/jvm/java/lib/i386/jvm.cfg
22/05/2006 22:42:43 5229 jsvc debug: VM configuration file not found
22/05/2006 22:42:43 5229 jsvc debug: Attempting to locate VM library
/usr/lib/jvm/java/jre/lib/i386/classic/libjvm.so
22/05/2006 22:42:43 5229 jsvc debug: Attempting to locate VM library
/usr/lib/jvm/java/jre/lib/i386/client/libjvm.so
22/05/2006 22:42:43 5229 jsvc debug: Attempting to locate VM library
/usr/lib/jvm/java/jre/lib/i386/libjvm.so
22/05/2006 22:42:43 5229 jsvc debug: Attempting to locate VM library
/usr/lib/jvm/java/lib/i386/classic/libjvm.so
22/05/2006 22:42:43 5229 jsvc debug: Attempting to locate VM library
/usr/lib/jvm/java/lib/i386/client/libjvm.so
22/05/2006 22:42:43 5229 jsvc debug: Attempting to locate VM library
/usr/lib/jvm/java/lib/i386/libjvm.so
22/05/2006 22:42:43 5229 jsvc debug: Attempting to locate VM library
/usr/lib/jvm/java/jre/bin/i386/classic/libjvm.so
22/05/2006 22:42:43 5229 jsvc debug: Attempting to locate VM library
/usr/lib/jvm/java/jre/bin/i386/libjvm.so
22/05/2006 22:42:43 5229 jsvc debug: Attempting to locate VM library
/usr/lib/jvm/java/bin/i386/classic/libjvm.so
22/05/2006 22:42:43 5229 jsvc debug: Attempting to locate VM library
/usr/lib/jvm/java/bin/i386/libjvm.so
22/05/2006 22:42:43 5229 jsvc debug: Attempting to locate VM library
/usr/lib/jvm/java/jre/lib/i386/classic/green_threads/libjvm.so
22/05/2006 22:42:43 5229 jsvc debug: Attempting to locate VM library
/usr/lib/jvm/java/jre/lib/classic/libjvm.so
22/05/2006 22

commons-daemon

2006-05-20 Thread Bernard
Hi

How can I enter an issue for commons-daemon at

http://issues.apache.org/bugzilla/enter_bug.cgi

I can't find the product/category anymore.

Many thanks

Bernard

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



commons-daemon with JVM included in Fedora?

2006-05-20 Thread Bernard
Hi,

jakarta-commons-daemon-jsvc-1.0.1-1jpp

when installed on Fedora 4 Linux, does not appear to like the
installed JVM:

gij (GNU libgcj) version 4.0.0 20050519 (Red Hat 4.0.0-8)


Can anyone suggest a way to get this working?

I would like to use the installed JVM instead of Sun's.

Many thanks

Bernard

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



Re: Tomcat 5 shutdown issue with jsvc commons daemon

2005-03-16 Thread Bernard
Thanks Wolfgang!
Sorry about my previous email - I found my mistake.

Regards,

Bernard

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



Re: Tomcat 5 shutdown issue with jsvc commons daemon

2005-03-16 Thread Bernard
Thanks Wolfgang!

Still problems.

I downloaded from
http://cvs.apache.org/builds/jakarta-commons/nightly/commons-daemon/
the latest file:
commons-daemon-20050316.zip

autoconf worked fine.
./configure worked fine.
make failed with many errors.

How to fix this? Is it worth it? When is the next version coming out?

The errors are below.
I cross-posted to the commons-dev list because I used a nightly build.

Many thanks,

Bernard


# ./configure
*** Current host ***
checking build system type... i586-pc-linux-gnu
checking host system type... i586-pc-linux-gnu
checking cached host system type... ok
*** C-Language compilation tools ***
checking for gcc... gcc
checking for C compiler default output... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ANSI C... none needed
checking for ranlib... ranlib
*** Java compilation tools ***
checking for javac... NONE
checking for javac... /usr/java/j2sdk1.4.2_07/bin/javac
checking wether the Java compiler (/usr/java/j2sdk1.4.2_07/bin/javac)
works... yes
checking for jar... NONE
checking for jar... /usr/java/j2sdk1.4.2_07/bin/jar
*** Host support ***
checking C flags dependant on host system type... ok
gcc flags added
*** Writing output files ***
configure: creating ./config.status
config.status: creating Makefile
config.status: creating Makedefs
config.status: creating native/Makefile
*** All done ***
Now you can issue "make"
[EMAIL PROTECTED] jsvc-src]# make
make -C native all
make[1]: Entering directory
`/tmp/jsvc/commons-daemon/bin/jsvc-src/native'
gcc -g -O2 -DCPU=\"i386\" -DOS_LINUX -DDSO_DLFCN
-I/usr/java/j2re1.4.2/include -I/usr/java/j2re1.4.2/include/linux
-Wall -Wstrict-prototypes -c jsvc-unix.c -o jsvc-unix.o
gcc -g -O2 -DCPU=\"i386\" -DOS_LINUX -DDSO_DLFCN
-I/usr/java/j2re1.4.2/include -I/usr/java/j2re1.4.2/include/linux
-Wall -Wstrict-prototypes -c arguments.c -o arguments.o
arguments.c: In function `arguments':
arguments.c:231: warning: unused variable `temp'
gcc -g -O2 -DCPU=\"i386\" -DOS_LINUX -DDSO_DLFCN
-I/usr/java/j2re1.4.2/include -I/usr/java/j2re1.4.2/include/linux
-Wall -Wstrict-prototypes -c debug.c -o debug.o
gcc -g -O2 -DCPU=\"i386\" -DOS_LINUX -DDSO_DLFCN
-I/usr/java/j2re1.4.2/include -I/usr/java/j2re1.4.2/include/linux
-Wall -Wstrict-prototypes -c dso-dlfcn.c -o dso-dlfcn.o
dso-dlfcn.c:51: warning: function declaration isn't a prototype
gcc -g -O2 -DCPU=\"i386\" -DOS_LINUX -DDSO_DLFCN
-I/usr/java/j2re1.4.2/include -I/usr/java/j2re1.4.2/include/linux
-Wall -Wstrict-prototypes -c dso-dyld.c -o dso-dyld.o
gcc -g -O2 -DCPU=\"i386\" -DOS_LINUX -DDSO_DLFCN
-I/usr/java/j2re1.4.2/include -I/usr/java/j2re1.4.2/include/linux
-Wall -Wstrict-prototypes -c help.c -o help.o
gcc -g -O2 -DCPU=\"i386\" -DOS_LINUX -DDSO_DLFCN
-I/usr/java/j2re1.4.2/include -I/usr/java/j2re1.4.2/include/linux
-Wall -Wstrict-prototypes -c home.c -o home.o
gcc -g -O2 -DCPU=\"i386\" -DOS_LINUX -DDSO_DLFCN
-I/usr/java/j2re1.4.2/include -I/usr/java/j2re1.4.2/include/linux
-Wall -Wstrict-prototypes -c java.c -o java.o
java.c:22:17: jni.h: No such file or directory
java.c:35: parse error before '*' token
java.c:35: warning: type defaults to `int' in declaration of `jvm'
java.c:35: warning: data definition has no type or storage class
java.c:36: parse error before '*' token
java.c:36: warning: type defaults to `int' in declaration of `env'
java.c:36: warning: data definition has no type or storage class
java.c:37: parse error before "cls"
java.c:37: warning: type defaults to `int' in declaration of `cls'
java.c:37: warning: initialization makes integer from pointer without
a cast
java.c:37: warning: data definition has no type or storage class
java.c:42: parse error before '*' token
java.c:42: warning: function declaration isn't a prototype
java.c: In function `shutdown':
java.c:43: `reload' undeclared (first use in this function)
java.c:43: (Each undeclared identifier is reported only once
java.c:43: for each function it appears in.)
java.c: At top level:
java.c:49: warning: function declaration isn't a prototype
java.c: In function `java_init':
java.c:91: warning: implicit declaration of function `jint'
java.c:91: `symb' undeclared (first use in this function)
java.c:91: `JavaVM' undeclared (first use in this function)
java.c:91: parse error before ',' token
java.c:92: `JNINativeMethod' undeclared (first use in this function)
java.c:93: `JavaVMOption' undeclared (first use in this function)
java.c:93: `opt' undeclared (first use in this function)
java.c:95: `JavaVMInitArgs' undeclared (fi

jsvc on Linux: multiple instances possible, why -pidfile?

2005-02-14 Thread Bernard
Hi,


I created multiple jsvc instances that did not die.
That happens with the adapted Tomcat5.sh supplied with the Tomcat 5.5
distribution.

That's a problem.

I would appreciate some help in understanding the logic of the pid
file.

This is my view of things; please correct me and help me if I am
wrong:

If, as it is presently the case, jsvc creates a pid file, then it must
not be possible for jsvc to launch a second copy of a service.

jsvc should however be able to briefly run only itself as multiple
instances - it must be allowed to do so in order to check the pid
file. It would not be reliable to pass this responsibility to the OS.

So any jsvc copy on top of the first should exit with an error
condition, and it should not attempt to start the jvm with the server.

If jsvc is NOT designed to block multiple service instances, then it
must not write the PID file. In that case it would be the
responsibility of the script to write the pid file and block multiple
service instances.

What to do?

Many thanks,

Bernard



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



RE: DBCP

2005-02-10 Thread Bernard D'Have
I think the first conn.close is unneeded, because the finally block is
always executed.

Bernard

-Original Message-
From: Craig McClanahan [mailto:[EMAIL PROTECTED] 
Sent: Thursday, February 10, 2005 7:24 PM
To: Jakarta Commons Developers List
Subject: Re: DBCP


Calling BasicDataSource.close() will only close the connections still in the
pool -- not the ones that have been checked out.  It is designed to be
called only when your app is ready to shut down.

For normal usage, the best approach is something like this:

DataSource ds = ... get your data source reference;
Connection conn = null;
try {
conn = ds.getConnection();
... use the connection as needed ...
conn.close(); // Returns this connection to the pool
} catch (SQLException e) {
... deal with any exception ...
} finally {
if (conn != null) {
try {
conn.close();
} catch (SQLException e) {
...
}
}
}

That way, you're always returning the connection to the pool, even if an
exception occurs while you're using it.

BTW, your MySQL admin will show active connections for all the entries in
the pool, as well as those that have been checked out and are in use.

Craig

On Thu, 10 Feb 2005 10:14:17 -0800, Paul Hsu <[EMAIL PROTECTED]> wrote:
> Hi,
> 
> I have one question about DBCP. I like to know if any one have used 
> BasicDataSource.close(). In my program I set up a BasicDataSource and 
> get connection from MYSQL, I call BasicDataSource.close() right after 
> get connection, I still see the connectioin from MYSQL admin. I just 
> wonder this function is working?
> 
> thanks,
> 
> Paul
>

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


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



RE: [OT] Test generation

2004-12-02 Thread Bernard D'Have
Have a look at http://www.beust.com/testng/

Bernard

-Original Message-
From: Corey Scott [mailto:[EMAIL PROTECTED] 
Sent: Friday, December 03, 2004 6:11 AM
To: Jakarta Commons Developers List
Subject: [OT] Test generation


A quick question for the collective brains trust.

I have been looking into test (and code) generation and have come to a
unexpected results.
1) JUnitDoclet appears to be the only (reasonable) opensource product around
2) commerical equiv are incredibly expensive
3) JUnitDoclet seems extremely like a decent tool, up to a point.  It seems
extremely limited and not terribly configurable (at least easily).  And
support for standard tests or standard layouts for common code structures
does not seem easy/available

This brings me to my questions:
1) Are the statements above correct?  It seems like I must have missed
something
2) Are their any OSS efforts around to produce an extended test generation
framework and maybe a repository of easily customizable tests?
3) If not, is anyone interesting in looking into the creation of such a
thing?

Regards,
Corey

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


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



[VFS] PropertiesValueSetter

2002-10-22 Thread David BERNARD
> > > +1.  Any thoughts on how the provider might get hold of the user's
> > > authentication info (usernames, passwords, certs, etc)?
> > Encoding this stuff
> > > in the url is ok as a convenience, but isn't a very good
> > general solution.
> > > I guess we need some kind of authentication provider that can
> > be handed to
> > > the ssh provider; Something that the ftp, smb, dav, whatever
> > providers can
> > > also make use of.
> >
> > I think about a call back Interface, call by provider to required
any
> > information (String). The user application provide implementation
for
> > this Interface (automatic answer, swing dialog box,...).
> > like :
> >
> > public interface Replier {
> >
> >   public void needProperties(Property[] properties) throws
Exception;
> > }
> >
> > public class Property {
> >   public String name;
> >   public String value;
> >   public String defaultValue;
> > }
> >
> > name and defaultValue are set by FSProvider before call
needProperties.
> > value are set by Replier implementation.
> >
> > Your opinion ?
> 
> That looks fine.  We'll need to come up with a naming scheme for
> common properties like the username for a particular
> protocol+hostname(+port), and
> a password for a particular username+protocol+hostname.

user.login, user.password,

> I guess another option could be to subclass Property with
> classes that provide this info to
> the Replier.

I think, my write was bad (like my english).

Replier is a bad name, I propose PropertiesValueSetter :

--
package org.apache.commons.vfs;

/**
 * Interface call by FileSystem(Provider) when it needs informations.
 * This interface is a gateway, used by VFS to request information to
 * user application.
 * So the user application provide implementation for this Interface
 * (automatic answer, swing dialog box,...).
 */
public interface PropertiesValueSetter {

/**
 * Method call by FileSystem(Provider) to request properties.
 * Property's value is set by this method.
 * Property's name and defaultValue were set by caller.
 *
 * @param fs FileSystem fo which properties are needs.
 * @param message optionnal message used by
 *fs to describe needs (for end-user).
 * @param prop Array of requested properties (inout)
 * @exception Exception if problem.
 */
public void setProperties(FileSystem fs,
  String message,
  Property[] prop) throws Exception ;
}

--
package org.apache.commons.vfs;

/**
 * Data structure used to store request part
 * (name, defaultValue) and the answser part (value)
 * of property.
 *
 * predefine names are :
 * 
 *   user.login : when login connexion is needed.
 *   user.password : when password connexion is needed.
 * 
 */
public class Property {
public String name;
public String value;
public String defaultValue;
}
--

-- 
*-*
| Contrary to popular belief, UNIX is user-friendly. It   |
| just happens to be selective on who it makes friendship |
| with.   |
|   - Richard Cook|
*-*


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




RE: [VFS][PATCH] use root of zip as directory

2002-10-20 Thread David BERNARD
Hi,

> I've applied this patch.  Thanks for sending it in.  Apologies for not
> applying it sooner; I've been a little busy.

Thanks,

> > - remove of depends from commons-IO
> > - remove of depends from excalibur-i18n (see my previous mail :
> >"[VFS] remove dependecies")
> > - add isWriteable() and isReadable() method on FileObject
> >(=>remove isReadOnly)
> 
> These sound like good changes.  Send 'em in.

Done in other mail.
 
> > Me too, provide a sshFileSystem via JSch (LGPL like Jcifs).

I need some study, I don't know lot of things on ssh, and JSch start
(and need JCE of JDK 1.4).
 
> +1.  Any thoughts on how the provider might get hold of the user's
> authentication info (usernames, passwords, certs, etc)?  Encoding this stuff
> in the url is ok as a convenience, but isn't a very good general solution.
> I guess we need some kind of authentication provider that can be handed to
> the ssh provider; Something that the ftp, smb, dav, whatever providers can
> also make use of.

I think about a call back Interface, call by provider to required any
information (String). The user application provide implementation for
this Interface (automatic answer, swing dialog box,...).
like :

public interface Replier {

  public void needProperties(Property[] properties) throws Exception;
}

public class Property {
  public String name;
  public String value;
  public String defaultValue;
}

name and defaultValue are set by FSProvider before call needProperties.
value are set by Replier implementation.

Your opinion ?

-- 
*-*
| Contrary to popular belief, UNIX is user-friendly. It   |
| just happens to be selective on who it makes friendship |
| with.   |
|   - Richard Cook|
*-*


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




[VFS][PATCH] remove some depends

2002-10-20 Thread David BERNARD
This pacth contains :

- remove of depends from commons-IO
- remove of depends from excalibur-i18n (see my previous mail :
  "[VFS] remove dependecies")
- add isWriteable() and isReadable() method on FileObject
   (=>remove isReadOnly)

!! I've also modified the name of the dist jar in build.xml.

Currently I'm not remove Resources.properties. I'll provide a possible
merged Resources.properties later. With it, user application of VFS
should internationalize FileSystemException.

-- 
*-*
| Contrary to popular belief, UNIX is user-friendly. It   |
| just happens to be selective on who it makes friendship |
| with.   |
|   - Richard Cook|
*-*

Index: build.xml
===
RCS file: /home/cvspublic/jakarta-commons-sandbox/vfs/build.xml,v
retrieving revision 1.2
diff -u -u -r1.2 build.xml
--- build.xml	21 Aug 2002 14:13:17 -	1.2
+++ build.xml	20 Oct 2002 09:56:44 -
@@ -1,22 +1,22 @@
 
 
 
-  
-   
+
+  
   
   
   
   
   
-  
-  
+  
+
   
 
 
   
 
   
-
+
   
 
 
@@ -32,28 +32,28 @@
   
 
 
-
- 
-
- 
+
+
+
+
 
-  
-  
-  
+
+
+
   
-  
-  
+
+
 
-  
-  
+
+
   
 
- 
-
+
+
 
 
   
-  
+
   
 
 
@@ -65,7 +65,7 @@
   
 
   
- 
+
   
 
 
@@ -81,12 +81,12 @@
   
   
 
-  
+
 
-  
-  
+
+
 
-  
+
 
   
 
@@ -106,33 +106,33 @@
   
 
 
-
-   
-
- 
+
+
+
+
 
   
-  
-  
+
+
   
 
-
+
   
 
   
- 
- 
+
+
 
- 
-
+
+
 
   
 
- 
+
 
- 
+
 
- 
+
 
   
 
@@ -141,41 +141,40 @@
 
   
 
- 
+
   
 
   
-  
+
 
-
+
 http://www.ibiblio.org/maven/ant/jars/ant-1.5.jar";>
 http://www.ibiblio.org/maven/junit/jars/junit-3.7.jar";>
 http://www.ibiblio.org/maven/commons-net/jars/commons-net-SNAPSHOT.jar";>
-http://www.ibiblio.org/maven/commons-io/jars/commons-io-SNAPSHOT.jar";>
+
 http://www.ibiblio.org/maven/commons-logging/jars/commons-logging-1.0.jar";>
-http://www.ibiblio.org/maven/excalibur-i18n/jars/excalibur-i18n-1.0.jar";>
+
 http://www.ibiblio.org/maven/jcifs/jars/jcifs-0.6.5.jar";>
-  
+
   
 
-  
-  
-  
-  
-  
-  
-  
-  
+
+
+
+
+
+
+
+
 
   
 
-
+
 
 
-
+
 
-
+
   
 
 
-
\ No newline at end of file
Index: src/java/org/apache/commons/vfs/FileObject.java
===
RCS file: /home/cvspublic/jakarta-commons-sandbox/vfs/src/java/org/apache/commons/vfs/FileObject.java,v
retrieving revision 1.4
diff -u -u -r1.4 FileObject.java
--- src/java/org/apache/commons/vfs/FileObject.java	22 Aug 2002 02:42:45 -	1.4
+++ src/java/org/apache/commons/vfs/FileObject.java	20 Oct 2002 09:56:44 -
@@ -85,6 +85,28 @@
 boolean exists() throws FileSystemException;
 
 /**
+ * Determines if this file can be read (only exists file could be read).
+ *
+ * @return
+ *  true if this file is readable, false if not.
+ *
+ * @throws FileSystemException
+ *  On error determining if this file exists.
+ */
+boolean isReadable() throws FileSystemException;
+
+/**
+ * Determines if this file can be write.
+ *
+ * @return
+ *  true if this file is writeable, false if not.
+ *
+ * @throws FileSystemException
+ *  On error determining if this file exists.
+ */
+boolean isWriteable() throws FileSystemException;
+
+/**
  * Returns this file's type.
  *
  * @return
Index: src/java/org/apache/commons/vfs/FileSystemException.java
===
RCS file: /home/cvspublic/jakarta-commons-sandbox/vfs/src/java/org/apache/commons/vfs/FileSystemException.java,v
retrieving revision 1.3
diff -u -u -r1.3 FileSystemException.java
--- src/java/org/apache/commons/vfs/FileSystemException.java	21 Aug 2002 07:00:10 -	1.3
+++ src/java/org/apache/commons/vfs/FileSystemException.java	20 Oct 2002 09:56:44 -
@@ -19,39 +19,74 @@
 /**
  * The Throwable that caused this exception to be thrown.
  */
-private final Throwable throwable;
+private final Throwable throwable_;
+
+/**
+ * array of complementary info (context).
+ */
+private String[] info_;
 
 /**
  * Constructs exception with the specified detail message.
  *
- * @param   message   the detail message.
+ * @param   code   the error code of the message.
  */
-public FileSystemException( final String message )
+public FileSystemException( final String code )
 {
-this

Re: [VFS][PATCH] use root of zip as directory

2002-10-18 Thread David BERNARD
Hi,

> Adam is probably busy.

Ok, I'll wait, but my current VFS differ more each week :
- creation of the root of a ZipFileSystem as a Folder
- getParent return the parent of ParentLayer for root of layeredFileSystem
- remove of depends from commons-IO
- remove of depends from excalibur-i18n (see my previous mail :
   "[VFS] remove dependecies")
- add isWriteable() and isReadable() method on FileObject
   (=>remove isReadOnly)

>, but I have a few ideas.

Me too, provide a sshFileSystem via JSch (LGPL like Jcifs).

> What about making Ruper into a filesystem provider???
> It could just be a special layered provider that suplies the meta info using
> getAttribute

Ruper is a tool that use VFS, but the package rsrc.info could be
converted as a LayeredFS, it's a interesting suggestion.
The default MetaInfo extractor use the name of the file and apply Regexp
Then usage of this add a dependance of jakarta-regexp or jakarta-oro to
used with any JVM 1.2+

> And the search for a specific version could be implemented with some FileSelectors.

Maybe, yes, goal seem to be similar.
 
> - Brian
> 
> ----- Original Message - 
> From: "David BERNARD" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Saturday, October 12, 2002 2:31 PM
> Subject: [VFS][PATCH] use root of zip as directory
> 
> 
> > Hi,
> > 
> > I 'm working on 2 projects using VFS (FSUI a GUI ala MidnightCommander
> > and Ruper http://krysalis.org/cgi-bin/krywiki.pl?Ruper).
> > 
> > The attached patch include :
> > - creation of the root of a ZipFileSystem as a Folder
> > - getParent return the parent of ParentLayer for root of
> > layeredFileSystem
> > 
> > Like this Root of LayeredFileSystem like Zip could be manage more like a
> > "regular" folder.
> > 
> > -- 
> > *-*
> > | Contrary to popular belief, UNIX is user-friendly. It   |
> > | just happens to be selective on who it makes friendship |
> > | with.   |
> > |   - Richard Cook|
> > *-*
> > 
> 
> 
> 
> 
> 
> > --
> > To unsubscribe, e-mail:   <mailto:commons-dev-unsubscribe@;jakarta.apache.org>
> > For additional commands, e-mail: <mailto:commons-dev-help@;jakarta.apache.org>
> 
> 
> --
> To unsubscribe, e-mail:   <mailto:commons-dev-unsubscribe@;jakarta.apache.org>
> For additional commands, e-mail: <mailto:commons-dev-help@;jakarta.apache.org>
> 
-- 
*-*
| Contrary to popular belief, UNIX is user-friendly. It   |
| just happens to be selective on who it makes friendship |
| with.   |
|   - Richard Cook|
*-*


--
To unsubscribe, e-mail:   <mailto:commons-dev-unsubscribe@;jakarta.apache.org>
For additional commands, e-mail: <mailto:commons-dev-help@;jakarta.apache.org>




[VFS] is dead ?

2002-10-16 Thread David BERNARD

I 've some patches to submit to VFS team.
I already sent patch and question, but without answer. If VFS is dead,
could I fork a project from VFS ?

-- 
*-*
| Contrary to popular belief, UNIX is user-friendly. It   |
| just happens to be selective on who it makes friendship |
| with.   |
|   - Richard Cook|
*-*


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




[VFS][PATCH] use root of zip as directory

2002-10-12 Thread David BERNARD

Hi,

I 'm working on 2 projects using VFS (FSUI a GUI ala MidnightCommander
and Ruper http://krysalis.org/cgi-bin/krywiki.pl?Ruper).

The attached patch include :
- creation of the root of a ZipFileSystem as a Folder
- getParent return the parent of ParentLayer for root of
layeredFileSystem

Like this Root of LayeredFileSystem like Zip could be manage more like a
"regular" folder.

-- 
*-*
| Contrary to popular belief, UNIX is user-friendly. It   |
| just happens to be selective on who it makes friendship |
| with.   |
|   - Richard Cook|
*-*


Index: src/java/org/apache/commons/vfs/provider/AbstractFileObject.java
===
RCS file: /home/cvspublic/jakarta-commons-sandbox/vfs/src/java/org/apache/commons/vfs/provider/AbstractFileObject.java,v
retrieving revision 1.7
diff -u -u -r1.7 AbstractFileObject.java
--- src/java/org/apache/commons/vfs/provider/AbstractFileObject.java	22 Aug 2002 02:42:45 -	1.7
+++ src/java/org/apache/commons/vfs/provider/AbstractFileObject.java	4 Oct 2002 16:08:27 -
@@ -167,7 +167,7 @@
 protected long doGetLastModifiedTime() throws FileSystemException
 {
 final String message = REZ.getString( "get-last-modified-not-supported.error" );
-throw new FileSystemException( message );
+throw new FileSystemException( message );
 }

 /**
@@ -179,7 +179,7 @@
 throws FileSystemException
 {
 final String message = REZ.getString( "set-last-modified-not-supported.error" );
-throw new FileSystemException( message );
+throw new FileSystemException( message );
 }

 /**
@@ -202,7 +202,7 @@
 throws FileSystemException
 {
 final String message = REZ.getString( "set-attribute-not-supported.error" );
-throw new FileSystemException( message );
+throw new FileSystemException( message );
 }

 /**
@@ -339,8 +339,15 @@
 {
 if ( this == fs.getRoot() )
 {
-// Root file has no parent
-return null;
+if (fs.getParentLayer() != null)
+{
+return fs.getParentLayer().getParent();
+}
+else
+{
+// Root file has no parent
+return null;
+}
 }

 // Locate the parent of this file
Index: src/java/org/apache/commons/vfs/provider/zip/ZipFileObject.java
===
RCS file: /home/cvspublic/jakarta-commons-sandbox/vfs/src/java/org/apache/commons/vfs/provider/zip/ZipFileObject.java,v
retrieving revision 1.3
diff -u -u -r1.3 ZipFileObject.java
--- src/java/org/apache/commons/vfs/provider/zip/ZipFileObject.java	22 Aug 2002 01:32:49 -	1.3
+++ src/java/org/apache/commons/vfs/provider/zip/ZipFileObject.java	4 Oct 2002 16:08:27 -
@@ -47,12 +47,12 @@

 protected void setZipEntry( ZipEntry entry )
 {
-if ( entry == null || this.entry != null )
+if ( this.entry != null )
 {
 return;
 }
-
-if ( entry.isDirectory() )
+
+if ((entry == null) || ( entry.isDirectory() ))
 type = FileType.FOLDER;
 else
 type = FileType.FILE;
Index: src/java/org/apache/commons/vfs/provider/zip/ZipFileSystem.java
===
RCS file: /home/cvspublic/jakarta-commons-sandbox/vfs/src/java/org/apache/commons/vfs/provider/zip/ZipFileSystem.java,v
retrieving revision 1.8
diff -u -u -r1.8 ZipFileSystem.java
--- src/java/org/apache/commons/vfs/provider/zip/ZipFileSystem.java	22 Aug 2002 02:42:46 -	1.8
+++ src/java/org/apache/commons/vfs/provider/zip/ZipFileSystem.java	4 Oct 2002 16:08:27 -
@@ -75,7 +75,7 @@
 fileObj.setZipEntry( entry );
 continue;
 }
-
+
 fileObj = createZipFileObject( name, entry, zipFile );
 putFile( fileObj );

@@ -90,7 +90,7 @@
 parent = (ZipFileObject) getFile( parentName );
 if ( parent == null )
 {
-parent = createZipFileObject( parentName, null, null );
+parent = createZipFileObject( parentName, null, zipFile );
 putFile( parent );
 }

@@ -100,7 +100,7 @@
 }
 }

-protected ZipFileObject createZipFileObject( FileName name,
+protected ZipFileObject createZipFileObject( FileName name,
  ZipEntry entry,
  ZipFile file )
 throws FileSystemException



--
To unsubscribe, e-mail:   
For additional commands, e-mail: 

[VFS] remove dependecies

2002-10-04 Thread David BERNARD

Hi,
May be a stupid suggestion but :

1. Dependence of commons-io could be remove by adding few line to
AbstractFileObject.

2. Dependence of excalibur-i18n could be remove by removing used of
Resource in exception. IMHO it was a bad practice,
 - the selected language is always the default locale (bad if exception
are raise on a server)
 - to provide other translation the user need to make a similar
directory structure, or to unjar, add, jar the lib.

So there isn't really internationalization. As replacement, I suggest to
:
 - add Exception.code as a key (like those in REZ)
 - add Exception.infos, an array of String that contains the arguments
 - set Exception.message = "Exception.code{Exception.infos[0],
Exception.infos[1], ...}"
 - provide a properties file that merged all Ressources.prop, but don't
use it in VFS only provide for user who want to humanize message.

By sample
final String message =
REZ.getString("set-attribute-not-supported.error");
throw new FileSystemException( message );

become
throw new FileSystemException("set-attribute-not-supported.error");

AND

final String message = REZ.getString( "list-children.error", name );
throw new FileSystemException( message, exc );

become
throw new FileSystemException( "list-children.error", name, exc);

And IMO, for FileType the use of Resources as constant is very
dangerous.

If you are OK, I could provide a patch for all those modifications.

-- 
*-*
| Contrary to popular belief, UNIX is user-friendly. It   |
| just happens to be selective on who it makes friendship |
| with.   |
|   - Richard Cook|
*-*


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




[beanutils] An indexed and mapped property?

2002-05-21 Thread Etienne Bernard

Hello,

I am trying to use struts 1.1 into my project and I need to access
properties that are both mapped and indexed. I tried to use

  

But it calls getProperty("name") and not getProperty("name", 0).

I had a look at the code and what I saw suggests that this syntax is not
supported. I'd like to know if you are planning to support such syntax
or if you are willing to accept patches (provided that I manage to code
the feature) ?

Regards,
-- 
Etienne Bernard <[EMAIL PROTECTED]>
Senior Software Engineer - FullSIX - http://www.fullsix.com/

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