openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Praveen G" <praveenkumar.gan...@emagia.com>
Subject Exception while retrieving the data from database
Date Fri, 18 May 2007 15:27:03 GMT
Hello Pinaki/Patrick,

I am having following two classes 

@Entity
@Table(name = "LOG_DB2")
public class B extends A {
 @Column(name = "INSTANCE_NAME")
 private String instanceName;

 @Column(name = "DB2_TIMESTAMP")
 private Timestamp db2Timestamp;

 @Column(name = "DB_ALIAS")
 private String dbAlias;

 @Column(name = "DB_PARTITION")
 private int partitionNum;


@Entity
@Table(name = "LOG_DB2")
@MappedSuperclass
public class A {
 @Column(name = "LOG_ID")
 @Id
 @GeneratedValue(strategy=GenerationType.IDENTITY)
 private Long id;

 @Column(name = "TAG")
 private String tag;

 @Column(name = "SUBTAG")
 private String subtag;

I am able to store the data into database successfully where as I am facing the problem 
while retriveing the data from the database, the following is the code and highlighted the

problem area in the code

em=ServiceLocator.getOpenJPASession("pu1");
em.getTransaction().begin();
Query q = em.createQuery("select ad from B ad");
for (B l : (List<B>)q.getResultList()) {
 System.out.println("Host Name is : "+l.getHostName()+" Instance Name is "+l.getInstanceName());
 em.remove(l);
}
em.getTransaction().commit();

The following error occurs

<0.9.7-incubating nonfatal general error> org.apache.openjpa.persistence.PersistenceException:
null
 at org.apache.openjpa.kernel.BrokerImpl.find(BrokerImpl.java:857)
 at org.apache.openjpa.kernel.BrokerImpl.find(BrokerImpl.java:756)
 at org.apache.openjpa.jdbc.kernel.JDBCStoreManager.load(JDBCStoreManager.java:776)
 at org.apache.openjpa.jdbc.sql.AbstractResult.load(AbstractResult.java:257)
 at org.apache.openjpa.jdbc.sql.SelectImpl$SelectResult.load(SelectImpl.java:2152)
 at org.apache.openjpa.jdbc.sql.AbstractResult.load(AbstractResult.java:251)
 at org.apache.openjpa.jdbc.kernel.InstanceResultObjectProvider.getResultObject(InstanceResultObjectProvider.java:59)
 at org.apache.openjpa.lib.rop.EagerResultList.<init>(EagerResultList.java:36)
 at org.apache.openjpa.kernel.QueryImpl.toResult(QueryImpl.java:1219)
 at org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:987)
 at org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:796)
 at org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:766)
 at org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:762)
 at org.apache.openjpa.kernel.DelegatingQuery.execute(DelegatingQuery.java:517)
 at org.apache.openjpa.persistence.QueryImpl.execute(QueryImpl.java:230)
 at org.apache.openjpa.persistence.QueryImpl.getResultList(QueryImpl.java:269)
 at com.server.dao.audit.hibernate.AuditDAOImpl.purgeDebugMessages(AuditDAOImpl.java:196)
 at com.server.messageanalyzer.MessageAnalyzerManager.purgeDebugMessages(MessageAnalyzerManager.java:113)
 at com.server.mgmt.ConsoleManagement.purgeDebugMessages(ConsoleManagement.java:675)
 at com.server.mgmt.console.log.LogAnalyzerAction.execute(LogAnalyzerAction.java:217)
 at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:431)
 at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:236)
 at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
 at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)
 at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
 at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
 at com.server.mgmt.console.access.AuthorizationFilter.doFilter(AuthorizationFilter.java:70)
 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
 at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
 at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
 at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
 at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:175)
 at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74)
 at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
 at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
 at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
 at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
 at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
 at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
 at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
 at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
 at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
 at java.lang.Thread.run(Thread.java:803)
Caused by: 
java.lang.NullPointerException
 at org.jboss.mx.loading.RepositoryClassLoader.findClass(RepositoryClassLoader.java:620)
 at java.lang.ClassLoader.loadClass(ClassLoader.java:602)
 at org.jboss.mx.loading.RepositoryClassLoader.loadClassImpl(RepositoryClassLoader.java:464)
 at org.jboss.mx.loading.RepositoryClassLoader.loadClass(RepositoryClassLoader.java:405)
 at java.lang.ClassLoader.loadClass(ClassLoader.java:568)
 at com.server.dao.audit.A.pcCopyKeyFieldsFromObjectId(A.java)
 at com.server.dao.audit.B.pcNewInstance(B.java)
 at org.apache.openjpa.enhance.PCRegistry.newInstance(PCRegistry.java:121)
 at org.apache.openjpa.kernel.StateManagerImpl.initialize(StateManagerImpl.java:250)
 at org.apache.openjpa.jdbc.kernel.JDBCStoreManager.initializeState(JDBCStoreManager.java:330)
 at org.apache.openjpa.jdbc.kernel.JDBCStoreManager.initialize(JDBCStoreManager.java:255)
 at org.apache.openjpa.kernel.DelegatingStoreManager.initialize(DelegatingStoreManager.java:111)
 at org.apache.openjpa.kernel.ROPStoreManager.initialize(ROPStoreManager.java:57)
 at org.apache.openjpa.kernel.BrokerImpl.initialize(BrokerImpl.java:876)
 at org.apache.openjpa.kernel.BrokerImpl.find(BrokerImpl.java:834)

Please help me to resolve the above problem as soon as possible.

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