Here is what I tried after reading your response on the JBoss forum:
1. I reverted back to List for the relationships. Initially I did
not remove the @IndexedColumn annotation.
I got the same error message 'index column null' while trying
to insert data into the tables.
2. I then removed the @IndexedColumn annotations and then the EJBs
would are not getting loaded by the server.
The error message reads:
org.hibernate.AnnotationException: List/array has to
be annotated with an @IndexColumn:
I had earlier started with Set to define the join fields after reading
the JBoss examples, but that did not work.
I did not use the IndexedColumn attribute then.
Here is source code:
------------------------
Application.java
-------------------
@Entity()
public class Application implements java.io.Serializable
{
private static final long serialVersionUID = 1L;
private int applicationId;
private String name;
private String description;
private List virtualRights;
private List administrators;
@Id (generate = GeneratorType.AUTO)
@Column (name = "applicationId")
public int getApplicationId() {
return applicationId;
}
public void setApplicationId(int applicationId) {
this.applicationId = applicationId;
}
@Column (name = "description")
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
@Column (name = "name")
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.EAGER,
mappedBy="application")
public List getVirtualRights() {
return virtualRights;
}
public void setVirtualRights(List virtualRights) {
this.virtualRights = virtualRights;
}
@ManyToMany (cascade = {CascadeType.PERSIST, CascadeType.MERGE}, fetch
= FetchType.EAGER)
@JoinTable(table = @Table(name = "Administrator"),
joinColumns = [EMAIL PROTECTED](name =
"applicationId")},
inverseJoinColumns = [EMAIL PROTECTED](name
= "userId")})
public List getAdministrators() {
return administrators;
}
public void setAdministrators(List administrators) {
this.administrators = administrators;
}
}
VirtualRight.java
-------------------
@Entity()
public class VirtualRight implements java.io.Serializable {
private static final long serialVersionUID = 1L;
private int virtualRightId;
private String name;
private String description;
private Application application;
private List rights;
private List appGroups;
private List customerRoles;
private List masterRoles;
@ManyToOne
@JoinColumn (name = "applicationId")
public Application getApplication() {
return application;
}
public void setApplication(Application application) {
this.application = application;
}
@Column (name = "description")
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
@Column (name = "name")
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
@Id (generate = GeneratorType.AUTO)
@Column (name = "virtualRightId")
public int getVirtualRightId() {
return virtualRightId;
}
public void setVirtualRightId(int virtualRightId) {
this.virtualRightId = virtualRightId;
}
@ManyToMany(cascade = {CascadeType.PERSIST, CascadeType.MERGE},
fetch = FetchType.EAGER, mappedBy="virtualRights")
public List getRights() {
return rights;
}
public void setRights(List rights) {
this.rights = rights;
}
@ManyToMany(cascade = {CascadeType.PERSIST, CascadeType.MERGE},
fetch = FetchType.EAGER, mappedBy="virtualRights")
public List getAppGroups() {
return appGroups;
}
public void setAppGroups(List appGroups) {
this.appGroups = appGroups;
}
@ManyToMany(cascade = {CascadeType.PERSIST, CascadeType.MERGE},
fetch = FetchType.EAGER, mappedBy="virtualRights")
public List getCustomerRoles() {
return customerRoles;
}
public void setCustomerRoles(List customerRoles) {
this.customerRoles = customerRoles;
}
@ManyToMany(cascade = {CascadeType.PERSIST, CascadeType.MERGE},
fetch = FetchType.EAGER, mappedBy="virtualRights")
public List getMasterRoles() {
return masterRoles;
}
public void setMasterRoles(List masterRoles) {
this.masterRoles = masterRoles;
}
}
server.log error message:
------------------------------
23:04:43,281 INFO [Environment] using CGLIB reflection optimizer
23:04:43,296 INFO [Environment] using JDK 1.4 java.sql.Timestamp handling
23:04:43,453 INFO [Ejb3Configuration] found EJB3 Entity bean:
com.eds.autoeng.vcc.security.ejb.Account
23:04:43,453 INFO [Ejb3Configuration] found EJB3 Entity bean:
com.eds.autoeng.vcc.security.ejb.AppGroup
23:04:43,468 INFO [Ejb3Configuration] found EJB3 Entity bean:
com.eds.autoeng.vcc.security.ejb.Application
23:04:43,468 INFO [Ejb3Configuration] found EJB3 Entity bean:
com.eds.autoeng.vcc.security.ejb.CustomerRole
23:04:43,484 INFO [Ejb3Configuration] found EJB3 Entity bean:
com.eds.autoeng.vcc.security.ejb.MasterRole
23:04:43,484 INFO [Ejb3Configuration] found EJB3 Entity bean:
com.eds.autoeng.vcc.security.ejb.Right
23:04:43,531 INFO [Ejb3Configuration] found EJB3 Entity bean:
com.eds.autoeng.vcc.security.ejb.User
23:04:43,531 INFO [Ejb3Configuration] found EJB3 Entity bean:
com.eds.autoeng.vcc.security.ejb.VirtualRight
23:04:43,609 INFO [Ejb3Configuration] found EJB3 Entity bean:
com.eds.autoeng.vcc.security.ejb.Account
23:04:43,609 INFO [Ejb3Configuration] found EJB3 Entity bean:
com.eds.autoeng.vcc.security.ejb.AppGroup
23:04:43,625 INFO [Ejb3Configuration] found EJB3 Entity bean:
com.eds.autoeng.vcc.security.ejb.Application
23:04:43,625 INFO [Ejb3Configuration] found EJB3 Entity bean:
com.eds.autoeng.vcc.security.ejb.CustomerRole
23:04:43,640 INFO [Ejb3Configuration] found EJB3 Entity bean:
com.eds.autoeng.vcc.security.ejb.MasterRole
23:04:43,640 INFO [Ejb3Configuration] found EJB3 Entity bean:
com.eds.autoeng.vcc.security.ejb.Right
23:04:43,656 INFO [Ejb3Configuration] found EJB3 Entity bean:
com.eds.autoeng.vcc.security.ejb.User
23:04:43,656 INFO [Ejb3Configuration] found EJB3 Entity bean:
com.eds.autoeng.vcc.security.ejb.VirtualRight
23:04:43,796 INFO [AnnotationBinder] Binding entity from annotated class:
com.eds.autoeng.vcc.security.ejb.Application
23:04:44,296 INFO [EntityBinder] Bind entity
com.eds.autoeng.vcc.security.ejb.Application on table Application
23:04:44,484 INFO [AnnotationBinder] Binding entity from annotated class:
com.eds.autoeng.vcc.security.ejb.User
23:04:44,484 INFO [EntityBinder] Bind entity
com.eds.autoeng.vcc.security.ejb.User on table User
23:04:44,500 INFO [AnnotationBinder] Binding entity from annotated class:
com.eds.autoeng.vcc.security.ejb.VirtualRight
23:04:44,500 INFO [EntityBinder] Bind entity
com.eds.autoeng.vcc.security.ejb.VirtualRight on table VirtualRight
23:04:44,515 INFO [AnnotationBinder] Binding entity from annotated class:
com.eds.autoeng.vcc.security.ejb.Right
23:04:44,515 INFO [EntityBinder] Bind entity
com.eds.autoeng.vcc.security.ejb.Right on table Right
23:04:44,546 INFO [AnnotationBinder] Binding entity from annotated class:
com.eds.autoeng.vcc.security.ejb.MasterRole
23:04:44,546 INFO [EntityBinder] Bind entity
com.eds.autoeng.vcc.security.ejb.MasterRole on table MasterRole
23:04:44,546 INFO [AnnotationBinder] Binding entity from annotated class:
com.eds.autoeng.vcc.security.ejb.CustomerRole
23:04:44,562 INFO [EntityBinder] Bind entity
com.eds.autoeng.vcc.security.ejb.CustomerRole on table CustomerRole
23:04:44,562 INFO [AnnotationBinder] Binding entity from annotated class:
com.eds.autoeng.vcc.security.ejb.Account
23:04:44,562 INFO [EntityBinder] Bind entity
com.eds.autoeng.vcc.security.ejb.Account on table Account
23:04:44,562 INFO [AnnotationBinder] Binding entity from annotated class:
com.eds.autoeng.vcc.security.ejb.AppGroup
23:04:44,562 INFO [EntityBinder] Bind entity
com.eds.autoeng.vcc.security.ejb.AppGroup on table AppGroup
23:04:44,703 WARN [ServiceController] Problem starting service
persistence.units:jar=vcc_security_ejb.ejb3.jar,unitName=manager1
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at
org.jboss.ejb3.ServiceDelegateWrapper.startService(ServiceDelegateWrapper.java:97)
at
org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:274)
at
org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:230)
at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at
org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:72)
at
org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:245)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:644)
at
org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:943)
at $Proxy0.start(Unknown Source)
at org.jboss.system.ServiceController.start(ServiceController.java:428)
at sun.reflect.GeneratedMethodAccessor6.invoke(Unknown Source)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at
org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:72)
at
org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:245)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:644)
at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:176)
at $Proxy56.start(Unknown Source)
at
org.jboss.ejb3.JmxKernelAbstraction.install(JmxKernelAbstraction.java:76)
at
org.jboss.ejb3.Ejb3Deployment.startPersistenceUnits(Ejb3Deployment.java:608)
at org.jboss.ejb3.Ejb3Deployment.start(Ejb3Deployment.java:452)
at org.jboss.ejb3.Ejb3Module.startService(Ejb3Module.java:139)
at
org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:274)
at
org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:230)
at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at
org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:72)
at
org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:245)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:644)
at
org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:943)
at $Proxy0.start(Unknown Source)
at org.jboss.system.ServiceController.start(ServiceController.java:428)
at sun.reflect.GeneratedMethodAccessor6.invoke(Unknown Source)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at
org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:72)
at
org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:245)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:644)
at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:176)
at $Proxy35.start(Unknown Source)
at org.jboss.ejb3.EJB3Deployer.start(EJB3Deployer.java:365)
at org.jboss.deployment.MainDeployer.start(MainDeployer.java:989)
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:790)
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:753)
at sun.reflect.GeneratedMethodAccessor7.invoke(Unknown Source)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at
org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
at
org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:118)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:74)
at
org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:127)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:74)
at
org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:245)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:644)
at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:176)
at $Proxy6.deploy(Unknown Source)
at
org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:319)
at
org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:507)
at
org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(AbstractDeploymentScanner.java:192)
at
org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.loop(AbstractDeploymentScanner.java:203)
at
org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.run(AbstractDeploymentScanner.java:182)
Caused by: org.hibernate.AnnotationException: List/array has to be annotated
with an @IndexColumn: com.eds.autoeng.vcc.security.ejb.Right.vi
rtualRights
at
org.hibernate.cfg.annotations.ListBinder.bindIndex(ListBinder.java:106)
at
org.hibernate.cfg.annotations.ListBinder.access$000(ListBinder.java:34)
at
org.hibernate.cfg.annotations.ListBinder$1.secondPass(ListBinder.java:69)
at
org.hibernate.cfg.CollectionSecondPass.doSecondPass(CollectionSecondPass.java:35)
at
org.hibernate.cfg.Configuration.secondPassCompile(Configuration.java:1012)
at
org.hibernate.cfg.AnnotationConfiguration.secondPassCompile(AnnotationConfiguration.java:238)
at org.hibernate.cfg.Configuration.buildMappings(Configuration.java:997)
at
org.hibernate.ejb.Ejb3Configuration.buildMappings(Ejb3Configuration.java:722)
at
org.hibernate.ejb.EventListenerConfigurator.configure(EventListenerConfigurator.java:161)
at
org.hibernate.ejb.Ejb3Configuration.createEntityManagerFactory(Ejb3Configuration.java:567)
at
org.hibernate.ejb.Ejb3Configuration.createContainerEntityManagerFactory(Ejb3Configuration.java:245)
at
org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFactory(HibernatePersistence.java:108)
at
org.jboss.ejb3.entity.PersistenceUnitDeployment.start(PersistenceUnitDeployment.java:231)
... 77 more
23:04:44,921 INFO [JmxKernelAbstraction] installing MBean:
jboss.j2ee:service=EJB3,jar=vcc_security_ejb.ejb3,name=AccountsBean with depende
ncies:
23:04:44,921 INFO [JmxKernelAbstraction]
persistence.units:jar=vcc_security_ejb.ejb3.jar,unitName=manager1
23:04:44,921 INFO [JmxKernelAbstraction] installing MBean:
jboss.j2ee:service=EJB3,jar=vcc_security_ejb.ejb3,name=AppGroupsBean with depend
encies:
23:04:44,921 INFO [JmxKernelAbstraction]
persistence.units:jar=vcc_security_ejb.ejb3.jar,unitName=manager1
23:04:44,921 INFO [JmxKernelAbstraction] installing MBean:
jboss.j2ee:service=EJB3,jar=vcc_security_ejb.ejb3,name=ApplicationsBean with dep
endencies:
23:04:44,921 INFO [JmxKernelAbstraction]
persistence.units:jar=vcc_security_ejb.ejb3.jar,unitName=manager1
23:04:44,937 INFO [JmxKernelAbstraction] installing MBean:
jboss.j2ee:service=EJB3,jar=vcc_security_ejb.ejb3,name=CustomerRolesBean with de
pendencies:
23:04:44,937 INFO [JmxKernelAbstraction]
persistence.units:jar=vcc_security_ejb.ejb3.jar,unitName=manager1
23:04:44,937 INFO [JmxKernelAbstraction] installing MBean:
jboss.j2ee:service=EJB3,jar=vcc_security_ejb.ejb3,name=MasterRolesBean with depe
ndencies:
23:04:44,937 INFO [JmxKernelAbstraction]
persistence.units:jar=vcc_security_ejb.ejb3.jar,unitName=manager1
23:04:44,937 INFO [JmxKernelAbstraction] installing MBean:
jboss.j2ee:service=EJB3,jar=vcc_security_ejb.ejb3,name=RightsBean with dependenc
ies:
23:04:44,937 INFO [JmxKernelAbstraction]
persistence.units:jar=vcc_security_ejb.ejb3.jar,unitName=manager1
23:04:44,937 INFO [JmxKernelAbstraction] installing MBean:
jboss.j2ee:service=EJB3,jar=vcc_security_ejb.ejb3,name=UsersBean with dependenci
es:
23:04:44,937 INFO [JmxKernelAbstraction]
persistence.units:jar=vcc_security_ejb.ejb3.jar,unitName=manager1
23:04:44,937 INFO [JmxKernelAbstraction] installing MBean:
jboss.j2ee:service=EJB3,jar=vcc_security_ejb.ejb3,name=VirtualRightsBean with de
pendencies:
23:04:44,937 INFO [JmxKernelAbstraction]
persistence.units:jar=vcc_security_ejb.ejb3.jar,unitName=manager1
23:04:44,937 INFO [EJB3Deployer] Deployed:
file:/C:/jboss-4.0.3SP1/server/default/deploy/vcc_security_ejb.ejb3
23:04:45,187 INFO [TomcatDeployer] deploy, ctxPath=/vcc_security_web,
warUrl=.../tmp/deploy/tmp20690vcc_security_web-exp.war/
23:04:45,593 INFO [WSDLFilePublisher] WSDL published to:
file:/C:/jboss-4.0.3SP1/server/default/data/wsdl/vcc_security_web.war/VCCSecurityC
reateService.wsdl
23:04:45,671 INFO [WSDLFilePublisher] WSDL published to:
file:/C:/jboss-4.0.3SP1/server/default/data/wsdl/vcc_security_web.war/VCCSecurityU
pdateService.wsdl
23:04:45,750 INFO [WSDLFilePublisher] WSDL published to:
file:/C:/jboss-4.0.3SP1/server/default/data/wsdl/vcc_security_web.war/VCCSecurityQ
ueryService.wsdl
23:04:46,140 INFO [AxisService] WSDD published to:
C:\jboss-4.0.3SP1\server\default\data\wsdl\vcc_security_web.war\VCCSecurityCreate.wsdd
23:04:46,671 INFO [AxisService] Web Service deployed:
http://W2VZJNHG:7070/vcc_security_web/VCCSecurityCreateWS
23:04:46,937 INFO [AxisService] WSDD published to:
C:\jboss-4.0.3SP1\server\default\data\wsdl\vcc_security_web.war\VCCSecurityUpdate.wsdd
23:04:46,937 INFO [AxisService] Web Service deployed:
http://W2VZJNHG:7070/vcc_security_web/VCCSecurityUpdateWS
23:04:47,078 WARN [JavaWsdlMapping] Cannot find jaxrpc-mapping for type:
{http://vcc.ws.eds.com/types/arrays/java/lang}StringArray
23:04:47,109 WARN [TypeMappingDescription] Class not found:
com.eds.autoeng.vcc.security.ws._arrays.java.lang.StringArray
23:04:47,109 INFO [AxisService] WSDD published to:
C:\jboss-4.0.3SP1\server\default\data\wsdl\vcc_security_web.war\VCCSecurityQuery.wsdd
23:04:47,125 INFO [AxisService] Web Service deployed:
http://W2VZJNHG:7070/vcc_security_web/VCCSecurityQueryWS
23:04:47,125 ERROR [URLDeploymentScanner] Incomplete Deployment listing:
--- MBeans waiting for other MBeans ---
ObjectName: persistence.units:jar=vcc_security_ejb.ejb3.jar,unitName=manager1
State: FAILED
Reason: java.lang.reflect.InvocationTargetException
I Depend On:
jboss.jca:service=DataSourceBinding,name=DefaultDS
Depends On Me:
jboss.j2ee:service=EJB3,jar=vcc_security_ejb.ejb3,name=AccountsBean
jboss.j2ee:service=EJB3,jar=vcc_security_ejb.ejb3,name=AppGroupsBean
jboss.j2ee:service=EJB3,jar=vcc_security_ejb.ejb3,name=ApplicationsBean
jboss.j2ee:service=EJB3,jar=vcc_security_ejb.ejb3,name=CustomerRolesBean
jboss.j2ee:service=EJB3,jar=vcc_security_ejb.ejb3,name=MasterRolesBean
jboss.j2ee:service=EJB3,jar=vcc_security_ejb.ejb3,name=RightsBean
jboss.j2ee:service=EJB3,jar=vcc_security_ejb.ejb3,name=UsersBean
jboss.j2ee:service=EJB3,jar=vcc_security_ejb.ejb3,name=VirtualRightsBean
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3921279#3921279
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3921279
-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems? Stop! Download the new AJAX search engine that makes
searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
_______________________________________________
JBoss-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jboss-user