[JBoss-user] [Persistence & CMP/JBoss] - problem with auto-increment field and CMP bean
I want to know if I can work with auto-increment with CMP beans. I have a table with 2 fields: id (identity) dbPass dbUrl dbUser dbDriver dbName and when I use a create() method ECollections collHome = collectionHome.create(dbPass,dbUrl,dbUser,dbDriver,dbName); , the console display this error: javax.ejb.CreateException: Could not create entity:java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC][SQLServer]Cannot insert explicit value for identity column in table 'collections' when IDENTITY_INSERT is set to OFF. at org.jboss.ejb.plugins.cmp.jdbc.JDBCAbstractCreateCommand.performInsert(JDBCAbstractCreateCommand.java:303) at org.jboss.ejb.plugins.cmp.jdbc.JDBCAbstractCreateCommand.execute(JDBCAbstractCreateCommand.java:138) at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.createEntity(JDBCStoreManager.java:554) at org.jboss.ejb.plugins.CMPPersistenceManager.createEntity(CMPPersistenceManager.java:208) at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.createEntity(CachedConnectionInterceptor.java:269) at org.jboss.ejb.EntityContainer.createHome(EntityContainer.java:737) 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:324) at org.jboss.ejb.EntityContainer$ContainerInterceptor.invokeHome(EntityContainer.java:1043) at org.jboss.ejb.plugins.AbstractInterceptor.invokeHome(AbstractInterceptor.java:88) at org.jboss.ejb.plugins.EntitySynchronizationInterceptor.invokeHome(EntitySynchronizationInterceptor.java:197) at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invokeHome(CachedConnectionInterceptor.java:214) at org.jboss.ejb.plugins.AbstractInterceptor.invokeHome(AbstractInterceptor.java:88) at org.jboss.ejb.plugins.EntityInstanceInterceptor.invokeHome(EntityInstanceInterceptor.java:89) at org.jboss.ejb.plugins.EntityLockInterceptor.invokeHome(EntityLockInterceptor.java:61) at org.jboss.ejb.plugins.EntityCreationInterceptor.invokeHome(EntityCreationInterceptor.java:28) at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:88) at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:267) at org.jboss.ejb.plugins.TxInterceptorCMT.invokeHome(TxInterceptorCMT.java:98) at org.jboss.ejb.plugins.SecurityInterceptor.invokeHome(SecurityInterceptor.java:92) at org.jboss.ejb.plugins.LogInterceptor.invokeHome(LogInterceptor.java:120) at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invokeHome(ProxyFactoryFinderInterceptor.java:93) at org.jboss.ejb.EntityContainer.internalInvokeHome(EntityContainer.java:483) at org.jboss.ejb.Container.invoke(Container.java:720) 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:324) at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284) at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:546) at org.jboss.invocation.local.LocalInvoker.invoke(LocalInvoker.java:101) at org.jboss.invocation.InvokerInterceptor.invoke(InvokerInterceptor.java:90) at org.jboss.proxy.TransactionInterceptor.invoke(TransactionInterceptor.java:46) at org.jboss.proxy.SecurityInterceptor.invoke(SecurityInterceptor.java:45) at org.jboss.proxy.ejb.HomeInterceptor.invoke(HomeInterceptor.java:173) at org.jboss.proxy.ClientContainer.invoke(ClientContainer.java:85) at $Proxy236.create(Unknown Source) at com.entrieva.skyline.sessionBeans.admin.SCollectionsBean.insertCollections(SCollectionsBean.java:171) 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:324) at org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.invoke(StatelessSessionContainer.java:683) at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:185) at org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(StatelessSessionInstanceInterceptor.java:72) at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:84)
[JBoss-user] [Persistence & CMP/JBoss] - Re: DataSource API's from JBoss
I want to change the CMP datasource on the fly. Can I use CMP's in this context where I need to connect to different databases(with absolutely identical structure) for each client. Different databases mean different Datasources, hence how do I uniquely associate a CMP Entity Bean with a single table for a particular datasource. Also, we do not want a different entity bean set for each database! View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3838467#3838467 Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3838467 --- This SF.Net email is sponsored by the new InstallShield X. >From Windows to Linux, servers to mobile, InstallShield X is the one installation-authoring solution that does it all. Learn more and evaluate today! http://www.installshield.com/Dev2Dev/0504 ___ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user
[JBoss-user] [Persistence & CMP/JBoss] - DataSource API's from JBoss
Have Jboss some API's to work with datasource ? View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3838351#3838351 Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3838351 --- This SF.Net email is sponsored by the new InstallShield X. >From Windows to Linux, servers to mobile, InstallShield X is the one installation-authoring solution that does it all. Learn more and evaluate today! http://www.installshield.com/Dev2Dev/0504 ___ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user
[JBoss-user] [Persistence & CMP/JBoss] - Re: Changing a Datasource at runtime
I read a note from Alexey Loubyansky on http://www.junlu.com/msg/36487.html but I can't get some other examples. Could you give me an examples of your DataSource Factory ? Thanks in advance!!! View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3838320#3838320 Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3838320 --- This SF.Net email is sponsored by: GNOME Foundation Hackers Unite! GUADEC: The world's #1 Open Source Desktop Event. GNOME Users and Developers European Conference, 28-30th June in Norway http://2004/guadec.org ___ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user
[JBoss-user] [Persistence & CMP/JBoss] - Changing a Datasource at runtime
Consider a hypothetical application that needs to be deployed on a single app server and has to service mulitple clients. Consider that there is a database per client. Thus n databases for n clients. However, all of these database have the same structure, and only the content varies. Now to the problem: Can I use CMP's in this context where I need to connect to different databases(with absolutely identical structure) for each client. Different databases mean different Datasources, hence how do I uniquely associate a CMP Entity Bean with a single table for a particular datasource. Also, we do not want a different entity bean set for each database! View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3838245#3838245 Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3838245 --- This SF.Net email is sponsored by: GNOME Foundation Hackers Unite! GUADEC: The world's #1 Open Source Desktop Event. GNOME Users and Developers European Conference, 28-30th June in Norway http://2004/guadec.org ___ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user
[JBoss-user] [Persistence & CMP/JBoss] - Re: dinamic in jbosscmp-jdbc.xml
I think that is that I'm looking for. I've 2 DB with the same tables and I need to choose one of them in every moment depends of the client choose View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3838225#3838225 Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3838225 --- This SF.Net email is sponsored by: GNOME Foundation Hackers Unite! GUADEC: The world's #1 Open Source Desktop Event. GNOME Users and Developers European Conference, 28-30th June in Norway http://2004/guadec.org ___ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user
[JBoss-user] [Persistence & CMP/JBoss] - dinamic in jbosscmp-jdbc.xml
hi everybody, I have a jbosscmp-jdbc.xml file with this piece of code java:/skyline MS SQLSERVER2000 . . This xml is on EJBs.jar file. And mssql-ds.xml (on jboss_home/server/default/deploy) has these lines skyline jdbc:microsoft:sqlserver://localhost:1433;DatabaseName=skyline3 com.microsoft.jdbc.sqlserver.SQLServerDriver skyline skyline So, my client need to change dynamically the datasource for use a diferent database. The question is : Can I change dynamically the java:/skyline into the EJBs.jar file to work with other database ? Anybody give me some ideas to do that. Thank in advance !!! View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3838170#3838170 Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3838170 --- This SF.Net email is sponsored by: GNOME Foundation Hackers Unite! GUADEC: The world's #1 Open Source Desktop Event. GNOME Users and Developers European Conference, 28-30th June in Norway http://2004/guadec.org ___ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user
[JBoss-user] [Persistence & CMP/JBoss] -
well, I have a lot of beans running with : java:/skyline MS SQLSERVER2000 and ... I want to create other beans in the same jar file (EJBs.jar) but these beans will be use a different jndi connection like java:/skylineAdmin MS SQLSERVER2000 Can I do that ? View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3838004#3838004 Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3838004 --- This SF.Net email is sponsored by: GNOME Foundation Hackers Unite! GUADEC: The world's #1 Open Source Desktop Event. GNOME Users and Developers European Conference, 28-30th June in Norway http://2004/guadec.org ___ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user
[JBoss-user] [Persistence & CMP/JBoss] - EJB-QL order by...
Hi everyBody !!! well I want to know how can I do this query with ejb-ql: SELECT * FROM documents WHERE docid =x ORDER BY docname ASC I did try with this code but didn't running *@ ejb.finder query="SELECT OBJECT(d) FROM documents d where d.docid=?1 order by ?2 ?3" View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3836383#3836383 Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3836383 --- This SF.Net email is sponsored by: Oracle 10g Get certified on the hottest thing ever to hit the market... Oracle 10g. Take an Oracle 10g class now, and we'll give you the exam FREE. http://ads.osdn.com/?ad_id=3149&alloc_id=8166&op=click ___ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user
[JBoss-user] [Persistence & CMP/JBoss] - EJB-QL ordey by...
Hi everyBody !!! well I want to know how can I do this query with ejb-ql: SELECT * FROM documents WHERE docid =x ORDER BY docname ASC I did try with this code but didn't running *@ ejb.finder query="SELECT OBJECT(d) FROM documents d where d.docid=?1 order by ?2 ?3" View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3836382#3836382 Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3836382 --- This SF.Net email is sponsored by: Oracle 10g Get certified on the hottest thing ever to hit the market... Oracle 10g. Take an Oracle 10g class now, and we'll give you the exam FREE. http://ads.osdn.com/?ad_id=3149&alloc_id=8166&op=click ___ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user
[JBoss-user] [Persistence & CMP/JBoss] - Re: simplest one-to-one relationships bug
somebody knows some tutorial to create one-to-one relationships ? thanks in advance View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3835418#3835418 Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3835418 --- This SF.Net email is sponsored by: SourceForge.net Broadband Sign-up now for SourceForge Broadband and get the fastest 6.0/768 connection for only $19.95/mo for the first 3 months! http://ads.osdn.com/?ad_id=2562&alloc_id=6184&op=click ___ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user
[JBoss-user] [Persistence & CMP/JBoss] - Re: simplest one-to-one relationships bug
so, how can I get the fields from the other bean that participate in the relationships ? while (iter.hasNext()) { EDocuments element = ((EDocuments) iter.next()); System.out.println("Abstract:" + element.getShortabstract()); EDocMetaDataLocal meta = element.getEDocMetaData(); System.out.println(meta.getAuthor()[/color]); } View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3835373#3835373 Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3835373 --- This SF.Net email is sponsored by: SourceForge.net Broadband Sign-up now for SourceForge Broadband and get the fastest 6.0/768 connection for only $19.95/mo for the first 3 months! http://ads.osdn.com/?ad_id=2562&alloc_id=6184&op=click ___ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user
[JBoss-user] [Persistence & CMP/JBoss] - Re: simplest one-to-one relationships bug
My Problem was because I didn't use a Local Interface. Ok , I just use EDocMetaDataLocal meta = element.getEDocMetaData(); but when I want to use any filed for example: System.out.println(meta.getAuthor()); this error appear: java.lang.NullPointerException at org.jboss.ejb.plugins.local.EntityProxy.invoke(EntityProxy.java:38) at $Proxy4.getAuthor(Unknown Source) at com.neoris.Test.DocumentsTest.testBean(DocumentsTest.java:60) at com.neoris.Test.DocumentsTest.main(DocumentsTest.java:70) Exception in thread "main" View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3835364#3835364 Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3835364 --- This SF.Net email is sponsored by: SourceForge.net Broadband Sign-up now for SourceForge Broadband and get the fastest 6.0/768 connection for only $19.95/mo for the first 3 months! http://ads.osdn.com/?ad_id=2562&alloc_id=6184&op=click ___ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user
[JBoss-user] [Persistence & CMP/JBoss] - Re: simplest one-to-one relationships bug
ava.rmi.ServerException: RemoteException occurred in server thread; nested exception is: java.rmi.ServerException: RuntimeException; nested exception is: java.lang.ClassCastException at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:292) at sun.rmi.transport.Transport$1.run(Transport.java:148) at java.security.AccessController.doPrivileged(Native Method) at sun.rmi.transport.Transport.serviceCall(Transport.java:144) at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:460) at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:701) at java.lang.Thread.run(Thread.java:536) at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:247) at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:223) at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:133) at org.jboss.invocation.jrmp.server.JRMPInvoker_Stub.invoke(Unknown Source) at org.jboss.invocation.jrmp.interfaces.JRMPInvokerProxy.invoke(JRMPInvokerProxy.java:135) at org.jboss.invocation.InvokerInterceptor.invoke(InvokerInterceptor.java:96) at org.jboss.proxy.TransactionInterceptor.invoke(TransactionInterceptor.java:46) at org.jboss.proxy.SecurityInterceptor.invoke(SecurityInterceptor.java:45) at org.jboss.proxy.ejb.EntityInterceptor.invoke(EntityInterceptor.java:97) at org.jboss.proxy.ClientContainer.invoke(ClientContainer.java:85) at $Proxy2.getEDocMetaData(Unknown Source) at com.neoris.Test.DocumentsTest.testBean(DocumentsTest.java:67) at com.neoris.Test.DocumentsTest.main(DocumentsTest.java:77) Caused by: java.rmi.ServerException: RuntimeException; nested exception is: java.lang.ClassCastException at org.jboss.ejb.plugins.LogInterceptor.handleException(LogInterceptor.java:361) at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:195) at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor.java:122) at org.jboss.ejb.EntityContainer.internalInvoke(EntityContainer.java:489) at org.jboss.ejb.Container.invoke(Container.java:700) at sun.reflect.GeneratedMethodAccessor184.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:324) at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284) at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:546) at org.jboss.invocation.jrmp.server.JRMPInvoker.invoke(JRMPInvoker.java:367) at sun.reflect.GeneratedMethodAccessor136.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:324) at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:261) at sun.rmi.transport.Transport$1.run(Transport.java:148) at java.security.AccessController.doPrivileged(Native Method) at sun.rmi.transport.Transport.serviceCall(Transport.java:144) at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:460) at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:701) at java.lang.Thread.run(Thread.java:536) Caused by: java.lang.ClassCastException at com.Entrieva.Skyline.EntityBeans.EDocumentsCMP$Proxy.getEDocMetaData() at sun.reflect.GeneratedMethodAccessor209.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:324) at org.jboss.ejb.EntityContainer$ContainerInterceptor.invoke(EntityContainer.java:1096) at org.jboss.ejb.plugins.cmp.jdbc.JDBCRelationInterceptor.invoke(JDBCRelationInterceptor.java:72) at org.jboss.ejb.plugins.EntitySynchronizationInterceptor.invoke(EntitySynchronizationInterceptor.java:282) at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:185) at org.jboss.ejb.plugins.EntityReentranceInterceptor.invoke(EntityReentranceInterceptor.java:114) at org.jboss.ejb.plugins.EntityInstanceInterceptor.invoke(EntityInstanceInterceptor.java:163) at org.jboss.ejb.plugins.EntityLockInterceptor.invoke(EntityLockInterceptor.java:89) at org.jboss.ejb.plugins.EntityCreationInterceptor.invoke(EntityCreationInterceptor.java:54) at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:84) at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:267) at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInter
[JBoss-user] [Persistence & CMP/JBoss] - simplest one-to-one relationships bug
Hi all!! I've 2 tables that contain the same primary key (docid) and both have diferent fileds for a document One of that has all the basic fields for a document and the other has metadata for the same document. Obviously the relation is one-to-one well, the names of the beans are : EDocuments and EDocMetaData This is the code for EDocuments: /** * @ejb.bean name="EDocuments" * jndi-name="EDocumentsBean" * type="CMP" * schema="documents" * cmp-version="2.x" * primkey-field="docid" * * @ejb.persistence * table-name="documents" * * @ejb.finder *query="SELECT OBJECT(a) FROM documents as a" *signature="java.util.Collection findAll()" **/ /** * @ejb.interface-method * * @ejb.relation *name="EDocuments-EDocMetaData" *role-name="EDocuments-has-one-EDocMetadata" * * @jboss.relation *related-pk-field="docid" *fk-column="docid" * */ public abstract EDocMetaData getEDocMetaData(); /** * @ejb.interface-method * view-type="both" */ public abstract void setEDocMetaData(EDocMetaData metaData); and this is for EDocMetaData bean : /** * @ejb.bean name="EDocMetaData" * jndi-name="EDocMetaDataBean" * type="CMP" * primkey-field="docid" * schema="docmetadata" * cmp-version="2.x" * * @ejb.persistence * table-name="docmetadata" * * @ejb.finder *query="SELECT OBJECT(a) FROM docmetadata as a" *signature="java.util.Collection findAll()" * **/ /** * @ejb.interface-method * * @ejb.relation *name="EDocuments-EDocMetaData" *role-name="EDocMetadata-has-one-EDocuments" * @jboss.relation *related-pk-field="docid" *fk-column="docid" */ public abstract EDocuments getEDocuments(); public abstract void setEDocuments(EDocuments document); This is the code for ejb-jar.xml EDocuments-EDocMetaData EDocuments-has-one-EDocMetadata One EDocuments EDocMetaData EDocMetadata-has-one-EDocuments One EDocMetaData eocuments and this is for jbosscmp-jdbc EDocuments-EDocMetaData EDocuments-has-one-EDocMetadata docid docid EDocMetadata-has-one-EDocuments docid docid Well, Finally I'm using Lomboz for generate all deploy files and all the file were generated well and the deploy files were good too. But when I want to use the client tester like this : public class DocumentsTest { private com.Entrieva.Skyline.SessionBeans.SDocumentsHome getHome() throws NamingException { return (com.Entrieva.Skyline.SessionBeans.SDocumentsHome) getContext().lookup( com.Entrieva.Skyline.SessionBeans.SDocumentsHome.JNDI_NAME); } private InitialContext getContext() throws NamingException { Hashtable props = new Hashtable(); props.put(InitialContext.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory"); props.put(InitialContext.PROVIDER_URL, "jnp://127.0.0.1:1099"); InitialContext initialContext = new InitialContext(props); return initialContext; } public void testBean() throws CreateException, RemoteException, FinderException { try { SDocuments myBean = getHome().create(); Collection col = myBean.getAllDocumentByCategoryId(11); // get all documents by category Iterator iter = col.iterator(); while (iter.hasNext()) { EDocuments element = ((EDocuments) iter.next()); System.out.println("Abstract:" + element.getShortabstract()); EDocMetaData meta = element.getEDocMetaData();} } catch (NamingException e) { e.printStackTrace(); } } public static void main(String[] args) throws RemoteException, CreateException, FinderException { DocumentsTest test = new DocumentsTest(); test.testBean(); } this bugs appear in the console: java.rmi.ServerException: RemoteException occurred in server thread; nested exception is: java.rmi.ServerException: RuntimeException; nested exception is: java.lang.ClassCastException at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:292) at sun.rmi.transport.Transport$1.run(Transport.java:148) at java.security.AccessController.doPrivileged(Native Method) at sun.rmi.transport.Transport.serviceCall(Transport.java:144) at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:460) at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:701) at java.lang.Thread.run(Thread.java:536) at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:247) at sun.rmi.transport.StreamRemoteCall.e
[JBoss-user] [Persistence & CMP/JBoss] - Re: java.lang.ClassCastException
But in my case both tables contain the same amount of row And the data model for those tables is one-to-one relationships View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3835258#3835258 Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3835258 --- This SF.Net email is sponsored by: SourceForge.net Broadband Sign-up now for SourceForge Broadband and get the fastest 6.0/768 connection for only $19.95/mo for the first 3 months! http://ads.osdn.com/?ad_id=2562&alloc_id=6184&op=click ___ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user
[JBoss-user] [Persistence & CMP/JBoss] - Re: java.lang.ClassCastException
do you have any document to implement a one-to-one relationships I think the @ejb.relation is good in both case (2 beans) but I can't understand why I can't call one bean to other by getDocidMetaData() method. thanks in advance View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3835254#3835254 Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3835254 --- This SF.Net email is sponsored by: SourceForge.net Broadband Sign-up now for SourceForge Broadband and get the fastest 6.0/768 connection for only $19.95/mo for the first 3 months! http://ads.osdn.com/?ad_id=2562&alloc_id=6184&op=click ___ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user
[JBoss-user] [Persistence & CMP/JBoss] - Re: java.lang.ClassCastException
EDocuments-EDocMetaData EDocuments-has-one-EDocMetadata EDocMetadata-has-one-EDocuments docid docid View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3835248#3835248 Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3835248 --- This SF.Net email is sponsored by: SourceForge.net Broadband Sign-up now for SourceForge Broadband and get the fastest 6.0/768 connection for only $19.95/mo for the first 3 months! http://ads.osdn.com/?ad_id=2562&alloc_id=6184&op=click ___ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user
[JBoss-user] [Persistence & CMP/JBoss] - java.lang.ClassCastException
Hi, I've 2 beans one-one relationships and this piece of code InitialContext ctx = new InitialContext(); SDocuments myBean = getHome().create(); Collection col = myBean.getAllDocumentByCategoryId(11); Iterator iter = col.iterator(); while (iter.hasNext()) { EDocuments element = ((EDocuments) iter.next()); System.out.println("Abstract:" + element.getShortabstract()); EDocMetaData metaData = element.getDocMetaData(); System.out.println("Rawtext:" + metaData.getRawtext()); } } catch (NamingException e) { e.printStackTrace(); } in the bold line this error appear: java.lang.ClassCastException at com.Entrieva.Skyline.EntityBeans.EDocumentsCMP$Proxy.getDocMetaData() the ejb-jar relationships is : EDocuments-EDocMetaData EDocuments-has-one-EDocMetadata One EDocuments docMetaData EDocMetadata-has-one-EDocuments One EDocMetaData documents View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3835237#3835237 Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3835237 --- This SF.Net email is sponsored by: SourceForge.net Broadband Sign-up now for SourceForge Broadband and get the fastest 6.0/768 connection for only $19.95/mo for the first 3 months! http://ads.osdn.com/?ad_id=2562&alloc_id=6184&op=click ___ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user
[JBoss-user] [Persistence & CMP/JBoss] - Error compiling EJB-QL statement 'SELECT OBJECT(b) FROM ...
I've 2 beans ECatDocuments and EDocuments I created a relationships like this in ECatDocuments /** * @ejb.interface-method * * @ejb.relation *name="ECatDocuments-EDocuments" *role-name="ECatDocuments-has-many-EDocuments" * @jboss.relation *related-pk-field="docid" *fk-column="docid" in EDocuments /** * @ejb.interface-method * * @ejb.relation *name="ECatDocuments-EDocuments" *role-name="EDocuments-has-ECatDocuments" *target-ejb="ECatDocuments" * */ and the relationships in ejb-jar.xml is : ECatDocuments-EDocuments ECatDocuments-has-many-EDocuments Many ECatDocuments documents EDocuments-has-ECatDocuments One EDocuments documents java.util.Collection everything all right but.. when I want to create a query in ECatDocuments like this : * @ejb.finder *query="SELECT OBJECT(b) FROM catDocumentsSchema a, IN(a.documents) b where a.catid=?1" *signature="java.util.Collection findDocsByCatid(int catId)" this deploy error appear: Depends On Me: org.jboss.deployment.DeploymentException: Error compiling EJB-QL statement 'SELECT OBJECT(b) FROM catDocumentsSchema a, IN(a.documents) b where a.docid=?1'; - nested throwable: (org.jboss.ejb.plugins.cmp.ejbql.ParseException: Encountered "a.documents" at line 1, column 50. Was expecting: ... )] somebody can help me??!!! Thanks in advance View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3835080#3835080 Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3835080 --- This SF.Net email is sponsored by: SourceForge.net Broadband Sign-up now for SourceForge Broadband and get the fastest 6.0/768 connection for only $19.95/mo for the first 3 months! http://ads.osdn.com/?ad_id=2562&alloc_id=6184&op=click ___ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user
[JBoss-user] [Persistence & CMP/JBoss] - relationship doubt
Hi everybody! I've 2 tables : CatDocuments and Documents CatDocuments has docid and catid fields Documents has docid and docname fields The relation between both are with the docid field I want to get all the docs from documents where catid =x for example [select docname from catdocuments a inner join documents b on a.docid=b.docid where catid = xxx] well, I' been created a code like this in Documents bean /** * @ejb.interface-method * view-type="both" * * @ejb.persistence * column-name = "docid" * * @ejb.relation *name="EDocuments-ECatDocuments" *target-ejb="ECatDocuments" *target-multiple="no" *role-name="EDocuments-has-ECatDocuments" * * @jboss.relation *related-pk-field="docid" *fk-column="docid" * */ public abstract Collection getCatDocuments(); /** * @ejb.interface-method * view-type="both" */ public abstract void setCatDocuments(int docid); and in the CatDocuments bean I put the next code /** * @ejb.interface-method * view-type="both" * * @ejb.persistence * column-name = "docid" * * @ejb.relation *name="EDocuments-ECatDocuments" *target-ejb="EDocuments" *target-multiple="yes" *role-name="ECatDocuments-has-EDocuments" * * @jboss.relation *related-pk-field="docid" *fk-column="docid" * */ public abstract Collection getDocuments(); /** * @ejb.interface-method * view-type="both" */ public abstract void setDocuments(int docid); so, the question is 1) if the code above is right and 2) why I want to deploy the code that error appear org.jboss.deployment.DeploymentException: No ejb-relationship-role-name element found View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3835016#3835016 Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3835016 --- This SF.Net email is sponsored by: SourceForge.net Broadband Sign-up now for SourceForge Broadband and get the fastest 6.0/768 connection for only $19.95/mo for the first 3 months! http://ads.osdn.com/?ad_id=2562&alloc_id=6184&op=click ___ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user
[JBoss-user] [Persistence & CMP/JBoss] - How to create relationships with XDoclet
Anybody knows a tutorial , document anything that talk about how to create relationships with XDoclet. thanks in advance. View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3834975#3834975 Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3834975 --- This SF.Net email is sponsored by: SourceForge.net Broadband Sign-up now for SourceForge Broadband and get the fastest 6.0/768 connection for only $19.95/mo for the first 3 months! http://ads.osdn.com/?ad_id=2562&alloc_id=6184&op=click ___ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user
[JBoss-user] [Persistence & CMP/JBoss] - EJB-QL query
somebody knows how I can do this query with EJB-QL Select A.catid FROM catparents A where (A.parentid IN (SELECT B.parentid from dbo.catparents B WHERE (B.catid = 4) AND (B.depth = 0)) AND (A.depth = 0) AND (A.catid <> 4)) thanks in advance View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3834805#3834805 Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3834805 --- This SF.Net email is sponsored by: SourceForge.net Broadband Sign-up now for SourceForge Broadband and get the fastest 6.0/768 connection for only $19.95/mo for the first 3 months! http://ads.osdn.com/?ad_id=2562&alloc_id=6184&op=click ___ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user
[JBoss-user] [Persistence & CMP/JBoss] - Problem with Integer fields on @ejb.finder result
I've been doing a CMP with 3 integer fields. So, when I create an use this finder: * @ejb.finder * query="SELECT OBJECT(c) FROM catparents c where c.parentId=?1" * signature="java.util.Collection findByChild(java.lang.Integer catId)" the result give me the collection of the same row. I mean the count result in the query of MSSQL is 13 but the result of collection objects is 13 but with the same data. somebody knows this problem ? thank a lot!! View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3834524#3834524 Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3834524 --- This SF.Net email is sponsored by Sleepycat Software Learn developer strategies Cisco, Motorola, Ericsson & Lucent use to deliver higher performing products faster, at low TCO. http://www.sleepycat.com/telcomwpreg.php?From=osdnemail3 ___ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user