Problem with a simple CMP bean while working on JBoss

S

Subra

Problem with a simple CMP bean while working on JBoss

CLIENT : EmployeeSalInsertClient.java
CMP Jar: emp
------------------------------------------------
Database : MS SQL SERVER
Table Name is : emp
Column names:
eno - int
ename - varchar(30)
esal - float

It is a simple ejb.........
able to insert the records into the database.............
unable to find records..................

The error is given below

C:\javajava -classpath

..;D:\jboss-3.2.4\server\default\lib\jboss-j2ee.jar;D:\jboss-3.2.4\serv

er\default\lib\jbossall-client.jar;D:\jboss-3.2.4\server\default\lib\jnet.jar;
EmployeeSalInsertClient
Exception in thread "main" javax.ejb.FinderException: Unknown query:
public
abstract emp.Employee
emp.EmployeeHome.findByPrimaryKey(java.lang.Integer)
throws java.rmi.RemoteException,javax.ejb.FinderException
at

sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.jav
a:245)
at

sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:220)
at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:122)
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:53)
at
org.jboss.proxy.ejb.HomeInterceptor.invoke(HomeInterceptor.java:173)
at org.jboss.proxy.ClientContainer.invoke(ClientContainer.java:85)
at $Proxy0.findByPrimaryKey(Unknown Source)
at
EmployeeSalInsertClient.main(EmployeeSalInssimertClient.java:34)
 
S

Sudsy

Subra wrote:
.;D:\jboss-3.2.4\server\default\lib\jboss-j2ee.jar;D:\jboss-3.2.4\serv

er\default\lib\jbossall-client.jar;D:\jboss-3.2.4\server\default\lib\jnet.jar;
EmployeeSalInsertClient
Exception in thread "main" javax.ejb.FinderException: Unknown query:
public
abstract emp.Employee
emp.EmployeeHome.findByPrimaryKey(java.lang.Integer)
<snip>

Were you aware that the default type of the primary key is String?
Check the prim-key-class element in your ejb-jar.xml file; it
should be java.lang.Integer in your case.
 
T

Tomer Ben-David

Problem with a simple CMP bean while working on JBoss

CLIENT : EmployeeSalInsertClient.java
CMP Jar: emp
------------------------------------------------
Database : MS SQL SERVER
Table Name is : emp
Column names:
eno - int
ename - varchar(30)
esal - float

It is a simple ejb.........
able to insert the records into the database.............
unable to find records..................

The error is given below

C:\javajava -classpath

.;D:\jboss-3.2.4\server\default\lib\jboss-j2ee.jar;D:\jboss-3.2.4\serv

er\default\lib\jbossall-client.jar;D:\jboss-3.2.4\server\default\lib\jnet.jar;
EmployeeSalInsertClient
Exception in thread "main" javax.ejb.FinderException: Unknown query:
public
abstract emp.Employee
emp.EmployeeHome.findByPrimaryKey(java.lang.Integer)
throws java.rmi.RemoteException,javax.ejb.FinderException
at

sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.jav
a:245)
at

sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:220)
at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:122)
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:53)
at
org.jboss.proxy.ejb.HomeInterceptor.invoke(HomeInterceptor.java:173)
at org.jboss.proxy.ClientContainer.invoke(ClientContainer.java:85)
at $Proxy0.findByPrimaryKey(Unknown Source)
at
EmployeeSalInsertClient.main(EmployeeSalInssimertClient.java:34)


do you have a findByPrimaryKey method in your bean home interface ?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top