[ 
http://jira.codehaus.org/browse/JIBX-279?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=169230#action_169230
 ] 

Hakam Sandhu commented on JIBX-279:
-----------------------------------

Hi Dennis, 
                  Apologies for not being clear in my first posting.  Here is a 
snippet of the setup:

    <mapping name="valuationScenario" 
class="com.test.valuations.impl.ValuationScenario" pre-get="preGet">
        <value style="attribute" name="id" field="id" usage="optional" 
ident="def" />
        <structure name="marketReference" field="marketReference" 
type="com.test.common.impl.IDReference" usage="optional">
            <value style="attribute" name="href" get-method="getHref" 
set-method="setHref"  type="com.test.valuations.impl.MarketEnvironment" 
ident="ref" usage="optional"/>      
        </structure>
    </mapping>


public class ValuationScenario implements IValuationScenario {
   private IDReference<IMarketEnvironment> marketReference;
...
}

public class IDReference<T> implements IIDReference<T> {
  private T href;
  public IDReference(T href) {
      this.href = href;
  }
   public IDReference() { }     
   public T getHref() {
         return href;
   }
   public void setHref(T href) {
        this.href = href;
   }
}

Error I get:

java.lang.IllegalAccessError: tried to access method 
com.test.valuations.impl.MarketEnvironment.JiBX_access_load_id_1_0()Ljava/lang/String;
 from class com.test.common.impl.IDReference
        at 
com.test.common.impl.IDReference.JiBX_binding_iml_marshalAttr_1_8(IDReference.java)
        at 
com.test.valuations.impl.ValuationScenario.JiBX_binding_iml_marshal_1_0(ValuationScenario.java)
        at 
com.test.valuations.impl.JiBX_binding_imlValuationScenario_access.marshal()
        at 
com.test.products.impl.JiBX_MungeAdapter.JiBX_binding_iml_marshal_1_35()


If I move IDReference into the same package as ValuationScenario - the errors 
disappears.
Under ValuationScenario, the private member variable marketReference does not 
have getter / setter methods.

The example here does raise another issue, which has been highlighted in the 
past, in that jibx still has problems with id's & ref, when using "ident". The 
problem I encounter is that some href's are optional. If there is no href, than 
the element shouldn't be created, jibx creates an empty element.

<valuationcSenario>
  <marketReference href="test1"/>
  <marketReference/>    <-- jibx does this when there is no href, this is due 
to the binding on the <structure>.                 
</valuationScenario>



> JIBX under Java 6
> -----------------
>
>                 Key: JIBX-279
>                 URL: http://jira.codehaus.org/browse/JIBX-279
>             Project: JiBX
>          Issue Type: Bug
>          Components: BindGen
>    Affects Versions: JiBX 1.2.1
>            Reporter: Hakam Sandhu
>            Assignee: Dennis Sosnoski
>
> There was a posting sometime ago by Jennifer Gau 
> [http://www.mail-archive.com/jibx-us...@lists.sourceforge.net/msg02888.html] 
> regarding problems with java 6 ( This problem does exist in 1.1.6a and 
> possible earlier).
> I can confirm that if the serialize/deserialize method are in the same 
> package as the class being unmarshalled, unmarshalling will be
> successful.  
> However, it appears you can get round this problem by runing the binding 
> twice on. I'm not sure if there are side effects to doing this, but it does 
> appear to fix the problem. I am using the jibx eclipse plugin to do the byte 
> code enrichment ( NB: with updated 1.2.1 jars).
> Ideally we should be able to build cleanly on 6, and not need bind multiple 
> times.
> Regards
> Hakam

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

------------------------------------------------------------------------------
Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are
powering Web 2.0 with engaging, cross-platform capabilities. Quickly and
easily build your RIAs with Flex Builder, the Eclipse(TM)based development
software that enables intelligent coding and step-through debugging.
Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com
_______________________________________________
jibx-devs mailing list
jibx-devs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jibx-devs

Reply via email to