Check your code and make sure the ejbCreate functions have a return type of
com.netitbe.ishop.business.item2.ejb.ItemPk. And make sure that the argument
type for findByPrimaryKey in the home interface is
com.netitbe.ishop.business.item2.ejb.ItemPk.
When I got that error, it was because the return type for ejbCreate did not
match the <prim-key-class> in my ejb-jar.xml.
Kurt in Atlanta
>-----Original Message-----
>From: Tom Klaasen [mailto:[EMAIL PROTECTED]]
>Sent: Friday, September 08, 2000 5:26 AM
>To: Orion-Interest
>Subject: IllegalArgumentException
>
>
>I'm sorry to disturb you guys again, but I just keep hitting
>the wall in
>trying to deploy my application.
>
>The error I see this time is
>
>E:\orion>java -jar orion.jar
>Copying default deployment descriptor from archive at
>E:\orion\applications\isho
>p\ishop-ejb/orion/orion-ejb-jar.xml to deployment directory
>E:\orion\application
>-deployments\ishop\ishop-ejb...
>Auto-deploying ishop-ejb (No previous deployment found)...
>java.lang.IllegalArgu
>mentException: Cannot convert from class java.lang.String to class
>com.netitbe.i
>shop.business.item2.ejb.ItemPk
> at com.evermind.zip.a.t(JAX)
> at com.evermind.server.ejb.compilation.fm.aew(JAX)
> at com.evermind.server.ejb.compilation.fk.ru(JAX)
> at com.evermind.server.ejb.compilation.fo.ad_(JAX)
> at com.evermind.server.ejb.compilation.fx.agd(JAX)
> at com.evermind.server.ejb.compilation.fo.ru(JAX)
> at com.evermind.server.ejb.compilation.fq.ru(JAX)
> at com.evermind.server.ejb.compilation.fw.ru(JAX)
> at com.evermind.server.ejb.EJBContainer.bx(JAX)
> at com.evermind.server.Application.bx(JAX)
> at com.evermind.server.Application.f7(JAX)
> at com.evermind.server.ApplicationServer.qu(JAX)
> at com.evermind.server.ApplicationServer.an6(JAX)
> at com.evermind.server.ApplicationServer.f7(JAX)
> at com.evermind.server.gz.run(JAX)
> at java.lang.Thread.run(Unknown Source)
> at com.evermind.util.f.run(JAX)
>
>E:\orion>
>
>This is similar to what I got a few days ago, and I thought I
>could solve
>this by creating an orion-ejb-jar.xml (which costed me a lot
>of headache,
>also).
>My orion-ejb-jar.xml looks like this (it's not complete, but I
>want to solve
>this error and then move on):
><?xml version="1.0" encoding="UTF-8"?>
><orion-ejb-jar>
> <enterprise-beans>
> <entity-deployment
> data-source="jdbc/questEJBDS"
> location="com.netitbe.ishop.business.item2.ejb.ItemHome"
> name="Item2"
> table="item2"
> >
> <primkey-mapping>
> <cmp-field-mapping name="itemid"
>persistence-name="itemid"
>persistence-type="varchar(255)"/>
> <cmp-field-mapping name="version"
>persistence-name="version"
>persistence-type="varchar(255)"/>
> <cmp-field-mapping name="supplier"
>persistence-name="supplier" persistence-type="varchar(255)"/>
> </primkey-mapping>
> <finder-method
> partial="true"
> query="$1.supplier=$supplier and $1.itemid=$itemid and
>$1.version=$version"
> >
> <method>
> <description>Find an item by its primary
>key.</description>
> <ejb-name>Item2</ejb-name>
> <method-intf>Home</method-intf>
> <method-name>findByPrimaryKey</method-name>
> <method-params>
>
><method-param>com.netitbe.ishop.business.item2.ejb.ItemPk</meth
od-param>
> </method-params>
> </method>
> </finder-method>
> </entity-deployment>
> </enterprise-beans>
></orion-ejb-jar>
>
>I presume the ejb-name is referring to the ejb-jar.xml, so this is the
>relevant part:
> <entity>
> <description>Item Bean2.</description>
> <ejb-name>Item2</ejb-name>
>
><home>com.netitbe.ishop.business.item2.ejb.ItemHome</home>
>
><remote>com.netitbe.ishop.business.item2.ejb.ItemEJB</remote>
>
><ejb-class>com.netitbe.ishop.business.item2.ejb.ItemImpl</ejb-class>
> <persistence-type>Container</persistence-type>
>
><prim-key-class>com.netitbe.ishop.business.item2.ejb.ItemPk</pr
im-key-class>
> <reentrant>False</reentrant>
> <cmp-field>
> <field-name>itemid</field-name>
> </cmp-field>
> <cmp-field>
> <field-name>version</field-name>
> </cmp-field>
> <cmp-field>
> <field-name>supplier</field-name>
> </cmp-field>
> <cmp-field>
> <field-name>description</field-name>
> </cmp-field>
> <cmp-field>
> <field-name>pricevalue</field-name>
> </cmp-field>
> <cmp-field>
> <field-name>pricecurrency</field-name>
> </cmp-field>
> <cmp-field>
> <field-name>shopid</field-name>
> </cmp-field>
> <cmp-field>
> <field-name>displayname</field-name>
> </cmp-field>
> <cmp-field>
> <field-name>icon</field-name>
> </cmp-field>
> <cmp-field>
> <field-name>image</field-name>
> </cmp-field>
> <resource-ref>
> <res-ref-name>jdbc/quest</res-ref-name>
>
><res-type>javax.sql.DataSource</res-type>
> <res-auth>Container</res-auth>
> </resource-ref>
> </entity>
>
>
>And the data-sources file is this one:
><?xml version="1.0" encoding="UTF-8"?>
><!DOCTYPE data-sources PUBLIC "Orion data-sources"
>"http://www.orionserver.com/dtds/data-sources.dtd">
><data-sources>
> <!--
> An example DataSource that uses an ordinary
>JDBC-driver to
>create the connections,
> to install; set the proper URL to the db, specify the
>db-driver name and
> unrem the below section. This creates all the
>needed kinds
> of data-sources, transactional, pooled and EJB-aware
>sources.
> -->
> <data-source
> name="quest"
> class="com.evermind.sql.ConnectionDataSource"
> location="jdbc/questDS"
> pooled-location="jdbc/questPooledDS"
> xa-location="jdbc/xa/questXADS"
> ejb-location="jdbc/questEJBDS"
> url="jdbc:odbc:quest"
> connection-driver="sun.jdbc.odbc.JdbcOdbcDriver"
> username="dummyuser"
> password="dummypwd"
> schema="database-schemas/sybase.xml"
> />
></data-sources>
>
>Anybody recognizes this and could give me some help?
>
>tomK, who still doesn't understand why documentation of the
>proprietary-parts of orion is so ill.
>