[Persistence, JBoss/CMP, Hibernate, Database] - Re: JPA (hibernate) entity mapping problem in ear
by tperrigo
Some additional information (that didn't prove very illuminating to me). If I change the mapping from the Process entity to the ProcessType entity to the following, the deployment error goes away (well, actually, it goes to the next relationship between entities of this type, and then causes the same exception...but it does seem to have some effect):
Process entity (alternate mapping):
| @Column(name="process_type_id", nullable=false)
| private ProcessType processType;
|
I have no idea why the first way (which seems to be the encouraged way to handle such relationships) is not working, but this way does seem to work (or at least, gets past the current deployment error).
Just thought I should include this in case it helps anyone figure out what I might be doing wrong. I _really_ appreciate any help anyone might have...Thank you so much!
Tim
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4233395#4233395
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4233395
16 years, 11 months
[Persistence, JBoss/CMP, Hibernate, Database] - JPA (hibernate) entity mapping problem in ear
by tperrigo
I've got a jar file of JPA entities; they are mapped primarily using annotations, but, since we need to use them against several databases, we map the primary key field for each entity in an orm.xml file (so the key generation strategy can be properly specified; nothing else changes between databases).
We've been using the entities successfully for quite some time in a Java SE application. Now, though, as I am attempting to deploy the entity jar in the lib directory of an ear file (and the JPA mapping files in the META-INF directory), I am getting a strange error upon deployment from entities with bi-directional relationships. For example, we have a Process entity and a ProcessType entity; a Process can have only 1 ProcessType, but a ProccessType can have many associated Processes, so we mapped the bi-directional relationhip between Process and ProcessType as follows:
Process entity:
| @ManyToOne(fetch=FetchType.LAZY)
| @JoinColumn(name="process_type_id", nullable=false)
| private ProcessType processType;
|
ProcessTypeEntity:
| @OneToMany(mappedBy="processType", fetch=FetchType.LAZY)
| @JoinColumn(name="process_type_id", nullable=false)
| private Set<Process> processes;
|
As I mentioned, we have many relationships of this nature and have been using them without issue in a Java SE application for a couple of months now. When I attempt to deploy the entity jar (and mapping files) as part of an ear file (in JBoss 5.1.0.GA), I get the following error:
anonymous wrote :
| 1:14:11,047 ERROR [AbstractKernelController] Error installing to Start: name=persistence.unit:unitName=opt_process_control.ear/#logos state=Create
| org.hibernate.AnnotationException: @OneToOne or @ManyToOne on werner.opt.logos.config.Process.processType references an unknown entity: werner.opt.logos.global.ProcessType
|
This has me quite confused; I'm not even sure what I can test to narrow this down, since the exact same jar file works elsewhere, and the entities pass all their tests (there's a TestNG unit test for each entity, as well as a test for the bidirectional relationship between Process and ProcessType; all of the tests succeed). Please, please let me know if you see anything I've missed, or if you have any ideas for me to try. I truly appreciate your help!
Tim
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4233394#4233394
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4233394
16 years, 11 months
[Installation, Configuration & DEPLOYMENT] - Scheduler IllegalStateException while migrating jboss4 -> jb
by radimchatkalahari
Hi everyone,
I'm facing strange deployment problem while migrating from jboss 4.2.3
to jboss 5.1.0GA
I'm deploying myApp.ear file
containing META-INF\scheduler-service.xml
with content:
<?xml version="1.0" encoding="UTF-8"?>
| <server>
| <mbean code="org.jboss.varia.scheduler.Scheduler"
| name=":service=Scheduler,name=PingScheduler">
| <depends>jboss.j2ee:ear=mesbridlicna.ear,jar=mesbridlicnaEjb.jar,name=PingService,service=EJB3</depends>
| <attribute name="StartAtStartup">true</attribute>
| <attribute name="SchedulableMBean">jboss.j2ee:ear=mesbridlicna.ear,jar=mesbridlicnaEjb.jar,name=PingService,service=EJB3,type=ManagementInterface</attribute>
| <attribute name="SchedulableMBeanMethod">ping</attribute>
| <attribute name="InitialStartDate">NOW</attribute>
| <attribute name="SchedulePeriod">1000</attribute>
| <attribute name="InitialRepetitions">-1</attribute>
| <attribute name="FixedRate">true</attribute>
| </mbean>
| </server>
while this is OK on jboss 4.2.3
on 5.1.0GA it throws exception:
2009-05-26 20:15:50,218 ERROR [org.jboss.kernel.plugins.dependency.AbstractKernelController] (main) Error installing to Real: name=vfszip:/C:/bin/Java/jboss-5.1.0.GA/server/mes/deploy/myApp.ear/ state=PreReal mode=Manual requiredState=Real
|
| org.jboss.deployers.spi.DeploymentException: Error deploying: :service=Scheduler,name=PingScheduler
| at org.jboss.deployers.spi.DeploymentException.rethrowAsDeploymentException(DeploymentException.java:49)
| ...
|
| Caused by:java.lang.IllegalStateException: :name=PingScheduler,service=Scheduler is already installed.
| at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:716)
| at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:540)
| at org.jboss.system.ServiceController.doInstall(ServiceController.java:670)
| at org.jboss.system.ServiceController.install(ServiceController.java:273)
| at org.jboss.system.deployers.ServiceDeployer.deploy(ServiceDeployer.java:90)
| ... 35 more
After 5+ hours of googling, forum searching and experiments I have no more ideas how to try to solve this problem.
thanks
Radim
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4233393#4233393
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4233393
16 years, 11 months