File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes EJB and other Java EE Technologies and the fly likes where to write the client code in websphere? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "where to write the client code in websphere?" Watch "where to write the client code in websphere?" New topic
Author

where to write the client code in websphere?

Priya Sri
Ranch Hand

Joined: Mar 30, 2004
Posts: 84
hi friends,

I am new to EJB's and working in IBM WebSphere. In want to write

1.sampleHome (home interface)
2.sample (bean interface)
3.sampleBean (bean class)
4.sampleClient (client code)

I created the first 3 by File|New|EJB project and placed these home interface,bean interface,bean class in the folder.

Sample EJB
EJB Modules
com
ibm
pbw
ejb
samplehome.java
samplebean.java
sample.java

Now my problem where to write this client code sampleclient.java
and how? (I mean File|New|??|??)?
After writing the client code , how to run the ejb?

Please remember that I am working in Websphere

bye
priya.
Dave Clark
Ranch Hand

Joined: Feb 16, 2005
Posts: 52
I take it by 'WebSphere' you actually mean WSAD (i.e. WebSphere Studio Application Developer) - which is the development tool of choice for WebSphere - the Application Server.

If you're using WSAD, go to File -> New -> Other -> J2EE -> Application Client Project to create a J2EE Client Container client. This will give you a client container deployment descriptor and easier access to JNDI and a few other services than a vanilla J2SE client.

cheers,

Dave.


Dave Clark<br />Senior WebSphere Architect<br /><a href="http://www.versant.com" target="_blank" rel="nofollow">Versant Open Access - JDO2 & EJB3</a>
Priya Sri
Ranch Hand

Joined: Mar 30, 2004
Posts: 84
Thanks Dave...

I will try it and let u know..

bye
priya
Priya Sri
Ranch Hand

Joined: Mar 30, 2004
Posts: 84
hi dave,
I created an application client project as u said.
But the sampleclient.java is not able to import the home interface and bean interface...
i.e.,

import com.ibm.pbw.ejb.SimpleSessionHome;
import com.ibm.pbw.ejb.SimpleSession;

It is showing that it can't resolve com.ibm.pbw.ejb..
Avinash Pandit
Greenhorn

Joined: Oct 27, 2003
Posts: 5
It's a CLASSPATH problem. Do include ur root directory in CLASSPATH.
Priya Sri
Ranch Hand

Joined: Mar 30, 2004
Posts: 84
hi,

I didn't set the classpath..
Some code is automatically generated in the ".classpath"
This is as follows::

<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="var"
path="SERVERJDK_50_PLUGINDIR/jre/lib/rt.jar"
rootpath="SERVERJDK_SRCROOT" sourcepath="SERVERJDK_50_PLUGINDIR/src.jar"/>
<classpathentry kind="src" path="appClientModule"/>
<classpathentry kind="var" path="WAS_50_PLUGINDIR/lib/j2ee.jar"/>
<classpathentry kind="var" path="WAS_50_PLUGINDIR/lib/ivjejb35.jar"/>
<classpathentry kind="output" path="appClientModule"/>
</classpath>

How to set classpath..? What should I do now?
Dave Clark
Ranch Hand

Joined: Feb 16, 2005
Posts: 52
right-cllick on the project, -> Properties -> Java Build Path.

another good option is Help Menu -> Help Contents -> ... ;-)

cheers,

Dave
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: where to write the client code in websphere?