Re: [Betwixt] Performance Issue

2007-01-30 Thread robert burrell donkin
On Tue, 2007-01-30 at 16:48 +1030, David Lloyd wrote:
 Hi There,
 
 
 I have a set of nested classes which model a payment transaction. The 
 nesting is like this:
 
   Transaction
 
 - OrderInformation
   - CustomerCredentials
 - MerchantCredentials
 - PaymentInformation
 
 They're fairly standard classes and contain nothing more complex than 
 standard String and Integers (int and String).
 
 Running the class through Betwixt to make XML gives me:
 
 Transaction
   OrderInformation
etc etc
 
 ...as you'd expect. It's not a large file; there's no attributes apart 
 from the version = '1.0' on the ?xml ? prolog. The file's about 30 
 lines long.
 
 The setup I am running under is this:
 
   Sun Java Application Server running a Java EE web service
   Paste the output of the XML above into the ?Tester application
   Wait to see what result I get
 
 I've tested the results and if I deliberately do something silly, 
 Betwixt throws an appropriate error. It's not its error handling that 
 worries me.
 
 It takes SJAS, Betwixt or my Java about 15-30 seconds to process the 
 XML. Whilst I understand that Betwixt uses Java introspection and quite 
 possibly does a _lot_ of XML processing, processing a simple payment 
 transaction set of classes shouldn't, in my opinion, take so long.
 
 As to the hardware I'm running this on:
 
   Sun Solaris Community Express (ON 54)
   Sun Java 1.5.0_08
   Intel Pentium D945 / 2Gb of RAM
 
   - The Global Zone can use all memory and all CPU and has at least 1/2 a
 gig of memory free at all times during the tests
 
   - During processing, the two cores go to minimum of 70% usage
 
   - CPU fans start to spin but there does appear to be minor disk usage
 when the test is going
 - this appears as swap, which in Solaris means that /tmp is
   overflowing or memory use has a very sudden spike
 - it doesn't appear to be seriously excessive
 
   - vmstat, iostat don't show anything too bizarre whilst test runs
 
 I probably need to be more precise but does thirty seconds for Betwixt 
 to parse a set of nested classes each with an avg. of 4 fields each 
 sound a little excessive, given the hardware and OS I've described?

definitely

any chance of contributing some test code that you're happy to see made
public (obvious not the stuff you're working on but something similar
which exhibits the same issue)...?

(please post to a JIRA then follow up on list)

- robert



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



RE: Betwixt CyclicReferenceException: Bean graph contains a cyclic reference

2006-10-28 Thread robert burrell donkin
On Tue, 2006-10-24 at 14:11 -0400, Rao, Sailesh wrote:
 In further digging through the trace logs, I find a whole bunch of 
 ClassCastException prior to the CyclicReferenceException.
 Any idea what may be causing the ClassCastExceptions? 

could be a classloader issue since betwixt works by reflection

- robert



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



Re: [commons-logging-api] 1.1 POM not deployed at iblibio?

2006-07-13 Thread robert burrell donkin
On Sat, 2006-07-08 at 16:27 +0200, Carlos Sanchez wrote:
 There are a lot of hand made poms in the repo so i don't see that as a 
 problem.
 
 AFAIK the difference between api and implementation is the
 dependencies section, so it's just a matter of copying it and strip
 all unneded deps (all of them?).

+1

any volunteers...?

- robert



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



Re: [betwixt] Summary feature

2006-06-21 Thread robert burrell donkin
On Wed, 2006-06-14 at 10:36 +0200, Holger Haag wrote:
 Hi,

hi Holger

sorry for such a tardy reply (been very busy with ApacheCon EU stuff) 

 I am looking for a betwixt feature I call summary having found no better 
 term.
 
 Requirements are as follows:
 
 A air fare list is converted to the following XML:
 
 fareList 
   fare
 departure code=SXF/
 destination code=JFK/
 price amount=123.45 currency=EUR/
   /fare
   fare
 departure code=SXF/
 destination code=JFK/
 price amount=200.45 currency=EUR/
   /fare
   fare
 departure code=SXF/
 destination code=JFK/
 price amount=323.45 currency=EUR/
   /fare
 /fareList
 
 Now it happens that codes like JFK (JFK stands for New York John F. Kennedy 
 aiport) are not necessarily self-describing, 
 and there is a lot of information related to an airport, e.g. name, city, 
 country, web site, weather conditions etc.
 
 This information should also be included in the XML document, but in a 
 separate section - to keep the XML document smaller.
 
 So the XML should really look like:
 
 
 fareList 
   fare
 departure code=SXF/
 destination code=JFK/
 price amount=123.45 currency=EUR/
   /fare
   fare
 departure code=SXF/
 destination code=JFK/
 price amount=200.45 currency=EUR/
   /fare
   fare
 departure code=SXF/
 destination code=JFK/
 price amount=323.45 currency=EUR/
   /fare
   summary
 airports
   airport
 codeJFK/code
 nameJohn F. Kennedy International/name
 cityNew York/city
 stateNew York/state
 country isoCode=USUnited States of America/country
   /airport
 /airports
   /summary
 /fareList
 
 Such an XML structure can of course already be built via betwixt, but my 
 application has this kind of requirements 
 in a couple of XML documents and I don't want to browse the object tree for 
 each 
 and every bean to find out which airports are contained. 
 
 In fact an elegant way would be to have 
 
 (1) a bean collector which is called whenever a bean is converted to XML
 
 (2) a summary builder which uses the collected beans to build a summary
 
 is this (or something similar) already available in betwixt ? If not I'm 
 willing to put some work into and contribute the appropriate SVN patches.

sounds good :-)

similar problems have been solved by using ID-IDREF magic using a custom
IdStoringStrategy. 

(sorry for not being to find very much time ATM)

- robert


signature.asc
Description: This is a digitally signed message part


Re: Read XML with Betwixt

2006-06-07 Thread robert burrell donkin
On Wed, 2006-06-07 at 10:50 +0200, [EMAIL PROTECTED] wrote:
 Hello,

hello jean

 I am new to Betwixt and I have the following problem.
 I have the following MyBean class :
 public class MyBean
 {
 private String str;
 private String[] arrayOfElement;
  
 public String getStr()
 {
 return str;
 }
 
 public void setStr(String str)
 {
 this.str = str;
 }
 
 public String[] getArrayOfElement()
 {
 return arrayOfElement;
 }
 
 public void setArrayOfElement(String[] arrayOfElement)
 {
 this.arrayOfElement = arrayOfElement;
 }
 }
 
 You notice that there is not add method to add an element in 
 arrayOfElement attribute.
 It is because this bean is generated by another utility and I can not add 
 new methods.
 So this bean is not modifiable and only has these methods.
 
 Now I have the following XML file that I want to read using Betwixt :
 MyBean
 strtoto/str
 elementelt1/element
 elementelt2/element
 /MyBean
 
 So how can I manage the fact that there are many element tags but no add 
 method in MyBean class ?

quite possibly not easily, i suspect but it's worth giving it a go. if
you aren't using the latest code from trunk, please checkout the code
and build using maven (a lot of additional features have been added
since the last release) before you try the mapping.

i suspect that some additional support for the array in this use case
may be required. i'm unlikely to be able to look at this until early
next week.

if you can't wait that long, JiBX may perhaps be able to map it
http://jibx.sourceforge.net/tutorial/binding-tutorial.html. JiBX is a
mapper (like betwixt) but is generative and field based (rather than
dynamic and bean based). not sure how good the array support is for this
use case, though.

- robert



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



Re: [Betwixt] Supply .betwixt file in code?

2006-06-05 Thread robert burrell donkin
On Fri, 2006-06-02 at 16:19 -0400, Frank W. Zammetti wrote:
 Hi... first time even *looking* at Betwixt, so quick n00b question... is
 it possible to supply the equivalent of a *.betwixt mapping file, as a
 String, in my code?  I basically want to be able to embed the mappings
 directly into a class as a static String and not have an external mapping
 file.  

http://jakarta.apache.org/commons/betwixt/guide/binding.html#Multi_Mapping

(the documentation needs indexing and i have a stylesheet ready for the
job but not sure when i'll find the time ATM)

- robert



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



Re: betwixt:

2006-05-31 Thread robert burrell donkin
On Wed, 2006-05-31 at 09:47 +0200, Stefano Orselli wrote:
 I've a problem with betwixt 0.7
 I work on a Apache Tomcat/5.0.28
 java 1.4.2_01-b06
 i write this java code:
 String prefix = context.getRealPath(/);
 String xmlpath = prefix + xmlpdf/;
 (new File(xmlpath)).mkdirs();
 FileWriter fWriter = new FileWriter(xmlpath + 
 output_+System.currentTimeMillis()+.xml);
 BeanWriter bWriter = new BeanWriter(fWriter);
 bWriter.enablePrettyPrint();
 bWriter.setIndent(\t);
 bWriter.write(qualforn, ib);
 bWriter.flush();
 bWriter.close();
 when run this code for the first time i find a correct xml file,
 qualforn id=1
 istanza__compilatore_societa_sede__xx/
 istanza__data_creazione__xx2006-05-24/istanza__data_creazione__xx
 
 when from start the second time this i have an empty xml file with only the 
 first row:
 qualforn idref=1/
 If i restart the tomcat i can run the servlet and i have a correct result 
 only the first time that i run the code.

this looks to be a problem with involving id referencing. betwixt can
keep track of instances and use an id when they occur later in the
object graph. looks like the cache isn't getting cleared between
invocations.

if you don't want betwixt to keep track of id's (and have an object
graph without cyclic bean references) then the easiest way to fix this
is to switch off id's (getConfiguration().setMapIDs(false)).

the cause may be a bug in betwixt or your configuration. if you're
willing to contribute a unit test to the ASF (please file a report in
JIRA) i'll take a look.

- robert



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



Re: betwixt: No updater for ...

2006-05-30 Thread robert burrell donkin
hi ken

sorry i've been so long in picking this one up...

On Thu, 2006-05-25 at 15:29 -0600, Ken Miller wrote:
 I have an object that contains a Collection of some simple beans, as
 well as a couple of attributes.  The XML generated by Betwixt looks like
 this:
  
 FolderList nextFolderId=2 id=1
 folder folderId=0 folderName=One id=2/
 folder folderId=1 folderName=Two id=3/
 /FolderList

snip

 The Folder object is instantiated, and the attrributes for it are set
 to the correct value, but FolderList.addFolder() is never invoked to
 insert the Folder object back into it's parent.  The end result is that
 the FolderList object is returned with no Folders.  Not good.

yes - not good
 
 Am I missing a mapping rule somewhere?

the problem is likely to be the plural stemming: betwixt guesses the
adder from the getter name and matches them up in that fashion. the
default plural stemmer algorithm is may not match

public void addFolder(Folder folder);
public Collection getFolderList();

a good way to test this hypothesis is by unit testing the default plural
stemmer. if the problem is the plural stemmer then just create a new
strategy extending the default one that knows about your naming
conventions.

let me know if this doesn't fix the problem and i'll take a deeper look
into it.
 
 I'm using the current dev build of Betwixt (as of yesterday).

cool

BTW i usually spend quite a bit of time setting up scenarios such as
this to find out what's going wrong (yes: i know mapping is too hard and
obscure - i was working on a GUI application which would help to map
betwixt and JIBX last year but got a little sidetracked...). the more
time i need to spend to provide an answer, the longer it'll take me to
find time. so, anyone who contributes a unit test to the ASF through
JIRA demonstrating your particular use case will find a quicker
reply... 

- robert



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



Re: [jira] Created: (BETWIXT-52) Bug/Testcase: Reading does not work: Container holding a list (generics) of interface implementations

2006-05-25 Thread robert burrell donkin
hi holgar

thanks very much for the test cases

On Wed, 2006-05-24 at 08:15 +, Holger Haag (JIRA) wrote:
 Bug/Testcase: Reading does not work: Container holding a list (generics) of 
 interface implementations
 -
 
  Key: BETWIXT-52
  URL: http://issues.apache.org/jira/browse/BETWIXT-52
  Project: Commons Betwixt
 Type: Bug

i've been taking a look at this tonight. bit tricky so i probably will
not have a solution completed tonight. 

the first problem is that the xml to be mapped to. the formulation is:

[1]AlphaListHolder
   AlphaList
   one1/one
   /AlphaList
   AlphaList
   two2/two
   /AlphaList
/AlphaListHolder

this makes things very difficult. betwixt only supports polymorphic
mappings with different names. this means mapping as a mixed collection
which would be something like:

[2] AlphaListHolder
   AlphaOneImpl
   one1/one
   /AlphaOneImpl
   AlphaTwoImpl
   two2/two
   /AlphaTwoImpl
/AlphaListHolder

would this be acceptable?

the second problem is that betwixt doesn't support List based properties
very well ATM. really, a list backed property should act in the same way
as a getter-added bean. a few changes will likely be needed before this
works correctly.

a final issue is that it's hard to guess context without a wrapping
element. 

[3] AlphaListHolder
AlphaList
  AlphaOneImpl
 one1/one
  /AlphaOneImpl
  AlphaTwoImpl
  two2/two
   /AlphaTwoImpl
/AlphaList
/AlphaListHolder

seems a more natural mapping to me for your object structure. 

if not then there are other ways that polymorphism could be extended. 

- robert



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



Re: Re: Re: [betwixt] Betwixt mapping of generic lists with instances of an interface

2006-05-24 Thread robert burrell donkin
On Wed, 2006-05-24 at 10:18 +0200, [EMAIL PROTECTED] wrote:
 Hi Robert,
 
 you are right about test cases: that's what I keep telling my bug reports: to 
 provide good bug descriptions, the best thing being broken test cases ;-)
 
 So I've created a JIRA entry with such a broken test case:
 
 http://issues.apache.org/jira/secure/ManageAttachments.jspa?id=12343455

great :-)

could you please consider filling a
http://www.apache.org/licenses/#clas. IMHO it's not necessary yet but
it's always good to have one on file. 

- robert



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



Re: Re: [betwixt] Betwixt mapping of generic lists with instances of an interface

2006-05-23 Thread robert burrell donkin
On Tue, 2006-05-23 at 11:09 +0200, [EMAIL PROTECTED] wrote:
 Hi Robert,

hi Holger

some apache stuff's blow up so unfortunately i haven't found the time
i'd hoped for :-/ 

 thanks for the patch, TestPolyList works nicely, also if I adapt it 1:1 to
 my environment. However, I failed in setting up a container which holds such
 a list, e.g.:
 
 container
   mylist
 myimpl1/
 myimpl2/
   /mylist
 /container
 
 I tried 
 
 OverrideCollectiveTypeStategy strategy = new
 OverrideCollectiveTypeStategy();
 strategy.overrideNotCollective(MyList.class);
 
 but that wouldn't work either. 

yeh - probably not. i wasn't sure about your use case...

 Is there a chance that you can set up another Testcase like
 TestPolyListContainer ?? I find that working test cases are the best way to
 provide samples. 

+1

i work best from broken test cases. the easiest and quickest way to get
some more functionality is to contribute a test case demonstrating what
you'd like.

i probably won't have time tonight to take a look at this. i'd be able
to fix this quicker if i had a test case demonstrating your use case ;)

- robert



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



Re: [betwixt] Versioning of XML Output

2006-05-22 Thread robert burrell donkin
On Mon, 2006-05-22 at 14:31 +0200, Holger Haag wrote:
 Hi,
 
 I hope this goes to the correct mailing list; if not pls. let me know:

developers hang out on the dev list. now you've contributed a patch, you're  a 
developer and might like to start hanging out there too. if so, you might need 
to set up some filters.

 I've been working on this issue and attached a SVN patch (see below). 

great

 Here is a quick overview:
 
 - Two new strategies: Attribute and Element suppression. Chose interfaces
 instead of abstract class so that one class (see test cases) can implement
 both.
 - After an element/attribute descriptor has been build completely (including
 the options), the suppression strategies are evaluated. If the
 element/attribute shall be suppressed, it is removed from the introspection
 results. 
 - Important: use addDefaults add-properties=false / ! Otherwise the
 effects of element/attribute suppression will be ... none.
 - Test cases for illustration

sounds good

 I hope I've got everything properly according to the apache guidelines. Just
 let me know if somethings wrong.

nothing wrong (guideline wise) but i wonder whether the list has
stripped some of the content (that's one of the reason i prefer patches
to be in JIRA). 

 Eagerly waiting ;-)

+1

i can't see the test cases or the new classes. this might be because
they were stripped by the list (which is why it's better to submit
patches through JIRA and then follow up on list) or maybe because svn
ignored them when the patch was created. (in which case you might need
to do svn add for each one of your new classes.)

- robert



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



Re: Re: Re: [betwixt] Versioning of XML Output

2006-05-21 Thread robert burrell donkin
On Fri, 2006-05-19 at 08:37 +0200, Holger Haag wrote:
 Hi,
 
 maybe there is even a better way of doing it, more flexible and probably
 about the same amount of work.

sounds good so far :-)

 Here's what to do:

(just to check that i understand correctly, i'll add examples in line.
please jump in and correct any misunderstandings)

 * Store all attributes of an element in a .betwixt file in the corresponding
 ElementDescriptor

so (for example) given

element name='whatever' alpha='alpha-value' beta='beta-value'

it would be possible to find out that the value for attribute 'beta' is
'beta-value' by a call to the element descriptor

 * Store all attributes of an attribute in a .betwixt file in the
 corresponding AttributeDescriptor

attribute name='whatever' alpha='alpha-value' beta='beta-value'

it would be possible to find out that the value for attribute 'beta' is
'beta-value' by a call to the attribute descriptor

it's already possible to attach arbitrary data to descriptors. 

attribute name='whatever'
optionnamebeta/namevaluebeta-value/value/option
...
/attribute

this value be retrieved by
descriptor.getOptions().getValue(beta-value).

would be best to re-use this existing mechanism. this form of extension
doesn't violate the DTD (which is why it was added that way). 

it would be possible to process extra attributes and use them to
populate options (which would then be overridden by the option elements
to preserve compatibility). would this be worth the effort?

 * Add and support new interfaces ElementSuppressionStrategy and
 AttributeSuppressionStrategy

+1

 This way, the application using betwixt can define its own custom attributes
 and strategies for suppressing elements/attributes.

+1

 Such attributes/strategies could be for example
 * Versioning: Suppress attributes/elements for older clients
 * Versioning: Suppress obsolete attributes/elements 
 * Add debug information to XML documents if desired
 * Suppress elements/attributes for smaller XML documents (to save bandwidth)
 * ...

 What do you think ?

sounds good :-)

fancy contributing a patch to implement this? 

(read http://jakarta.apache.org/site/getinvolved.html and
http://www.apache.org/dev/#committers) 

otherwise i should be able to start to take a look at implementing on
monday

- robert



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



Re: [betwixt] Betwixt mapping of generic lists with instances of an interface

2006-05-18 Thread robert burrell donkin
i've committed a change in the default mapping for lists. please build
from the latest code. i've updated the website with some documentation
but it'll take a while to sync and you may be better looking at the unit
tests. see src/test/org/apache/commons/betwixt/poly/TestPolyList.java.

- robert

On Wed, 2006-05-17 at 22:21 +0100, robert burrell donkin wrote:
 On Thu, 2006-05-11 at 14:22 +0200, Holger Haag wrote:
  Hi all,
  
  I'm trying to figure out how (or if) it is possible to handle lists
  containing instances of an interface.
  
  Sample:
  
  // the interface
  public interface MyInterface {
..
  }
  
  // an implementation
  public class MyImpl1 implements MyInterface {
..
  }
  
  // an implementation
  public class MyImpl2 implements MyInterface {
..
  }
  
  // the list containing instances of MyInterface
  public class MyList extends java.util.ListMyInterface {
..
  }
  
  
  A serialized sample should look like the following
  
  list
!-- serialized instance of MyImpl1 --
impl1
/impl1

!-- serialized instance of MyImpl2 --
impl2
/impl2

!-- serialized instance of MyImpl1 --
impl1
/impl1
  /list
  
  
  I think this is currently not possible via betwixt (pls. correct me if I am
  wrong) 
  since all list items will be named myinterface or so thus loosing the
  proper type information.
 
 snip
 
  So the question boils down to how to setup polymorphic mapping for generic
  lists. 
  http://jakarta.apache.org/commons/betwixt/guide/reading.html only details
  how to do this for a container, but nothing about lists/collections.
 
 there are two parts to this problem: the first is configuring
 polymorphic mappings so that the reading works. the second is persuading
 betwixt to write the right names. it's easiest to attack them
 separately.
 
 the documentation should give a reasonable description about how to
 setup the multi mapping so that the reading works. 
 
 the second problem is covered in
 http://jakarta.apache.org/commons/betwixt/guide/derived.html. you may
 need to switch mapping derivation to introspection time. 
 
 the only wrinkle is that it might be difficult to configure a list
 (rather than a container). i'm not ATM whether this will be a problem or
 not. i'll try to find time tomorrow to try this out.
 
 - robert
 
 
 
 -
 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: [betwixt] Versioning of XML Output

2006-05-17 Thread robert burrell donkin
On Thu, 2006-05-11 at 14:21 +0200, Holger Haag wrote:
 Hi all,
 
 I'm using betwixt in an environment where I'm converting beans to xml in
 order to build SOAP/XML messages. For proper SOAP handling, a WSDL
 definition is necessary including XSDs.
 
 To support all soap clients in the field (e.g. which are using the Apache
 Axis framework) the generated XML has to be controlled carefully mainly when
 it comes to adding new elements (nodes, attributes) to an existing XML
 structure. Older SOAP Clients will probably complain when the generated
 XML has elements which were not permitted by the older XSD/WSDL definition.

sounds like an interesting problem :)

 I think this could be done by adding a String attribute since to the
 ElementDescriptor/AttributeDescriptor classes. 
 The value for since would be provided in the .betwixt file:
 
 attribute name='name' property='name' since='1.01'/
 
 Provided this is possible, a ValueSuppressionStrategy could be implemented
 suppressing the XML output for older versions/clients.

sounds like a cunning plan with a good chance of success

perhaps value suppression won't be sufficient: wouldn't you need to
suppress elements as well as values. i suppose that this could be done
by asking betwixt to prune empty elements, though.

 Or is something similar already possible in betwixt ?

definitely not out of the box :-)

i have more energy now that JCL 1.1 has finally been released. i'd
recommend trying out your solution but i'll try to find some time
tomorrow to play around myself...

- robert



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



Re: [betwixt] Betwixt mapping of generic lists with instances of an interface

2006-05-17 Thread robert burrell donkin
On Thu, 2006-05-11 at 14:22 +0200, Holger Haag wrote:
 Hi all,
 
 I'm trying to figure out how (or if) it is possible to handle lists
 containing instances of an interface.
 
 Sample:
 
 // the interface
 public interface MyInterface {
   ..
 }
 
 // an implementation
 public class MyImpl1 implements MyInterface {
   ..
 }
 
 // an implementation
 public class MyImpl2 implements MyInterface {
   ..
 }
 
 // the list containing instances of MyInterface
 public class MyList extends java.util.ListMyInterface {
   ..
 }
 
 
 A serialized sample should look like the following
 
 list
   !-- serialized instance of MyImpl1 --
   impl1
   /impl1
   
   !-- serialized instance of MyImpl2 --
   impl2
   /impl2
   
   !-- serialized instance of MyImpl1 --
   impl1
   /impl1
 /list
 
 
 I think this is currently not possible via betwixt (pls. correct me if I am
 wrong) 
 since all list items will be named myinterface or so thus loosing the
 proper type information.

snip

 So the question boils down to how to setup polymorphic mapping for generic
 lists. 
 http://jakarta.apache.org/commons/betwixt/guide/reading.html only details
 how to do this for a container, but nothing about lists/collections.

there are two parts to this problem: the first is configuring
polymorphic mappings so that the reading works. the second is persuading
betwixt to write the right names. it's easiest to attack them
separately.

the documentation should give a reasonable description about how to
setup the multi mapping so that the reading works. 

the second problem is covered in
http://jakarta.apache.org/commons/betwixt/guide/derived.html. you may
need to switch mapping derivation to introspection time. 

the only wrinkle is that it might be difficult to configure a list
(rather than a container). i'm not ATM whether this will be a problem or
not. i'll try to find time tomorrow to try this out.

- robert



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



[ANNOUNCEMENT] Apache Jakarta Commons Logging 1.1 Released

2006-05-14 Thread robert burrell donkin
The Jakarta Commons team are pleased to announced that Apache Jakarta
Commons
Logging (JCL) 1.1 has been released. JCL is a thin bridging API for
logging with adapters for many common logging systems. Read more about
JCL at http://jakarta.apache.org/commons/logging.
  
JCL 1.1 is a maintenance release. A few new configuration features are
provided but
the focus has been on improving the discovery of logging implementations
and in error
handling whilst maintaining backwards compatibility. A number of
problems that have
troubled some users in past releases will hopefully be significantly
reduced or cured.
This is covered in more detail in the release notes
(http://jakarta.apache.org/commons/logging/RELEASE-NOTES.txt).
  
Some changes have been made to the class-wise composition of the
distributed jars.
Some deprecated classes are no longer shipped. 
This is covered in more detail in the release notes
(http://jakarta.apache.org/commons/logging/RELEASE-NOTES.txt.

The JCL documentation has also been improved. A Technology Guide
(http://jakarta.apache.org/commons/logging/tech.html) offering an
introduction to
classloading issues and a Troubleshooting Guide
(http://jakarta.apache.org/commons/logging/troubleshooting.html')
complement an
improved User Guide
(http://jakarta.apache.org/commons/logging/guide.html)

Binary and source distributions are available at
http://jakarta.apache.org/site/downloads/downloads_commons-logging.cgi.
The jars
are available from the usual repositories with codegroupId:
commons-logging/code and codeartifactId: commons-logging/code.
Please
remember to verify the signatures.

Robert Burrell Donkin


signature.asc
Description: This is a digitally signed message part


Re: Log4JLogger does not implement Log

2006-05-03 Thread robert burrell donkin
On Wed, 2006-05-03 at 11:25 +0300, Amit Jha wrote:
 I had the same problem when I included commons-logging.jar and log4j.jar in
 WEB-INF/lib
 Once I removed it from there everything was fine.
 It seems it has conflict with what Jboss log4j has already.

if that doesn't work then please try JCL 1.1 RC10
http://people.apache.org/~rdonkin/commons-logging. 

- robert



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



Re: Why Log implementation is Serialized?

2006-05-03 Thread robert burrell donkin
On Wed, 2006-05-03 at 03:04 -0700, Meera Mehta wrote:
 Hi,
 
 I am new to commons logging, we are using commons
 logging in our next project.
 
 I want to know why Log implementations(Wrappers say
 Log4JLogger,Jdk14Logger) implements Serializable
 
 please let me kow.

so that people who want to serialize them can do so. 

see
http://mail-archives.apache.org/mod_mbox/jakarta-commons-dev/200308.mbox/[EMAIL 
PROTECTED]

- robert



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



Re: [betwixt] Thanks (and qn re next release date)

2006-05-01 Thread robert burrell donkin
On Sat, 2006-04-29 at 16:45 +0200, Martin van den Bemt wrote:
 I will have a go at this if that is ok with you, 

fine

 though I am currently pretty swamped with other things (deadline before I go 
 to JavaOne)..

that's understandable :)

i should have some more time once JCL 1.1 ships. will try to start the
preparations required.

- robert



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



Re: [betwixt] className for String, Integer?

2006-05-01 Thread robert burrell donkin
On Sat, 2006-04-29 at 14:51 -0500, Michael Gardner wrote:
 I've un-suppressed the className attribute for all beans, but it doesn't
 seem to get outputted for Strings and Integers (presumably because those are
 handled specially, not being true beans). 

yep: mapped to simple rather than complex xml types

 How can I get betwixt to use className for these, too?

a good question and i need some more information  :)

could you describe a bit more about you particular use case? 

(it would be great if you could contribute a unit test demonstrating
your use case for use in the code base: please use bugzilla since this
list strips most attachments)

- robert





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



Re: [betwixt] className for String, Integer?

2006-05-01 Thread robert burrell donkin
On Mon, 2006-05-01 at 15:10 -0500, Michael Gardner wrote:
 Robert, thanks for the quick response. I submitted a bug to Bugzilla (
 http://issues.apache.org/bugzilla/show_bug.cgi?id=39460), though without a
 unit test yet since I'm having trouble getting the Betwixt test harness
 working.

if you continue to have problems, check out the source from subversion
and take a look at the test cases in there. betwixt is mavenised
(http://maven.apache.org) so building is easy. if you use eclipse, maven
will generate a basic project outline. 

 Anyway, my basic use case involves properties that have setters with formal
 parameter type 'Object': if I try to write such a bean that happens to have
 a String as the value of such a property, BeanWriter will not write the
 className property even though I've un-suppressed the className property in
 general. Then when a BeanReader tries to reconstruct the object, it creates
 a plain Object instead of a String (this also happens with Integer, etc.).

ok

 I can create wrappers for those types to work around the problem, but it
 really messes up my code -- especially since this issue affects more than
 one of my bean types. I thought of modifying Betwixt to no longer treat
 Strings, etc. as simple types, but would BeanWriter still know how to write
 them to XML in that case?

recognition of simple types is pluggable. you'd need to create custom
mappings for Integer and String but that should be ok.

read in again is actually more difficult due to the fact that Integer
and String are not really beans. i don't have the time to supply any
code samples right now but i'll try to set you on the right path...

if you have flexibility over the xml format then the quickest and
easiest way to make things work would be to output the value of the
string or integer as an attribute. then use a new custom
BeanCreationChain which knows how to create a string or integer with the
correct value when called upon to create the object from the complex
type.

otherwise, you need to looking into creating a custom MappingAction
which is more difficult.

- robert



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



Re: [betwixt] Thanks (and qn re next release date)

2006-04-25 Thread robert burrell donkin
On Sat, 2006-04-22 at 10:40 +0200, Martin van den Bemt wrote:
 Hi Simon,
 
 I am a bit rusty concerning betwixt (it's been a while since I did something 
 for it), but before eg 
 ddlutils can be released we prefer to have a released betwixt, so I will 
 definitely start investing 
 some time into it again, but not before I have talked to Robert about it :)

the betwixt code base has been ready for another release for quite a
while. should just be a case of tidying stuff up and updating to the
latest best practice.

- robert



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



[ANNOUNCEMENT] Commons Logging 1.1 Release Candidate 8 Now Available

2006-04-09 Thread robert burrell donkin
Release Candidate 8 for the 1.1 release of Jakarta Commons Logging is
now available:

http://people.apache.org/~rdonkin/commons-logging/

http://cvs.apache.org/repository/commons-logging/jars/

Please download and check this candidate and report any defects. If no
defects are found then this release will be proposed for election early
next week.

Robert


signature.asc
Description: This is a digitally signed message part


Re: [betwixt] manage list

2006-04-09 Thread robert burrell donkin
On Wed, 2006-04-05 at 12:22 +0200, denis queffeulou wrote:
 Ok,
 I understand that the addDefaults tag is mandatory otherwise strange  
 things happen. I think this is very confusing because the functionning 
 of element tag depends on the addDefaults, but anyway...
 So I will put the addDefaults at the end of the .betwixt and manage 
 unwanted properties with the hide tag or by using :
 addDefaults add-properties=false/

the addDefaults tag is optional. using it adds the standard heuristics
used by betwixt to guess adders and so on. when it's not present
everything needs to be completely specified.

- robert 



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



Re: Dependencies needed

2006-04-05 Thread robert burrell donkin
hi jeff

please remember to prefix the mail with name of the component in future.
read http://wiki.apache.org/jakarta-commons/JakartaCommonsEtiquette.

On Wed, 2006-04-05 at 14:37 -0700, Jeff Barnes wrote:
 I need the following dependencies to be satisfied before I can use commons 
 net 1.4.1
  
 
 import org.apache.oro.text.regex.MalformedPatternException;
 import org.apache.oro.text.regex.MatchResult;
 import org.apache.oro.text.regex.Pattern;
 import org.apache.oro.text.regex.PatternMatcher;
 import org.apache.oro.text.regex.Perl5Compiler;
 import org.apache.oro.text.regex.Perl5Matcher;

that's jakarta oro

 They weren't provided with the binaries I downloaded so I get runtime errors. 
 Can someone help me fix this problem?

(thanks to maven) each commons component has it's dependencies listed on
the website:
http://jakarta.apache.org/commons/fileupload/dependencies.html

- robert


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



Re: [betwixt] Partial bean support?

2006-04-02 Thread robert burrell donkin
On Fri, 2006-03-31 at 22:27 -0600, Michael Gardner wrote:
 Does betwixt support reading or writing partial beans? I have a large-ish
 hierarchy of beans, and I would like to send only those properties that have
 changed. For example, say I have the following:
 
 public class Game {
 public void addPlayer(Player p) {...}
 public CollectionPlayer getPlayers() {...}
 ...
 }
 
 I send an instance of Game with two Players through a BeanWriter, which
 writes them out and assigns the Game an id of (say) 42. Later on, I add a
 third Player to the Game, and I would like to re-send the Game with XML to
 the effect of:
 
 game idref=42
 players
 player.../player
 /players
 /game

am i right in thinking that this wouldn't actually be an IDREF (in the
strict sense laid down in the xml specification which means it must
refer to an other entity within the document) but rather a logical
identifier? 

 When a BeanReader tries to reconstruct this, it would look up with its
 IdStoringStrategy the existing Game for id 42, and then call 'addPlayer' on
 that object with the newly-constructed Player object as the argument.

interesting :-)

 Note that while one of my reasons for wanting to do this is bandwidth usage,
 I have other reasons for wanting betwixt to re-use the existing Game instead
 of constructing a new one.
 
 Can betwixt do anything like this? (I fear not.)

not out of the box

 If not, how much work would it be for me to add such capabilities myself?

good question

depends on how this would work in detail. 

what would be hard is changes to objects deep in the hierarchy. for
example let's say change an attribute of a player's postal address:

 game id='42'
   players
player id='5'
address
cityNew Name/city
/address
/player
/players
/game

this is a little tricky to map generically. you have to know how to
traverse the bean hierarchy to get the player who's id is 5 and create
if it does not exist, then get the address object if it exists or create
if it does not. then set the city property to new name.

this kind of stuff would be possible using custom action mapping
strategies. would need to create a MappingAction implementation which
could scan the object graph and create only when there is no map. the
writing stuff would be more tricky but could be done using an xml or
bean diff'er, i suppose.

i can't see how deletions could handled: there seems to be no way to
distinguish between information which is not present because it has not
changed and between data which has been removed.

 Are there any other ways to accomplish this?

i'm sure that there must be some bean and xml diff libraries out there
but no names spring to mind. an interesting problem, though.

- robert


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



Re: Betwixt question: Is it possible to marshal/unmarshal HashMap that contains custom type (CivicAddress, PhoneNumber) whith betwixt?

2006-04-02 Thread robert burrell donkin
On Sun, 2006-04-02 at 10:22 -0400, David Gagnon wrote:
 Hi all,
 
 I'm searching a way to marshal a hashmap that contains custom type like 
 a CivicAddress, PhoneNumber into an XML file.
 
 I need to be able to read this XML and getting back the same HashMap 
 with the same properties.The properties in the Map aren't known.
 
 I look into betwixt to find an answer as well as Castor, XMLBeans, JAXB 
 after trying stuff for few hours .. im just lost:-(

maps are a controversial subject in the xml binding community: there's
not a really naturally way to express them.

 Is that possible to do this with betwixt .. or any other XML framework?
 Thanks to share your knowledge with me :-)

betwixt supports maps. see the section on in
http://jakarta.apache.org/commons/betwixt/guide/binding.html

- robert


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



Re: betwixt and mixed collections

2006-03-30 Thread robert burrell donkin
hi anil

this isn't about betwixt: you're more likely to get a good answer
quickly if you follow the list netiquette
(http://wiki.apache.org/jakarta-commons/JakartaCommonsEtiquette)

On Wed, 2006-03-29 at 10:29 +0530, Anil Mathew wrote:
 hai
 i am working on jelly unit but not able to find enough resources from net
 can any body help me out 
 i have allready gone through jakarta and onjava site but not able to find
 enough
 sample to work out
 please help me out??
 is jellyunit  or junit  is better !!

the best answer to this is: they are different.

jelly is a xml based scripting language. jellyunit allows unit tests to
be creating using jelly scripting. this can be useful for bulk testing.
 
junit is the library that started the unit testing revolution. it uses
reflection.

- robert


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



Re: betwixt and mixed collections

2006-03-30 Thread robert burrell donkin
On Tue, 2006-03-28 at 10:04 +0200, Marcos Truchado Martín wrote: 
 Hi Robert:

hi marcos

 Thanks a lot for your help. I have tried to run the code with both alpha 
 1.0 and latest nightly (marked as 0.8-dev 20060327), and I obtaint the 
 same wrong result I was receiving with 0.7

container#addElement accepts objects of type Object. Betwixt needs to
know the candidate classes which may be included in that collection.  

you need to use a polymorphic mapping. read
http://jakarta.apache.org/commons/betwixt/guide/reading.html#Reading%
20Polymorphic%20Mappings. 

i haven't managed to track down the exact mapping you need but i'll try
to do that at the weekend.

- robert



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



Re: betwixt and mixed collections

2006-03-26 Thread robert burrell donkin
On Thu, 2006-03-23 at 12:21 +0100, Marcos Truchado Martín wrote:
 Hi all, I´m having a problem trying to parse mixed collections. 

hi marcos

are you using the latest code? if not please checkout and build or use a
recent nightly and then retest.

- robert


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



Re: Problem: BeanWriter not enforcing the element list order in Betwixt

2006-03-22 Thread robert burrell donkin
On Tue, 2006-03-21 at 20:24 +, Nikolay Jordanov wrote:
 Hi,

hi Nikolay

 I am using a betwixt file to describe how to convert a Java complex type
 POJO (containing lists of other objects contained in ArrayLists) into
 XML. I need to ensure that the order of all attributes is preserved in
 the XML, as it must conform to a rigid XSD. 
 
 BeanWriter enforces the order in all of the component objects within the
 top level POJO objects correctly, as defined in the betwixt config file,
 but when it comes to elements contained in a List object, they are
 rendered in the resulting XML in alphabetical order, instead of in the
 order described in the betwixt file.
 
 Is this an issue with betwixt's handling of Lists, or am I missing a
 crucial piece of configuration?

i'm not 100% sure: it's a lot easier for me if you can provide a test
case. it means that i can just import the source, run the test and see
exactly what's not right. it also allows me to verify directly whether
the problem has already been fixed.

i think that your problem is that you need to create separate dot
betwixt files for GetCTNHistoryResponse and GCTNHRespHistoryListItem. 

- robert


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



Re: Betwixt and collections

2006-03-20 Thread robert burrell donkin
On Mon, 2006-03-20 at 10:04 +0100, RODRIGUEZ Eric wrote: 
 Hi all,

hi eric

 I'm sorry if this may seem to you a classic (dummy) question but I get some 
 difficulties to get working betwixt with collections.
 Basically, my problem is with List  I got a userlist with boys and girls 
 list, and I want to be populated in the right way.
 I get lost in the documentation to find a example on how to handle correctly 
 the addDefaults or updater settings.

it's worth bearing in mind that the documentation on the website
represents the latest code. a lot of work has been put in since the last
release and i recommend updating to the latest code (build from the
repository or grab a recent nightly) if you have any problems. 

 What should I use to ensure that boys entries are added to boys List (and 
 girls to girls List).
 
 Sorry if this may seem too simple but I tried several betwixt-config files 
 and .betwixt but I can't get this working properly.

if you have flexibility over your xml format then this will work without any 
mapping file if you are willing to make a few changes the format.

the wrapping element for each object in the collection should match the 
property name. so if you use:

 Betwixt XML out:
 ?xml version='1.0' ?  users
 boys
   boy
 nameBoy 1/name
   /boy
   boy
 nameBoy 2/name
   /boy
 /boys
 girls
   girl
 nameGirl 1/name
   /girl
   girl
 nameGirl 2/name
   /girl
 /girls
 userListNameUser List/userListName
   /users

this works for me (using the latest code - you may need to update).

note that 'userListName' does not match the name of your bean property. the 
easiest way to make this mapping work is to either change the name of your 
property or of the element.

if the xml format is fixed then this makes things a little more difficult and 
you'll need a dot betwixt file for UserList. let me know if this is the case 
and i'll try to give you some more help.

- robert


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



RE: Log4JLogger does not implement Log

2006-03-11 Thread robert burrell donkin
On Sat, 2006-03-11 at 09:17 -0800, Rick Herrick wrote:
 Is your classpath in your ant script (just ant, I think, on *nix, ant.bat on
 Windows) getting screwed up?  And/or do you have your classpath configured
 correctly?  Basically, you should check what classpath is getting passed
 into the JVM that's starting up ant.  Depending on what platform you're on,
 there are different ways to do this.  On Windows, just comment out all of
 the @echo off statements in the scripts.  On *nix, just change the line
 ant_exec_debug=false to ant_exec_debug=true and it'll echo out the command
 before it runs it.  You can then look at the jars on the classpath and see
 what you're getting for the Log class.
 
 My guess is that the Jakarta Commons Logging library, Log4J, and Java
 Logging libraries are getting mixed up somehow.  All of these have various
 Log and Logger classes in different packages and I have had different
 versions walk on each other and cause havoc.  The first thing to try is to
 check that your classpath is clean and has only a single version of whatever
 libs you need.
 
 If the problem is actually occurring IN THE BUILD as opposed to just in the
 ant run, then you need to check the classpath that's set up within the build
 script itself.  That's totally dependent on the contents of the script.

there have been some unconfirmed reports of some form of subtle
incompatibility between later log4j builds and commons-logging-1.0.4. 

if you still have problems after rick's advice then please try to latest
1.1 release candidate
(http://people.apache.org/~rdonkin/commons-logging). if this still fails
then please switch on the diagnostic logging and open a JCL bug report
(http://issues.apache.org/bugzilla) containing the output.

- robert


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



Re: [dbcp] Jumping in...

2006-03-08 Thread robert burrell donkin
On Wed, 2006-03-08 at 21:21 +0100, Jörg Schaible wrote:
 Phil Steitz wrote:
 
  There is a growing backlog of bugs open against [dbcp].  Unless other
  committers object, I am going to jump in and start committing patches
  and develop a maintenance release plan.  I plan to start with
  
  http://issues.apache.org/bugzilla/show_bug.cgi?id=33591
  http://issues.apache.org/bugzilla/show_bug.cgi?id=38073
  
  I would appreciate any feedback that community members have on
  prioritization of open tickets.  Also, as always, tickets with patches
  and test cases are likely to get addressed quicker and comments /
  testing / feedback are always welcome.
  
  Any help from other commons committers, even if just in the form of
  screams, will be most appreciated.
 
 I can at least apply my patches from Bugzilla, I just did not wanted to
 start to commit to a project I never committed before ...

+1

we're all one community here: please don't feel constrained to work in
just one little box. 

if you want to work on one of the components here you haven't worked on
before, just post a hello (as phil did) and then dive in.  the worst
that can happen is a -1 :)

remember to add yourself to the list of committers for that component.

if you're embarking on a major rewrite (rather than just bug fixes),
consider either starting work on a branch or taking a tag. 

- robert


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



Re: [betwixt] Exception suppression

2006-03-07 Thread robert burrell donkin
On Tue, 2006-03-07 at 11:13 -0500, Igor Marakov wrote:
 I recently ran into the situation where betwixt is suppressing exceptions
 during the translation.
 I don't think it is a good idea. 
 Enclosing application code should be aware that data that it expecting ain't
 coming. Here is the example of the unsuccessful translation of the SQLJ
 object that is coming from the DB and is supposed to be translated into the
 normal java bean. Translation fails due to SQLException, but application
 code is not getting any indication of it.
 
 Question: Is there the way to switch this behavior off or limit it to
 certain kinds of exceptions?

AFAIK not at the moment but this should be possible to add this
functionality without too much knowledge of the code. managing the
difficult JCL 1.1 release is taking most of my time ATM so not sure when
i'd find time to code this.

anyone want to volunteer to create a patch?

(i'd be glad to answer questions)

- robert



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



Re: [betwixt] Current status of derived bean support?

2006-03-07 Thread robert burrell donkin
On Mon, 2006-03-06 at 23:39 -0600, Michael Gardner wrote:
 What is the status of derived bean support in betwixt? I searched the list
 archive, but found only some relatively old information.

somewhere between started and finished :-/

it's a complex subject and a comprehensive solution would be a lot of
work...

please checkout the latest code from trunk and use that: it's stable and
compatible and a lot of effort has been put into this area since the
last release. build should be easy since maven will handle the
dependencies. 


 In particular, is there currently a way to turn on className attribute
 output for some or all beans? 
 I've read http://jakarta.apache.org/commons/betwixt/guide/derived.html, but 
 it doesn't
 say much about how one would actually go about getting those className
 attributes into the XML stream.

for all beans - the class property is suppressed by default: stop
suppressing it and use a custom mapping strategy.

for some beans - use a dot betwixt file and explicit map the class
property

what betwixt really needs is a configurator to make this easy :-/

 If there is no on switch for derived bean support, would I have to write a
 custom ChainedBeanCreator? 

there are number of cases where this is the easiest way but derived
beans will work automatically given the right configuration. 

 In either case, are there any working examples
 out there? I'm sure that would help clear things up a lot.

i don't know of a working example. perhaps someone who does will jump in
now. 

take a look at the tests: many of these in this area were submitted by
users and are reasonable examples.

- robert


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



RE: [betwixt] Exception suppression

2006-03-07 Thread robert burrell donkin
On Tue, 2006-03-07 at 17:21 -0500, Igor Marakov wrote:
 Robert,
 Do you have an approximate list of exceptions that SHOULD be handled by
 betwixt?

i'm not sure a general list is possible: the semantics of each method
mean that it would need to be done on a case-by-case basis. for some
APIs, an exception may indicate that the object is basically DOA, others
may throw exceptions when the input is outside acceptable bounds. there
are also some APIs which throw exceptions to communicate unusual
circumstances which are not necessarily errors. in this last case, users
may not want the mapping to terminate.

if i'd have designed the interface, i would probably have defaulted to
rethrowing all target exceptions but i'd have been wrong. this is
probably something that should be configurable: factor out a strategy
for processing the exception. have a switch in the configuration and let
users choose.

- robert


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



Re: [betwixt] Reader registration problem

2006-03-01 Thread robert burrell donkin
hi igor

are you using the latest code (from a recently nightly or subversion)?

if not, could you retry using the latest code?

if you can supply a test case (please attach it to a bugzilla)
demonstrating the issue, i'll see if i can fix it.

- robert


On Wed, 2006-03-01 at 16:40 -0500, Igor Marakov wrote:
 I wonder if anybody had seen this:
 
 When reader registration map is created for incoming XML translation it is
 created with tag/class pairs.
 
 I ran today into the situations when IF an element of the registration
 HashMap in the reader has NOT NULL next element, then during the
 translation instance of the wrong class is created. 
 
 Unfortunately I cannot provide a real example but, here is what happens:
 
 ** registration process **
 ...
 reader.registerBeanClass(mybean, com.rather.long.class.name.Mybean);
 reader.registerBeanClass(mybeanSimilarName,
 com.rather.long.class.name.MybeanSimilarName);
 ...
 
 What I see in debugger:
 ** resulting HashMap ** inside the reader ( registeredClasses )
 HashMap$Entry [xx] value com.rather.long.class.name.Mybean
 Field key  com.rather.long.class.name.Mybean
 Field next HashMap$Entry com.rather.long.class.name.MybeanSimilarName
 
 
 ** On translation of the XML element mybeanSimilarName
 
 ** Bean factory ( I have my own chained in ) ** 
 reports two beans being instantiated:
 com.rather.long.class.name.Mybean
 com.rather.long.class.name.MybeanSimilarName
 
 
 ** resulting object is **
 com.rather.long.class.name.Mybean
  
 
 Thanks,
 Igor
 
 
 -
 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: Betwixt Tutorial Problem

2006-02-22 Thread robert burrell donkin
On Tue, 2006-02-21 at 05:52 -0800, Jeff Marendo wrote:
 Thanks for all of the replies.  I finally got things to work, and  the 
 problems I had were due to my own misunderstandings rather than  something 
 with the tutorial's code.
   
   I think some of what is written in the different sections of the  Betwixt 
 pages is not clear, 
 and I'm compiling a short list with the  intention of submitting some work to 
 help provide more 
 clarity for new  Betwixt users--like myself.

that'd be great :)

- robert


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



Re: problem using betwixt

2006-02-19 Thread robert burrell donkin
hi Marcos

On Thu, 2006-02-16 at 17:57 +0100, Marcos Truchado Martín wrote:

 /?xml version='1.0' encoding='UTF-8' ?
 info primitiveTypes='attribute'
 element name='first-element'
 attribute name=foo property=field1/
 attribute name=bar property=field2/
 addDefaults/
 /element
 /info/
 
 and this one is for Thing:
 
 /?xml version='1.0' encoding='UTF-8' ?
 info primitiveTypes='attribute'
 *element name='second-element'*
 attribute name=inside-thing property=field3/
 /element
 /info/
 
 The problem I´m having is that I get this XML:
 
 /?xml version='1.0' encoding=ISO-8859-1?
   first-element foo=1 bar=2
 thing inside-thing=3/
 thing inside-thing=4/
   /first-element/
 
 but my desired ouput is:
 
 /?xml version='1.0' encoding=ISO-8859-1?
   first-element foo=1 bar=2
 *second-element* inside-thing=3/
 *second-element *inside-thing=4/
   /first-element/
 
 where is my fault?

betwixt (usually) takes the name from the property adder ('thing')
rather than the class dot betwixt file. one way to output what you need
is to specify the element name explicitly in the dot betwixt file:

the following works for me with the latest code:

?xml version='1.0' encoding='UTF-8' ?
info primitiveTypes='attribute'
   element name='first-element'
   attribute name=foo property=field1/
   attribute name=bar property=field2/
 element name='second-element' property='thingIterator'
adder='addThing'/
addDefaults/
   /element
/info

- robert


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



RE: Betwixt Tutorial Problem

2006-02-19 Thread robert burrell donkin
On Thu, 2006-02-16 at 05:48 -0800, Jeff Marendo wrote:
 Thanks for the suggestions, but things are still not working.  The  .betwixt 
 files are found at runtime 
 so I don't think there is a problem  in that area. For whatever reason, the 
 program is coming up with  
 a null value for the Channel instance after it tries to parse the  contents 
 of the file.
   
   I'm hoping one of the Betwixt developers will see this thread and be able 
 to provide more insight as 
 to what might be wrong.

not sure :-/

the stock configuration uses 
  
  reader.registerBeanClass( Channel.class );

which will automatically register based on the value in the betwixt
file.

perhaps the quickest way to get to grip with betwixt would be to
checkout the source from subversion and run the examples (in
org.apache.commons.betwixt.examples.rss) from there. 

betwixt uses maven 1 to build so it's quick to get up and running. 

   p.s. It's worth noting that I ran the WriteExampleApp and  ReadExampleApp
 (both using the PersonBean class that is provided in the  Examples section)
 without a problem (except for the INFO messages,  which still appear).
 However, the XML used for that example seems  simpler than that used in the
 tutorial.

i'm not sure whether has anything much to do with your problem or not
but the content on the website reflects the current codebase which has
had a lot of work put into it since 0.7 (see
http://jakarta.apache.org/commons/betwixt/tasks.html#Since%200.7). i
strongly recommend anyone trying betwixt to checkout a version using
subversion and roll their own release.

(betwixt really should have had a release in the last quarter of last
year but the commons release process went through a crisis)

- robert


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



Re: help with .betwixt files

2006-02-19 Thread robert burrell donkin
On Thu, 2006-02-16 at 13:04 +0100, Marcos Truchado Martín wrote:
 Hi.

hi marcus

 I´m looking for a way of set the property WrapCollectionsInElement in 
 the info/ element under a .betwixt file. Does anyone know how to do 
 it?, I think that must be a way in the same way you can tell betwixt to 
 set primitiveTypes as attribute or element. This is a lot of usefull 
 when for example I have some collections that needs to be wrapped and 
 others not (having a .betwixt file per class).

this isn't need when using the dot betwixt format. you can add
structural elements just very simple: they are just elements not mapped
to properties. for example

info
   ...
   element name='collection-wrapper'
  element name='collection-member' property='bound-property-name'/
   /element
/info

see http://jakarta.apache.org/commons/betwixt/guide/start.html#.betwixt%
20files for more information

- robert


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



Re: Format of .betwixt files

2006-02-19 Thread robert burrell donkin
On Thu, 2006-02-02 at 12:39 -0600, Joseph Larson wrote:
 Can someone point me to a full description of a .betwixt file?  There  
 is information scattered throughout the various betwixt documents,  
 but I have been unable to find a complete description of the contents.

there is a DTD:

http://svn.apache.org/repos/asf/jakarta/commons/proper/betwixt/trunk/src/resources/dotbetwixt.dtd

but it would great if all the information was collated into one
document.

any volunteers?

 At this point, I'm trying to properly define an element that is a  
 container.  Specifically, the class in question contains:
 
   private ArrayListPropertyImpl properties = new ArrayList  
 PropertyImpl ();
   public ArrayList PropertyImpl getProperties() { return 
 properties; }
   public void addProperty(PropertyImpl property)
   {
   properties.add(property);
   }
 
 The XML I'm reading has a format I can't change, so I need to get  
 betwixt to read it without fixing some shortcomings in the design.   
 They use the keyword property for this field.
 
 I haven't found an example that shows how to define an element like  
 this.  That is, I need to define a container where the name in the  
 XML does not match the names in the implementing class, and the adder  
 method is being used.

the first thing that i'd strongly recommend is checking out the latest
code from subversion and building a version of that: a lot of
improvements have been made since the last release.

flexible mapping is the strength of betwixt so should be able to do what
you need. i'm not sure i completely understand what you want to do (if i
have it wrong, please give an example of the xml).

you probably want to use a dot betwixt file for this. you need to
specify the mapping using a element element:

element name='XYZ' property='ABC' adder='DEF'/ 

this will map an xml element with tag XZY to property named ABC with
adder DEF.

hope this helps

- robert


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



Re: Log4JLogger does not implement Log

2006-02-07 Thread robert burrell donkin
please download the latest release candidate from
http://people.apache.org/~rdonkin/commons-logging. replace *all* JCL
jars (there will probably be a few in various classloaders since this
causes the problem you note) with new jar's. 

- robert

On Thu, 2006-02-02 at 16:33 +, Lee Hammond wrote:
 Hi,
  
 In the logging web page:
 http://wiki.apache.org/jakarta-commons/Logging/FrequentlyAskedQuestions,
 and for the issue Log4JLogger does not implement Log it says: If you
 get this problem, please post to the commons-user list so here goes...
  
 I get this error. I'm trying to deploy CentraView on JBoss4.0.3. I get
 the following:
  
 14:53:41,269 INFO  [TomcatDeployer] deploy, ctxPath=/centraview,
 warUrl=.../tmp/deploy/tmp58192centraview.ear-contents/centraview-exp.war
 /
 14:53:41,301 ERROR [Digester] Begin event threw exception
 org.apache.commons.logging.LogConfigurationException:
 org.apache.commons.logging.LogConfigurationException:
 org.apache.commons.logging.LogConfigurationException: Class
 org.apache.commons.logging.impl.Log4JLogger does not implement Log
  at
 org.apache.commons.logging.impl.LogFactoryImpl.newInstance(LogFactoryImp
 l.java:532)
  at
 org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImp
 l.java:272)
  at
 org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImp
 l.java:246)
  at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:398)
  at org.apache.catalina.session.ManagerBase.init(ManagerBase.java:63)
  at
 org.apache.catalina.session.StandardManager.init(StandardManager.java:
 64)
  at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
 Method)
  at
 sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorA
 ccessorImpl.java:39)
  at
 sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingCons
 tructorAccessorImpl.java:27)
  at java.lang.reflect.Constructor.newInstance(Constructor.java:494)
  at java.lang.Class.newInstance0(Class.java:350)
  at java.lang.Class.newInstance(Class.java:303)
  at
 org.apache.tomcat.util.digester.ObjectCreateRule.begin(ObjectCreateRule.
 java:205)
  at org.apache.tomcat.util.digester.Rule.begin(Rule.java:152)
  at
 org.apache.tomcat.util.digester.Digester.startElement(Digester.java:1275
 )
  at org.apache.xerces.parsers.AbstractSAXParser.startElement(Unknown
 Source)
  at
 org.apache.xerces.parsers.AbstractXMLDocumentParser.emptyElement(Unknown
 Source)
  at
 org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanStartElement(U
 nknown Source)
  at
 org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDis
 patcher.dispatch(Unknown Source)
  at
 org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unkno
 wn Source)
  at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
  at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
  at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
  at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
  at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown
 Source)
  at org.apache.tomcat.util.digester.Digester.parse(Digester.java:1561)
  at
 org.apache.catalina.startup.ContextConfig.processContextConfig(ContextCo
 nfig.java:778)
  at
 org.apache.catalina.startup.ContextConfig.contextConfig(ContextConfig.ja
 va:714)
  at
 org.apache.catalina.startup.ContextConfig.init(ContextConfig.java:974)
  at
 org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.j
 ava:273)
  at
 org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSu
 pport.java:119)
  at
 org.apache.catalina.core.StandardContext.init(StandardContext.java:5019)
  at
 org.apache.catalina.core.StandardContext.start(StandardContext.java:3885
 )
  at
 org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.ja
 va:759)
  at
 org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:739)
  at
 org.apache.catalina.core.StandardHost.addChild(StandardHost.java:524)
  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  at
 sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.jav
 a:39)
  at
 sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor
 Impl.java:25)
  at java.lang.reflect.Method.invoke(Method.java:585)
  at
 org.apache.commons.modeler.BaseModelMBean.invoke(BaseModelMBean.java:503
 )
  at
 org.jboss.mx.server.RawDynamicInvoker.invoke(RawDynamicInvoker.java:150)
  at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:644)
  at
 org.apache.catalina.core.StandardContext.init(StandardContext.java:5005)
  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  at
 sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.jav
 a:39)
  at
 sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor
 Impl.java:25)
  at java.lang.reflect.Method.invoke(Method.java:585)
  at
 

RE: RE:Commons-logging WSAD5.1

2006-02-06 Thread robert burrell donkin
On Fri, 2006-02-03 at 11:19 -0600, Srilatha Alase wrote:
 Robert,
thanks for correcting..good news is that It worked! I'm able to start and 
 run my application.
 but I'm again back to square one :(

the point is not where you are but what we have learnt :)

we now now that you current configuration of JCL is bridging correctly 
to log4j. therefore, you problems are on the other side of the bridge,
with log4j. 

you know need to do something similar for log4j: find each and every
log4j.properties file and remove each one until log4j starts printing
it's warning. then add in a single log4j.properties file to a known
location.

 I'm still seeing some messages when I start the server..so attached is the 
 message list.
 
 Our project was implemented around in 2002.They used different ways to get an 
 instance of 
 a log..
 One of the ways was to create a custom Class called common.util.Debug. Please 
 find the attached Debug class.
 Now we have some classes(ex:MyTestDAO) calling this Debug class to do the 
 logging.(Its not pretty.. 
 but thats how they implemented).

i understand that it's not your fault but for the record note also that
you'll find the design will lead to a performance degradation: string
concatenation is slow. the guard call (for example, isDebugEnabled) is
intended to allow slow operations such as string concatenation to be
avoided.  

 So In the log4j.properties I kept both the calling classes and the Debug 
 class to WARN.
 all the classes that were using or getting log Instance in a normal way have 
 no problems.

great

 But the classes
 which are calling Debug classes to log the messages are still printing out 
 the log messages.

can't see any obvious cause in the class

is it possible that common.util.Debug is being loaded by a different
classloader? in this case, it is possible that log4j will be picking up
a different log4j.properties file (see above). you can test this by
removing the log4j.properties file that you use for the classes that
work. if common.util.Debug still logs then it is using a separate
properties file.

 Thanks for all your help!

sorry for being so slow (not been too well over the weekend) 

- robert


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



RE: RE:Commons-logging WSAD5.1

2006-02-02 Thread robert burrell donkin
On Thu, 2006-02-02 at 13:17 -0600, Srilatha Alase wrote:
 Robert,
   Thank you for the latest jar files and the information that you
 provided.
 
 I took the following steps:-
 Cleaned all the old commons-logging jar files.
 I removed commons-logging-api.jar in the WSAD provided libraries.
 
 added a system property in the server configuration
 org.apache.commons.logging.diagnostics.dest=3DSTDERR
 
 updated the commons-logging.properties file to have this entry
 org.apache.commons.logging.Log=org.apache.commons.logging.impl.Log4jLogger
 ^^^
try:
org.apache.commons.logging.Log=org.apache.commons.logging.impl.Log4JLogger

the name of the logging implementation is case sensitive. (Log4JLogger
not Log4jLogger).

- robert


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



RE: RE:Commons-logging WSAD5.1

2006-02-01 Thread robert burrell donkin
On Tue, 2006-01-31 at 17:36 -0600, Srilatha Alase wrote: 
 Hi Robert,
   Thank you for your input..
 
 When I changed the commons-logging.properties to have the following entry:-
 org.apache.commons.logging.Log=org.apache.commons.logging.impl.Log4jLogger
 
 Now I'm getting an error on startup 
 
 Caused by: org.apache.commons.logging.LogConfigurationException: 
 org.apache.commons.logging.LogConfigurationException: 
 java.lang.ClassNotFoundException: org.apache.commons.logging.impl.Log4jLogger 
 ...

the stack's pretty clear: org.apache.commons.logging.impl.Log4jLogger
cannot be loaded. the open question is why it can't be loaded. 

 I do have commons-logging-1.0.4.jar in the server classpath,also added a 
 custom classloader in WSAD 5.1
 to use the commons-logging-1.0.4.jar.

the most likely explanation is that there are multiple JCL jars in your
classpath including an API jar. debugging a complex classloader
configuration (such as is found in modern J2EE containers) with multiple
JCL jars requires specialist knowledge and expertise. 

so, the easiest approach is usually just to remove all JCL jars (so the
application fails with a java.lang.ClassNotFoundException for either
org.apache.commons.logging.Log or
org.apache.commons.logging.LogFactory). then add one full jar
(commons-logging-1.0.4.jar) back and see if it works.

alternatively, we've been working hard on JCL 1.1. this has a lot of
improvements including better diagnostics. a release candidate is
available from http://people.apache.org/~rdonkin/commons-logging/.
please read the release notes carefully. remove all old jar's (by
following the process outlined above) and then try the new jar instead.
if it doesn't work, try running with the system property
org.apache.commons.logging.diagnostics.dest=STDERR (or STDOUT).

- robert


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



Re: RE:Commons-logging WSAD5.1

2006-01-31 Thread robert burrell donkin
On Tue, 2006-01-31 at 14:47 -0600, Srilatha Alase wrote:
 Hi,
   I have a problem with DEBUG messages being printed in the SystemOut.log 
 file.
 
 we have migrated from WSAD version 4 to WSAD 5.1 and we are encountering that 
 commons-logging does not consider
 the level assigned in the log4j.properties.It seems that It is reading the 
 log4j.properties that I provided
 since i kept a pattern to print and it prints in the pattern specified but 
 somehow ignores the priority.

commons-logging (JCL) is a bridge: all it does it work out which logging
system it should bridging to and then delegate all logging to the
logging system. with a bridge there are two factors to consider. the
first is a misconfiguration of the bridge, the other is a
misconfiguration of the logging system bridged to.

the easiest way to test whether JCL is logging to the logging system you
want is to check whether the output is logging to the right place and is
formatted in the expected way. if so, then the problem lies in the
configuration of the logging system (log4j, in this case). if the output
is misplaced or appears in an unusual format then it's likely that JCL
has failed to understand which logging system it should be bridging to.

 we have commons-logging.properties with the following entry :-
 org.apache.commons.logging.LogFactory=org.apache.commons.logging.impl.Log4jFactory

that's deprecated. the following is now preferred: 

org.apache.commons.logging.Log=org.apache.commons.logging.impl.Log4jLogger

- robert


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



Re: [digester] create parent from child node value

2005-12-21 Thread robert burrell donkin
On Tue, 2005-12-20 at 18:10 +0100, Valerio Schiavoni wrote:
 Hello Marco,
 i've already considered that option, but it looks quite poor design to
 provide so many setXXX methods on objects that will be initialized once and
 forever.
 Further, there are no restrictions to call those set methods after the
 initialization of the object (that is, after the 0-param constructor is
 used, either via a addObjectCreate or using addFactoryCreate), apart from
 self-disciplined programmers.
 
 What I mean is: how can I istantiate 'immutable' objects  that requires
 values in their constructors ? None of the examples I found illustrate this
 situation, so maybe this is voluntarly not supported by api designers. if
 so, it'be interesting to understand why.

the digester api is small and simple: digester fires rules when patterns
are matched in the xml being parsed. 

digester ships with a number of standard rules for common use cases.
these have been accumulated over the years. the presence or absence of
rules from this standard set has more to do with what rules developers
have created and contributed to apache than any great design. 

digester can do what you want but AFAIK there is no standard rule
suitable for your exact problem (if anyone knows of one, please jump
in). FactoryCreateRule can be used when the required initialization
parameters are contained in attriutes.

you can easily solve your particular problem by creating a custom rule.
if you feel like contributing a more general solution that can be
included in the standard rules, let me know and i'll outline a design.

- robert


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



Re: Betwixt and Log4j

2005-12-21 Thread robert burrell donkin
On Sun, 2005-12-18 at 22:26 +0100, Jakub Piechnik wrote:
 Hello
 
 I'm new to Betwixt. When I was creating my fiorst project using betwixt 
 everything was ok, but then when I add that project into larger project 
 - something went wrong. I mean code which was good, and worked started 
 to faild. I can not parse single xml text. After hours of fighting with 
 this problem - I've tried to remove log4j.jar - and to my suprise - it 
 stared working. So the cause was log4j.jar. Have You ever faced with 
 such a problem?

this sounds like a problem involving jakarta commons logging and a bad
classloader configuration. the behaviour of JCL has been changed in
these circumstances since the last release. i'd advise upgrading to a
recent JCL nightly.

- robert


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



Re: Can Betwixt/Digester directly access public data membersw/ogetters/setters?

2005-12-14 Thread robert burrell donkin
On Wed, 2005-12-14 at 15:47 +, Guillermo Bares wrote:
 I would like to help to code betwixt support.  The approach I mentioned 
 seemed to me to a step in that direction.  If you have another approach in 
 mind I would be glad to hear it.  Please let me know what you have in mind, 
 and I will look into it.

great :)

first some information...

if you haven't already please take a few minutes to browse the jakarta
(http://jakarta.apache.org/commons/patches.html) and ASF
(http://www.apache.org/dev) websites. i prefer test-driven development
but whether you do or not, it's very important to have unit tests for
all development. 

please use bugzilla (http://issues.apache.org) to submit patches (the
list strips most attachments). of course i'm sure you know that any
contributed code needs to be original work developed by yourself that
you are feel to license to us (sorry about the legalese but that's the
way things seem to be going these days...). patches need to be against
trunk (so you'll need to check out from subversion - see
http://www.apache.org/dev/version-control.html). ATM i use eclipse and i
find subclipse (http://subclipse.tigris.org) works well with the latest
3.2 milestone.



one of the advantages of betwixt is that you can use digester rules.
however, it's not the same as adding proper support for fields into the
core of betwixt.

i think that there are different levels of support so it's possible to
work in stages. 

start by creating a couple of new classes FieldExpression (which will
write out values of fields) and FieldUpdater (which will update POJO's
with values). it's probably best to start by leaving collectives till
later. the other expressions and updaters (especially MethodExpression
and MethodUpdater) can be used as examples. you don't need to wait
before starting this work.

once that's done, the next step would be to add introspection code.
there are two possibility: either generic strategies or dot betwixt
support. it's completely up to you which of these you want to tackle.
ideally support should include both but you probably want to focus on
the one that's going to be most useful for you first. if you let know
which would be most useful, i'll describe how to approach the problem.

- robert


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



Re: Can Betwixt/Digester directly access public data members w/ogetters/setters?

2005-12-13 Thread robert burrell donkin
On Mon, 2005-12-12 at 20:56 +, Guillermo Bares wrote:
 I am definitely interested in adding support for fields.  If you have ideas 
 of what the best way to go about it would be, I would greatly appreciate it. 
   T. Dudziak previously Thomas Dudziak that the SetPropertiesRule would be a 
 good place to start.  While going through the source code I noticed that the 
 SetPropertiesRule uses the BeanUtils' populate method to do the update.  
 Would you see the field access using a similar/identical approach?

if you want to give the digester rules a try, then yep. 

(let me know if you want help code betwixt support)

- robert


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



Re: Can Betwixt/Digester directly access public data members w/o getters/setters?

2005-12-11 Thread robert burrell donkin
On Wed, 2005-12-07 at 16:10 +, Guillermo Bares wrote:

snip

 2) If there is no configuration mechanism, I am willing to extend the 
 Betwixt/Digester frameworks.  I have a couple ideas on where to start, but I 
 would like to hear others.

for various pretty obscure reasons, i intend to add support for fields
soon. i've got a lot on ATM so i'm not sure when i'd get round to this
but i'd be pleased to help you if you fancy developing a patch for
betwixt  (if you're still interested).

- robert


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



Re: Betwixt - Strings set to null strings when reading a Collection of strings

2005-12-10 Thread robert burrell donkin
On Fri, 2005-11-25 at 09:13 +, David Gough wrote:
 I have been trying to get Betwixt to read/write my java classes and have
 run into a problem with read Collections of Strings.

hi david

(sorry for the late response: my ISP's had major major email issues for
the last or so)

this is a bug. i've committed a fix. please try again using a recent
nightly or a new version rolled from trunk in svn.

- robert


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



RE: Log4JLogger Not Thread Safe?

2005-12-01 Thread robert burrell donkin
On Tue, 2005-11-29 at 13:31 -0600, Wilson, Chris (SAHQ I/S) wrote:
 To preface, let me state I am certainly not a JVM, compiler, or
 threading expert!  

that makes two of us!

however, the first step to knowledge is the acknowledgement of
ignorance...

 The link you provided
 (http://www.cs.umd.edu/~pugh/java/memoryModel/DoubleCheckedLocking.html)
 and this article by Doug Lea (http://gee.cs.oswego.edu/dl/cpj/jmm.html)
 talk about the compiler or memory system reordering statements as long
 as as-if-serial semantics are preserved.

that's correct: as far as i can tell (at least for older JVMs) there are
no guarantees that construction will be completed before the object is
exposed to other threads.

http://www-128.ibm.com/developerworks/java/library/j-jtp02244.html and
http://www-128.ibm.com/developerworks/java/library/j-jtp03304/ are good
references.

(i'm sure i used to know this: but it's always a pleasure to dip back
into Concurrent Programming in Java by Doug Lea)

 Since getLogger() is not synchronized, I suppose the only danger could
 be the following scenario:
 
 Thread A enters getLogger() and determines that the logger instance is
 null (because the class has been recently deserialized).  Thread A
 proceeds to get an instance of logger from the underlying logging
 system.  Because getLogger() is not synchronized, a reference to the new
 logger instance may be set in the local logger variable before the
 object is fully constructed.  At this point Thread A gets swapped out
 for another thread to run.
 
 Thread B enters getLogger() and sees that the logger instance is not
 null and happily returns it for use.  The code using the logger instance
 calls some methods on it before it has been completely setup (still
 waiting to happen in Thread A which is waiting to run again).
 
 At this point, what happens?  The behavior of the logger instance is
 undefined as I understand it.  It may not fail, but could possibly act
 in a strange way?

what happens will depends on the internal behaviour of log4j logger but
it's probably wiser to assume the worst and address this issue. 

i agree that should be fixed and think that overriding the readObject
method is probably the right way to do it. if you'd like to submit a
patch (through bugzilla) i'll take a look at committing it. otherwise,
i'll take a look at the weekend (when i hope to do the preparation work
for a 1.1 JCL release).

note that the string constructor (which calls getLogger) potentially
suffers from the same problem. i really don't want to synchronize
getLogger() - it is called too much. would need to review the usage to
determine whether this is safe as used in JCL. should probably put
something in the documentation for the constructor warning that it's not
thread safe. again, if you want to lend a hand please do :) 

- robert


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



Re: Log4JLogger Not Thread Safe?

2005-11-29 Thread robert burrell donkin
On Mon, 2005-11-28 at 10:15 -0600, Wilson, Chris (SAHQ I/S) wrote:
 Hello,
 
 I was looking at the source code of Log4JLogger and it seems to me that
 it may not be thread safe after deserialization.
 
 The implementation holds a transient variable called logger which is
 initialized at construction time.  There is no synchronized access to
 the logger variable anywhere in the class.  The classes encapsulates all
 access to the logger variable via the getLogger() method which
 optionally initializes it if it's null.
 
 Since the logger variable is transient, when a Log4JLogger instance is
 deserialized, the logger variable will be null and thus reinitialized
 the next time getLogger() is called.  If a Log4JLogger instance is held
 as a static variable in a containing class (a standard commons logging
 pattern), it would be possible for two threads to call getLogger() at
 the same time which could lead to a thread unsafe scenario since
 getLogger() is not synchronized.
 
 Even if the underlying log implementation is thread safe (which Log4J
 is), this class accesses and stores a reference to its returned logger
 in a thread unsafe way.
 
 Unless I'm missing something, it seems this class should protect access
 to the logger variable if it is to be dynamically created via
 getLogger() or override the readObject() method so that it's created
 during deserialization (which I'm assuming would be thread safe as the
 JVM would release the instance for use until it had been completely
 deserialized).

i've take a look and here's how i see things...

since the class is unsynchronized, it is likely that concurrent use
cases could be developed without the need for serialization. (there are
a lot of oddities in java. for example see
http://www.cs.umd.edu/~pugh/java/memoryModel/DoubleCheckedLocking.html.)

JCL is (for better or worse) one of the most widely used java libraries
and is now approaching maturity after many years of use. though it has
it's deficiencies, i would have expected any synchronization issues to
have emerged by now.

for me, the key question is: what are the possible scenarios when two
threads concurrently enter getLogger() and are any of these unsafe?

luckily, the method is very simple. the worst case scenario (i can see)
results in two threads both setting the logger to a non-null value. this
would be safe but a little inefficient. 

but if you think i'm wrong or my arguments seem unconvincing, please
take this as a challenge to create a unit test that proves log4j logger
is thread unsafe :)

- robert


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



Re: Betwixt : Class Loader - Food for thought

2005-11-20 Thread robert burrell donkin
On Sun, 2005-11-20 at 19:07 +0100, Thomas Dudziak wrote:
 On 11/20/05, Ryan McGuinness [EMAIL PROTECTED] wrote:
  I have been trying to get betwixt running with the IBM JDK within
  WebSphere. While sifting through the source, I noticed that each
  class that deals with loading classes does something a little
  different. Should there be a Utility class to handle this.
 
 +1

+1  

having experienced the vast differences that can happen when faced with
running bricks in different environments, what's really needed is a
configurable strategy for class loading with probably two base
implementations (one aimed at application work, one for J2EE
containers).

ryan: if you've already sifted through the source, perhaps you might
contribute a patch which tidies up all the classloading into a single
strategy...?

  Also, in more secure containers, it may be a good idea to get the
  class loader a little differently:
  Below is a code snip-it on getting the loader through the Security
  Manager.
 
 why so complicated ? 
 Wouldn't it suffice to first check the context
 class loader at the current thread
 
 Thread.currentThread().getContextClassLoader()
 
 is available, and if not, then using the one that loaded the current class
 
 getClass().getClassLoader()

the above is the usual basic (a few details are missing) procedure when
running in a J2EE container. 

i'm not sure that i understand the reasons behind the complex procedure
above. could you explain it?

- robert


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



Re: Betwixt: JRE compatabilities

2005-11-18 Thread robert burrell donkin
On Thu, 2005-11-17 at 21:39 -0600, Ryan R. McGuinness wrote:
 Which JRE's are betwixt compatible with? More directly, does it work  
 with IBM JDK 1.3 (or 1.3 at all)? Which libraries are needed to make  
 this work?

the last betwixt release was compiled against using blackdown 1.3.1. (i
don't have a 1.3.0 JDK which will run against my current kernel.)  

 This stems from the fact that I am running betwixt on AIX in  
 WebSphere 5.1, and I am not getting any debugging out in my log  
 files. The code is working fine in test, but when I deploy: BLAMMO no  
 worky-worky. Any insight is appreciated.

i recommend recompiling from source using the IBM 1.3 JDK JVM and
retrying. 

the 1.3 JRE you are using may not ship with JAXP: if it does not then
you need to download and install JAXP
(http://java.sun.com/webservices/jaxp/index.jsp) any version compatible
with your JVM should work. 

- robert



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



Re: [csv] Creating a CSV component

2005-11-18 Thread robert burrell donkin
On Thu, 2005-11-17 at 09:36 -0600, Don Seiler wrote:
 Stefan Rufer wrote:
  The discussion was continued on the commons-dev mailing list.
  
  Henri Yandell proposed to bring in the Netcetera CSV code via the Apache
  Incubator Project. I think that's a good idea and I will try to put some
  effort in to get the incubation process started.
 
 Is there any progress on this?  I'll ask sf.net to remove the
 csv4j.sf.net project if it seems Apache/Jakarta is carrying the ball now.

AIUI we're processing the required paperwork now. hopefully it shouldn't
be too much longer...

- robert


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



Re: [betwixt] Array of extended class

2005-11-17 Thread robert burrell donkin
On Thu, 2005-11-17 at 10:08 -0500, Sacha Fournier wrote:
 Hi,
 
 I have something like this:
 
 MainClass.java
 class MainClass
 {
private MyObject aObject[];
 
   public MyObject[] getMyObject()
  {
 return this.aObject;
  }
 }
 
 MyObjectA.java
 class MyObjectA extends MyObject
 {
 // Some specific attribute getter...
 }
 
 MyObjectB.java
 class MyObjectB extends MyObject
 {
 // Some other specific attribute getter...
 }
 
 Main.java
 void Main()
 {
   MainClass oMain = new MainClass();
   MainClass.addToMyObject(new MyObjectA());
   MainClass.addToMyObject(new MyObjectB());
 
   StringWriter outputWriter = new StringWriter();
   outputWriter.write(?xml version='1.0' ?);
   BeanWriter beanWriter = new BeanWriter(outputWriter);   
   beanWriter.write(oMain.getClass().getName(), oMain);
 }
 
 =
 My xml output is
 MainClass
   MyObject{all MyObjectA attributes}/MyObject
   MyObject{all MyObjectB attributes}/MyObject
 /MainClass
 
 But I was expecting something like that:
 MainClass
   MyObjectA{all MyObjectA attributes}/MyObjectA
   MyObjectB{all MyObjectB attributes}/MyObjectB
 /MainClass
 
 
 Any ideas ?

this has to do with introspection time verses bind time typing. when
betwiwt introspects the MainClass bean it finds that the property is
typed MyObject. at bind time, the instance actually contains subclasses
of MyObject. by default, betwixt uses bind time mapping.

if you want to be able to round trip (rather than just generate xml),
you'll need to use a polymorphic mapping. this should be covered in
here: http://jakarta.apache.org/commons/betwixt/guide/derived.html.

BTW if you're using the last release please upgrade to a recent nightly
or roll your own since a substantial amount of functionality has been
added in this area.

- robert


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



Re: [betwixt] mapping java.util.Map

2005-11-17 Thread robert burrell donkin
On Thu, 2005-11-17 at 12:13 -0800, Brian Ferris wrote:
 It seems that the rules for mapping a java.util.Map are determined by  
 the BeanProperty.createDescriptorForMap() method.  Is there any way  
 to override this method or change the behavior of java.util.Map  
 mapping.  After examining the parent method  
 BeanProperty.createXMLDescriptor(), it doesn't look like there is an  
 easy way to do it.

the support for maps is one of the few areas which hasn't really been
refactored (so it's a bit rubbish). needs a redesign. 

i work best from concrete use cases so maybe we could develop a better
design now...

- robert 


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



Re: Menu In struts tiles

2005-11-16 Thread robert burrell donkin
On Mon, 2005-11-14 at 13:53 +, Kanuri, Chand wrote:
 Hi all,
 I am using struts tiles in my web app.
 can any one suggest me to build the menu in tiles purely using java code?

you'll probably get a better answer quicker if you ask over on the
struts user list. please read http://struts.apache.org/mail.html.

- robert


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



Re: [OT] - UDDI Creation and administration tool question

2005-11-12 Thread robert burrell donkin
On Fri, 2005-11-11 at 09:39 -0600, Alfredo Ledezma Melendez wrote:
 
 Hello,

hi 

 In our company we are developing a SOA architecture using web services; I
 proposed to my boss to post them using an internal UDDI. The question is, are
 there some commons related projects can I use to create/manage this? Do you 
 know
 another projects can I use (propietary included)? Any pointers on the subject
 would be really apreciated.

apache web services are federated over in the webservices proeject
(http://ws.apache.org). there's a wealth of knowledge and code over
there so that's the best place to ask this kind of question. 

- robert


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



Re: [VFS] No binary downloads?

2005-11-08 Thread robert burrell donkin
On Tue, 2005-11-08 at 18:39 +0100, David J. M. Karlsen wrote:
 Mario Ivankovits wrote:
 
  David J. M. Karlsen wrote:
 
  Is this a current snapshot - or a 1.0 release. I'm interested in 
  the stable release.
 
  I was still not able to create the 1.0 release.
 
 OK - now I get it. It's out of the sandbox - but not released yet. I 
 read 2005-05-24 - [EMAIL PROTECTED]: Moved VFS out of sandbox into 
 proper. What a great day! as a relase - which is clearly not a correct 
 conclusion. Sorry about the confusion.
 
 Well - keep up the good work - and I'll be waiting for the final 
 release. :-D

i fear that VFS may be falling into one of the commons traps. that's a
long time for a component to have been promoted without any release. 

even if VFS isn't ready for a 1.0 release, it's good to have 0.x
releases available. 

- robert


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



Re: Betwixt : flavours for complex objects

2005-11-08 Thread robert burrell donkin
On Tue, 2005-11-08 at 00:48 -0800, Brian Ferris wrote:
 So I'd like to toss my two cents in on the issue.  

grand :)

 I was recently  
 working with a custom IdStoringStrategy which used an Option value to  
 determine if an instance of an object would be encoded with an id-ref  
 or not.  Something like:
 
element name=node property=node
  option
nameuse-idref/name
valuetrue/value
  /option
/element
 
 I quickly discovered that things didn't work quite as I planned,  
 since the Conext object passed into method calls in IdStoringStrategy  
 didn't have any Options.  The relevant code in AbstractBeanWriter  
 indicated that options weren't pushed onto the context stack prior to  
 calls concerning the id-storage strategy.  I patched  
 AbstractBeanWriter to push options onto the stack at the appropriate  
 point, but I still wasn't getting the behavior I wanted.  It boils  
 down to the option inheritance that Robert was hinting at.  When I  
 pushed the options onto the stack, I had a choice of the options from  
 the ElementDescriptor defined by the parent class (options of the  
 node element in the above example) or options from the  
 ElementDescriptor defined by the target node class (options  
 potentially defined in a .betwixt file for the underlying node class).

i added a new method getInheritedOption() recently to context that
searches the options stack for the first match. this has some drawbacks
(in that it doesn't completely address the issue) but was quick to code
and is useful in some use cases.

opinions welcomed :)

 Ultimately, I chose a solution that combined the two sets of options,  
 allowing the Options in the parent to override the Options in the  
 target class.  I think that behavior works best since it allows you  
 to define default Options in the target class and then override them  
 as needed in parent classes for custom rendering.  I know my use of  
 parent and target probably isn't the properly terminology here, but  
 hopefully you get the idea.

i'm not sure there really is any standard terminology but i think i know
what you mean. a property mapped to a complex type in the schema is
modelled in the descriptors by a hollow descriptor in the property. the
filled descriptor for the class is pushed onto the stack but ignored (in
many ways). 

in a lot of ways, parent property and target type are as reasonable
terms as any for this arrangement (so with any luck) they might be
adopted ;)

this causes difficulties with options since options for the target type
are pushed onto the stack and so override those of the parent. this is
(at best) unintuitive.

 Anyways, I'd like to see behavior like this incorporated and I'm  
 willing to write up a patch if something can be agreed to.

i like patches :)

but the question is: what's the best approach. 

ignoring target options is intuitive but breaks semantic compatibility.
(not to say that this would be a reason to reject the idea, just needs a
little consideration). 

(as always) opinions welcomed 

- robert


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



Re: betwixt: can it round-trip a tree structure?

2005-11-07 Thread robert burrell donkin
hi ryan

that's quite a cool example :)

if you'd fancy contributing it to the betwixt documentation please
submit a patch. 

(you'll find information about how to do this by browsing
http://jakarta.apache.com/commons http://jakarta.apache.org and
http://www.apache.org/dev. please attach patches to
http://issues.apache.org/bugzilla since the mailing list usually strips
them.)

- robert

On Mon, 2005-11-07 at 10:16 -0600, Ryan McGuinness wrote:
 Richard,
 
 I had a similar issue, but was able to resolve it with .betwixt files, and
 a simple collections class.
 
 The example if for a reflexive questionaire:
 
 Questionnaire
 QuestionaireInfo
 QuestionGroup
Question
QuestionGroup
Question...
/QuestionGroup
/Question
Question
QuestionGroup...
 
 
 Questions:
 import java.util.ArrayList;
 import java.util.Iterator;
 import java.util.List;
 
 Questionnaire:
...
Questions questions = new Questions();
...
addQuestion(Question q) {
questions.add(q);
}
 
 Questionnare Betwixt:
 ?xml version='1.0'?
 info
   element name='rq:questionnaire'
   attribute name=xmlns:rq value=some namespace /
   element name='rq:questionnaireInfo'
property='questionnaireInfo' /
   element name='rq:questionGroup' property='questions'/
   /element
 /info
 
 Question:
...
Questions questions = new Questions();
...
addQuestion(Question q) {
questions.add(q);
}
 
 Question Betwixt:
 ?xml version='1.0'?
 info
   element name='rq:question'
  ...
  element name='rq:questionGroup' property='questions' /
   /element
 /info
 
 public class Questions {
 private List questions = new ArrayList();
 public Iterator getQuestions() {
 return questions.iterator();
 }
 public void addQuestion(Question question) {
 questions.add(question);
 }
 public int size() {
 return questions.size();
 }
 }
 
 Questions Betwixt:
 ?xml version='1.0'?
 info
   element name='rq:questionGroup'
   element property='questions'
  updater='addQuestion' /
   /element
 /info
 
 
 This could be applied to your objects quite easily.
 Hope this helps.
 
 Ryan -
 
 
 
 
 
 
  Hi,
 
  I am trying to model a budget as a tree structure.
 
  For example:
 
  A1   [parent] Eligible costs
  A1.1 [parent] Personnel
  A1.2 [parent] Travel and accomodation
  A1.2.1   [parent] Travel
  A1.2.1.1 [Leaf]   Travel - London Brussels 19/11/2005
  A1.2.1.2 [Leaf]   Travel - Amsterdam Brussels 21/11/2005
 
 
  Expense-categories are non-leaf items in the tree (modelled by the java
  class BudgetNonLeafItemImpl) and individual expense items are leaves
  (BudgetLeafItemImpl ).
 
 
  Both types of node have many fields and operations in common which they
  inherit from a common base class (BaseBudgetItemImpl).
 
  A simplified skeleton of the source code looks like the follows:
 
  public  abstract class BaseBudgetItemImpl   {
  public abstract boolean isLeafItemType();
  //…
  }
 
  public class BudgetLeafItemImpl extends BaseBudgetItemImpl {
  /** Is this an item at the extremity of the tree - yes always */
  public boolean isLeafItemType() { return true; }
  //…
  }
 
 
  public class BudgetNonLeafItemImpl extends BaseBudgetItemImpl {
 
  /** Is this an item at the extremity of the tree - no never */
  public boolean isLeafItemType() { return false; }
 
  public List getChildren() { …}
 
 public BaseBudgetItemImpl addChild(BaseBudgetItemImpl child) { …}
 
 private ArrayList children = new ArrayList();  // holds references to
  leaf- or non-leaf items !
 //…
  }
 
 
  Does it make sense to try to use Betwixt to read/write (round-trip) such a
  structure or would another tool (Castor ?) be better for the job ?
 
  I started trying to write the xml and this works fine (see actual output
  from an attempted round-trip of the more complex real classes below).  I
  managed to read  back the root node but none of the children get restored.
 
  The basic question is if Betwixt can handle the recursive relationship -
  the root node will be of type non-leaf and this will contain a mixture of
  leaf and non-leaf items in the children collection.  The non-leaf nodes
  may of course then themselves have children of both types.
 
  Thanks,
  Richard SULLIVAN
 
 
 
 
  XML output:
  =?xml version=1.0?  budgetNonLeafItemImpl id=1
  child id=2
basicLayoutInfo id=3
  attachTo/
  tablefalse/table
/basicLayoutInfo
canAddOnlyLeavesfalse/canAddOnlyLeaves
descriptions/
leafItemTypefalse/leafItemType
mandatorytrue/mandatory
optionalId/
titleA1.1 Personnel/title
toolTipText/
usageNotes/

Re: LogConfigurationException NullPointerException

2005-11-03 Thread robert burrell donkin
On Thu, 2005-11-03 at 01:27 +, Ramu Srinivasan wrote:
 Hi,

hi

please remember to prefix with your subject

 I am using ant to build my EAR which is deployed in WAS 5.1. Log4J isn't 
 getting initialized and I get the following exception. But it works file when 
 I build the EAR file with WASAD. At one point, I know it was working with ANT 
 build. Any help on this will be appreciated. Thanks in advance.

sounds a little bit mysterious...

IIRC the latest code from trunk has a fix in for something similar. if
you haven't done this already please retry after build from SVN or from
a recent nightly. details about how to so this can be found linked from
http://jakarta.apache.org/commons.

- robert


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



Re: Betwixt : flavours for complex objects

2005-11-02 Thread robert burrell donkin
On Tue, 2005-11-01 at 07:58 -0600, Ryan McGuinness wrote:
  I have an issue with objects and flavours, and need to know where to
  look. I have read the docs, and the source, at this point it still is
  unclear.
 
  I have two objects
 
  public Object1 {
  private String name;
  Object2 property1 = new Object2();
  ...
  }
 
  public Object2 {
  private String attr1;
  private String attr2;
  }
 
  in my .betwixt file, I have a definition:
 
  object1.betwixt
  info
  element name='my-first-object'
  element name='my-name' property='name'
  option
  namevalue/name
  valuemyValue/value
  /option
  /element
  element name='my-object' property='property1'
  option
  namevalue/name
  valuemySecondValue/value
  /option
  /element
  /element
  /info
 
  I have written a custom StringConverter, and I can see which flavours
  are being passed, and which are not.
  basically, I do not get a flavour when I am calling the complex type
  (property1).

as the code stands now, this is expected.

  Do I have to create a ClassConverter? or do I have to modify some base
  class? or is there a plugable approach that I can take for this.

not ATM. probably need to add some kind of option inheritance for this
use case.

options are posted onto a stack. ATM only access to the top of the stack
is possible. probably need to be able to access options down the stack.
it would be easy (and backwards compatible) to add a method to context
that searched the stack and returned the first option value matching a
particular name. 

opinions?

  I need a flavour for this custom object because in one output I have to
  create:
 
  my-object attr1='somevalue' /
 
  and in another
 
  my-object
  attr1value1/attr1
  attr2value2/attr1
  /my-object

this is a structural change

i think that the quickest way to get this working would be to use
multi-mappings
(http://jakarta.apache.org//commons/betwixt/guide/binding.html#Multi%
20Mapping). for each output type, define the mappings for object one and
object two within the same multi-mapping.

if you are caching XmlBeanInfo's then you'll need to maintain a separate
registry for each mapping.

- robert


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



Re: HttpClient: can it cause too many open files ?

2005-11-02 Thread robert burrell donkin
On Wed, 2005-11-02 at 18:03 -0500, Zhaohua Meng wrote:
 HttpClient gugus,
 
 
 I have a HttpClientEngine (see code listing at the bottom ) which wraps 
 commons HttpClient. It is used as following in my code deployed on SuSe 
 Linux.
 
 for (int i=0; irequests.length; i++)  }
 HttpClientEngine engine = new HttpClientEngine ();
 response = engine.doPost(requests[i]);
 //code to process response
 }
 
 In real situation t he request loop can be as big as 500+. After the code 
 running for a while I got too many open files exception. I know in Linux 
 a stream is considered a file. 

have you checked the number of file descriptors available?

(i'll not bore the list with the details: how to do this is easily found
on google)

many linux distributions now ship with default allocations which are far
too low for any serious server usage. so, this is usually my first port
of call when this issue crops up.

- robert


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



RE: Commons-Betwixt : Few Queries

2005-10-27 Thread robert burrell donkin
On Wed, 2005-10-26 at 08:41 +0200, Alex wrote:
 Xstream is used in Axis Project, there you would find so many examples.

to the best of my knowledge, xstream does not play a major role in
either axis version. axis 1 uses castor. axis 2 uses xmlbeans amd jibx.

but that's not to say it's not a good choice for serialization rather
than mapping.

- robert 


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



Re: [betwixt] Only use idref for == objects, not for equal objects

2005-10-26 Thread robert burrell donkin
On Tue, 2005-10-25 at 13:35 +0200, Wim Deblauwe wrote:
 ok. What do you exaclty mean by saying that betwixt is a bean mapper (not
 an xml serializer)? Do you believe there are better options for serializing
 and deserializing java-objects to/from xml?

serializers just concentrate on serializing and deserializing the object
state into xml and back again. in many ways, they are alternatives to
the standard java xml serialization mechanism. typically, little
flexibility or control is offered over the xml outputted. a example of a
good object serializer is http://xstream.codehaus.org. 

a (start-from-java) mapper attempts to map objects into arbitrary xml.
mappers offers more powerful and flexible mappings than serializers but
the price is paid in complexity. 

betwixt is bean-centric: it's default mappings and strategies are based
in properties. other mappers are field-centric: for example
http://jibx.sourceforge.net.

hope this helps

BTW if you're attending http://www.apachecon.com/2005/US/ Thomas Dudziak
will be giving a talk called Java-XML Binding Approaches at Apache. this
will cover the full range of mapping, serializing and binding approaches
and techniques. 

- robert


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



Re: [betwixt] Only use idref for == objects, not for equal objects

2005-10-24 Thread robert burrell donkin
On Sun, 2005-10-23 at 14:05 +0200, Wim Deblauwe wrote:
 ok, thanks. This will be in the 0.8 release then I guess? Any idea when this
 will happen?

nope :)

been a few months and the last of tasks done since the last release is
quite long so if there's demand out there, i suppose we could look at
cutting one sometime in the near future.

- robert


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



Re: [betwixt] Books on Betwixt

2005-10-22 Thread robert burrell donkin
On Tue, 2005-10-18 at 00:38 -0700, Konstantin Priblouda wrote:
 
 --- Sameer Nanda [EMAIL PROTECTED] wrote:
 
  I am still looking for good books on Betwixt, anyone
  wants to recommend any
  good books !!!
 
 I'm not aware of them.  Try to look in O'Reily or
 Manning publishing.  

to the best of my knowledge there are no books exclusively on betwixt.

there are quite a number of books on jakarta and jakarta commons which
include some coverage of betwixt. see
http://wiki.apache.org/jakarta-commons/JakartaCommonsResources?
highlight=%28book%29 or google.

for those attending apacheconUS (http://www.apachecon.com/), Thomas
Dudziak will be including betwixt amongst his Java-XML Binding
[EMAIL PROTECTED] session. 

- robert


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



Re: [betwixt] Only use idref for == objects, not for equal objects

2005-10-22 Thread robert burrell donkin
On Mon, 2005-10-17 at 10:12 +0200, Wim Deblauwe wrote:
 Hi,
 
 Betwixt outputs idref attributes for objects that are equal. It would be
 better if it only used idref for objects that are the same reference (==).
 Because when you use Betwixt now to serialize 2 equal objects, they turn
 into the same object after deserialization. So you have a different
 situation.

betwixt is a bean mapping (not an xml serializer). using equals is
therefore a reasonable default. 

 This problem can easily be solved by replacing the use of HashMap in
 AbstractBeanWriter with IdentityHashMap.

since the 0.7 release, this has been factored out into IdStoringStrategy
but as wim rightly says, using an implementation which is backed by
IdentityHashMap will give the behaviour required. i've added a
convenience constructor to DefaultIdStoringStrategy to make this a
little easier.

- robert


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



Re: Apache betwixt

2005-10-09 Thread robert burrell donkin
On Thu, 2005-10-06 at 15:44 -0700, vladimir lenin wrote:
 Hello,

hi vladimir

 I am trying to use Betwixt to parse an XML document
 with elements from more than one namespace. But I am
 running into problems. Does Betwixt support
 namespaces? 

yes

at the moment, there are no strategies so you'll need to create dot
betwixt files. (though the strategies would be easy to do.)

 if so, can someone please provide me a
 simple example that reads an XML with namespaces and
 converts it into a javabean

you just need to add uri attributes to the appropriate parts of the dot
betwixt file.

- robert

public class SimpleBean {
private String alpha;
private int beta;
public String getAlpha() {
return alpha;
}
public void setAlpha(String alpha) {
this.alpha = alpha;
}
public int getBeta() {
return beta;
}
public void setBeta(int beta) {
this.beta = beta;
}


}

?xml version='1.0' encoding='UTF-8' ?

info
element name=simple
uri='http://jakarta.apache.org/commons/betwixt/example'
element name='alpha'
uri='http://jakarta.apache.org/commons/betwixt/example'
property='alpha' /
element name='beta'
uri='http://jakarta.apache.org/commons/betwixt/example'
property='beta' /
/element
/info


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



Re: Fwd: Managing XML Output from Betwixt

2005-10-06 Thread robert burrell donkin
those of us who use filter will pick up questions much quicker if you
prefix the subject (add [betwixt]). see
http://wiki.apache.org/jakarta-commons/JakartaCommonsEtiquette.

On Mon, 2005-10-03 at 11:46 -0400, Sameer Nanda wrote:
 Well thanks again Russell,
 
 Whatever you said is true, I can either rename my Class to a lowercase
 authorization (but then I am breaking the naming convention for writing Java
 classes which I dont wanna do) , and I could also run the replaceAll() on
 the XML string generated to replace all Authorization to authorization
 (but that would be a hack).
 
 My point here is, it shouldnt have to be like that ... theres gotta be
 something in Betwixt using which I can do this. I mean this is just one
 example I am talking here, I have to generate much more complex XML
 documents which would involve a lot of Java Bean Objects, which in turn
 would contain a bunch of other Java Beans. Do you know what I mean?

there are two different (complementary) ways to configure betwixt. you
can use strategies
(http://svn.apache.org/repos/asf/jakarta/commons/proper/betwixt/trunk/src/java/org/apache/commons/betwixt/strategy/)
 to influence generic behaviour and dot betwixt files to specify mappings for a 
particular class. these strategies are set on the appropriate configuration 
objects (IntrospectionConfiguration on XMLIntrospector for introspection time 
strategies, BindingConfiguration for bind time strategies).

in general, to change the way that betwixt maps java names to xml names,
you need to replace the default NameMapper strategy.
CapitalizeNameMapper probably does what you need.

- robert


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



Re: [betwixt] Cannot make collections work

2005-09-21 Thread robert burrell donkin
On Fri, 2005-09-16 at 11:07 +0200, Holger Haag wrote:
snip
 Hello Robert,
 
 thank you very much for the information and your time. I actually have 
 the same problems with maps and lists, so maybe the map example was not 
 the best choice.
 
 The problem remains pretty much the same:
 
 I am trying to serialize and deserialize a List (generic ArrayList)  
 using betwixt (version 0.6). Serialization (Converting the bean to XML) 
 works fine but  deserialization does not. The map is always empty. To 
 isolate the problems I have created a unit test which should succeed but 
 ... fails.

sorry for misleading you before: it appears that the tiger generics work
fine (at least on my machine) without any further work. 

could you retry with the latest code from HEAD? 

either roll your own - which is very easy with maven
(http://maven.apache,org) and svn (see
http://www.apache.org/dev/svn-anon.html,
http://www.apache.org/dev/svn-faq.html and http://svnbook.red-bean.com/)
- or download a recent nightly
(http://cvs.apache.org/builds/jakarta-commons/nightly/)

- robert


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



Re: [betwixt] Cannot make collections work

2005-09-20 Thread robert burrell donkin
On Fri, 2005-09-16 at 11:07 +0200, Holger Haag wrote:
 robert burrell donkin wrote:
 On Wed, 2005-09-14 at 23:23 +0200, Holger Haag wrote:

 Hello Robert,
 
 
 thank you very much for the information and your time. I actually have 
 the same problems with maps and lists, so maybe the map example was not 
 the best choice.
 
 The problem remains pretty much the same:
 
 I am trying to serialize and deserialize a List (generic ArrayList)  
 using betwixt (version 0.6). Serialization (Converting the bean to XML) 
 works fine but  deserialization does not. The map is always empty. To 
 isolate the problems I have created a unit test which should succeed but 
 ... fails.

i suspect that the problem with the arrays is different from that with
the maps. the java 5 templates are probably not recognised by the
betwixt introspection code. i try to find time to add this functionality
but it might be a day or two.

- robert


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



Re: [betwixt] Specify a certain class in a betwixt file

2005-09-01 Thread robert burrell donkin
On Thu, 2005-09-01 at 14:10 +0200, Thomas Dudziak wrote:
 On 9/1/05, Wim Deblauwe [EMAIL PROTECTED] wrote:
 
  is it possible to specify a certain type of class in you betwixt file that
  the introspector should use?
 
 Not sure whether really helps, but you might want to try the
 mappingDerivation attribute for your element:
 
 mappingDerivation='introspection'
 
 see here for more info:
 
 http://jakarta.apache.org/commons/betwixt/guide/derived.html

there is a strategy which allows class substitution
(http://jakarta.apache.org/commons/betwixt/guide/binding.html#Introspection%20And%20Normalization)
 but not forced substitution in a betwixt file.

try setting the 'type' property for the element. though not guaranteed,
it may work.

otherwise, i suggest downloading the latest source from SVN, building
and running an IDE debugging and examine the results of the
introspection. just run XMLIntrospector.introspect and take a look at
the element descriptor for maximum in the XmlBeanInfo. 

- robert


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



Re: Betwixt - convert XML to a bean Collection

2005-08-21 Thread robert burrell donkin
i think that this is caused by a bug which has now been fixed. could you
try again using either the code from HEAD or a recent nightly?

- robert

On Fri, 2005-08-19 at 07:25 -0700, Cristiane Fogaça wrote:
 Hi,
 
 Does anybody know how to convert an XML to a
 Collection of beans?
 
 Here is the XML that I have:
 
 ProjectReviews
   ProjectReviewStatus
 commentsnew status with date/comments
 createdByCristiane/createdBy
 createdOn2005-08-18 13:32:17.562/createdOn
 projectStatusIn Process/projectStatus
   /ProjectReviewStatus
   ProjectReviewStatus
 commentsanother comment/comments
 createdByCristiane II/createdBy
 createdOn2005-08-18 13:32:17.562/createdOn
 projectStatusIn Process/projectStatus
   /ProjectReviewStatus
 /ProjectReviews
 
 
 I'm trying to do something like this:
 beanReader.registerBeanClass(ProjectReviews,
 ArrayList.class);
 ArrayList reviews =
 (ArrayList)beanReader.parse(xmlReader);
 
 Anything is returned and no error is throw. What is
 wrong with this code?
 
 Thanks for any help.
 Cristiane
 
 
 
   
 
 Start your day with Yahoo! - make it your home page 
 http://www.yahoo.com/r/hs 
 
 
 -
 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: [betwixt] Time and memory performance

2005-08-09 Thread robert burrell donkin
On Tue, 2005-08-09 at 01:36 -0700, Kirill Grouchnikov wrote:
 I'm soory, but i am really tired of this fruitless dispute.

i for one am very glad at that. i'm also glad that you finally got round
to giving your plug for JAXB2 (bit slow, i thought). 

 This will be my last mail on below issues.

a refusal to correct factual inaccuracies speaks volumes :)

   Take a look at
   http://jakarta.apache.org/commons/betwixt/dependencies
  and
   note the following line:  The following is a list of
   dependencies for this project. These dependencies are
   required to compile and run the application. It may be
  not
   your fault, but once i want to use betwixt, i'm stuck
  with
   all these jars.
  
  you're missing my point: resolver.jar and which.jar are
  not on that
  list. your summary is inaccurate. if you're going to take
  on the role of
  critique then it is important for your credibility that
  you make
  accurate comments in your summary.
 
 Going from
 http://jakarta.apache.org/commons/betwixt/dependencies.html
 to the link on xml commons and to its download section
 http://xml.apache.org/mirrors.cgi . DL the
 xml-commons-1.0.b2.tar.gz file. It contains three jars,
 xml-apis.jar, resolver.jar and which.jar. Nowhere on
 Betwixt site i've seen that i must take only xml-apis.jar.

you downloaded some files from xml-commons (the wrong files BTW) and
didn't like the names they had. betwixt has no dependency on them, just
a dependency on a SAX parser. so, your comment is factually inaccurate.
and yet, you still refuse to rephrase your inaccurate and misleading
comment.

so, please change the comment to 'misleading documentation' or whatever.

  if your basic complaint is that the size of the
  dependency tree is a
  negative: great! just say that. 
 
 In What are the factors that you use for ease-of-use
 scoring? section of FAQ you can see that distinct names of
 jar files are part of rating. Number of jar files isn't.

you FAQ is an interesting document. it seems to be very creative in
rating some points (for example, jar names) whilst ignoring others (such
as how hard the generation process is). 

i also note that you felt the need to defend yourself against criticism
for many of your controversial ratings. seems i'm not alone in believing
that if you improved your methodology then your criticisms would be
taken more seriously.

snip
  
 #   the marshaler and the unmarshaler require
specifying
 root xml tag name

this is inaccurate. betwixt does not require specific
root tags.
   
   Taken from
  
 
 http://jakarta.apache.org/commons/betwixt/guide/examples.html
   :
   
   // Write example bean as base element 'person'
   beanWriter.write(person, new PersonBean(John Smith,
   21));
   
   // Register beans so that betwixt knows what the xml is
  to
   be converted to
   // Since the element mapped to a PersonBean isn't
  called
   the same, 
   // need to register the path as well
   beanReader.registerBeanClass(person,
  PersonBean.class);
  
  this describes how the example works. 
  
  do you intend to replace your inaccurate line with
  something more
  accurate like: poor example code (or something).
 
 Once again, going to What are the factors that you use for
 ease-of-use scoring? section of FAQ - Documentation
 (not Javadocs). If you have poor documentation, you have
 poor library. Period.

you chose to write something that is factually incorrect: betwixt does
not require specific root tags. 

i do find it surprising that you refuse to correct specific factual
inaccuracies and this gives me reason to doubt your sincerity. i have
made no complaints about your low score (as a subjective rating, that is
your right) and would not have complained had you commented about the
documentation. you did not.

you project would have much great impact if it were not so partisan and
if you took the trouble to replace inaccurate comments. for the record,
betwixt is not the only entry which has inaccuracies.

snip

IMO it would be much more illuminating if you listed
  the
natural
weaknesses of start-from-java binders (as you see
  them)
separately and
then just classify those which adopt this approach. 
   
   How about a link from the main page at
   https://bindmark.dev.java.net/ (to Ronald Bourret
  site)?
  
  your site does not try to apply any classify to them,
  though. Ronald
  seems to take a little bit of an unusual way to do it but
  any
  classification would be better than none.
 
 The project is a benchmark, not a classificator.

but if you are so sure that generative start-from-java solutions are so
much superior for all applications then why not create some benchmarks
which are not systematically biased against start-from-java solutions.

or are you just a little afraid of xstream?  

 #   if ByteArrayOutputStream is used for
 
 #   default log level for BeanReader is INFO 

this is inaccurate. the default log level depends on
  your

Re: [betwixt] Time and memory performance

2005-08-08 Thread robert burrell donkin
On Sun, 2005-08-07 at 07:06 -0700, Kirill Grouchnikov wrote:
 Robert,
 
  all dynamic binders by their nature require tuning.
  though your benchmarks are useful for generative binders,
  they not all
  that informative for the dynamic binders. all dynamic
  binders are slow
  (since they use reflection). what's crucial (for users)
  is whether they
  can be tuned. two sets of benchmarks (vanilla and tuned)
  would be more
  interesting and useful for the dynamic binders. 
 
 To see what exactly? 

there are occasions when a dynamic binder is more useful than a
generative one. it's not good picking a dynamic binder that does not
have adequate performance when tuned.

 That the default options of some
 dynamic binder are not good? Why are they default then?

it's the nature of dynamic binding: a generator has (by definition) all
the information that they require at generation time. dynamic binders
only know what they are binding at run time. the real advantage of
dynamic binders is that they are much more flexible than generative
ones. 

in the specific case of betwixt, it needs to play well with other
frameworks and so lacks 

 
   2. If it takes a first-time user that looks at the
  examples
   more than 4-5 hours to make the library even work,
  chances
   are that this user will no longer be a user.
  
  i would expect most users either to follow the example as
  documented or
  know that private static inner classes are inaccessible. 
 
 I understand the reflection limitations, but the marshaler
 goes half way (emits the attribute names, but not values,
 and doesn't provide errors at all), while the unmarshaller
 fails completely. It's either all go, or no go.
 
  
  i would also not expect most users to use
  ByteArrayOutputStream  unless
  they knew enough about it to realise the need to flush
  the stream.
 
 Thankfully, i realised that, having worked a lot with BAOS.
 However, if i need to close BeanWriter, it should be in the
 docs.
 
   3. BeanReader is not reusable, producing empty results
   after the first unmarshaling. 
  
  SAX is by it's nature single threaded. so there really
  isn't too much to
  gain by pooling readers. 
 
 Is it mentioned anywhere in the docs?
 
  
   4. It says in the documentation that
  XMLBeanInfoRegistry is
   the default choice, so how do i share them and why it's
  not
   on the first page of the documentation?
  
  the slowest part of the process is introspection. though
  bean readers
  are no reusable, registries are reusable and can be
  shared. 
 
 Three replies later, and i still don't see an example of
 doing this.
 
   The team is (once again) more than welcome to see the
   source code and to send me the corrections, which will
  be
   incorporated, assessed and published.
  
  does this include correcting the mistakes on the
  ease-of-use page?
 
 Currently, the following entries are on the ease-of-use
 page. I don't see any mistakes there yet.
 
 # requires writing your own classes
 This can be viewed as either a negative or as a positive.
 You can say that i can take all my classes and just feed
 them to Betwixt with no changes. Obviously, this is not so
 - the conventions for get/set pairs (for both simple and
 list attributes) are pretty rigid. On the other hand, if i
 start working with external system that provides its
 interface description as schemas (which is a very standard
 way of doing this, and believe me when i say it, because
 this is where i work), i'd like to just generate those
 intermediate classes from a schema without the need to
 create hundreds of classes manually.
 
 #   xml-commons jar files (resolver.jar and which.jar) have
 common names which can easily lead to jar name collision
 The jar naming *is* a big concern once you start to use
 open source libraries *and* your own. The names should be
 clear and unequivocal.
 
 #   the marshaler needs to explicitly add xml header
 Call this petty, but why should i add this by myself?
 
 
 #   the marshaler and the unmarshaler require specifying
 root xml tag name
 Once again, may sound petty, but why should i treat root as
 something different? If the an object of the same class
 appears elsewhere in the hierarchy, you are not requiring
 me to provide you the name, so what's different?
 
 #   example docs use deprecated functions
 (setAttributesForPrimitives, setWriteIDs, setMatchIDs)
 The project examples should be *the first* to get rid of
 deprecated functions. If you don't do it, what it says
 about the status of deprecation?
 
 #   can not correctly handle private static inner classes
 I understand the reflection limitations, but the marshaler
 goes half way (emits the attribute names, but not values,
 and doesn't provide errors at all), while the unmarshaller
 fails completely. It's either all go, or no go.
 
 #   if ByteArrayOutputStream is used for marshaling, the
 BeanWriter must be close()'d to see the xml, unlike
 StringWriter
 The documentation in its current state says 

Re: [betwixt] Time and memory performance

2005-08-08 Thread robert burrell donkin
On Sun, 2005-08-07 at 07:12 -0700, Kirill Grouchnikov wrote:
  IMO your project would be far more effective if it didn't
  suffer so much
  from being obviously just one man's opinions. setting
  yourself up as a
  expert without taking great care to ensure that you
  understand the
  subject and that your criticisms are accurate is to
  invite attacks on
  your personal integrity. 
 
 Another thing - the last answer in the FAQ [1] would be the
 best answer to the poorly-disguised personal attack above.

it wasn't intended to be a personal attack. as i said off-list, i decide
to give you the benefit of the doubt though others may not. if you
really want to achieve the gaols you state, then i'd recommend that you
adopt a more positive attitude. 

 Suffices to say that developers of a number of other
 libraries have taken a different approach - seeing the
 assessment as a chance of learning from their potential
 users instead of looking down on them from high above.

you've picked up a few things missing from the documentation. thanks for
that. 

i had hoped that in return i might help to open your mind a little to
other approaches to data binding. there is a real lack of knowledge out
there about which general approaches are most appropriate to which
problems. i had hoped that you might be able to step up and but that
will mean casting aside the advocacy but maybe i've just been wasting my
time...

- robert


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



Re: [betwixt] Time and memory performance

2005-08-08 Thread robert burrell donkin
On Sun, 2005-08-07 at 07:06 -0700, Kirill Grouchnikov wrote:
 Robert,

kirill

 #   xml-commons jar files (resolver.jar and which.jar) have
 common names which can easily lead to jar name collision
 The jar naming *is* a big concern once you start to use
 open source libraries *and* your own. The names should be
 clear and unequivocal.

this is inaccurate: betwixt ships only one jar commons-betwixt.

 #   the marshaler needs to explicitly add xml header
 Call this petty, but why should i add this by myself?

this is accurate but is a feature :)

betwixt deals with fragments not documents

 #   the marshaler and the unmarshaler require specifying
 root xml tag name

this is inaccurate. betwixt does not require specific root tags.

 Once again, may sound petty, but why should i treat root as
 something different? If the an object of the same class
 appears elsewhere in the hierarchy, you are not requiring
 me to provide you the name, so what's different?

it isn't different: dynamic binders make a guess and may have to be
corrected through configuration

 #   can not correctly handle private static inner classes

this is accurate but misleading. the java language prevents
construction. don't you feel a little silly listing that as a negative
point?

 I understand the reflection limitations, but the marshaler
 goes half way (emits the attribute names, but not values,
 and doesn't provide errors at all), while the unmarshaller
 fails completely. It's either all go, or no go.

i disagree (and i'm in good company). start-from-java binders typically
adopt a do-what-you-can approach. this is why start-from-java binders do
not guarantee to be able to round trip. 

IMO it would be much more illuminating if you listed the natural
weaknesses of start-from-java binders (as you see them) separately and
then just classify those which adopt this approach. 

 #   if ByteArrayOutputStream is used for marshaling, the
 BeanWriter must be close()'d to see the xml, unlike
 StringWriter
 The documentation in its current state says nothing about
 using BAOS and need to explicitly close BeanWriter. I had
 to figure out this one by myself.

inaccurate: *all* streams and readers should be closed.

 #   default log level for BeanReader is INFO 

this is inaccurate. the default log level depends on your environment.

 and it
 produces messages on the examples (and real code) which can
 be turned off only via configuration
 Now this *is* a major issue. I don't want a 3rd party to
 pollute my logs, especially since everything went smoothly.
 In addition, commons logging is *way* too complicated. You
 can say here that it figures out everything on its own, but
 there is simply no option to turn it off in every possible
 system configuration except creating your own logger and
 putting it on BeanReader).

it's clear from comments about other libraries that you view the use of
JCL as a major negative point. fine. IMO it would be much clearer just
to say 'uses commons-logging' as a negative for each that does rather
than list some inaccurate specific.

i'll be interested to see whether you decide to correct the inaccuracies
in your summary listed above. 

- robert


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



Re: [betwixt] Time and memory performance

2005-08-08 Thread robert burrell donkin
On Mon, 2005-08-08 at 13:43 -0700, Kirill Grouchnikov wrote:
 Robert, 
 
   #   xml-commons jar files (resolver.jar and which.jar)
  have
   common names which can easily lead to jar name
  collision
   The jar naming *is* a big concern once you start to use
   open source libraries *and* your own. The names should
  be
   clear and unequivocal.
  
  this is inaccurate: betwixt ships only one jar
  commons-betwixt.
 
 Take a look at
 http://jakarta.apache.org/commons/betwixt/dependencies and
 note the following line:  The following is a list of
 dependencies for this project. These dependencies are
 required to compile and run the application. It may be not
 your fault, but once i want to use betwixt, i'm stuck with
 all these jars.

you're missing my point: resolver.jar and which.jar are not on that
list. your summary is inaccurate. if you're going to take on the role of
critique then it is important for your credibility that you make
accurate comments in your summary.

if your basic complaint is that the size of the dependency tree is a
negative: great! just say that. 

you could make great improvement to the site by separating out the
advocacy and linking to it. you dislike the xml-commons stuff and think
stuff should be better named: fine. put it in a link and say some simple
and true like 'has a big dependency tree'.
 
   #   the marshaler and the unmarshaler require
  specifying
   root xml tag name
  
  this is inaccurate. betwixt does not require specific
  root tags.
 
 Taken from
 http://jakarta.apache.org/commons/betwixt/guide/examples.html
 :
 
 // Write example bean as base element 'person'
 beanWriter.write(person, new PersonBean(John Smith,
 21));
 
 // Register beans so that betwixt knows what the xml is to
 be converted to
 // Since the element mapped to a PersonBean isn't called
 the same, 
 // need to register the path as well
 beanReader.registerBeanClass(person, PersonBean.class);

this describes how the example works. 

do you intend to replace your inaccurate line with something more
accurate like: poor example code (or something).

   Once again, may sound petty, but why should i treat
  root as
   something different? If the an object of the same class
   appears elsewhere in the hierarchy, you are not
  requiring
   me to provide you the name, so what's different?
  
  it isn't different: dynamic binders make a guess and may
  have to be
  corrected through configuration
  
   #   can not correctly handle private static inner
  classes
  
  this is accurate but misleading. the java language
  prevents
  construction. don't you feel a little silly listing that
  as a negative
  point?

snip

 If you remove setAccessible, you get access exception, but
 with them (silly me), it works like magic.

thanks for the information. i did ask you previously on the list but
you've decided to play a little game, i see! how amusing :)

   I understand the reflection limitations, but the
  marshaler
   goes half way (emits the attribute names, but not
  values,
   and doesn't provide errors at all), while the
  unmarshaller
   fails completely. It's either all go, or no go.
  
  i disagree (and i'm in good company). start-from-java
  binders typically
  adopt a do-what-you-can approach. this is why
  start-from-java binders do
  not guarantee to be able to round trip. 
 
 Except that in this case you just could go all the way
 (silly me for noticing this).

no, silly me for thinking that you might actually be engaged in honest
intelligent evaluation rather than submarine advocacy.

  IMO it would be much more illuminating if you listed the
  natural
  weaknesses of start-from-java binders (as you see them)
  separately and
  then just classify those which adopt this approach. 
 
 How about a link from the main page at
 https://bindmark.dev.java.net/ (to Ronald Bourret site)?

your site does not try to apply any classify to them, though. Ronald
seems to take a little bit of an unusual way to do it but any
classification would be better than none.

   #   if ByteArrayOutputStream is used for marshaling,
  the
   BeanWriter must be close()'d to see the xml, unlike
   StringWriter
   The documentation in its current state says nothing
  about
   using BAOS and need to explicitly close BeanWriter. I
  had
   to figure out this one by myself.
  
  inaccurate: *all* streams and readers should be closed.
 
 Back to
 http://jakarta.apache.org/commons/betwixt/guide/examples.html
 and write example. Can you spot a close() for me?

thanks for the spot. i'll add one.
 
   #   default log level for BeanReader is INFO 
  
  this is inaccurate. the default log level depends on your
  environment.
 
 And my environment is pretty standard (it has commons
 logging and JDK 5.0). 

then why not actually clarify the statement so it's true?
 
   and it
   produces messages on the examples (and real code) which
  can
   be turned off only via configuration
   Now this *is* a major issue. I don't want a 3rd party
  to
  

Re: [betwixt] Time and memory performance

2005-08-07 Thread robert burrell donkin
On Sat, 2005-08-06 at 10:14 -0700, Kirill Grouchnikov wrote:
 Robert,
 
 You are more then welcome to provide the correct use of
 Betwixt for optimal time and memory footprint. There are
 couple of things that you should be aware of:
 
 1. The default options should be the best ones. If i need
 to tweak the settings, most of the chances are that i'll
 miss it (as i did). 

all dynamic binders by their nature require tuning.

though your benchmarks are useful for generative binders, they not all
that informative for the dynamic binders. all dynamic binders are slow
(since they use reflection). what's crucial (for users) is whether they
can be tuned. two sets of benchmarks (vanilla and tuned) would be more
interesting and useful for the dynamic binders. 

 2. If it takes a first-time user that looks at the examples
 more than 4-5 hours to make the library even work, chances
 are that this user will no longer be a user.

i would expect most users either to follow the example as documented or
know that private static inner classes are inaccessible. 

i would also not expect most users to use ByteArrayOutputStream  unless
they knew enough about it to realise the need to flush the stream.

 3. BeanReader is not reusable, producing empty results
 after the first unmarshaling. 

SAX is by it's nature single threaded. so there really isn't too much to
gain by pooling readers. 

 4. It says in the documentation that XMLBeanInfoRegistry is
 the default choice, so how do i share them and why it's not
 on the first page of the documentation?

the slowest part of the process is introspection. though bean readers
are no reusable, registries are reusable and can be shared. 

 The team is (once again) more than welcome to see the
 source code and to send me the corrections, which will be
 incorporated, assessed and published.

does this include correcting the mistakes on the ease-of-use page?

not only is the betwixt entry inaccurate but i've noticed mistakes in
several others as well. IMO it's sloppy methodology not to post your
comments to the project in question first so that you have a chance to
correct your mistakes before they are made public. by labelling a
document as subjective does not excuse inaccuracies. 

 The personal biases are outlined for all to see in the
 project FAQ, and everyone can draw his / her own
 conclusions on the weapon of choice.

IMO your project would be far more effective if it didn't suffer so much
from being obviously just one man's opinions. setting yourself up as a
expert without taking great care to ensure that you understand the
subject and that your criticisms are accurate is to invite attacks on
your personal integrity. 

the project would also be more useful if you tried to educate users
about how to choose the most suitable binder for their problem. 

you show a consistent bias against start-from-java binders in favour of
start-from-schema binders. for example, you consistently list 'Requires
writing your own classes' as a negative point but this is the whole
point of start-from-java binders! if you don't like start-from-java
binders, it would be more honest to write this at the top of the page.

this bias extends to the benchmarks as well. i would be interested to
see additional benchmarks organised to hit the start-from-java hot spot
rather than the start-from-schema one. 

i also find your treatment of JAXB binders confusing. not only do you
confuse the specification with the reference implementation but
shouldn't all implementations be equally easy to use?

your ratings of the generative binders also do not seem to accord with
experience. JAXB is known to be a difficult specification to work with.
i think that most people would be very surprise to see the JAXB
implementations rated so highly in terms of ease of use. i note that you
acknowledge this in the FAQ. 

- robert


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



Re: [betwixt] Sample code not working

2005-08-06 Thread robert burrell donkin
On Fri, 2005-08-05 at 08:34 -0700, Kirill Grouchnikov wrote:
 So, two things that finally made the code work:
 
 1. Betwixt can not handle private static inner classes as
 beans, only public static inner classes. 

betwixt uses standard java reflection to create classes. AFAIK private
inner classes cannot be created by reflection. does anyone know a trick
that does this?

 This is true even
 if the marshalling is done in the outer class which has
 immediate access to its private static class. 

AIUI the code in which the call is initiated is not relevant for
security when using reflection: only the security manager.

 Is it a bug?

that depends on what you mean :)

it's certainly a limitation but not an unexpected one. i'd like to be
able to add support for private inner classes but i don't know the trick
(and won't spend much time looking at a problem that i suspect has no
solution)...

 2. Using ByteArrayOutputStream as an underlying stream for
 BeanWriter requires closing the BeanWriter (unlike the case
 with StringWriter) to produce the XML. 

have you tried calling flush or close on the beanwriter?

 Is it a bug?

probably not. 

you can write more than one bean to the same stream therefore betwixt
does not flush the stream until requested. you should call close or
flush on bean write (or on the stream) when you're done.

probably this should be in the documentation, though. anyone want to
submit a patch?

 3. Why the default configuration of BeanReader produces
 INFO messages?

good question :)

i was wondering that myself. i'm of the opinion that users should ignore
messages of INFO and below unless they are trying to diagnose a problem.
so, you should not be concerned about INFO messages. i suspect that most
of the other developers who've worked on betwixt think in a similar
fashion. i don't think that this is written down anywhere, though.

creating a logging policy then going through and ensuring that the
logging is high quality is certainly a task that needs to be done before
a betwixt 1.0 can be produce. i'll add this to the task list. 

this should be pretty easy (and educational). any volunteers?

  Why do i need to see them, and how do i
 change the log level *programatically (without property
 file)* not to see them?

betwixt uses JCL (http://jakarta.apache.org/commons/logging) which is a
thin bridging API. configuration of the log output is left entire to the
logging system bridged to. so, you need to figure which logging system
JCL is bridging to then work out whether and how you can change the
settings of that logging system programatically. 

if you don't explicitly configure JCL then it will try to guess which
logging system you're using and bridge to that automatically. if have
log4j on the classpath, that'll be used otherwise if you're using java
1.4+ then java.util logging will be used. for more details, read the JCL
documentation.

- robert


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



Re: [email] progress on 1.0 release?

2005-08-02 Thread robert burrell donkin
On Tue, 2005-08-02 at 12:14 -0700, Eric Pugh wrote:
 First off, I'll start with a mea culpa.  As one of the people who  
 picked up commons-email and moved it from commons-sandbox into  
 commons proper, and a committer on the Turbine project where commons- 
 email came from, I should have done a better job.  My only excuse/ 
 reason was some personal issues came up during my attempt to release  
 1.0 that pretty much shut down all my activity on OSS stuff.
 
 However, at this point, I have cleared the decks, and am ready to  
 get back into being active on the Jakarta Commons community.   I'll  
 take a look at the updated list of changes, including the ones that  
 Siegfried sent me directly in an attempt to get some movement done!

cool

 IIRC, my big difficulty a couple months ago when trying to do the  
 release was I just switched to OSX, and didn't get the whole key  
 signing thing...   

i've been working on key signing documents for the foundation site and
i've used macOSX since the public beta. so, if you don't grok keys yet,
i'd be glad to help.

 I am at OSCON this week, if any other Commons  
 committers are there I bet we could do a bit of pair programming and  
 knock out updated RC and 1.0 this week...

i'm in sunny yorkshire (so that rules me out) but +1 to the concept

 Being as the code has sat for a while since the last 1.0 vote thread  
 passed months ago, I would do another RC first.

the good news is that we already have a recent RC:
http://people.apache.org/~rdonkin/commons-email/

i rolled the release as a stand in for dion (who has been going through
some difficult times lately...)

AIUI the major question remaining is which of the proposed significant
additions to the API should be added before the 1.0. IIRC they are
listed in bugzilla and dion is in favour of one of them. (please check
the recent emails for details).

- robert


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



[ANNOUNCEMENT] Right Commons-Cli 1.0 Jar Now In Java Repository

2005-08-01 Thread robert burrell donkin
For many months, the Apache java repository has contained an unofficial
snapshot named commons-cli-1.0 rather than the official 1.0 release.
This jar has been mirrored to ibiblio and made available through Maven
as commons-cli-1.0. I'd like to extend apologies to you all on behalf of
the Jakarta team for this mistake. Sorry.

The existing jar has now been replaced by the official 1.0 release.
(This change may take several hours to work it's way through to the
mirrors.) Maven users who use commons-cli directly or indirectly may be
effected by this change. It is recommended that maven users should wait
24 hours (to allow the mirrors to sync) and then delete the version of
commons-cli in their local repository. They should then rebuild and
retest their code. It is recommended that all who can should switch to
use the official release.

There is a small risk that some code may be broken by this change.
However, is no reason to suspect that the original jar has been tampered
with: it is just wrongly named. For those who require it, it is
available as commons-cli-20040117.00 from ibiblio
(http://www.ibiblio.org/maven/commons-cli/jars/commons-cli-20040117.00.jar).
 Some users may need to update their project.xml to use this version (rather 
than the official release).

Please direct any questions to the user list at Jakarta Commons
(http://jakarta.apache.org/site/mail.html).

Robert


signature.asc
Description: This is a digitally signed message part


Re: [Betwixt] Customizing Vector binding with dot betwixt file

2005-07-31 Thread robert burrell donkin
On Tue, 2005-07-26 at 18:25 +0200, Rodrigo Partearroyo wrote:
 I´m trying to serialize a Vector of Strings. They are the security-roles
 allowed to access some part of my webapp. The output i need is this:
 
 security-roles
 security-role rol=rol1 /
 security-role rol=rol2 /
 security-role rol=rol3 /
 security-role rol=rol4 /
 /security-roles
 
 but all i can obtain is this:
 
 security-roles
 security-role rol=[rol1, rol2, rol3, rol4]/
 /security-roles
 
 The bean i'm using is :
 
 public class SecurityRolesBean {
 private Vector rolesList;
 public SecurityRolesBean (){
 rolesList = new Vector();
 }
 public Vector getRolesList(){
 return rolesList;
 }
 public void setServiceRole(String role){
 setRolesList(role);
 }
 private void setRolesList(String rol){
 rolesList.addElement(rol);
 }
 }
 
 and the dot betwixt file:
 
 ?xml version=1.0?
 info
 element name=security-roles
 element name=security-role
 attribute name='rol' property='rolesList'/
 /element
 /element
 /info
 
 The question is: How can i put each of the Vector's elements (which are
 Strings) in separate xml elements?

that 'attribute' tag needs to be an 'element' tag 

?xml version=1.0?
info
element name=security-roles
element name=security-role
element name='rol' property='rolesList'/
/element
/element
/info

 The inverse step (populating the Bean with data read from a xml file) is
 done with Digester following this rule:
 
 [...]
 pattern value=security-role
 set-properties-rule
 alias attr-name=rol prop-name=serviceRole /
 /set-properties-rule
 /pattern
 [...]
 
 Due to Digester cannot perform the inverse operation (writting beans to
 xml files) i´m trying to move it to Betwixt, but the xml format cannot
 change.

betwixt should handle this pretty easily. you'll need to add the name of
the adder to be used to the dot betwixt file 

?xml version=1.0?
info
element name=security-roles
element name=security-role
element name='rol' property='rolesList' adder='setServiceRole'/
/element
/element
/info

please take a look at the documentation
(http://jakarta.apache.org/commons/betwixt) for more details.

- robert


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



RE: [email] progress on 1.0 release?

2005-07-28 Thread robert burrell donkin
On Thu, 2005-07-28 at 16:34 +1200, Simon Kitching wrote:
 On Wed, 2005-07-27 at 22:25 +0100, robert burrell donkin wrote:
  it's rare that any initial release candidate survives scrutiny from the
  commons release maestros so i'm sure that an RC6 will have to be rolled
  anyway.
  
  i'm just rolling the cuts for dion so i'd appreciate some guidance on
  this from those who know the code better. opinions?
 
 From looking at the patch
   http://issues.apache.org/bugzilla/show_bug.cgi?id=35881
 this is a fairly significant change to the email API.
 
 I think this is definitely something that should be done by the main
 product maintainer, not someone just volunteering to roll RCs.

+1

 I would suggest that either 1.0 go out without this change, or 1.0 be
 delayed until the real email maintainer(s) have properly investigated
 this, considered any backwards compatibility issues, etc.

i'm willing to let this one ride for a little while, i think. the
release candidate's only just out so there's no real reason why a
decision needs to be taken just yet.

 And as Troy Poppe mentions, if 35881 is being considered for 1.0 then
 perhaps 34056 should be as well.

+1

- robert


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



[ANNOUNCEMENT] Jakarta-Commons Betwixt 0.7 Released

2005-07-27 Thread robert burrell donkin
The Jakarta Commons Team is pleased to announce the latest release of
common-betwixt from Apache.

Betwixt is a flexible, dynamic, start-from-beans xml-object binder. For
more information on Betwixt, please see
http://jakarta.apache.org/commons/betwixt/.

Betwixt 0.7 is a feature release adding numerous new features. It is
binary compatible with the last release (0.6) but there are a small
number of semantic changes. It is believed that these should have
minimal impact on existing users but these users are advised to read the
release notes.

Binary and source distributions can be download from
http://jakarta.apache.org/site/downloads/downloads_commons-betwixt.cgi.
Since the distributions are download from mirrors, please check the md5
sum and verify the detach signature using the files linked from the
download page (hosted on an ASF server).  

Robert


signature.asc
Description: This is a digitally signed message part


[ANNOUNCEMENT][email] commons-email release candidate 5 available

2005-07-27 Thread robert burrell donkin
the fifth release candidate for commons email is now available for
download from http://people.apache.org/~rdonkin/commons-email/.

feedback welcomed

- robert


signature.asc
Description: This is a digitally signed message part


Re: Corrupt Word File Upload

2005-07-25 Thread robert burrell donkin
hi ken

please read
http://wiki.apache.org/jakarta-commons/JakartaCommonsEtiquette and
remember to prefix your subject appropriately. most attachments are now
stripped so i'd suggest creating an issue in bugzilla
(http://issues.apache.org/bugzilla) and attaching the file to that. you
can then use the url in a followup post. 

- robert

On Mon, 2005-07-25 at 08:51 -0700, Ken D. Nelson wrote:
 HI All -
  
 I am using the File commons component.  I have run into an issue with
 upload Microsoft Files (Word/Excel).  It appears that files are being
 corrupted.  When I upload PDF or Text files, all is well - even large
 files (10 MB+).  Anyone have any idea's what may be causing this?  I
 have attached the served as.
  
 Ken
  
 -
 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: [email] progress on 1.0 release?

2005-07-24 Thread robert burrell donkin
On Sun, 2005-07-24 at 08:04 +1000, Dion Gillard wrote:
 On 7/24/05, robert burrell donkin [EMAIL PROTECTED] wrote:
  hi dion
  
  On Fri, 2005-07-22 at 21:13 +1000, Dion Gillard wrote:
   Yes. I have the source at a point where I'm happy to build an RC and
   make it available, however I have very limited time at that moment, as
   I'm spending a large amount of time with my father who is in critical
   care in hospital.
  
  i'm really sorry to hear that. please don't feel under any pressure to
  make time for ASF work at a time like this.
 
 ;-)
 
 I'm keeping really busy making sure my mum is ok at the moment.
 
  if you think that the code's fine, then i can easily cut the RC and so
  on if that'd make things easier for you. let me know.
 
 That would be fantastic.

i'll take a look at this today

- robert


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



Re: [Messenger] Abandonware?

2005-07-24 Thread robert burrell donkin
On Sun, 2005-07-24 at 10:33 -0400, Henri Yandell wrote:

snip

 As he was the only developer on Messenger, the one in Commons is
 effectively deprecated in favour of the Codehaus project. We need to
 come up with a dormancy process for the sandbox to make this more
 clear.

hi hen

managed to have a chat with some folks at apachecon and a reasonable
proposal emerged. i'll pull something together now on the wiki now. 

(flew home on thursday and ran out of time to do lots of things and see
lots of people - apologies if i missed you)

- robert


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



[all] archiving sandbox components [WAS Re: [Messenger] Abandonware?]

2005-07-24 Thread robert burrell donkin
On Sun, 2005-07-24 at 16:27 +0100, robert burrell donkin wrote:
 On Sun, 2005-07-24 at 10:33 -0400, Henri Yandell wrote:
 
 snip
 
  As he was the only developer on Messenger, the one in Commons is
  effectively deprecated in favour of the Codehaus project. We need to
  come up with a dormancy process for the sandbox to make this more
  clear.
 
 hi hen
 
 managed to have a chat with some folks at apachecon and a reasonable
 proposal emerged. i'll pull something together now on the wiki now. 

http://wiki.apache.org/jakarta-commons/ProposalSandboxPruning

comments welcomed

- robert


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



Re: [betwixt] Making deserialise work like serialise (long)

2005-07-24 Thread robert burrell donkin
(back from apachecon now)

On Fri, 2005-07-15 at 12:26 +0100, Ricardo Gladwell wrote:
 robert burrell donkin wrote:
  On Thu, 2005-07-14 at 17:46 +0100, Ricardo Gladwell wrote:
  it's a bit complicated by the fact that it's a release candidate (not a
  SNAPSHOT). release candidates should not be uploaded to ibiblio (or any
  other mirror). but thank's for the warning: i will remember to try to
  check that the maven repository is right when the full release is cut.
 
 Please do update it for the final release: so few project maintainers do 
 properly update the Maven repository and that extra work is really 
 appreciated by us downstream Maven users :) Shouldn't the Maven 
 repository have the latest CVS code in it's snapshot release, though?

AIUI the apache releases at the maven repository at ibiblio are sync'd
from the from the apache repository. apache only allows full official
releases to be served from that repository. snapshots are uploaded by
the maven team manually but are not official apache releases. it is
common for snapshots to be out of date.

  FYI the release candidate is very close now to being accepted as betwixt
  0.7. it is strongly recommended that all users upgrade to this new
  version.
 
 I'm confused by the above: some of the artefacts in the maven repository 
 are listed as 1.0-dev and -beta, yet 0.7 will be the next release version?

when betwixt was originally promoted from the sandbox, the number was
1.0 and the alpha was cut. the numbering system was then revised to
reflect more accurately the actual state of the betwixt (of release
quality but with an unstable interface and feature incomplete) starting
with 0.5 so that users requiring full, official releases could use
betwixt.

see http://jakarta.apache.org/commons/betwixt/

  In the end, I cheated and hard-coded XPath to read specific bank
  accounts using the BeanReader.registerBeanClass method:
  
  it is possible to make betwixt work that way (you can integrate it with
  digester rules) but it's pretty black belt...
 
 Not sure what else to do at this point (BTW, what does black belt 
 mean? I'm familiar but not sure). 

just a friendly way of saying expert user :)

 Even the above does not seem to be 
 working.

you'll find it tough because you need to use additional digester rules.
there are a lot of wrinkles and so i won't recommend that you go down
this path...

  Some sort of
  intelligent comparison between the betwixt file and the bean object
  model would be required to interpolate expected behaviour. Perhaps some
  sort of additional scripting would be required?
  
  scripting sounds very interesting (hadn't really thought about it
  before). betwixt is generally declarative but maven's mix of declarative
  data and scripting works very well. how do you see this working?
 
 Actually, I was thinking an entirely different approach might be 
 required: instead of having a XML configuration file describing how to 
 convert a bean to XML (one way) it would be better to map individual 
 properties to XML constructs using xdoclet tags or annotation, as in 
 Hibernate. This ensures relationships are two way and more easily 
 reversible. For example:
 
 /**
   * @betwixt.xml
   *path=bankAccount/bankAccount-AT
   */
 public class AustrianBankAccount {...}
 
 Would mean that an occurrences of AustrianBankAccount could be clearly 
 read and written as bankAccountbankAccount-AT... for example without 
 any confusion over how it should be interpreted.

it is possible that support for annotations may be added sometime (maybe
soonish) but betwixt still needs to know which classes you intend to
include. 

i now suspect that the problem is that polymorphic mappings are
supported fully only for collectives. (i added more information to the
documentation:
http://jakarta.apache.org/commons/betwixt/guide/derived.html#Mapping%
20An%20Element%20To%20A%20Class%20Name which might help explain what i
mean). i'll try to find some time to add this feature this week (but i
can't promise when). if anyone wants to jump in and volunteer to code
this feature, it'd probably speed things up and i'd provide help.

- robert


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



RE: [betwixt] AddDefaultsRule bug in 0.7RC2

2005-07-24 Thread robert burrell donkin
On Thu, 2005-07-14 at 16:25 -0500, Glenn Goldenberg wrote:
 hi robert:
 
  you help's appreciated. if (in future) you want to help to speed the
  process of application, please read
  http://jakarta.apache.org/site/getinvolved.html and consider creating
  some patches (once you get the hang of them, you'll find them easier
  than describing things in words). if you find your emails are getting a
  little long, then you could open a report in
  http://issues.apache.org/bugzilla/ (if you like) and then follow up on
  list .
 
 Thanks, I will take a look at this for contributing in the future...
 
  BTW are you happy to contribute your test cases (which i've deleted from
  the bottom of this mail) to apache? (saves me having to create fresh
  ones.) just FYI if you attach the apache software license 2.0 to the top
  of any new classes you post then i won't have to ask ;)
 
 Sure, no problem.  Glad you can use the tests.

(back from apachecon now which was very cool BTW)

great. thanks. 

- robert


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



  1   2   3   4   5   >