Unsuscribe
Unsuscribe
EJB 2.0 again, again, please.
Hi, I have the following entity beans which have a 1-1 relationship: person(id(integer), name(varchar)) job(id(integer), name(varchar)) This is part of my ejb-jar.xml: enterprise-beansentitydescription/descriptioncmp-version2.0/cmp-versionejb-namePerson/ejb-namehomePersonHome/homeremotePerson/remoteejb-classPersonBean/ejb-classprim-key-classjava.lang.Integer/prim-key-classreentrantFalse/reentrantpersistence-typeContainer/persistence-typecmp-fieldfield-nameid/field-name/cmp-fieldcmp-fieldfield-namename/field-name/cmp-field cmp-fieldfield-namejobid/field-name/cmp-fieldprimkey-fieldid/primkey-field/entity/enterprise-beans enterprise-beansentitydescription/descriptioncmp-version2.0/cmp-versionejb-nameJob/ejb-namehomeJobHome/homeremoteJob/remoteejb-classJobBean/ejb-classprim-key-classjava.lang.Integer/prim-key-classreentrantFalse/reentrantpersistence-typeContainer/persistence-typecmp-fieldfield-nameid/field-name/cmp-fieldcmp-fieldfield-namename/field-name/cmp-fieldprimkey-fieldid/primkey-field/entity/enterprise-beans And this is the relationship between them: relationships ejb-relation ejb-relation-namePerson-Job/ejb-relation-name ejb-relationship-role ejb-relationship-role-name/ejb-relationship-role-name multiplicityone/multiplicity role-source ejb-namePerson/ejb-name remote-ejb-namePerson/remote-ejb-name dependent-namePerson/dependent-name /role-source cmr-field cmr-field-namejobid/cmr-field-name cmr-field-typeJob/cmr-field-type /cmr-field /ejb-relationship-role ejb-relationship-role ejb-relationship-role-name/ejb-relationship-role-name multiplicityone/multiplicity role-source ejb-nameJob/ejb-name remote-ejb-nameJob/remote-ejb-name dependent-nameJob/dependent-name /role-source /ejb-relationship-role /ejb-relation /relationships Everything seems to work fine, I mean, the entities get deployed etc... The tables that Orion create are ok: Person(name(varchar(50)), jobid(integer), id (integer primary key not null)) Job(name(varchar(50)), id(integer primary key not null)) But when I try to create a new Person I get the following error: [ODBC SQL SERVER DRIVER] Optional feature not implemented I've made a trace to the ODBC driver and I've found out that Orion tries to fill the "jobid" field with a SQLBIG_INT type instead of a integer type. This is what I get in the log file: Preparing (SQLPrepare), hStmt=151987528, szSqlStr=insert intoPerson (name, jobid, id) VALUES (?, ?, ?)Number of parameter markers (SQLNumParams), hStmt=151987528 Number of parameter markers (SQLNumParams), hStmt=151987528value=3 --- This is the name field-- Registering Statement sun.jdbc.odbc.JdbcOdbcPreparedStatement@486be5 Binding IN NULL parameter (SQLBindParameter), hStmt=151987528, ipar=1, SQLtype=12 *PreparedStatement.setNull (1,12) ---This is the jobid field --- Binding IN NULL parameter (SQLBindParameter), hStmt=151987528, ipar=2, SQLtype=-5*PreparedStatement.setNull (2,-5) ---The type -5 is the SQLBIG_INT type. I think it must be 4 which is the integer type Binding IN NULL parameter (SQLBindParameter), hStmt=151987528, ipar=11, SQLtype=-5RETCODE = -1ERROR - Generating SQLException...SQLException: SQLState(S1C00) vendor code(0)java.sql.SQLException: [Microsoft][ODBC SQL Server Driver]Optional feature not implementedat sun.jdbc.odbc.JdbcOdbc.createSQLException(Unknown Source)at sun.jdbc.odbc.JdbcOdbc.standardError(Unknown Source)at sun.jdbc.odbc.JdbcOdbc.SQLBindInParameterNull(Unknown Source)at sun.jdbc.odbc.JdbcOdbcPreparedStatement.setNull(Unknown Source)at com.evermind.sql.ao.setNull(JAX)at com.evermind.sql.ao.setNull(JAX)at PersonHome_EntityHomeWrapper13.create(PersonHome_EntityHomeWrapper13.java:402)at Nuevo.doGet(NewPerson.java:328)at javax.servlet.http.HttpServlet.service(HttpServlet.java:190)at javax.servlet.http.HttpServlet.service(HttpServlet.java:302)at javax.servlet.http.HttpServlet.service(HttpServlet.java:329)at com.evermind.server.http.d3.sw(JAX)at com.evermind.server.http.d3.su(JAX)at com.evermind.server.http.ef.s1(JAX)at com.evermind.server.http.ef.do(JAX)at com.evermind.util.f.run(JAX) In the squema for the sql-server I have the following mapping: type-mapping type="java.lang.Integer" name="int" / but anyway it still replace the Integer by SQLBIG_INT Does anybody know what I'm doing wrong? Thanks in advance.
Again EJB 2.0
Hi, I have the following entity beans: person(id(integer), name(varchar)) job(id(integer), name(varchar)) So, this is my ejb-jar.xml: enterprise-beansentitydescriptionPerson EJB CMP /descriptioncmp-version2.0/cmp-versionejb-namePerson/ejb-namehomeperson.PersonHome/homeremoteperson.Person/remoteejb-classperson.PersonBean/ejb-classprim-key-classjava.lang.Integer/prim-key-classreentrantFalse/reentrantpersistence-typeContainer/persistence-typecmp-fieldfield-nameid/field-name/cmp-fieldcmp-fieldfield-namename/field-name/cmp-field cmp-fieldfield-namejobid/field-name/cmp-fieldprimkey-fieldid/primkey-field/entity/enterprise-beans enterprise-beansentitydescriptionPerson EJB CMP /descriptioncmp-version2.0/cmp-versionejb-nameJob/ejb-namehomeJobHome/homeremoteJob/remoteejb-classJobBean/ejb-classprim-key-classjava.lang.Integer/prim-key-classreentrantFalse/reentrantpersistence-typeContainer/persistence-typecmp-fieldfield-nameid/field-name/cmp-fieldcmp-fieldfield-namename/field-name/cmp-fieldprimkey-fieldid/primkey-field/entity/enterprise-beans relationships ejb-relation ejb-relation-namePerson-Job/ejb-relation-name ejb-relationship-role ejb-relationship-role-name/ejb-relationship-role-name multiplicityone/multiplicity role-source ejb-nameJob/ejb-name remote-ejb-nameJob/remote-ejb-name dependent-nameJob/dependent-name /role-source cmr-field cmr-field-namejobid/cmr-field-name cmr-field-typeJob/cmr-field-type /cmr-field /ejb-relationship-role ejb-relationship-role ejb-relationship-role-name/ejb-relationship-role-name multiplicityone/multiplicity role-source ejb-namePerson/ejb-name remote-ejb-namePerson/remote-ejb-name dependent-namePerson/dependent-name /role-source /ejb-relationship-role /ejb-relation /relationships Everything seems to work fine, I mean, the entities get deployed etc... but when I try to create a new Person Orion seems to map the Integer field to SQLBIG_INT so I get the following error: [ODBC SQL SERVER DRIVER] Optional feature not implemented In the squema for the sql-server I have the following mapping: type-mapping type="java.lang.Integer" name="int" / but anyway it still replace the Integer by SQLBIG_INT Does anybody know what I'm doing wrong? Thanks in advance.
EJBQL
Does Orion provide support for EJBQL? Which Orion version? Is Orion full EJB 2.0 compliant? Thanks in advance
RE: Problem with a finder QUERY.
No, It doesn't work! Anyway, putting the code "String findByName_query = "people.name like $1"" in the home interface seems to modify the orion-ejb-jar.xml as you said, doesn't it?. Has anybody made such a query? Please!! Help!!! Thanks in advance - Original Message - From: Luong, Tony S322 [EMAIL PROTECTED] To: Orion-Interest [EMAIL PROTECTED] Sent: Tuesday, February 13, 2001 6:19 PM Subject: RE: Problem with a finder QUERY. The code "String findByName_query = "people.name like $1"" in the home interface does not do anything for the bean, you have to modify the deployment descriptor (eq. orion_home\application-deployments\app\app-ejb.jar\orion-ejb-jar.xml). in the deployment descriptor look for finder-method query="" tag then change it to finder-method query="$name like $1" ... ... call the method using findByName("%john%"); stop and start the server. this should do it. -Original Message- From: fresnaULL [SMTP:[EMAIL PROTECTED]] Sent: Tuesday, February 13, 2001 8:43 AM To: Orion-Interest Subject: Problem with a finder QUERY. Hi all, Basically, this is the query i'm trying to do: (i'm using SQL SERVER 7.0) SELECT * FROM people WHERE people.name LIKE '%john%' This is what i've done now: - In the people home interface String findByName_query = "people.name like $1"; . . public java.util.Enumeration findByName(String value) throws java.rmi.RemoteException, javax.ejb.FinderException; I make a call to the finder query like this: Enumeration en = PeopleHome.findByName("%John%"); But this doesn't work or at least I don't get any result(of course it should return a result). If I replace the "like" clause by "=" and i make a call like Enumeration en = PeopleHome.findByName("John"); it does work, I get a result. Does anybody know what I'm doing wrong? is there any problem with the "like" clause? Thanks in advance P.S. I'm not trying to laugh at anybody :-) From: [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] [ mailto:[EMAIL PROTECTED]]On Behalf Of Geoff Marshall Sent: Monday, February 12, 2001 10:31 AM To: Orion-Interest Subject: Re: Problems with a finder method in a cmp Please don't laugh at me, but what IS a 'finder method in a CMP'?? Just a simple explanation or a pointer to more info, please... -- -Geoff Marshall, Director of Development -- CONFIDENTIALITY NOTICE: If you have received this e-mail in error, please immediately notify the sender by e-mail at the address shown. This e-mail transmission may contain confidential information. This information is intended only for the use of the individual(s) or entity to whom it is intended even if addressed incorrectly. Please delete it from your files if you are not the intended recipient. Thank you for your compliance.
Problems with a finder method in a cmp
Hi all, I'm trying to define this finder method in a cmp: SELECT * FROM people WHERE people.name LIKE '%name%' which is correct in SQL SERVER 7.0 I put the following in the people home interface: String findByName_query = "people.name like '%$1%'"; . . . public java.util.Enumeration findByName(String value) throws java.rmi.RemoteException, javax.ejb.FinderException; but it doesn't work. Orion is able to deploy the cmp but when I try to use it I only get this error message: 500 Internal Server Error java.lang.NullPointerException at sun.jdbc.odbc.JdbcOdbcPreparedStatement.clearParameter(Unknown Source) at sun.jdbc.odbc.JdbcOdbcPreparedStatement.setChar(Unknown Source) at sun.jdbc.odbc.JdbcOdbcPreparedStatement.setString(Unknown Source) at com.evermind.sql.am.setString(JAX) at com.evermind.sql.am.setString(JAX) at PeopleHome_EntityHomeWrapper72.findByName(PeopleHome_EntityHomeWrapper72.jav a:1142) at Search.doGet(Search.java:46) at javax.servlet.http.HttpServlet.service(HttpServlet.java) at javax.servlet.http.HttpServlet.service(HttpServlet.java) at javax.servlet.http.HttpServlet.service(HttpServlet.java) at com.evermind.server.http.d1.si(JAX) at com.evermind.server.http.d1.forward(JAX) at com.evermind.server.http.ed.sp(JAX) at com.evermind.server.http.ed.so(JAX) at com.evermind.util.f.run(JAX) Does anybody know how i can make it work? Thanks in advance
Problems with an identity (autoincrement) field.
Hi, I've made an entity cmp which map a database table which has an identitiy (autoincrement) field as primary key. When I do a home.create(primary_key) I get the following error: [Microsoft][ODBC SQL Server Driver][SQL Server] Cannot insert explicit value for identity column in table when IDENTITY_INSERT is set to OFF. I've been looking for the INSERT statement which i guess is asociated with the create method to try to fix it up but I haven't found it. Does anybody know what I have to do? Thanks in advance.
Data type to access a datetime field in database
Hi, I'm trying to access a datatime field in a SQL-SERVER 7.0 with a EJB CMP but I don't know which java type I have to use in the bean to map this field. I've tried with a java.util.Date type but I get the following error: javax.ejb.EJBException: Error saving state: [Microsoft] [ODBC SQL Server Driver] Datatime field overflow at Persona_EntityBeanWrapper0.saveState(Persona_EntityBeanWrapper0.java:3092) at Persona_EntityBeanWrapper0.setPer_fecha_nac(Persona_EntityBeanWrapper0.java:2964) at NewCmp.doGet(NewCmp.java:51) at javax.servlet.http.HttpServlet.service(HttpServlet.java) at javax.servlet.http.HttpServlet.service(HttpServlet.java) at javax.servlet.http.HttpServlet.service(HttpServlet.java) at com.evermind.server.http.d1.si(JAX) at com.evermind.server.http.d1.forward(JAX) at com.evermind.server.http.ed.sp(JAX) at com.evermind.server.http.ed.so(JAX) at com.evermind.util.f.run(JAX Also, I'm trying to access an image typefield but I have no idea which java type I have to use to map this kind of field. Does anybody know which java type I have to use in both cases? Thanks.
RE: Problems with the Orion primer example
Hi, I've resolved my problems with the Orion primer example. I had to create a $(ORION_HOME)/database directory and everything seems to work fine! For the people who wants to try CMP, I've attached the Orion CMP primer example. Don't forget to create the $(ORION_HOME)/database directory!! Thanks. hi fresnaULLWhen I created a database directory ($ORION_DIR/database) andtest the news demo app again, I get new erroe message:com.evermind.server.rmi.OrionRemoteException: Database error: Table not found: COM_EVERMIND_EJB_NEWSITEM in statement [select com_evermind_ejb_NewsItem.id, com_evermind_ejb_NewsItem.submitter, com_evermind_ejb_NewsItem.text, com_evermind_ejb_NewsItem.locale, com_evermind_ejb_NewsItem.date, com_evermind_ejb_NewsItem.subject, com_evermind_ejb_NewsItem.parent from com_evermind_ejb_NewsItem where com_evermind_ejb_NewsItem.parent = NULL]at NewsItemHome_EntityHomeWrapper4.findByParent(NewsItemHome_EntityHomeWrapper4.java, Compiled Code)at com.evermind.ejb.NewsSessionEJB.getChildren(NewsSessionEJB.java, Compiled Code)at NewsSession_StatefulSessionBeanWrapper1.getChildren(NewsSession_StatefulSessionBeanWrapper1.java:66)at /news.jsp._jspService(/news.jsp.java:83) (JSP page line 26)at com.orionserver.http.OrionHttpJspPage.service(JAX)at com.evermind.server.http.HttpApplication.xa(JAX)at com.evermind.server.http.JSPServlet.service(JAX)at com.evermind.server.http.d3.so(JAX, Compiled Code)at com.evermind.server.http.d3.sm(JAX)at com.evermind.server.http.ef.su(JAX, Compiled Code)at com.evermind.server.http.ef.dn(JAX, Compiled Code)at com.evermind.util.f.run(JAX, Compiled Code)Nested exception is:...What should I do in next step ? Where can I get more docs ? Thank you very much.bubble (2000/11/23 PM 11:46:07)[EMAIL PROTECTED]=== Hi. No, I haven't created any database directory. This is the first time I hear about that!! . Could you tell me what I have to do?, I mean, What is this directory for? What about the defaultdb file in it? Where did you read about that? Thank you very much. - Original Message - From: KirkYarina [EMAIL PROTECTED] To: Orion-Interest [EMAIL PROTECTED] Sent: Wednesday, November 22, 2000 9:35 PM Subject: Re: Problems with the Orion CMP primer example.Have you created a database directory ($ORION_DIR/database)? Do you have the appropriate permissions on defaultdb.* in it? At 12:10 PM 11/22/00 +, you wrote: Hi, I'm trying to deploy the Orion CMP primer example. I've follow the instructions but I've got the following error: Auto-deploying addressbook (New server version detected)... Auto-deploying addressbook-ejb.jar (No previous deployment found)... SQL error: File input/output error: ./database/defaultdb.properties Warning: Error creating table: File input/output error: ./database/defaultdb.pro perties done Orion/1.3.8 initialized I'm sure I've installed Orion properly because I've deployed successfully the Orion Primer example.Thanks in advance Kirk Yarina [EMAIL PROTECTED] PC home : http://www.pchome.com.tw PC home Online addressbook-src.zip Title: Orion CMP Primer OrionCMPPrimer $Revision: 1.15 $ This article will show you how to write and run a simple Container-Managed Persistent Entity Bean using the Orion application server (http://www.orionserver.com/). Note: This article assumes you are familiar with the topics presented in the Orion Primer. If you are not, please follow the instructions in that article before starting with this article. Introduction The Orion Primer showed you how to write, compile and deploy a servlet and a session bean. This article will show you how to write a Container Managed Entity Bean as well as an HTML page and a JSP that you can use to access the entity bean. We will first draw a sketch of what we are going to build. Then we'll set up a directory structure for this, and write the necessary HTML, JSP and Java files. After that we will build the JAR, WAR and EAR files and deploy them into Orion. If you have any trouble, see if your question is answered by any of the resources at the bottom of this article. If it's not, try posting your question on the orion-interest mailing list (see the Orion website), or on the IRC channel #java on EFnet. Before you start, make sure you have downloaded and installed the following software: Java Development Kit (1.2 or later) Orion (1.0 or later) Ant This article has the following sections: Introduction Case description Step 1: Setup directory structure Step 2: Write the remote interface Step 3: Write the bean class Step 4: Write the home interface Step 5: Write the EJB deployment descriptor Step 6: Create the front end Step 7: Write
Problems with the Orion CMP primer example.
Hi, I'm trying to deploy the Orion CMP primer example. I've follow the instructions but I've got the following error: Auto-deploying addressbook (New server version detected)... Auto-deploying addressbook-ejb.jar (No previous deployment found)... SQL error: File input/output error: ./database/defaultdb.properties Warning: Error creating table: File input/output error: ./database/defaultdb.pro perties done Orion/1.3.8 initialized I'm sure I've installed Orion properly because I've deployed successfully the Orion Primer example. Thanks in advance
Problems with the Orion CMP primer example.
Hi, I'm trying to deploy the Orion CMP primer example. I've follow the instructions but I've got the following error: Auto-deploying addressbook (New server version detected)... Auto-deploying addressbook-ejb.jar (No previous deployment found)... SQL error: File input/output error: ./database/defaultdb.properties Warning: Error creating table: File input/output error: ./database/defaultdb.pro perties done Orion/1.3.8 initialized I'm sure I've installed Orion properly because I've deployed successfully the Orion Primer example. Thanks in advance
Problems with EJB.
Hi all, I think I've deployed correctly a EJB, because I'm able to use from a java application. I've deployed the ejb like the cart ejb example. My problem is that when I try to use it from a servlet the context.lookup doesn't find the EJB and generate an exception. Please I need help!!! Thanks.
First approach to ORION EJB.
Hi all, I am trying to deploy my first Orion EJB but I'm really confused. Theses are the step I have done so far: - I've created the home and remote interfaces and the bean itself. I've copied them into a directory called d:\src and I've compiled them. - I've created the application.xml and ejb-jar.xml files and I've put them in the d:\src\META-INF directory. - I've updatethe server.xml file in /orion/config/with the following line: application name="first-ejb" path="d:\src" auto-start="true" / When I restart the orion application server it shows a message saying that it's made the deployment correctly (or that's what I think it says). The message is: Auto-deploying first-ejb (New server version detected)... Orion/1.3.8. initialized Now I want to create a servlet which use that ejb. How do I have to make it? Do I have to make it like the orion-primer example? Have I deployed the ejb properly? Thanks in advance.