I'm having problems with Application clients and JNDI.

First of all, I can't run the news-app demo provided with orion. I can
install it no problem and the web app appears to be fine. When I try the
application client I get:

C:\Java\orion\demo\news-app>java -Djava.naming.factory.initial=com.evermind.
serv
er.ApplicationClientInitialContextFactory -jar news-client.jar
Communication error: Error reading application-client descriptor: No
location sp
ecified and no suitable instance of the type 'com.evermind.ejb.NewsSession'
foun
d for the ejb-ref ejb/NewsSession


Now something even more curious. Take the Product demo (mprod-ejb.jar is a
copy of the provided orion-product.jar)

C:\Java\orion\my projects\product2>java -jar mprod-ejb.jar
Enter the id (integer) of the product you want to add: 345343432
Enter the name for item 345343432: wew
Enter the cost for wew: 23
creating prod with id 345343432
adding name wew
Product added

which is fine. However, if I change the package of the source files to com
(rather the the default empty package), recompile, and simply change the
location of home/remote/ejb in the xml descriptor files and rejar, I get:

C:\Java\orion\my projects\product2>java -jar mprod-ejb.jar
Communication error: Error reading application-client descriptor: No
location sp
ecified and no suitable instance of the type 'com.Product' found for the
ejb-ref
 com.MyProd

If I add an orion-application-client.xml (and an orion-ejb-jar.xml) then I
get:

C:\Java\orion\my projects\product2>java -jar mprod-ejb.jar
Communication error: Error reading application-client descriptor: No EJBHome
fou
nd at com.Product as specified by ejb-ref com.MyProd

So, anyone know how to get the demos to work? I'd really appreciate it as
I'm now really confused.

Many thanks

Alistair

xml files for mprod after package renaming:

<?xml version="1.0"?>
<!DOCTYPE application-client PUBLIC "-//Sun Microsystems, Inc.//DTD J2EE
Application Client 1.2//EN"
"http://java.sun.com/j2ee/dtds/application-client_1_2.dtd";>
<application-client>
        <ejb-ref>
                <ejb-ref-name>com.MyProd</ejb-ref-name>
                <ejb-ref-type>Entity</ejb-ref-type>
                <home>com.ProductHome</home>
                <remote>com.Product</remote>
        </ejb-ref>
</application-client>


<?xml version="1.0"?>
<!DOCTYPE orion-application-client PUBLIC "-//Evermind//DTD J2EE
Application-client runtime 1.2//EN"
"http://www.orionserver.com/dtds/orion-application-client.dtd";>
<orion-application-client>
        <ejb-ref-mapping name="com.MyProd" location="com.Product"/>
</orion-application-client>



<?xml version="1.0"?>
<!DOCTYPE ejb-jar PUBLIC "-//Sun Microsystems, Inc.//DTD Enterprise
JavaBeans 1.2//EN" "http://java.sun.com/j2ee/dtds/ejb-jar_1_2.dtd";>
<ejb-jar>
        <description/>
        <enterprise-beans>
                <entity>
                        <description/>
                        <ejb-name>com.MyProd</ejb-name>
                        <home>com.ProductHome</home>
                        <remote>com.Product</remote>
                        <ejb-class>com.ProductEJB</ejb-class>
                        <primkey-class>java.lang.Integer</primkey-class>
                        <reentrant>True</reentrant>
                        <persistence-type>Container</persistence-type>
                        <cmp-field>
                                <field-name>id</field-name>
                        </cmp-field>
                        <cmp-field>
                                <field-name>name</field-name>
                        </cmp-field>
                        <cmp-field>
                                <field-name>description</field-name>
                        </cmp-field>
                        <cmp-field>
                                <field-name>price</field-name>
                        </cmp-field>
                        <primkey-field>id</primkey-field>
                </entity>
        </enterprise-beans>
        <assembly-descriptor>
                <container-transaction>
                        <method>
                                <ejb-name>com.MyProd</ejb-name>
                                <method-name>*</method-name>
                        </method>
                        <trans-attribute>NotSupported</trans-attribute>
                </container-transaction>
        </assembly-descriptor>
</ejb-jar>




<?xml version="1.0"?>
<!DOCTYPE orion-ejb-jar PUBLIC "-//Evermind//DTD Enterprise JavaBeans 1.1
runtime//EN" "http://www.orionserver.com/dtds/orion-ejb-jar.dtd";>
<orion-ejb-jar deployment-version="1.5.2" deployment-time="ea77b9f65e">
        <enterprise-beans>
                <entity-deployment name="com.MyProd" location="com.Product"
wrapper="ProductHome_EntityHomeWrapper2" max-tx-retries="3"
table="com_MyProd" data-source="jdbc/SQLServerDS">
                        <primkey-mapping>
                                <cmp-field-mapping name="id" persistence-name="id"/>
                        </primkey-mapping>
                        <cmp-field-mapping name="name" persistence-name="name"/>
                        <cmp-field-mapping name="description" 
persistence-name="description"/>
                        <cmp-field-mapping name="price" persistence-name="price"/>
                        <finder-method query="">
                                <!-- Generated SQL: "select com_MyProd.id, 
com_MyProd.name,
com_MyProd.description, com_MyProd.price from com_MyProd" -->
                                <method>
                                        <ejb-name>com.MyProd</ejb-name>
                                        <method-name>findAll</method-name>
                                        <method-params/>
                                </method>
                        </finder-method>
                </entity-deployment>
        </enterprise-beans>
        <assembly-descriptor>
                <default-method-access>
                        <security-role-mapping name="&lt;default-ejb-caller-role&gt;"
impliesAll="true"/>
                </default-method-access>
        </assembly-descriptor>
</orion-ejb-jar>


Reply via email to