openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From saidulu chitipolu <csai_in...@yahoo.co.in>
Subject Open JPA error-Could not locate metadata for the class using alias
Date Wed, 11 Apr 2007 18:23:09 GMT
Hi,
  
  I am trying to run standalone application access the database using spring ,openjpa.
  
  part of code in main method
  
  EntityManagerFactory factory = Persistence.createEntityManagerFactory("tsf");
        EntityManager em =  factory.createEntityManager();                 
        System.out.println("------///// "+em);      
       
          
        Query q = em.createQuery("select m from AbstractItemEntity m");
        List<AbstractItemEntity> absEntity=q.getResultList();
  
  facing the problem at 
        Query q = em.createQuery("select m from AbstractItemEntity m");
  
  we have persistance.xml and orm files.
  
  Log is as like below
  your earliest suggetions are valuable
  
  110  INFO   [main] openjpa.Runtime - Starting OpenJPA 0.9.6-incubating
  422  INFO   [main] openjpa.jdbc.JDBC - Using dictionary class "org.apache.openjpa.jdbc.sql.OracleDictionary".
  766  INFO   [main] openjpa.MetaData - Found 10 classes with metadata in 31 milliseconds.
  ------///// org.apache.openjpa.persistence.EntityManagerImpl@1c8b24d
  Exception in thread "main" <4|true|0.9.6-incubating>  org.apache.openjpa.persistence.ArgumentException:
Could not locate  metadata for the class using alias "AbstractItemEntity". Registered  alias
mappings: "{AbstractItemEntity=null}"
      at org.apache.openjpa.meta.MetaDataRepository.getMetaData(MetaDataRepository.java:343)
      at org.apache.openjpa.kernel.jpql.JPQLExpressionBuilder.getClassMetaData(JPQLExpressionBuilder.java:164)
      at org.apache.openjpa.kernel.jpql.JPQLExpressionBuilder.resolveClassMetaData(JPQLExpressionBuilder.java:142)
      at org.apache.openjpa.kernel.jpql.JPQLExpressionBuilder.getCandidateMetaData(JPQLExpressionBuilder.java:211)
      at org.apache.openjpa.kernel.jpql.JPQLExpressionBuilder.getCandidateMetaData(JPQLExpressionBuilder.java:181)
      at org.apache.openjpa.kernel.jpql.JPQLExpressionBuilder.getCandidateType(JPQLExpressionBuilder.java:174)
      at org.apache.openjpa.kernel.jpql.JPQLExpressionBuilder.access$500(JPQLExpressionBuilder.java:61)
      at org.apache.openjpa.kernel.jpql.JPQLExpressionBuilder$ParsedJPQL.populate(JPQLExpressionBuilder.java:1657)
      at org.apache.openjpa.kernel.jpql.JPQLParser.populate(JPQLParser.java:52)
      at org.apache.openjpa.kernel.ExpressionStoreQuery.populateFromCompilation(ExpressionStoreQuery.java:145)
      at org.apache.openjpa.kernel.QueryImpl.newCompilation(QueryImpl.java:642)
      at org.apache.openjpa.kernel.QueryImpl.compilationFromCache(QueryImpl.java:623)
      at org.apache.openjpa.kernel.QueryImpl.compileForCompilation(QueryImpl.java:589)
      at org.apache.openjpa.kernel.QueryImpl.compileForExecutor(QueryImpl.java:651)
      at org.apache.openjpa.kernel.QueryImpl.getOperation(QueryImpl.java:1464)
      at org.apache.openjpa.kernel.DelegatingQuery.getOperation(DelegatingQuery.java:120)
      at org.apache.openjpa.persistence.QueryImpl.execute(QueryImpl.java:202)
      at org.apache.openjpa.persistence.QueryImpl.getResultList(QueryImpl.java:251)
      at com.symcor.sis.tecp.dao.ExecuteDB.main(ExecuteDB.java:35)
  
  
       
---------------------------------
 Check out what you're missing if you're not on Yahoo! Messenger 
Mime
  • Unnamed multipart/alternative (inline, 8-Bit, 0 bytes)
View raw message