|
Hi Vamsi,
I
believe that particular error message occurs when you try to load an entity bean
but your primary key is set to null. I don't know exactly why your primary
key is null though.
Hi
sesques, Thanks for ur interest on me. Here i am posting I
have created a simple cmp , with 3 fields empId,
empFirstname,empLastName. Here empId is primary key with
autoincrement. When i enter Emp first name, last name using the create
method my cmp is working fine and i am able to create new row with
autoincrement. When i call setEmpFirstName() or serEmpLastName() methods
from my client geeting an error given below
java.rmi.ServerException:
RemoteException occurred in server thread; nested exception is: [java]
java.rmi.ServerException: RuntimeException; nested exception is: [java]
java.lang.IllegalArgumentException: Attempt to get lock ref with a null
object [java] at
sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:292) [java]
at sun.rmi.transport.Transport$1.run(Transport.java:148) [java] at
java.security.AccessController.doPrivileged(Native Method) [java] at
sun.rmi.transport.Transport.serviceCall(Transport.java:144) [java] at
sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:460) [java]
at
sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:701) [java]
at java.lang.Thread.run(Thread.java:534) .....21
ejb-jar.xml
<?xml version="1.0"
encoding="UTF-8"?> <!DOCTYPE ejb-jar PUBLIC "-//Sun Microsystems,
Inc.//DTD Enterprise JavaBeans 2.0//EN" "http://java.sun.com/dtd/ejb-jar_2_0.dtd">
<ejb-jar
> <description>[CDATA[No
Description.]]</description>
<display-name>Generated by XDoclet</display-name>
<enterprise-beans>
<entity
>
<description>[CDATA[]]</description>
<ejb-name>Employee</ejb-name>
<home>com.emp.empdata.EmployeeHome</home>
<remote>com.emp.empdata.Employee</remote>
<local-home>com.emp.empdata.EmployeeLocalHome</local-home>
<local>com.emp.empdata.EmployeeLocal</local>
<ejb-class>com.emp.empdata.EmployeeCMP</ejb-class>
<persistence-type>Container</persistence-type>
<prim-key-class>java.lang.Integer</prim-key-class>
<reentrant>False</reentrant>
<cmp-version>2.x</cmp-version>
<abstract-schema-name>mytestSchema</abstract-schema-name>
<cmp-field
>
<description>[CDATA[Returns the
id]]</description>
<field-name>id</field-name>
</cmp-field>
<cmp-field
>
<description>[CDATA[Returns the
empFirstName]]</description>
<field-name>empFirstName</field-name>
</cmp-field>
<cmp-field
>
<description>[CDATA[Returns the
empLastName]]</description>
<field-name>empLastName</field-name>
</cmp-field>
<primkey-field>id</primkey-field>
<security-identity><use-caller-identity/></security-identity>
<!-- Write a file named ejb-finders-EmployeeBean.xml if you
want to define extra finders. -->
</entity>
</enterprise-beans>
<assembly-descriptor
>
<security-role>
<role-name>every
onene</role-name>
</security-role>
<method-permission>
<role-name>every
one</role-name>
<method>
<ejb-name>Employee</ejb-name>
<method-name>*</method-name>
</method>
</method-permission>
<container-transaction>
<method>
<ejb-name>Employee</ejb-name>
<method-name>*</method-name>
</method>
<trans-attribute>Required</trans-attribute>
</container-transaction>
</assembly-descriptor> </ejb-jar>
jbosscmp-jdbc.xml
<?xml
version="1.0" encoding="UTF-8"?> <!DOCTYPE jbosscmp-jdbc
PUBLIC "-//JBoss//DTD JBOSSCMP-JDBC 3.2//EN"
"http://www.jboss.org/j2ee/dtd/jbosscmp-jdbc_3_2.dtd">
<jbosscmp-jdbc>
<defaults>
<datasource>java:/MySqlDS</datasource>
<datasource-mapping>mySQL</datasource-mapping>
<create-table>true</create-table>
<remove-table>true</remove-table>
</defaults>
<enterprise-beans>
<entity>
<ejb-name>Employee</ejb-name>
<cmp-field>
<field-name>id</field-name>
<column-name>emp_id</column-name>
<jdbc-type>INTEGER</jdbc-type>
<sql-type>INTEGER</sql-type>
<auto-increment></auto-increment>
</cmp-field>
<cmp-field>
<field-name>empFirstName</field-name>
<column-name>emp_firstname</column-name>
<jdbc-type>VARCHAR</jdbc-type>
<sql-type>VARCHAR(25)</sql-type>
</cmp-field>
<cmp-field>
<field-name>empLastName</field-name>
<column-name>emp_lastname</column-name>
<jdbc-type>VARCHAR</jdbc-type>
<sql-type>VARCHAR(25)</sql-type>
</cmp-field>
</entity>
</enterprise-beans> </jbosscmp-jdbc>
please let me know
the reason.
please tell me what is the exact problem vamsi
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3831755#3831755
Reply to the post: http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3831755
Please note that:
1. This e-mail may constitute privileged information. If you are not the intended recipient, you have received this confidential email and any attachments transmitted with it in error and you must not disclose, copy, circulate or in any other way use or rely on this information.
2. E-mails to and from the company are monitored for operational reasons and in accordance with lawful business practices.
3. The contents of this email are those of the individual and do not necessarily represent the views of the company.
4. The company does not conclude contracts by email and all negotiations are subject to contract.
5. The company accepts no responsibility once an e-mail and any attachments is sent.
http://www.activis.com
This annotation was added by the e:scan service.
http://www.activis.com
----------------------------------------------------------------------------------
This message has been checked for all known viruses by e:scan.
For further information please contact [EMAIL PROTECTED]
|