Hi everybody, Following is the error i get when i run the following comand, It prepares the std_ejb_jar file and when executing the ejbc command following error ocurs : D:\bea\wlserver6.0\samples\ejb\com\entity\cabin>java -classpath d:\bea\wlserver6.0/lib/weblogic_sp.jar;d:\bea\wlserver6.0/lib/weblogic.jar weblogic.ejbc -verbose -compiler javac build\std_ejb_cabin.jar \ejb_cabin.jar ERROR: Error from ejbc: [9.7.12] In EJB cabinmethod, the findByPrimaryKey method must return the Entity bean's remote interface type, and it's parameter must be the primary key type or java.lang.Object: findByPrimaryKey(ejb.com.entity.cabin.CabinPK) ERROR: ejbc found errors Process Exit... I have a table called cabin_table with id has not null.
Please send your findByPrimaryKey method code as well as the Primary key type.
------------------ Mahindrakar IBM Application Server & Developer Forum Moderator Consultant - Zensar Technologies ,Pune India. SCJP2, SCJD2 & SCJEA (Part I)
amit ang
Ranch Hand
Joined: Sep 28, 2001
Posts: 38
posted
0
Originally posted by Rahul Mahindrakar: Please send your findByPrimaryKey method code as well as the Primary key type. Hi Rahul, Sorry for delay, I will send u the complete details by mail. Bye Thanks
from the err message that you have posted, I feel you need to check the following: The findByPrimaryKey(..) method in your Home interface should have a signature like this:
also, make sure that the argument primaryKey is not a primitive data type(int,char..). hope it was simple RC! :-)
Take care<BR>r@njith
amit ang
Ranch Hand
Joined: Sep 28, 2001
Posts: 38
posted
0
Hi Rahul, Bellow is the code that u had sent me right, I tried to execute it but facing exception( ATTACHED AT THE END) related to connection. Can u pls tell me the solution of error? import java.io.*; import java.sql.*; import javax.naming.InitialContext; import javax.servlet.*; import javax.servlet.http.*; import javax.sql.DataSource; public class DataSourceServlet extends HttpServlet { public DataSourceServlet() { } public void doGet(HttpServletRequest httpservletrequest, HttpServletResponse httpservletresponse) throws ServletException, IOException { httpservletresponse.setHeader("Cache-Control", "No-Cache");
Hello sir, There might be a mis-match between your Home Interface and the primary key class. Please check your entity bean's home interface, it should look something like this: Note 1. CabinEB - should be your Entity bean Remote interface 2. CabinEBHome - should be your Entity bean Home interface 3. <DATATYPE> - valid data type 4. <METHOD> - method name 5. <VARIABLE> - variable name public interface CabinEBHome extends EJBHome { public CabinEB create() throws CreateException, RemoteException; public CabinEB findByPrimaryKey(CabinPK primaryKey) throws FinderException, RemoteException; public <DATATYPE> findBy<METHOD>(<DATATYPE> <VARIABLE>) throws FinderException, RemoteException; } Hope this helps. Cheers
Originally posted by amit ang: Hi everybody, Following is the error i get when i run the following comand, It prepares the std_ejb_jar file and when executing the ejbc command following error ocurs : D:\bea\wlserver6.0\samples\ejb\com\entity\cabin>java -classpath d:\bea\wlserver6.0/lib/weblogic_sp.jar;d:\bea\wlserver6.0/lib/weblogic.jar weblogic.ejbc -verbose -compiler javac build\std_ejb_cabin.jar \ejb_cabin.jar ERROR: Error from ejbc: [9.7.12] In EJB cabinmethod, the findByPrimaryKey method must return the Entity bean's remote interface type, and it's parameter must be the primary key type or java.lang.Object: findByPrimaryKey(ejb.com.entity.cabin.CabinPK) ERROR: ejbc found errors Process Exit... I have a table called cabin_table with id has not null.
homeboy
amit ang
Ranch Hand
Joined: Sep 28, 2001
Posts: 38
posted
0
Hi Everybody, Iam amit again here : I have installed weblogic6.1 and all my earlier problems where solved I have checked for my datasouce with the external program that works properly. According to the latest development, Iam getting the following error when i deploy my ejbc jar. cabinmethd is the ejb name Unable to deploy EJB: cabinmethod from ejb_cabin.jar: Unable to bind EJB Home Interface to the JNDI name: CabinEntityJndi. The error w as: javax.naming.NameAlreadyBoundException: Can't rebind anything but a replica-awar e stub to a name that is currently bound to a replica-aware stub; remaining name '' <<no stack trace available>>
> <Oct 9, 2001 10:48:00 AM IST> <Error> <Management> <Error deploying application<br /> .\config\mydomain\applications\ejb_cabin.jar: java.lang.reflect.UndeclaredThrowa<br /> bleException> Thanks for ur help Amit
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to
run our stuff on 16 servers instead of 3.
subject: Error while running entity bean on weblogic6.0