openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Hans J. Prueller" <hans.pruel...@gmx.net>
Subject RE: Forgot subject: Strange Could not locate metadata for the classError?
Date Fri, 23 Mar 2007 12:57:54 GMT
full stack trace (up until application specific stuff) is:

2007-03-22 21:34:53,287 : SEVERE : WorkThread-2/34 : Logger.log :
system exception in business method:
<4|true|0.9.7-incubating-SNAPSHOT>
org.apache.openjpa.persistence.ArgumentException: Could not locate
metadata for the class using alias "PositionLog". Registered alias
mappings: "{PositionLog=[class com.lbslogics.ims.model.PositionLog]}"
	at
org.apache.openjpa.meta.MetaDataRepository.getMetaData(MetaDataRepository.java:345)
	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:1668)
	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.datacache.QueryCacheStoreQuery.populateFromCompilation(QueryCacheStoreQuery.java:237)
	at
org.apache.openjpa.kernel.QueryImpl.newCompilation(QueryImpl.java:644)
	at
org.apache.openjpa.kernel.QueryImpl.compilationFromCache(QueryImpl.java:625)
	at
org.apache.openjpa.kernel.QueryImpl.compileForCompilation(QueryImpl.java:591)
	at
org.apache.openjpa.kernel.QueryImpl.compileForExecutor(QueryImpl.java:653)
	at org.apache.openjpa.kernel.QueryImpl.compile(QueryImpl.java:560)
	at
org.apache.openjpa.persistence.EntityManagerImpl.createNamedQuery(EntityManagerImpl.java:785)
	at
org.apache.openjpa.persistence.EntityManagerImpl.createNamedQuery(EntityManagerImpl.java:62)
	at com.lbslogics.ims.model.PositionLog.findById(PositionLog.java:175)
	at
com.lbslogics.ims.persistence.ejb.EventBean.getPositionLog(EventBean.java:2875)
         [ ... some more ]

The corresponding EventBean is a SLSB (EJB2.1) and the method looks like
that:

        /**
	 * 
	 * @return
	 */
	public PositionLog getPositionLog(final EntityManager em) {
		final PositionLog log = PositionLog.findById(em, getPositionLogId());
		return log;
	}

and the Positionlog.findById is a static method which encapsulates some
of the "technical work":

        public static PositionLog findById(EntityManager em, Long plId)
{
		Query q = em.createNamedQuery("PositionLog.byId");
		q.setParameter("id", plId);

		try {
			return (PositionLog) q.getSingleResult();
		} catch (javax.persistence.NoResultException e) {
			logger.finest("findById: did not find result for id=" + plId);
			return null;
		}
	}

This method or better the top-level entry point of this method is called
several hundred times for different records, all invoked by a MDB. Could
it be some concurrency issue because after several hundred invocations
only a single exception occured? 

Hans

Am Freitag, den 23.03.2007, 05:48 -0700 schrieb Patrick Linskey:

> Could you post the full stack trace, and maybe some code showing how
> you're invoking the JPA APIs?
> 
> -Patrick
> 

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message