EJB API Deployment

I’m trying to use SUN J2EE Reference Implementation, and I’ve followed the documentation step by step, and then after setting up the classpath, I don’t know how to run the application.

Then, I tried to use the deploytool to deploy the application. Since I’m not very good at that, does anyone have a detailed documentation for this part.

By the way, do I need to use the Sun’s Deployment tool to deploy a ear file? How can I run the example provided, like Telephone.

Thanks for your help.

nil

I can deploy it and run the application, but I faced an error - getConnection failed. Any ideas on this?

D:\ejb>runclient -client Telephone.ear -name TelephoneClient

Initiating login …
Binding name:java:comp/env/ejb/BeanDemarcatedTelephone
ATTENTION: Usage: EjbClient
when JNDI name not specified, then using
Creating telephone instance

Welcome to Telephone
--------------------------------------------------------
enter one of these commands
--------------------------------
c - setCollection
i - insert
d - delete
q - query
e - exit
--------------------------------
command: c

Enter the collection name: Telephone
enter one of these commands
--------------------------------
c - setCollection
i - insert
d - delete
q - query
e - exit
--------------------------------
command: q

Enter a query: Telephone
ejb.session.stateful.ProcessingErrorException: TelephoneBean: getConnection fail
ed
<>
enter one of these commands
--------------------------------
c - setCollection
i - insert
d - delete
q - query
e - exit
--------------------------------
command: q

Enter a query: Telephone
java.rmi.ServerException: RemoteException occurred in server thread; nested exce
ption is:
java.rmi.RemoteException: nested exception is: java.lang.NullPointerExce
ption; nested exception is:
java.lang.NullPointerException
java.rmi.RemoteException: nested exception is: java.lang.NullPointerException; n
ested exception is:
java.lang.NullPointerException
java.lang.NullPointerException
<>
enter one of these commands
--------------------------------
c - setCollection
i - insert
d - delete
q - query
e - exit
--------------------------------
command: q

Enter a query: Telephone
java.rmi.NoSuchObjectException: CORBA OBJECT_NOT_EXIST 9999 No; nested exception
is:
org.omg.CORBA.OBJECT_NOT_EXIST: minor code: 9999 completed: No
org.omg.CORBA.OBJECT_NOT_EXIST: minor code: 9999 completed: No
at java.lang.Class.newInstance0(Native Method)
at java.lang.Class.newInstance(Class.java:237)
at com.sun.corba.ee.internal.iiop.messages.ReplyMessage_1_2.getSystemExc
eption(ReplyMessage_1_2.java:92)
at com.sun.corba.ee.internal.iiop.ClientResponseImpl.getSystemException(
ClientResponseImpl.java:108)
at com.sun.corba.ee.internal.POA.GenericPOAClientSC.invoke(GenericPOACli
entSC.java:174)
at org.omg.CORBA.portable.ObjectImpl._invoke(ObjectImpl.java:459)
at ejb.session.stateful._TelephoneRemote_Stub.xmlQuery(Unknown Source)
at ejb.session.stateful.TelephoneDialog.query(TelephoneDialog.java:157)
at ejb.session.stateful.TelephoneDialog.run(TelephoneDialog.java:69)
at ejb.session.stateful.EjbClient.main(EjbClient.java:90)
at java.lang.reflect.Method.invoke(Native Method)
at com.sun.enterprise.util.Utility.invokeApplicationMain(Utility.java:26
1)
at com.sun.enterprise.appclient.Main.main(Main.java:159)
enter one of these commands
--------------------------------
c - setCollection
i - insert
d - delete
q - query
e - exit
--------------------------------
command:

nil

I found another clue regarding my problem:
No suitable driver.

But, I think I’ve followed the installation procedures to add driver and database. And you can view from below that there’s already a binding
Binding DataSource, name = MyTaminoDataSource, url = http://localhost/tamino/tes
t

==============================================
Error message
==============================================

D:\j2sdkee1.3\bin>j2ee -verbose

J2EE server listen port: 1050
Naming service started:1050
Binding DataSource, name = jdbc/EstoreDB, url = jdbc:cloudscape:rmi:CloudscapeDB
;create=true
Binding DataSource, name = jdbc/InventoryDB, url = jdbc:cloudscape:rmi:Cloudscap
eDB;create=true
Binding DataSource, name = jdbc/Cloudscape, url = jdbc:cloudscape:rmi:Cloudscape
DB;create=true
Binding DataSource, name = jdbc/DB2, url = jdbc:cloudscape:rmi:CloudscapeDB;crea
te=true
Binding DataSource, name = jdbc/DB1, url = jdbc:cloudscape:rmi:CloudscapeDB;crea
te=true
Binding DataSource, name = MyTaminoDataSource, url = http://localhost/tamino/tes
t
Binding DataSource, name = jdbc/XACloudscape, url = jdbc/XACloudscape__xa
Binding DataSource, name = jdbc/XACloudscape__xa, dataSource = COM.cloudscape.co
re.RemoteXaDataSource@3576a2
Starting JMS service … Initialization complete - waiting for client requests
Binding : < JMS Destination : jms/Queue , javax.jms.Queue >
Binding : < JMS Destination : jms/Topic , javax.jms.Topic >
Binding : < JMS Cnx Factory : jms/QueueConnectionFactory , Queue , No properties
>
Binding : < JMS Cnx Factory : QueueConnectionFactory , Queue , No properties >
Binding : < JMS Cnx Factory : TopicConnectionFactory , Topic , No properties >
Binding : < JMS Cnx Factory : jms/TopicConnectionFactory , Topic , No properties
>
Starting web service at port:8000
Starting secure web service at port:7000
Apache Tomcat/4.0-b4-dev
Starting web service at port:9191
Apache Tomcat/4.0-b4-dev
Loading jar:/D:/j2sdkee1.3/repository/nb-mullin/applications/TelephoneApp1000959
739367Server.jar
/D:/j2sdkee1.3/repository/nb-mullin/applications/TelephoneApp1000959739367Server
.jar
Binding name:java:comp/env/tamino/telephoneDS
Application deployment successful : com.sun.ejb.containers.StatefulSessionContai
ner@abc7b
J2EE server startup complete.
Nested Exception stacktrace:

java.sql.SQLException: No suitable driver
at java.sql.DriverManager.getConnection(DriverManager.java:537)
at java.sql.DriverManager.getConnection(DriverManager.java:177)
at com.sun.enterprise.resource.JdbcUrlAllocator.createResource(JdbcUrlAl
locator.java:49)
at com.sun.enterprise.resource.PoolManagerImpl.getResourceFromPool(PoolM
anagerImpl.java:181)
at com.sun.enterprise.resource.JdbcXAConnection.(JdbcXAConnection.
java:60)
at com.sun.enterprise.resource.Jdbc10XaAllocator.createResource(Jdbc10Xa
Allocator.java:70)
at com.sun.enterprise.resource.PoolManagerImpl.getResourceFromPool(PoolM
anagerImpl.java:181)
at com.sun.enterprise.resource.PoolManagerImpl.getResource(PoolManagerIm
pl.java:130)
at com.sun.enterprise.resource.JdbcDataSource.internalGetConnection(Jdbc
DataSource.java:141)
at com.sun.enterprise.resource.JdbcDataSource.getConnection(JdbcDataSour
ce.java:76)
at com.softwareag.tamino.db.api.ejb.TEJBConnectionFactory.newConnection(
TEJBConnectionFactory.java:101)
at com.softwareag.tamino.db.api.ejb.TEJBConnectionFactory.newConnection(
TEJBConnectionFactory.java:62)
at ejb.session.stateful.TelephoneBean.getConnection(TelephoneBean.java:2
40)
at ejb.session.stateful.TelephoneBean.xmlQuery(TelephoneBean.java:362)
at ejb.session.stateful.TelephoneBean_EJBObjectImpl.xmlQuery(TelephoneBe
an_EJBObjectImpl.java:116)
at ejb.session.stateful._TelephoneBean_EJBObjectImpl_Tie._invoke(Unknown
Source)
at com.sun.corba.ee.internal.POA.GenericPOAServerSC.dispatchToServant(Ge
nericPOAServerSC.java:514)
at com.sun.corba.ee.internal.POA.GenericPOAServerSC.internalDispatch(Gen
ericPOAServerSC.java:199)
at com.sun.corba.ee.internal.POA.GenericPOAServerSC.dispatch(GenericPOAS
erverSC.java:107)
at com.sun.corba.ee.internal.iiop.ORB.process(ORB.java:272)
at com.sun.corba.ee.internal.iiop.RequestProcessor.process(RequestProces
sor.java:84)
at com.sun.corba.ee.internal.orbutil.ThreadPool$PooledThread.run(ThreadP
ool.java:99)

nil

When I looked into EjbClient.java, and I found out BeansJNDIName is “DemarcatedTelephone” by default if we didn’t pass anything.

But, is it correct to change it to
"java:comp/env/ejb/DemarcatedTelephone" or
"java:comp/env/DemarcatedTelephone" depending and then basic on this value, we type it on the deployment tool.

I’m not sure whether it’s related to my stated problem or not.

Sorry that I’m not familiar to use ANT to recompile all the application. It would be great if someone can give me the build.xml to help compile all the java files.

Thanks!

nil

Finally, I got it working. It’s due to mis-configuration of environment.

nil

Checkout Mullin Yu’s detailed description in this forum in the following topic: “How to configure EJB with SUN’s Reference Implementation”.