aspose file tools*
The moose likes EJB and other Java EE Technologies and the fly likes impossible to solve FinderException Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "impossible to solve FinderException " Watch "impossible to solve FinderException " New topic
Author

impossible to solve FinderException

David Rankin
Greenhorn

Joined: Apr 23, 2001
Posts: 1
I am having real problems with finding an entity bean type in my database using the findByPrimaryKey method in my home interface and i am wondering if anybody has came across the same problem. I continually get a FinderException thrown which i think is wrapping a ClassNotFoundException exception. Here is the stack trace.
Team Home Primary Key: soccer.data.team.TeamPK
javax.ejb.FinderException: ERROR in database SELECT for find: java.sql.SQLException: Remot
eException occurred in server thread; nested exception is:
java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is:
java.lang.ClassNotFoundException: soccer.data.team.TeamPK
The system out at the top is from this debug section
EJBMetaData data = home.getEJBMetaData() ;
System.out.println( "Team Home Primary Key: " + data.getPrimaryKeyClass().getName() ) ;
This tells me (i assume) that the home knows about the PK class soccer.data.team.TeamPK
I am using the J2EE server and deploy tool which seems to be as robust as a chocolate fire guard at times. The .ear file does contain the .jar file with the Pk class inside. I have used the home create method to add data to the Database which i have checked. it is just when i try to use the PK class to search or even remove that the PK class cannot be found. ???. I have checked and double checked my code. It looks as if the server needs the jar file loaded in the classpath but i have tried that and restarted the server. i am lost.
If it helps here is my ejb-jar.xml file contents.
Thanks in advancve for any help that you can give me

<?xml version="1.0" encoding="Cp1252"?>
< !DOCTYPE ejb-jar PUBLIC '-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 1.1//EN' 'http://java.sun.com/j2ee/dtds/ejb-jar_1_1.dtd'>
<ejb-jar>
<description>no description</description>
<display-name>Team</display-name>
<enterprise-beans>
<entity>
<display-name>Team</display-name>
<ejb-name>Team</ejb-name>
<home>soccer.data.team.TeamHome</home>
<remote>soccer.data.team.Team</remote>
<ejb-class>soccer.data.team.TeamEJB</ejb-class>
<persistence-type>Container</persistence-type>
<prim-key-class>soccer.data.team.TeamPK</prim-key-class>
<reentrant>False</reentrant>
<cmp-field>
<description>no description</description>
<field-name>teamId</field-name>
</cmp-field>
<cmp-field>
<description>no description</description>
<field-name>name</field-name>
</cmp-field>
<primkey-field>teamId</primkey-field>
</entity>
</enterprise-beans>
<assembly-descriptor>
<container-transaction>
<method>
<ejb-name>Team</ejb-name>
<method-intf>Home</method-intf>
<method-name>remove</method-name>
<method-params>
<method-param>java.lang.Object</method-param>
</method-params>
</method>
<trans-attribute>Required</trans-attribute>
</container-transaction>
<container-transaction>
<method>
<ejb-name>Team</ejb-name>
<method-intf>Remote</method-intf>
<method-name>remove</method-name>
<method-params />
</method>
<trans-attribute>Required</trans-attribute>
</container-transaction>
<container-transaction>
<method>
<ejb-name>Team</ejb-name>
<method-intf>Remote</method-intf>
<method-name>setName</method-name>
<method-params>
<method-param>java.lang.String</method-param>
</method-params>
</method>
<trans-attribute>Required</trans-attribute>
</container-transaction>
<container-transaction>
<method>
<ejb-name>Team</ejb-name>
<method-intf>Home</method-intf>
<method-name>remove</method-name>
<method-params>
<method-param>javax.ejb.Handle</method-param>
</method-params>
</method>
<trans-attribute>Required</trans-attribute>
</container-transaction>
<container-transaction>
<method>
<ejb-name>Team</ejb-name>
<method-intf>Remote</method-intf>
<method-name>getName</method-name>
<method-params />
</method>
<trans-attribute>Required</trans-attribute>
</container-transaction>
<container-transaction>
<method>
<ejb-name>Team</ejb-name>
<method-intf>Home</method-intf>
<method-name>create</method-name>
<method-params>
<method-param>java.lang.String</method-param>
<method-param>int</method-param>
</method-params>
</method>
<trans-attribute>Required</trans-attribute>
</container-transaction>
<container-transaction>
<method>
<ejb-name>Team</ejb-name>
<method-intf>Home</method-intf>
<method-name>findByPrimaryKey</method-name>
<method-params>
<method-param>soccer.data.team.TeamPK</method-param>
</method-params>
</method>
<trans-attribute>Required</trans-attribute>
</container-transaction>
</assembly-descriptor>
</ejb-jar>
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: impossible to solve FinderException