CMP Entity Bean (addressbook) not deploying
I'm trying to deploy the addressbook example [http://www.orionserver.com/tutorials/orion-cmp-primer/] on my server. My data-sources.xml contains this entry: data-source class=com.evermind.sql.DriverManagerDataSource name=OracleDS location=jdbc/OracleDS pooled-location=jdbc/pooled/OracleDS xa-location=jdbc/xa/OracleDS ejb-location=jdbc/ejb/OracleDS connection-driver=oracle.jdbc.driver.OracleDriver min-connections=5 max-connections=25 username=myuser password=mypass url=jdbc:oracle:thin:192.168.1.68:1521:orclcat / Everything else is fine (I've followed all the steps mentioned in that cmp-primer) but at the time of deployment the server gives me the following error message: Auto-deploying addressbook-ejb.jar (No previous deployment found)... Error compiling /home/oc4j/tutorial/addressbook/build/addressbook/addressbook-ejb.jar: jdbc/OracleDS did not contain a cmt-dataSource/ejb-datasource ... and I have no clue what that means! I need to get my app running on orion ASAP. Any help towards this would be highly appreciated. Thanks a lot. Manish
Re: CMP Entity Bean (addressbook) not deploying
Ray Harrison wrote: Are you by chance using the location attribute in the code somewhere - i.e. refering to jdbc/OracleDS? If so, use the ejb-location instead (jdbc/ejb/OracleDS). Thanks a lot. That solved my problem. I have another problem though. When I deploy my own app into orion, the cmp beans get deployed properly (w/o any error messages). But when the client tries to access the bean through the findByPrimaryKey method I get the following exception: javax.ejb.ObjectNotFoundException: no such entity: prikey where prikey is the primary key. The row does exist in the database but I don't see why it's not accessible. The same app is working well in weblogic. Manish
Re: CMP Entity Bean (addressbook) not deploying
Did the information in the database get entered outside of the application? If so, cycle the app server to see if that fixes the problem (there's a flag you can set to eliminate that particular problem). If not, would you mind firing over the appropriate code snippets? (The place in your code that you are calling the findBy.. in, and the orion-ejb-jar.xml file that is generated). What version of Orion are you using? (Curious also as to your weblogic version). Cheers Ray --- Manish Jethani [EMAIL PROTECTED] wrote: Ray Harrison wrote: Are you by chance using the location attribute in the code somewhere - i.e. refering to jdbc/OracleDS? If so, use the ejb-location instead (jdbc/ejb/OracleDS). Thanks a lot. That solved my problem. I have another problem though. When I deploy my own app into orion, the cmp beans get deployed properly (w/o any error messages). But when the client tries to access the bean through the findByPrimaryKey method I get the following exception: javax.ejb.ObjectNotFoundException: no such entity: prikey where prikey is the primary key. The row does exist in the database but I don't see why it's not accessible. The same app is working well in weblogic. Manish __ Do You Yahoo!? Yahoo! Movies - coverage of the 74th Academy Awards® http://movies.yahoo.com/
Re: CMP Entity Bean (addressbook) not deploying
Ray Harrison wrote: Did the information in the database get entered outside of the application? If so, cycle the app server to see if that fixes What do you mean outside of the application? The database is populated with some base data before the application can start doing anything. the problem (there's a flag you can set to eliminate that particular problem). If not, would you mind firing over the appropriate code snippets? (The place in your code that you are calling the findBy.. in, and the orion-ejb-jar.xml file that is generated). Here's my new data-sources.xml (snip): data-source class=com.evermind.sql.DriverManagerDataSource name=CatsummitSource location=jdbc/nonPooledCatsummitSource pooled-location=jdbc/pooledCatsummitSource xa-location=jdbc/CatsummitTxSource ejb-location=jdbc/CatsummitSource connection-driver=oracle.jdbc.driver.OracleDriver min-connections=5 max-connections=25 username=catsummit password=catsummit url=jdbc:oracle:thin:192.168.1.68:1521:orclcat / My orion-ejb-jar.xml has this entity-deployment node: entity-deployment name=com.zycus.util.PrimarykeygenerationHome location=com.zycus.util.PrimarykeygenerationHome wrapper=PrimarykeygenerationHome_EntityHomeWrapper200 table=util_PrimarykeygenerationHome data-source=jdbc/CatsummitSource primkey-mapping cmp-field-mapping name=tablename persistence-name=tablename / /primkey-mapping cmp-field-mapping name=currentkeyid persistence-name=currentkeyid / resource-ref-mapping name=jdbc/CatsummitSource / /entity-deployment That's for an entity bean for the database table PrimaryKeyGenerationTbl, where a mapping of table name to max(prikey) is stored for every other table in the database. Here's the piece of code that throws the ObjectNotFoundException: public Long getNextNumberInSequence(String tableName) throws PrimaryKeyGenerationException, RemoteException { Long key = null; Primarykeygeneration pkgRemote = (Primarykeygeneration) hmpEntries.get(tableName); if (pkgRemote == null) { // add an entry to the PrimaryKeyGenerationTbl table try{ pkgRemote = pkgHome.findByPrimaryKey(tableName); } catch(javax.ejb.FinderException e) { // this exception throw new PrimaryKeyGenerationException(msgId1, e); } hmpEntries.put(tableName, pkgRemote); } // ... and so on and so forth } What version of Orion are you using? (Curious also as to your weblogic version). I'm using OC4J (Oracle9iAS) 1.0.2.2.1 and WebLogic 6.1. Manish