Action里面的代码
public String queryGoodsreceipt(){
java.util.Properties props = new java.util.Properties();
props.put(javax.naming.Context.PROVIDER_URL,"iiop://localhost:2809/");
props.put(javax.naming.Context.INITIAL_CONTEXT_FACTORY,"com.ibm.websphere.naming.WsnInitialContextFactory");
InitialContext ctx;
try {
ctx = new InitialContext(props);
GoodsreceiptdetailEJBLocal goodsreceiptdetailEJBLocal = (GoodsreceiptdetailEJBLocal) ctx.lookup("ejblocal:com.quantong.code.ejb.GoodsreceiptdetailEJBLocal");
GoodsreceiptEJBLocal goodsreceiptEJBLocal = (GoodsreceiptEJBLocal) ctx.lookup("ejblocal:com.quantong.code.ejb.GoodsreceiptEJBLocal");
StoreEJBLocal storeEJBLocal = (StoreEJBLocal) ctx.lookup("ejblocal:com.quantong.code.ejb.StoreEJBLocal");
String sql = "select g from Goodsreceiptdetail g where 1=1 ";
if(storeDesc != null && storeDesc.length()>0){
String sql1 = "select s from Store s where s.storeDesc = '"+storeDesc+"'";
System.out.println(storeDesc+"11111111111111111");
List<Store> store1=storeEJBLocal.getStoreBySql(sql1);
for(Store store1Temp:store1){
if(storeDesc.equals(store1Temp.getStoreDesc())){
storeCode=store1Temp.getStoreCode();
System.out.println(storeCode+"2222222222");
String sql2 = "select gg from Goodsreceipt gg where gg.storeCode = '"+storeCode+"'";
List<Goodsreceipt> goodsreceiptList=goodsreceiptEJBLocal.getGoodsreceiptBySql(sql2);
System.out.println(sql2+"333333333333");
for(Goodsreceipt goodsreceiptListTemp:goodsreceiptList){
sql += "and g.goodsreceiptId = '"+goodsreceiptListTemp.getGoodsreceiptId()+"'";
}
}else{
addFieldError(storeDesc, "你查询的库房名称不存在,请重新输入");
return ERROR;
}
}
}
System.out.println(sql+"444444444444");
List<Goodsreceiptdetail> goodsreceiptdetailList=goodsreceiptdetailEJBLocal.getGoodsreceiptdetailBySql(sql); for(Goodsreceiptdetail goodsreceiptTemp:goodsreceiptdetailList){
System.out.println(goodsreceiptTemp.getManufacturer()+"55555555555");
}
} catch (NamingException e) {
// TODO 自动生成 catch 块
e.printStackTrace();
}
return SUCCESS;
}
出现的异常
在调用 Bean“BeanId(CODEEAR#CODE.jar#GoodsreceiptdetailEJB, null)”上的方法“getGoodsreceiptdetailBySql”期间,EJB 抛出意外(未声明的)异常。异常数据:<openjpa-1.2.3-SNAPSHOT-r422266:965640 nonfatal user error> org.apache.openjpa.persistence.ArgumentException: 找不到类型“class java.lang.String”的任何元数据。此类未进行增强。
其中我在后台打印出来的System.out.println(sql+"444444444444");
也能够打印出来,就是不知道问题出在哪?恳请高手支招
------解决方案--------------------