openxava出现异常,希望大家能帮忙解决!!!

  我用的是openxava框架,在本地测试可以成功  ,但是用osgi的felix就出现异常 。下面是正确方法的测试,可以成功!

 

一 , add方法

 

 @SuppressWarnings("unchecked")
 public boolean add(String filedName,String value){
  
  Map  map = new HashMap();
  
  map.put(filedName, value);
  
  boolean flag = false;

   try {
    MapFacade.create("Application",map);
  
    MapFacade.commit();
    flag = true;
    

   } catch (Exception e) {
    flag = false;
   }
   
   
  return flag;
  
  
 }

 

二,测试

public static void main(String[] args) {
 ApplicationProvider ap = new ApplicationProvider();
 
   System.out.println(ap.add("description","kebi"));--------------------这里进行方法调用可以成功
}
-------------------------------------------------------------------------

-------------------------------------------------------------------------

 

经过上面的测试可以把数据存到数据库中去

 

 

三, 但是我用osgi的felix客户端调用就会报异常

 

felix客户端的代码如下(自己手写的):

 

 

 public class Activator implements BundleActivator { -----------这是felix客户端的激活器代码

 

  private ServiceTracker st;


  public void start(BundleContext context) throws Exception {


  st = new ServiceTracker(context, ApplicationInterface.class.getName(), null) {


     public Object addingService(ServiceReference reference) {


      Object result = super.addingService(reference);


    ApplicationInterface h = (ApplicationInterface) context.getService(reference);


     System.out.println(h.add("description","kaobing"));----------在这里进行调用,后台就出现异常


    return "ss";

 

   }

 

  };

  st.open();
 }

 

 

四,异常如下:

 

警告: 在确定默认 schema (从persistence.xml中读出)时发生错误. 没有缺省的schema.
2011-1-13 0:05:08 org.openxava.annotations.parse.AnnotatedClassParser getManaged
ClassNames
警告: Hibernate连接无法工作, 因此 JPA managed classes 直接从classpath中获取
javax.persistence.PersistenceException: No Persistence provider for EntityManager named default

 

 

希望大家能提供帮助,谢谢!!!!!!!!!!

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章