GlassFish中有一个bug,假如你的项目所在目录包含中文,那么在调用会话Bean的远程商务方法传递自定义类型参数的时候,就会发生GlassFish中有一个bug,假如你的项目所在目录包含中文,那么在调用会话Bean的远程商务方法传递自定义类型参数的时候,就会发生"IOP02400001: (DATA_CONVERSION) 字符未映射至协商的传输代码集"这个异常!

我的应用是EJB+JPA+JSF,我的JSF的后台Bean——ShowBillListBB 在调用BillEOFacadeRemote 的findAll()传输数据的时候就出现了这个问题!以后目录一定要写成英文,连空格都不留!

/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/


package com.pz.entidao;

import com.pztest.entity.BillEO;
import java.util.List;
import javax.ejb.Remote;

/**
*
* @author bache
*/

@Remote
public interface BillEOFacadeRemote {

        void create(BillEO billEO);

        void edit(BillEO billEO);

        void remove(BillEO billEO);

        BillEO find(Object id);

        List<BillEO> findAll();

}

/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/


package com.pztest.backing;

import com.pz.entidao.BillEOFacadeRemote;
import com.pztest.entity.BillEO;
import java.util.List;
import javax.naming.Context;
import javax.naming.InitialContext;
import javax.naming.NamingException;

/**
*
* @author bache
*/


public class ShowBillListBB {
        private List<BillEO> billList;
        /** Creates a new instance of ShowBillListBB */
        public ShowBillListBB() throws NamingException {
                Context context = new InitialContext();
                BillEOFacadeRemote billDAO = (BillEOFacadeRemote) context.lookup("com.pz.entidao.BillEOFacadeRemote");
                billList = billDAO.findAll();
        }

        public List<BillEO> getBillList() {
                return billList;
        }

        public void setBillList(List<BillEO> billList) {
                this.billList = billList;
        }

}