-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: Problem with NamedQuery
PostPosted: Mon Aug 23, 2010 4:38 pm 
Newbie

Joined: Mon Aug 23, 2010 4:29 pm
Posts: 2
Hi,

I have the following NamedQuery in an Entity

import java.io.Serializable;
import javax.persistence.Entity;
import javax.persistence.NamedQuery;
import javax.persistence.Table;



@Entity
@Table(name="VW_OFA_MCI")
@NamedQuery(name="vwOfaResultadoMci.buscarTodos" ,
query="SELECT v FROM VwOfaResultadoMci v")
public class VwOfaResultadoMci extends AbstractDomainObject implements
Serializable {


When I deploy wiht the namedquery annotation i get this error:

Its very strange!!!

2010-08-23 17:25:08.596 ERROR J2EE EJB-03027 [NCA-Ofa_Dummy] An error occured deploying EJB module:
com.evermind.server.ejb.exception.DeploymentException: [NCA-Ofa_Dummy:nca.ofa-dummy-business] - Exce
ption creating EntityManagerFactory using PersistenceProvider class org.hibernate.ejb.HibernatePersi
stence for persistence unit nca.ofa-dummy.
2010-08-23 17:25:08.634 NOTIFICATION application : NCA-Ofa_Dummy is in failed state
10/08/23 17:25:08 WARNING: Application.setConfig Application: NCA-Ofa_Dummy is in failed state as in
itialization failed.
java.lang.InstantiationException: Error initializing ejb-modules: [NCA-Ofa_Dummy:nca.ofa-dummy-busin
ess] - Exception creating EntityManagerFactory using PersistenceProvider class org.hibernate.ejb.Hib
ernatePersistence for persistence unit nca.ofa-dummy.
10/08/23 17:25:08 oracle.oc4j.admin.internal.DeployerException: java.lang.InstantiationException: Ap
plication: NCA-Ofa_Dummy is in failed state as initialization failed
10/08/23 17:25:08 at oracle.oc4j.admin.internal.ApplicationDeployer.addApplication(Application
Deployer.java:518)
10/08/23 17:25:08 at oracle.oc4j.admin.internal.ApplicationDeployer.doDeploy(ApplicationDeploy
er.java:199)
10/08/23 17:25:08 at oracle.oc4j.admin.internal.DeployerBase.execute(DeployerBase.java:93)
10/08/23 17:25:08 at com.evermind.server.ApplicationServerTask.deploySingleFile(ApplicationSer
verTask.java:133)
10/08/23 17:25:08 at com.evermind.server.ApplicationServerTask.performAutoDeployCheck(Applicat
ionServerTask.java:97)
10/08/23 17:25:08 at com.evermind.server.ApplicationServerTask.run(ApplicationServerTask.java:
71)
10/08/23 17:25:08 at com.evermind.util.Task.schedule(Task.java:51)
10/08/23 17:25:08 at com.evermind.util.TaskManager.run(TaskManager.java:212)
10/08/23 17:25:08 at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(Releasabl
eResourcePooledExecutor.java:298)
10/08/23 17:25:08 at java.lang.Thread.run(Thread.java:595)
10/08/23 17:25:08 Caused by: java.lang.InstantiationException: Application: NCA-Ofa_Dummy is in fail
ed state as initialization failed
10/08/23 17:25:08 at com.evermind.server.Application.setConfig(Application.java:512)
10/08/23 17:25:08 at com.evermind.server.Application.setConfig(Application.java:355)
10/08/23 17:25:08 at com.evermind.server.ApplicationServer.addApplication(ApplicationServer.ja
va:1895)
10/08/23 17:25:08 at oracle.oc4j.admin.internal.ApplicationDeployer.addApplication(Application
Deployer.java:515)
10/08/23 17:25:08 ... 9 more
10/08/23 17:25:08 Caused by: java.lang.InstantiationException: Error initializing ejb-modules: [NCA-
Ofa_Dummy:nca.ofa-dummy-business] - Exception creating EntityManagerFactory using PersistenceProvide
r class org.hibernate.ejb.HibernatePersistence for persistence unit nca.ofa-dummy.
10/08/23 17:25:08 at com.evermind.server.ejb.EJBContainer.postInit(EJBContainer.java:1060)
10/08/23 17:25:08 at com.evermind.server.ApplicationStateRunning.initializeApplication(Applica
tionStateRunning.java:231)
10/08/23 17:25:08 at com.evermind.server.Application.setConfig(Application.java:454)
10/08/23 17:25:08 ... 12 more
10/08/23 17:25:08 Caused by: com.evermind.server.ejb.exception.DeploymentException: [NCA-Ofa_Dummy:n
ca.ofa-dummy-business] - Exception creating EntityManagerFactory using PersistenceProvider class org
.hibernate.ejb.HibernatePersistence for persistence unit nca.ofa-dummy.
10/08/23 17:25:08 at com.evermind.server.ejb.exception.DeploymentException.exceptionCreatingEn
tityManagerFactory(DeploymentException.java:130)
10/08/23 17:25:08 at com.evermind.server.ejb.persistence.PersistenceUnitManagerImpl.createCont
ainerEntityManagerFactory(PersistenceUnitManagerImpl.java:197)
10/08/23 17:25:08 at com.evermind.server.ejb.persistence.PersistenceUnitManagerImpl.initialize
PersistenceUnit(PersistenceUnitManagerImpl.java:159)
10/08/23 17:25:08 at com.evermind.server.ejb.persistence.PersistenceUnitManagerImpl.initialize
(PersistenceUnitManagerImpl.java:87)
10/08/23 17:25:08 at com.evermind.server.ejb.EJBPackageDeployment.initializePersistenceUnitMan
ager(EJBPackageDeployment.java:1055)
10/08/23 17:25:08 at com.evermind.server.ejb.EJBContainer.postInit(EJBContainer.java:841)
10/08/23 17:25:08 ... 14 more
10/08/23 17:25:08 Caused by: javax.persistence.PersistenceException: [PersistenceUnit: nca.ofa-dummy
] Unable to build EntityManagerFactory
10/08/23 17:25:08 at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configu
ration.java:677)
10/08/23 17:25:08 at org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFactor
y(HibernatePersistence.java:132)
10/08/23 17:25:08 at com.evermind.server.ejb.persistence.PersistenceUnitManagerImpl.createCont
ainerEntityManagerFactory(PersistenceUnitManagerImpl.java:192)
10/08/23 17:25:08 ... 18 more
10/08/23 17:25:08 Caused by: org.hibernate.HibernateException: Errors in named queries: vwOfaResulta
doMci.buscarTodos
10/08/23 17:25:08 at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:407)

10/08/23 17:25:08 at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:13
41)
10/08/23 17:25:08 at org.hibernate.cfg.AnnotationConfiguration.buildSessionFactory(AnnotationC
onfiguration.java:867)
10/08/23 17:25:08 at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configu
ration.java:669)
10/08/23 17:25:08 ... 20 more



ANY IDEAS PLEASE???????


Top
 Profile  
 
 Post subject: Re: Problem with NamedQuery
PostPosted: Tue Aug 24, 2010 3:33 pm 
Newbie

Joined: Mon Aug 23, 2010 4:29 pm
Posts: 2
Solved.

I added to my:

orion-application.xml

the following:

<import-shared-library name="hibernatejpa" />

and to:

server.xml

<shared-library name="hibernatejpa" version="1.0">
<code-source path="*"/>
</shared-library>
<shared-library name="global.tag.libraries" version="1.0" library-compatible="true">
<code-source path="../../home/jsp/lib/taglib/"/>
<code-source path="../../../j2ee/home/jsp/lib/taglib/"/>
<code-source path="../../../lib/dsv2.jar"/>
<import-shared-library name="oracle.xml"/>
<import-shared-library name="oracle.jdbc"/>
<import-shared-library name="oracle.cache"/>
<import-shared-library name="soap"/>
<import-shared-library name="hibernatejpa"/>
</shared-library>

and i created a directory called hibernatejpa inside shared-lib directory from oc4j home, and then a directory called 1.0 and there i copied
antlr-2.7.6.jar inside.

and that's it.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.