James,

I don't think that solution will work.
The compiler will have already resolved the ED reference to be the class 
in the segment package.
Merely deleting that class will not cause it to resolve to the ED from 
the datatype package.
I think the only solution is to recompile the UAC.java class with the 
getUserAuthenticationCredential method replaced with the following text.

   public ca.uhn.hl7v2.model.v26.datatype.ED 
getUserAuthenticationCredential()  {
     ca.uhn.hl7v2.model.v26.datatype.ED ret = null;
     try {
         Type t = this.getField(2, 0);
         ret = (ca.uhn.hl7v2.model.v26.datatype.ED)t;
     } catch (ClassCastException cce) {
         HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected 
problem obtaining field value.  This is a bug.", cce);
         throw new RuntimeException(cce);
     } catch (HL7Exception he) {
         HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected 
problem obtaining field value.  This is a bug.", he);
         throw new RuntimeException(he);
     }
     return ret;
   }

Chris Selwyn

On 07/01/2010 02:45, James Agnew wrote:
> Hi Marc,
>
> Your analysis is exactly correct I would say, the problem is the
> conflicting segment class called "ED". This class shouldn't be there,
> it is created because of an unexpected row in the HL7 database which
> appears to be a bug with the database. Frank Oemig's (the maintainer
> of the HL7 database) website lists this as an old but unsolved issue
> in section 1.2 here: http://www.oemig.de/HL7/hl7v26fs.htm . I don't
> have a copy of the spec handy at the moment, but it might shed some
> light on this in section 7.11.2 as mentioned on Frank's page.
>
> Probably the right thing to do is to fix the structure JAR generator
> so that it doesn't generate this segment. I'll make this change for
> the next version of the HAPI. I am hoping to put out a new beta quite
> soon to fix a few issues including the one you mention where there
> seems to have been a problem with the build process, resulting in the
> jars for HL7 0.5.1 and 0.6 being empty.
>
> In the mean time probably your easiest fix would be to unzip the 0.6
> structures JAR, delete the ED.class in the segments package, and
> re-zip it up.
>
> Cheers,
> James
>
> On Tue, Jan 5, 2010 at 9:53 AM,<[email protected]>  wrote:
>    
>> Hello,
>>
>> I'm currently experiencing an exception showing up in log4j's log output :
>>
>> 15:05:57,516 ERROR UAC:56 - Can't instantiate
>> ca.uhn.hl7v2.model.v26.segment.UAC
>> ca.uhn.hl7v2.HL7Exception: Class ca.uhn.hl7v2.model.v26.segment.ED does not
>> inherit from ca.on.uhn.datatype.Type
>>
>> I have looked at the code in UAC class and found this :
>>
>> 060 ED ret = null;
>> 061 try {
>> 062 Type t = this.getField(2, 0);
>> 063 ret = (ED)t;
>> 064 } catch (ClassCastException cce) {
>>
>> This class is imporing all files in model.v26.datatype and happens to be
>> part of model.v26.segment, both contain a class called ED.
>>
>> Is it possible that UAC class is trying to cast the variable t of type Type
>> in the segment class ED instead of the datatype class ED thus resulting in
>> the ClassCastException ?
>>
>> Can anyone help me out ?
>> Thanks.
>>
>> PS : I'm using HAPI v0.6 because when downloading HAPI v1.0beta1 I have
>> gotten empty datatype and segment packages...
>>
>> *********************************
>> This message and any attachments (the "message") are confidential and
>> intended solely for the addressees.
>> Any unauthorised use or dissemination is prohibited.
>> Messages are susceptible to alteration.
>> France Telecom Group shall not be liable for the message if altered, changed
>> or falsified.
>> If you are not the intended addressee of this message, please cancel it
>> immediately and inform the sender.
>> ********************************
>>
>> ------------------------------------------------------------------------------
>> This SF.Net email is sponsored by the Verizon Developer Community
>> Take advantage of Verizon's best-in-class app development support
>> A streamlined, 14 day to market process makes app distribution fast and easy
>> Join now and get one step closer to millions of Verizon customers
>> http://p.sf.net/sfu/verizon-dev2dev
>> _______________________________________________
>> Hl7api-devel mailing list
>> [email protected]
>> https://lists.sourceforge.net/lists/listinfo/hl7api-devel
>>
>>
>>      
> ------------------------------------------------------------------------------
> This SF.Net email is sponsored by the Verizon Developer Community
> Take advantage of Verizon's best-in-class app development support
> A streamlined, 14 day to market process makes app distribution fast and easy
> Join now and get one step closer to millions of Verizon customers
> http://p.sf.net/sfu/verizon-dev2dev
> _______________________________________________
> Hl7api-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/hl7api-devel
>    

------------------------------------------------------------------------------
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev 
_______________________________________________
Hl7api-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/hl7api-devel

Reply via email to