[EJB 3.0] - Bug in @OneToMany() table creation.
by webmarck
I haven?t created a bug rapport yet ? wanted to have your opinion first.
I have an entity bean that has 3 OneToMany relationships with another enity bean.
public class Information {
| ?
| @OneToMany()
| public Collection<InformationText> getContexts() {
| return context;
| }
| @OneToMany
| public Collection<InformationText> getHeadlines() {
| return headline;
| }
| @OneToMany
| public Collection<InformationText> getLinkTexts() {
| return linkText;
| }
| ?
| }
|
In persistence.xml I have hibernate create tables and this is the SQL it uses (PostgreSQL)
CREATE TABLE information_informationtext
| (
| information_id int8 NOT NULL,
| linktexts_id int8 NOT NULL,
| headlines_id int8 NOT NULL,
| contexts_id int8 NOT NULL,
| CONSTRAINT fk26384b2658965112 FOREIGN KEY (headlines_id)
| REFERENCES informationtext (id) MATCH SIMPLE
| ON UPDATE NO ACTION ON DELETE NO ACTION,
| CONSTRAINT fk26384b26b2a6936d FOREIGN KEY (contexts_id)
| REFERENCES informationtext (id) MATCH SIMPLE
| ON UPDATE NO ACTION ON DELETE NO ACTION,
| CONSTRAINT fk26384b26bdddc9e5 FOREIGN KEY (linktexts_id)
| REFERENCES informationtext (id) MATCH SIMPLE
| ON UPDATE NO ACTION ON DELETE NO ACTION,
| CONSTRAINT fk26384b26c9808d98 FOREIGN KEY (information_id)
| REFERENCES information (id) MATCH SIMPLE
| ON UPDATE NO ACTION ON DELETE NO ACTION,
| CONSTRAINT information_informationtext_contexts_id_key UNIQUE (contexts_id),
| CONSTRAINT information_informationtext_headlines_id_key UNIQUE (headlines_id),
| CONSTRAINT information_informationtext_linktexts_id_key UNIQUE (linktexts_id)
| )
|
The problem is the NOT NULL constraints on linktexts_id, headlines_id and contexts_id. When I try to persist anything on the bean I get the following exception.
| 10:29:51,703 ERROR [JDBCExceptionReporter] Batch entry 0 insert into Information_InformationText (Information_id, contexts_id) values (933, 930) was aborted. Call getNextException to see the cause.
| 10:29:51,703 WARN [JDBCExceptionReporter] SQL Error: 0, SQLState: 23502
| 10:29:51,703 ERROR [JDBCExceptionReporter] ERROR: null value in column "linktexts_id" violates not-null constraint
| 10:29:51,703 ERROR [AbstractFlushingEventListener] Could not synchronize database state with session
| org.hibernate.exception.ConstraintViolationException: Could not execute JDBC batch update
| at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:71)
|
If I create the table myself without the NOT NULL constraint on linktexts_id, headlines_id and contexts_id then everything works.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3988096#3988096
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3988096
19Â years, 5Â months
[Security & JAAS/JBoss] - Configuring JBoss Federated SSO
by praful_agrawal
Hi All,
I am trying to configure Federated SSO on JBoss.
I have JBoss 4.0.4 installed,after following the configuration of Identity Management when I am trying to start my server I am getting the following errors
12:39:48,376 ERROR [IdentityManager] org.jboss.security.idm.IdentityManager
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:494)
at org.jboss.security.idm.IdentityManager.loadLoginProviders(IdentityManager.java:275)
at org.jboss.security.idm.IdentityManager.loadConfiguration(IdentityManager.java:238)
at org.jboss.security.idm.IdentityManager.start(IdentityManager.java:193)
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.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:995)
at $Proxy0.start(Unknown Source)
at org.jboss.system.ServiceController.start(ServiceController.java:417)
at sun.reflect.GeneratedMethodAccessor9.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:155)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
at $Proxy4.start(Unknown Source)
at org.jboss.deployment.SARDeployer.start(SARDeployer.java:302)
at org.jboss.deployment.MainDeployer.start(MainDeployer.java:1007)
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:808)
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:771)
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.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
at $Proxy8.deploy(Unknown Source)
at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:421)
at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:634)
at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(AbstractDeploymentScanner.java:263)
at org.jboss.deployment.scanner.AbstractDeploymentScanner.startService(AbstractDeploymentScanner.java:336)
at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:289)
at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:245)
at sun.reflect.GeneratedMethodAccessor2.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:155)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:978)
at $Proxy0.start(Unknown Source)
at org.jboss.system.ServiceController.start(ServiceController.java:417)
at sun.reflect.GeneratedMethodAccessor9.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:155)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
at $Proxy4.start(Unknown Source)
at org.jboss.deployment.SARDeployer.start(SARDeployer.java:302)
at org.jboss.deployment.MainDeployer.start(MainDeployer.java:1007)
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:808)
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:771)
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:755)
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.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
at $Proxy5.deploy(Unknown Source)
at org.jboss.system.server.ServerImpl.doStart(ServerImpl.java:482)
at org.jboss.system.server.ServerImpl.start(ServerImpl.java:362)
at org.jboss.Main.boot(Main.java:200)
at org.jboss.Main$1.run(Main.java:464)
at java.lang.Thread.run(Thread.java:595)
Caused by: org.jboss.security.idm.IdentityException: com.octetstring.jdbcLdap.jndi.SQLNamingException: Connect Error
at org.jboss.security.idm.ldap.LDAPIdentityProvider.restoreIdentities(LDAPIdentityProvider.java:1402)
at org.jboss.security.idm.ldap.LDAPIdentityProvider.(LDAPIdentityProvider.java:123)
... 101 more
Caused by: com.octetstring.jdbcLdap.jndi.SQLNamingException: Connect Error
at com.octetstring.jdbcLdap.jndi.SQLNamingException.fillInStackTrace(SQLNamingException.java:67)
at java.lang.Throwable.(Throwable.java:181)
at java.lang.Exception.(Exception.java:29)
at java.sql.SQLException.(SQLException.java:98)
at com.octetstring.jdbcLdap.jndi.SQLNamingException.(SQLNamingException.java:44)
at com.octetstring.jdbcLdap.jndi.JndiLdapConnection.(JndiLdapConnection.java:291)
at com.octetstring.jdbcLdap.sql.JdbcLdapDriver.connect(JdbcLdapDriver.java:96)
at java.sql.DriverManager.getConnection(DriverManager.java:525)
at java.sql.DriverManager.getConnection(DriverManager.java:171)
at org.jboss.security.idm.ldap.LDAPIdentityProvider.getConnection(LDAPIdentityProvider.java:710)
at org.jboss.security.idm.ldap.LDAPIdentityProvider.restoreIdentities(LDAPIdentityProvider.java:1355)
... 102 more
Caused by: java.net.ConnectException: Connection refused: connect
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
at java.net.Socket.connect(Socket.java:516)
at java.net.Socket.connect(Socket.java:466)
at java.net.Socket.(Socket.java:366)
at java.net.Socket.(Socket.java:179)
at com.novell.ldap.Connection.connect(Connection.java:411)
at com.novell.ldap.Connection.connect(Connection.java:362)
at com.novell.ldap.LDAPConnection.connect(LDAPConnection.java:2092)
at com.octetstring.jdbcLdap.jndi.JndiLdapConnection.(JndiLdapConnection.java:287)
... 107 more
12:39:48,376 INFO [IdentityManager] Configuration loading for the IdentityManager failed...........
I already have the necessary tomcat-utils.jar patch installed at my end and my sso.cfg.xml has the following contents :
<identity-management>
jdbc:ldap://localhost:389/dc=jboss,dc=com?SEARCH_SCOPE:=subTreeScope&secure:=false&concat_atts:=true&size_limit:=10000000
cn=Admin,dc=jboss,dc=com
jbossrocks
jbosssso
role
</identity-management>
I wouls like to know what I am missing in my configuration.
Thanks in Advance,
Praful
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3988095#3988095
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3988095
19Â years, 5Â months