RE: [VFS] [PATCH] UrlFileObject.exists (when HTTP)

2003-05-29 Thread Adam Jack
 You say this project is active, but I've not seen a VFS committer chime
in.

Apologies for that.  I've been a little busier than I'd like recently.

 Any ideas how we entice one of them to work with us to help commit
your/our
 work?

Just keep hassling us :)  I will get your changes applied this weekend.

Did this patch get applied? I've done updates from CVS, but don't see the
fix. Is it 'cos I overwrote it locally, or did it not occur?

regards

Adam


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



Re: [jxpath] Iterating using a/b//c//d[type='e']...

2003-05-29 Thread Dmitri Plotnikov
Christian,

It's very important that you use the current nightly build.  There is a
check for loops in the graph.  However, I don't think it is a 100%
guarantee against infinite loops.  If the upgrade to the current build
does not solve the problem, let me know - we'll have to investigate
further.

- Dmitri

--- Beer, Christian [EMAIL PROTECTED] wrote:
 Hello!
 
 While evaluating JXPath if it could be used in my project, I got the
 following problem:
 
 I have a very complicated object tree that can get very big. It
 consists of
 the following classes:
 
 MyObject  (super-class of the following)
 MyArray
 MyName
 MyDictionary
 MyBoolean
 MyString
 MyInteger
 MyReal
 MyNull
 MyReference
 
 Rules:
 - There is one root MyDictionary. 
 - all but MyArray and MyDictionary are leaf-nodes.
 - Keys to the dictionarys are allways MyName objects.
 - I created a MyDictionaryHandler that gives the keys as strings to
 jxpath.
 - MyReference contains references to objects. 
 - My MyDictionary and MyArray resolve this references and return the
 real
 objects in get and iterator.
 - Sometimes there are items in MyDictionary called parent, that
 contain a
 reference on the parent-My-Object.
 
 The tree would look quite complex, so I'll skip it.
 
 If I call, for example myContext.iterate(a/b//c//d[t='f']) on a
 quite
 big tree, my program hangs. 
 
 Does anyone have an idea? Is it a loop in my tree? Is there a known
 bug in
 JXPath?
 
 
 I know it is quite complicated but I hope you can help me!
 
 Thanks in advance,
 
 Christian Beer
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 


__
Do you Yahoo!?
Yahoo! Calendar - Free online calendar with sync to Outlook(TM).
http://calendar.yahoo.com

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



DBCP sample usage questions

2003-05-29 Thread Keith Veleba
Hello,

I'm currently in the process of retrofitting an application that  
contains some database connection pooling.  Unfortunately, scalability  
issues with the current custom pooling implementation have cropped up,  
forcing a rewrite of those pools.  In my search, I discovered the DBCP  
and decided to use it to implement more robust pools in our application.

However, I have a question that I'm hoping someone can answer.

1)  My application calls for a number of pools to be created to  
different databases.  I would like to know how best to use the objects  
provided. Currently, our pooling is implemented using the Singleton  
design pattern; I would like to create a version of that class which  
uses the DBCP for pooling, and not our homegrown pooling code.
In the manual pooling example shown, the pool consists of the following  
objects:

ObjectPool connectionPool = new GenericObjectPool(null);
ConnectionFactory connectionFactory = new  
DriverManagerConnectionFactory(connectURI,null);
PoolableConnectionFactory poolableConnectionFactory = new  
PoolableConnectionFactory(connectionFactory,connectionPool,null,null,fal 
se,true);
PoolingDriver driver = new PoolingDriver();
driver.registerPool(example,connectionPool);

I would assume from this example that for any number of pools,  I would  
need instances of the following:

1 ObjectPool, ConnectionFactory, and PoolableConnectionFactory for each  
database connection pool
1 PoolingDriver for all connection pools.

Is this essentially correct?

Thanks,
Keith Veleba
[EMAIL PROTECTED]

Re: Help with digester

2003-05-29 Thread C F
Thanks for the helpful info.  I had actually tried pretty much what you suggested 
but as your predicted, there were some issues with that.  Anyway, I agree with you 
that explicit declarations would help here, but I'm trying to conform to a schema that 
has elements that allow mixed content (mixed=true) the example I gave was bogus 
to simplify, not the real thing.
Anyway, I'll look into custom rules, and see who I can fire :)

Craig R. McClanahan [EMAIL PROTECTED] wrote:


On Tue, 27 May 2003, C F wrote:

 Date: Tue, 27 May 2003 13:31:16 -0700 (PDT)
 From: C F 
 Reply-To: Jakarta Commons Users List 
 To: [EMAIL PROTECTED]
 Subject: Help with digester

 Hello,
 Could somebody please give me an example of how I might try to accomlish the 
 following with Digester (I'm coding, not using the XML config)?


Assume the following APIs on your bean classes (among other public
methods):

package mypackage;
public class MyDepartment {
public void setName(String name);
// Call this add instead of set because departments
// normally have more than one employee ;-)
public void addEmployee(MyEmployee employee);
}

package mypackage;
public class MyEmployee {
public void setName(String name);
}

 Suppose, in my XML file, the following two nodes are valid

 example 1
 
 
 
 Buddy Hackett
 
 


digester.addObjectCreate(department, mypackage.MyDepartment);
digester.addSetProperties(department); // Works for all properties
// passed as attributes
digester.addObjectCreate(department/employee,
mypackage.MyEmployee);
digester.addCallMethod(department/employee,
setName, 0); // 0 == use body content
digester.addSetNext(department/employee,
addEmployee, mypackage.MyEmployee);

 example 2
 
 
 Buddy Hackett
 

I've never actually tried this, but in *theory* this should work the same
as the above logic:

digester.addObjectCreate(department, mypackage.MyDepartment);
digester.addSetProperties(department); // Works for all properties
// passed as attributes
digester.addObjectCreate(department,
mypackage.MyEmployee);
digester.addCallMethod(department,
setName, 0); // 0 == use body content
digester.addSetNext(department,
addEmployee, mypackage.MyEmployee);

However, you're probably going to have problems with the property
settings, which are going to both get fired off on the Employee object
instead of being interleaved the way that example 1 works.

From a more serious perspective I would not recommend an XML document
structure like your example 2 case anyway -- I much prefer that my XML
have explicit elements to correspond to the Java objects that I'm going to
be creating. The example 2 approach also disables the ability to define
a department that contains more than one employee, so it seems
artificially limiting.

If you're really stuck having to read example 2 style XML (and you can't
fire whoever is forcing it on you :-), it's still possible to do this with
Digester -- but you'll need to implement your own Rule class to do the
work. Peruse the Digester sources for the various rules and you'll get a
pretty good idea of what's necessary.

 In both cases I want an Employee object to be created with a property
 set to the node text, setName(Buddy Hackett), and then the Employee
 object assigned as a property to the parent Department object. I
 would appreciated it if someone could whip up some sample code, as I'm
 at a loss and Digester examples are few and far between (example 2 is
 where I'm having the trouble).

 Thanks!!


Craig

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


-
Do you Yahoo!?
Free online calendar with sync to Outlook(TM).

Re: Invalid Option Code: 91 (org.apache.commons.net.telnet.SimpleOptionHandler)

2003-05-29 Thread cthulhu
Well, i found a hack who solves it.
I changed
   public static int NEW_ENVIRONMENT_VARIABLES = 39;

to

   public static int NEW_ENVIRONMENT_VARIABLES = 100;

in the TelnetOption class and now it works :)
Shouldn't be there a better way to handle this?
Marco

cthulhu wrote:

Hi,
I'm absolutely new to telnet, I have readen the RFC and more or less 
understood it.
I'm playing around with a MUD client and want to answer the server 
that i can handle MXP.
From some docs I'have found the telnet negotiation should work in the 
following way:

(Sent from server to client)   IACWILLMXP
(Sent from client to server)   IACDOMXP
(Sent from server to client)   IACSBMXPIACSE   Following 
this sequence the server can then start sending MXP tags.

If I understood rightly how all this works I have to register a 
OptionHandler for the option MXP wich int value is 91

SimpleOptionHandler mxpopt = new SimpleOptionHandler(91, false, false, 
false, true); // not sure about the flags but that's not the 
point, or not?
...
client.addOptionHandler(mxpopt);
...

Now, when I run the program a InvalidTelnetOtionException is thrown 
telling me that 91 is an invalid option code...
What I'm doing wrong? Does that mean that the server doesent has any 
MXP otpion(but it should, I can see MXP working with another client)? 
Or I just got everything the wrong way?

Thanks in advance for any help.

Marco

-
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]


[discovery] jdk 1.2.2 and websphere

2003-05-29 Thread Robert McIntosh
I seem to be running into trouble with discovery on an AS400 running jdk
1.2.2 and webspere 3.5.6. We are trying to deploy an Axis based web
service which runs fine in WSAD (websphere 4.x) and Tomcat 4.1.x. It
seems that class implementations are not being found even though they
are in the classpath. We varified this by starting with the LogFactory
in axis which normally uses discovery, and hard coded the return value
and it worked. It then went on to another class loading issue. 

Any suggestions??

At the moment I'm trying to go through axis code and hard code class
instantiations, but that doesn't seem like a good solution.

Thanks,
Robert 

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



Digester - Write XML File

2003-05-29 Thread Matthew Pomar
I'm unable to access the archives from my work and appologize if this question is 
redundant...

I understand that the Digester can be used to read an XML file and map to a document, 
but can the Digester then save the changes to the object back to the XML file? If not, 
does anyone have any suggestions for a library to do this?

Any suggestions would be greatly appreciated.

Thanks,
Matthew Pomar

Re: Digester - Write XML File

2003-05-29 Thread Tim O'Brien
Matthew,

You might want to take a look at Commons Betwixt -
http://jakarta.apache.org/commons/betwixt/ 

Good luck.

Tim


On Wed, 2003-05-28 at 13:59, Matthew Pomar wrote:
 I'm unable to access the archives from my work and appologize if this question is 
 redundant...
 
 I understand that the Digester can be used to read an XML file and map to a 
 document, but can the Digester then save the changes to the object back to the XML 
 file? If not, does anyone have any suggestions for a library to do this?
 
 Any suggestions would be greatly appreciated.
 
 Thanks,
 Matthew Pomar




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



Re: [lang] ToStringBuilder.reflectionToString() problem

2003-05-29 Thread Stephen Colebourne
Adding a method to ToStringStyle like:
  boolean includeReflectionField(Field f)
would allow the style to control the output.

It ought to work, but I haven't checked it. Maybe the same approach could be
adapted to do the 'only output a field once' processing (avoiding infinite
recursion).

Stephen

- Original Message -
From: Gary Gregory [EMAIL PROTECTED]
To: 'Jakarta Commons Users List' [EMAIL PROTECTED]
Sent: Wednesday, May 28, 2003 12:11 AM
Subject: RE: ToStringBuilder.reflectionToString() problem


 Right, this is a good idea that I have considered in the past. The way we
 specify whether or not to output transients is a bit bogus IMHO, there is
 room in all of this for an object that would let you tweak all of this
 behavior. I'll think about this tonight and propose something if I can
come
 up with something not too nasty.

 Gary

 -Original Message-
 From: Tolley Shorn [mailto:[EMAIL PROTECTED]
 Sent: Tuesday, May 27, 2003 16:07
 To: Jakarta Commons Users List
 Subject: RE: ToStringBuilder.reflectionToString() problem


 It's workable, I did it last night in order to keep going.  It just means
I
 don't get (almost) free toString()s anymore.

 What about making the worker methods non-static and overridable instead?
 Then I could subclass ToStringBuilder to build in the knowledge.
 Or factoring out a worker class that can be plugged in similarly to
 ToStringStyle?
 Or some kind of extension of the mechanism that specifies whether or not
to
 use transients?

 Cheers,
 Shorn.

  -Original Message-
  From: Gary Gregory [mailto:[EMAIL PROTECTED]
  Sent: Wednesday, 28 May 2003 2:37 AM
  To: 'Jakarta Commons Users List'
  Subject: RE: ToStringBuilder.reflectionToString() problem
 
 
  Hello,
 
  The quick answer to your question (without adding features to
  ToStringBuilder) is to use the non-reflection APIs. For example:
 
 public String toString() {
   return new ToStringBuilder(this).
 append(name, name).
 append(age, age).
 append(smoker, smoker).
 toString();
 }
 
  If this is not acceptable, we can discuss how to make your
  feature request
  fit in the ToStringBuilder framework. I am not sure the
  proposed solution
  fits: (1) It breaks the model-view type of separation b/w the
  builder and
  the style class and (2) it requires the access to be set on a
  per field
  basis, which, the current impl is not factored to do.
 
  So, in a nutshell, is the above example workable for you (or not)?
  Obviously, using the reflection method is less code.
 
  Gary
 
  -Original Message-
  From: Tolley Shorn [mailto:[EMAIL PROTECTED]
  Sent: Tuesday, May 27, 2003 02:51
  To: [EMAIL PROTECTED]
  Subject: ToStringBuilder.reflectionToString() problem
 
  Hi folks,
 
  I've got a bit of a problem with the ToStringBuilder's
  reflectionToString
  method.
  I'd like to suggest a very small improvement (I think) to the
  ToStringBuilder interface.
 
  We're using Hibernate to provide the persistence of our domain model.
  I would like to use ToStringBuilder to provide accurate
  toString() methods
  for the classes in our domain model.
  Unfortunately, in some circumstances Hibernate uses an OS library call
  CgLib.
  CgLib is a pretty nifty little library that dynamically constructs JVM
  bytecode.
  Hibernate uses CgLib to provide transparent proxies.
 
  Unfortunately, becuase of the structure of our app (not
  really Hibernate or
  CgLib's fault), the reflectionToString() method will cause an
  exception
  because it will try to access the CgLib class outside of an
  appropriate
  scope (becuase we call toString() outside of the appropriate scope).
 
  Basically, I would like to be able to customize the ToStringBuilder to
  decide on a per-attribute basis whether or not to access a
  given field using
  reflection.
 
  What I'd like the reflectionToString method to do is to implement the
  template design pattern by delegating the actual access and
  formatting of
  the individual attribute to a method on the ToStringStyle.
 
  The basic ToStringStyle could just delegate this decision
  straight back to
  the ordinary ToStringBuiler, so for ordinary use the
  interface wouldn't
  change at all.
  With this functionality you could have all kinds of fun with
  doing special
  things for certain attribute names or types.
 
  What this change would allow me to do is something like this:
 
  class BaseEntity{
  public toString(){
  return ToStringBuilder.reflectionToString(this, new
  CgLibAwareToStringStyle());
  }
  }
 
  CgLibAwareToStringStyle extends StandardToStringStyle {
  public String appendField(ToStringBuilder builder, Field f){
  if(
  f.getType().isAssignableFrom(CgLibMarkerInterface.class)
  ){
  // do a special CgLib appropriate thing
  that won't
  make my app barf :)
  }
  else {
  builder.append(f);
  }
  }
  }
 
  Maybe I'm missing a better way of doing this with the current
  ToStringBuilder interface?
  At the moment it 

RE: [lang] ToStringBuilder.reflectionToString() problem

2003-05-29 Thread Gary Gregory
These types of solution would 'fit' in the current framework in the sense of
wedge-in I this feature but I do think that this causes the purpose of the
builder and style classes to become muddled. 

Perhaps the more OO manner of dealing with this issue would be to create a
ToStringBuilder subclass used for reflection purposes
(ReflectionToStringBuilder?). After all, we are talking about two completely
different ways of dealing with the problem statement Give me a toString().

It is in such a class that I would see processing oriented overrides
possible. The class could then be made more configurable than what we can do
today with the static methods on ToStringBuilder.

Gary

-Original Message-
From: Stephen Colebourne [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, May 28, 2003 14:16
To: Jakarta Commons Users List
Subject: Re: [lang] ToStringBuilder.reflectionToString() problem

Adding a method to ToStringStyle like:
  boolean includeReflectionField(Field f)
would allow the style to control the output.

It ought to work, but I haven't checked it. Maybe the same approach could be
adapted to do the 'only output a field once' processing (avoiding infinite
recursion).

Stephen

- Original Message -
From: Gary Gregory [EMAIL PROTECTED]
To: 'Jakarta Commons Users List' [EMAIL PROTECTED]
Sent: Wednesday, May 28, 2003 12:11 AM
Subject: RE: ToStringBuilder.reflectionToString() problem


 Right, this is a good idea that I have considered in the past. The way we
 specify whether or not to output transients is a bit bogus IMHO, there is
 room in all of this for an object that would let you tweak all of this
 behavior. I'll think about this tonight and propose something if I can
come
 up with something not too nasty.

 Gary

 -Original Message-
 From: Tolley Shorn [mailto:[EMAIL PROTECTED]
 Sent: Tuesday, May 27, 2003 16:07
 To: Jakarta Commons Users List
 Subject: RE: ToStringBuilder.reflectionToString() problem


 It's workable, I did it last night in order to keep going.  It just means
I
 don't get (almost) free toString()s anymore.

 What about making the worker methods non-static and overridable instead?
 Then I could subclass ToStringBuilder to build in the knowledge.
 Or factoring out a worker class that can be plugged in similarly to
 ToStringStyle?
 Or some kind of extension of the mechanism that specifies whether or not
to
 use transients?

 Cheers,
 Shorn.

  -Original Message-
  From: Gary Gregory [mailto:[EMAIL PROTECTED]
  Sent: Wednesday, 28 May 2003 2:37 AM
  To: 'Jakarta Commons Users List'
  Subject: RE: ToStringBuilder.reflectionToString() problem
 
 
  Hello,
 
  The quick answer to your question (without adding features to
  ToStringBuilder) is to use the non-reflection APIs. For example:
 
 public String toString() {
   return new ToStringBuilder(this).
 append(name, name).
 append(age, age).
 append(smoker, smoker).
 toString();
 }
 
  If this is not acceptable, we can discuss how to make your
  feature request
  fit in the ToStringBuilder framework. I am not sure the
  proposed solution
  fits: (1) It breaks the model-view type of separation b/w the
  builder and
  the style class and (2) it requires the access to be set on a
  per field
  basis, which, the current impl is not factored to do.
 
  So, in a nutshell, is the above example workable for you (or not)?
  Obviously, using the reflection method is less code.
 
  Gary
 
  -Original Message-
  From: Tolley Shorn [mailto:[EMAIL PROTECTED]
  Sent: Tuesday, May 27, 2003 02:51
  To: [EMAIL PROTECTED]
  Subject: ToStringBuilder.reflectionToString() problem
 
  Hi folks,
 
  I've got a bit of a problem with the ToStringBuilder's
  reflectionToString
  method.
  I'd like to suggest a very small improvement (I think) to the
  ToStringBuilder interface.
 
  We're using Hibernate to provide the persistence of our domain model.
  I would like to use ToStringBuilder to provide accurate
  toString() methods
  for the classes in our domain model.
  Unfortunately, in some circumstances Hibernate uses an OS library call
  CgLib.
  CgLib is a pretty nifty little library that dynamically constructs JVM
  bytecode.
  Hibernate uses CgLib to provide transparent proxies.
 
  Unfortunately, becuase of the structure of our app (not
  really Hibernate or
  CgLib's fault), the reflectionToString() method will cause an
  exception
  because it will try to access the CgLib class outside of an
  appropriate
  scope (becuase we call toString() outside of the appropriate scope).
 
  Basically, I would like to be able to customize the ToStringBuilder to
  decide on a per-attribute basis whether or not to access a
  given field using
  reflection.
 
  What I'd like the reflectionToString method to do is to implement the
  template design pattern by delegating the actual access and
  formatting of
  the individual attribute to a method on the ToStringStyle.
 
  The basic ToStringStyle could 

Re: [Digester] - Read only methods

2003-05-29 Thread Simon Kitching
On Thu, 2003-05-29 at 07:27, Sloan Seaman wrote:
 I have a public void setActionMappingClass(String) 
 that Digester does not call because the get is 
 public Class getActionMappingClass() instead of 
 a public String getActionMappingClass()
 
 Just seems odd that Digester would be so strict...

While this means that your class does not comply with the Java Beans
specification, I don't see why Digester would not invoke the method.

Does Digester display an error message, or just appear to ignore the
rule?

Can you post the code you use to set up the related rules, and a
fragment of the input xml?

Regards,

Simon


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