-->
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: Redeploying Hibernate MBean with Enums cause exception
PostPosted: Tue Sep 09, 2003 6:36 pm 
Newbie

Joined: Tue Sep 09, 2003 6:19 pm
Posts: 9
Hi,

I'm using JBoss 3.2.1 with Hibernate 2.0.2. I'm using Hibernate's MBean. I'm getting the following exception when my application redeploys. I believe this to be the key to the problem: "The Enum name must be unique, 'OK' has already been added". I've defined a UserType using my own Enum. If I get rid of the Enum and use a String the application redeploys fine. Is there something I can do to make Hibernate redeploy with Enums?

TIA

17:14:00,523 WARN [ServiceController] Problem starting service jboss.jca:service=HibernateFactory,name=SessionFactory
java.lang.ExceptionInInitializerError
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at com.bmc.metropolis.domain.hibernate.StatusType.returnedClass(StatusType.java:31)
at net.sf.hibernate.type.CustomType.<init>(CustomType.java:53)
at net.sf.hibernate.type.TypeFactory.hueristicType(TypeFactory.java:149)
at net.sf.hibernate.cfg.Binder.getTypeFromXML(Binder.java:786)
at net.sf.hibernate.cfg.Binder.bindValue(Binder.java:354)
at net.sf.hibernate.cfg.Binder.propertiesFromXML(Binder.java:890)
at net.sf.hibernate.cfg.Binder.bindRootClass(Binder.java:294)
at net.sf.hibernate.cfg.Binder.bindRoot(Binder.java:1094)
at net.sf.hibernate.cfg.Configuration.add(Configuration.java:230)
at net.sf.hibernate.cfg.Configuration.addInputStream(Configuration.java:252)
at net.sf.hibernate.cfg.Configuration.addResource(Configuration.java:273)
at net.sf.hibernate.jmx.HibernateService.buildSessionFactory(HibernateService.java:160)
at net.sf.hibernate.jmx.HibernateService.start(HibernateService.java:131)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:549)
at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:966)
at $Proxy11.start(Unknown Source)
at org.jboss.system.ServiceController.start(ServiceController.java:392)
at sun.reflect.GeneratedMethodAccessor3.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:549)
at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:177)
at $Proxy5.start(Unknown Source)
at org.jboss.deployment.SARDeployer.start(SARDeployer.java:226)
at org.jboss.deployment.MainDeployer.start(MainDeployer.java:832)
at org.jboss.deployment.MainDeployer.start(MainDeployer.java:824)
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:640)
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:613)
at sun.reflect.GeneratedMethodAccessor23.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:549)
at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:177)
at $Proxy7.deploy(Unknown Source)
at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:302)
at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:458)
at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(AbstractDeploymentScanner.java:200)
at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.loop(AbstractDeploymentScanner.java:211)
at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.run(AbstractDeploymentScanner.java:190)
Caused by: java.lang.IllegalArgumentException: The Enum name must be unique, 'OK' has already been added
at org.apache.commons.lang.enum.Enum.<init>(Enum.java:168)
at com.bmc.util.enum.OrderedEnum.<init>(OrderedEnum.java:25)
at com.bmc.util.enum.OrderedDisplayableEnum.<init>(OrderedDisplayableEnum.java:26)
at com.bmc.metropolis.domain.Status.<init>(Status.java:18)
at com.bmc.metropolis.domain.Status.<clinit>(Status.java:36)
... 48 more


Top
 Profile  
 
 Post subject:
PostPosted: Wed Sep 10, 2003 12:01 pm 
Newbie

Joined: Tue Sep 09, 2003 6:19 pm
Posts: 9
FYI,

In http://www.hibernate.org/66.htmlUsing%20Hibernate%20with%20JBoss it suggests you put commons-lang.jar in ${JBOSS_HOME}/server/default/lib. Still learning JBoss but it appears that anything in this directory doesn't get redeployed which caused the problem. I moved commons-lang.jar to my deploy directory and the exception went away.


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.