You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tomee.apache.org by "Manu T George (JIRA)" <ji...@apache.org> on 2007/01/15 14:24:27 UTC

[jira] Commented: (OPENEJB-444) Starting and ending spaces not trimmed in openejb during unmarshalling of descriptors.

    [ https://issues.apache.org/jira/browse/OPENEJB-444?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12464775 ] 

Manu T George commented on OPENEJB-444:
---------------------------------------

Need to create a StringAdapter class as shown below

package org.apache.openejb.jaxb.adapters;

import javax.xml.bind.annotation.adapters.XmlAdapter;


public class StringAdapter extends XmlAdapter<String, String> {
    public String unmarshal(String val) throws Exception {
        return val.trim();
    }
    public String marshal(String val) throws Exception {
        return val.trim();
    }
}

Now in all the package-info classes we need to add the annotation
@javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter(value=org.apache.openejb.jaxb.adapters.StringAdapter.class,type=String.class)

This will fix this issue. Thanks to Dain for this very useful link
http://weblogs.java.net/blog/kohsuke/archive/2005/09/using_jaxb_20s.html


> Starting and ending spaces not trimmed in openejb during unmarshalling of descriptors.
> --------------------------------------------------------------------------------------
>
>                 Key: OPENEJB-444
>                 URL: https://issues.apache.org/jira/browse/OPENEJB-444
>             Project: OpenEJB
>          Issue Type: Bug
>          Components: deployment
>    Affects Versions: 3.0
>         Environment: All 
>            Reporter: Manu T George
>             Fix For: 3.0
>
>
> During unmarshalling, the leading and trailing whitespaces in the deployment descriptors are not trimmed

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